tactile_edc_ethercat_protocol.h
Go to the documentation of this file.
00001 //
00002 // © 2010 Shadow Robot Company Limited.
00003 //
00004 // FileName:        tactile_edc_ethercat_protocol.h
00005 // Dependencies:
00006 // Processor:       PIC32
00007 // Compiler:        MPLAB® C32
00008 //
00009 //  +------------------------------------------------------------------------+
00010 //  | This file is part of The Shadow Robot PIC32 firmware code base.        |
00011 //  |                                                                        |
00012 //  | It is free software: you can redistribute it and/or modify             |
00013 //  | it under the terms of the GNU General Public License as published by   |
00014 //  | the Free Software Foundation, either version 3 of the License, or      |
00015 //  | (at your option) any later version.                                    |
00016 //  |                                                                        |
00017 //  | It is distributed in the hope that it will be useful,                  |
00018 //  | but WITHOUT ANY WARRANTY; without even the implied warranty of         |
00019 //  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          |
00020 //  | GNU General Public License for more details.                           |
00021 //  |                                                                        |
00022 //  | You should have received a copy of the GNU General Public License      |
00023 //  | along with this code repository. The text of the license can be found  |
00024 //  | in Pic32/License/gpl.txt. If not, see <http://www.gnu.org/licenses/>.  |
00025 //  +------------------------------------------------------------------------+
00026 //
00027 //
00028 //
00029 //  Doxygen
00030 //  -------
00031 //
00042 //
00043 
00044 #ifndef TACTILE_EDC_ETHERCAT_PROTOCOL_H_INCLUDED
00045 #define TACTILE_EDC_ETHERCAT_PROTOCOL_H_INCLUDED
00046 
00047 
00048 
00049 //      ---------------
00050 //      TACTILE SENSORS
00051 //      ---------------
00052 
00053 #define TACTILE_DATA_LENGTH_BYTES_v1   16
00054 #define TACTILE_DATA_LENGTH_WORDS_v1   (TACTILE_DATA_LENGTH_BYTES_v1/2)
00055 
00056 typedef union
00057 {
00058     int16u  word[TACTILE_DATA_LENGTH_WORDS_v1];                            
00059     char    string[TACTILE_DATA_LENGTH_BYTES_v1];
00060 }TACTILE_SENSOR_STATUS_v1;
00061 
00062 typedef enum                                                            
00063 {
00064     TACTILE_SENSOR_TYPE_WHICH_SENSORS           = 0xFFF9,               
00065     TACTILE_SENSOR_TYPE_SAMPLE_FREQUENCY_HZ     = 0xFFFA,               
00066     TACTILE_SENSOR_TYPE_MANUFACTURER            = 0xFFFB,               
00067     TACTILE_SENSOR_TYPE_SERIAL_NUMBER           = 0xFFFC,               
00068     TACTILE_SENSOR_TYPE_SOFTWARE_VERSION        = 0xFFFD,               
00069     TACTILE_SENSOR_TYPE_PCB_VERSION             = 0xFFFE,               
00070     TACTILE_SENSOR_TYPE_RESET_COMMAND           = 0xFFFF                
00071 }FROM_TACTILE_SENSOR_TYPE;
00072 
00073 
00074 typedef enum                                                            
00075 {
00076     TACTILE_SENSOR_PROTOCOL_TYPE_INVALID        = 0x0000,               
00077     TACTILE_SENSOR_PROTOCOL_TYPE_PST3           = 0x0001,               
00078     TACTILE_SENSOR_PROTOCOL_TYPE_BIOTAC_2_3     = 0x0002,               
00079     TACTILE_SENSOR_PROTOCOL_TYPE_UBI0           = 0x0003,               
00080     TACTILE_SENSOR_PROTOCOL_TYPE_CONFLICTING    = 0xFFFF                
00081 }TACTILE_SENSOR_PROTOCOL_TYPE;
00082 
00083 
00084 typedef enum                                                            
00085 {
00086     AUX_SENSOR_PROTOCOL_TYPE_INVALID            = 0x0000,               
00087     AUX_SENSOR_PROTOCOL_TYPE_MCP3202            = 0x0001,               
00088     AUX_SENSOR_PROTOCOL_TYPE_MCP3204            = 0x0002,               
00089     AUX_SENSOR_PROTOCOL_TYPE_MCP3208            = 0x0003                
00090 
00091 }AUX_SENSOR_PROTOCOL_TYPE;
00092 
00093 typedef enum                                                            // Data you can request from PST3s
00094 {
00095     TACTILE_SENSOR_TYPE_PST3_PRESSURE_TEMPERATURE       = 0x0000,       
00096     TACTILE_SENSOR_TYPE_PST3_PRESSURE_RAW_ZERO_TRACKING = 0x0002,       
00097     TACTILE_SENSOR_TYPE_PST3_DAC_VALUE                  = 0x0004        
00098 }FROM_TACTILE_SENSOR_TYPE_PST3;
00099 
00100 typedef enum                                                            // Data you can request from UBI0 tactiles
00101 {
00102     TACTILE_SENSOR_TYPE_UBI0_INVALID                    = 0x0000,       
00103     TACTILE_SENSOR_TYPE_UBI0_TACTILE                    = 0x0001       
00104 }FROM_TACTILE_SENSOR_TYPE_UBI0;
00105 
00106 typedef enum                                                            // Data you can request from BioTacs
00107 {
00108     TACTILE_SENSOR_TYPE_BIOTAC_INVALID         = 0x0000,
00109     TACTILE_SENSOR_TYPE_BIOTAC_PDC             = 0x0001,
00110     TACTILE_SENSOR_TYPE_BIOTAC_TAC             = 0x0002,
00111     TACTILE_SENSOR_TYPE_BIOTAC_TDC             = 0x0003,
00112     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_1     = 0x0004,
00113     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_2     = 0x0005,
00114     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_3     = 0x0006,
00115     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_4     = 0x0007,
00116     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_5     = 0x0008,
00117     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_6     = 0x0009,
00118     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_7     = 0x000A, 
00119     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_8     = 0x000B,
00120     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_9     = 0x000C,
00121     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_10    = 0x000D,
00122     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_11    = 0x000E,
00123     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_12    = 0x000F,
00124     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_13    = 0x0010,
00125     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_14    = 0x0011,
00126     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_15    = 0x0012,
00127     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_16    = 0x0013,
00128     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_17    = 0x0014,
00129     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_18    = 0x0015,
00130     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_19    = 0x0016,
00131     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_20    = 0x0017,
00132     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_21    = 0x0018,
00133     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_22    = 0x0019,
00134     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_23    = 0x001A,
00135     TACTILE_SENSOR_TYPE_BIOTAC_ELECTRODE_24    = 0x001B,
00136 
00137     FROM_TACTILE_SENSOR_TYPE_BIOTAC_NUM_VALUES = 0x001C
00138 }FROM_TACTILE_SENSOR_TYPE_BIOTAC;
00139 
00140 
00141 typedef enum                                                   // Data you can request from MCP320x ADC
00142 {
00143     TACTILE_SENSOR_TYPE_MCP320x_INVALID        = 0x0000,       
00144     TACTILE_SENSOR_TYPE_MCP320x_TACTILE        = 0x0001       
00145 } FROM_TACTILE_SENSOR_TYPE_MCP320x;
00146 
00147 
00148 typedef struct
00149 {
00150     int16u  Pac[2];
00151     int16u  other_sensor_0;
00152     //int16u  other_sensor_1;                               #ERROR NO! Do not place this here
00153 
00154     struct
00155     {
00156         int8u Pac0           : 1;
00157         int8u Pac1           : 1;
00158         int8u other_sensor_0 : 1;
00159         int8u other_sensor_1 : 1;
00160     }data_valid;
00161 
00162     int16u  other_sensor_1;                                 // This is placed here to make this struct backwards compatible
00163                                                             // with older versions of the host side driver.
00164     
00165     int16u  nothing[TACTILE_DATA_LENGTH_WORDS_v1 - 5];
00166 }TACTILE_SENSOR_BIOTAC_DATA_CONTENTS;
00167 
00168 
00169 // Length for Univ. Bielefeld tactile sensors
00170 
00171 #define TACTILE_DATA_LENGTH_BYTES_v2   32
00172 #define TACTILE_DATA_LENGTH_WORDS_v2   (TACTILE_DATA_LENGTH_BYTES_v2/2)
00173 
00174 
00175 typedef union
00176 {
00177     int16u  word[TACTILE_DATA_LENGTH_WORDS_v2];                            
00178     char    string[TACTILE_DATA_LENGTH_BYTES_v2];
00179 }TACTILE_SENSOR_STATUS_v2;
00180 
00181 typedef struct
00182 {
00183     int16u  distal[TACTILE_DATA_LENGTH_WORDS_v2];
00184     int16u  misc;
00185 }TACTILE_SENSOR_UNIBI_DATA_CONTENTS;
00186 
00187 typedef union
00188 {
00189     struct
00190     {
00191         int16u    middle[4];
00192         int16u  proximal[4];
00193     }named;
00194 
00195     int16u integers[8];
00196 }TACTILE_SENSOR_MID_PROX;
00197 
00198 typedef enum
00199 {
00200     MID_0   = 0,
00201     MID_1   = 1,
00202     MID_2   = 2,
00203     MID_3   = 3,
00204 
00205     PROX_0   = 4,
00206     PROX_1   = 5,
00207     PROX_2   = 6,
00208     PROX_3   = 7
00209 }TACTILE_MID_PROX_SENSOR_NUMBERS;
00210 
00211 
00212 typedef struct
00213 {
00214     int16u  sensor[16];
00215 }TACTILE_SENSOR_PALM;
00216 
00217 
00218 typedef struct
00219 {
00220     int16u  sensor[16];
00221 }AUX_SPI_SENSOR;
00222 
00223 
00224 
00225 /*
00226 #ifndef NO_STRINGS
00227 
00228     static const char* tactile_sensor_shadow_type_strings[4]  = {   "None",
00229                                                                     "Pressure Sensor Tactile",
00230                                                                     "6 Axis"};
00231 
00232     static const char* tactile_sensor_syntouch_type_strings[4] = {  "None",
00233                                                                     "BioTac 2.3"};
00234 
00235 
00236 
00237     static const char* tactile_sensor_manufacturer_strings[4] = {   "None",
00238                                                                     "Shadow Robot Company Ltd.",
00239                                                                     "Syntouch",
00240                                                                     "Bielefeld University"};
00241 
00242     static const char* tactile_sensor_generic_info_strings[7] = {   "Invalid",
00243                                                                     "SVN revision",
00244                                                                     "Revision is modified",
00245                                                                     "SVN revision on server at build time",
00246                                                                     "PCB version",
00247                                                                     "Part serial number low",
00248                                                                     "Part serial number high"};
00249 
00250 #endif
00251 */
00252 
00253 
00254 
00255 #endif


sr_external_dependencies
Author(s): Ugo Cupcic
autogenerated on Mon Jul 1 2019 20:06:25