44 #ifndef COMMON_EDC_ETHERCAT_PROTOCOL_H_INCLUDED 45 #define COMMON_EDC_ETHERCAT_PROTOCOL_H_INCLUDED 61 #ifndef NO_STRINGS // The PIC compiler doesn't deal well with strings. 65 "SVN revision on server at build time",
67 "Modified from SVN revision",
72 "Assembly date month, day",
79 "Controller deadband and sign",
81 "Controller loop frequency Hz" 98 #define MESSAGE_ID_DIRECTION_BITS 0b11000000000 99 #define MESSAGE_ID_MOTOR_ID_BITS 0b00111100000 100 #define MESSAGE_ID_ACK_BIT 0b00000010000 101 #define MESSAGE_ID_TYPE_BITS 0b00000001111 102 // or for the TO_MUSCLE_DATA_TYPE or FROM_MUSCLE_DATA_TYPE 104 #define MESSAGE_ID_DIRECTION_SHIFT_POS 9 108 #define SENSORS_NUM_0X20 ((int)36) 112 #define JOINTS_NUM_0X20 ((int)28) 117 #ifndef NO_STRINGS // The PIC compiler doesn't deal well with strings. 120 "MFJ0",
"MFJ1",
"MFJ2",
"MFJ3",
"MFJ4",
121 "RFJ0",
"RFJ1",
"RFJ2",
"RFJ3",
"RFJ4",
122 "LFJ0",
"LFJ1",
"LFJ2",
"LFJ3",
"LFJ4",
"LFJ5",
123 "THJ1",
"THJ2",
"THJ3",
"THJ4",
"THJ5",
131 "MFJ1",
"MFJ2",
"MFJ3",
"MFJ4",
132 "RFJ1",
"RFJ2",
"RFJ3",
"RFJ4",
133 "LFJ1",
"LFJ2",
"LFJ3",
"LFJ4",
"LFJ5",
134 "THJ1",
"THJ2",
"THJ3",
"THJ4",
"THJ5A",
"THJ5B",
135 "WRJ1A",
"WRJ1B",
"WRJ2",
136 "ACCX",
"ACCY",
"ACCZ",
137 "GYRX",
"GYRY",
"GYRZ",
138 "AN0",
"AN1",
"AN2",
"AN3" 171 #define INSERT_CRC_CALCULATION_HERE crc_i = (int8u) (crc_result&0xff); \ 174 if(crc_i & 0x01) crc_result ^= 0x3096; \ 175 if(crc_i & 0x02) crc_result ^= 0x612c; \ 176 if(crc_i & 0x04) crc_result ^= 0xc419; \ 177 if(crc_i & 0x08) crc_result ^= 0x8832; \ 178 if(crc_i & 0x10) crc_result ^= 0x1064; \ 179 if(crc_i & 0x20) crc_result ^= 0x20c8; \ 180 if(crc_i & 0x40) crc_result ^= 0x4190; \ 181 if(crc_i & 0x80) crc_result ^= 0x8320;
Normal operating value. Palm transmits ADC readings.
Requesting that motors send back status data (AKA Start of Frame)
Instead of sending ADC readings, send the channel number, so the host can confirm the firmware is cor...
Instead of sending ADC readings, send the chip select channel, so the host can confirm the firmware i...
static const char * joint_names[JOINTS_NUM_0X20]
This needs to be a #define for symmetry with SENSORS_NUM.
static const char * sensor_names[SENSORS_NUM_0X20]
This array defines the names of the joints. The names and order should match the enum SENSOR_NAMES_EN...
static const char * slow_data_types[17]
HARD_CONFIGURATION_INFORMATION
Might be used in the future for running automated tests inside the firmware.
Message contains status data from a motor.
SENSOR_NAME_ENUM
This enum defines which ADC reading goes into which sensors[].
Reading an empty mailbox on the ET1200 results in a zero.
Message contains command data being sent to the motors.
#define JOINTS_NUM_0X20
This needs to be a #define because it's used to dimension an array.
EDC_COMMAND
The host can request different types of data from the palm.
Message has something to do with boot-loading.