00001
00002
00003 #ifndef GLACSWEB_GLACSWEB_PROTOCOL_H
00004 #define GLACSWEB_GLACSWEB_PROTOCOL_H
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #define CMD_HEADER_ID 0x30 //command message header (send or rcv)
00015 #define INFO_HEADER_ID 0x50 //reply message header
00016
00017
00018 #define BITSYX_ID 0xF0 //ID of this device
00019 #define BROADCAST_ID 0xA0 //the ID boadcasting
00020
00021
00022
00023
00024 #define CMD_SYS_SLEEP 0x05 //put system in sleep mode
00025 #define CMD_SYS_EEPROM_WRITE 0x07 //write internal EEPROM
00026 #define CMD_SYS_EEPROM_READ 0x08 //Read internal EEEPROM
00027 #define CMD_SYS_ADC_READ 0x0C //Read ADC channel
00028 #define CMD_SYS_PARAM_1_READ 0x0D //Read system parameters(part 1)
00029 #define CMD_SYS_PARAM_2_READ 0x0E //Read system parameters(part 2)
00030 #define CMD_SYS_I_AM_AWAKE 0x14 //"I am Awake" Signal (always sent as reply)
00031 #define CMD_SYS_I_AM_IDLE 0x17 //"I am Idle" Signal (always sent as reply)
00032 #define CMD_SYS_DEBUG_STRING 0x18 //Debug String (always sent as reply)
00033 #define CMD_SYS_LOAD_PARAMS 0x1A //Load system variables with EEPROM values
00034 #define CMD_SYS_RUN_AUTO_PROG 0x1B //Reexecute the autonomous program
00035
00036
00037
00038 #define CMD_MCU_WRITE 0x28 //Write Flash
00039 #define CMD_MCU_READ 0x29 //Read Flash
00040 #define CMD_MCU_READ_FL_CHECKSUM 0x2A //Read Flash checksum
00041 #define CMD_MCU_READ_EE_CHECKSUM 0x2B //Read external EEPROM checksum
00042 #define CMD_MCU_PROGRAM 0x2C //Program FLASH with EEPROM contents
00043 #define CMD_MCU_WRITE_MODIFIER 0x2D //Reprogram LCALL to AutoProg
00044 #define CMD_MCU_ERASE 0x2E //Erase FLASH (0x1000 to 0x1fff)
00045
00046
00047 #define CMD_RTC_SET_TIME 0x32 //Set RTC time
00048 #define CMD_RTC_SET_DATE 0x33 //Set RTC date
00049 #define CMD_RTC_SET_ALARM 0x35 //Set RTC alarm
00050 #define CMD_RTC_READ_TIME 0x38 //Return RTC time register values
00051 #define CMD_RTC_READ_DATE 0x39 //Return RTC date register values
00052 #define CMD_RTC_READ_ALARM 0x3B //Return RTC alarm register values
00053
00054
00055 #define CMD_EEPROM_WRITE 0x3C //Write External EEPROM
00056 #define CMD_EEPROM_READ 0x3D //Read External EEPROM
00057 #define CMD_EEPROM_WRITE_8 0x3E //Write 8 Bytes to external EEPROM
00058 #define CMD_EEPROM_READ_16 0x3F //Read 16 Bytes from external EEPROM
00059 #define CMD_EEPROM_ERASE 0x40 //Erase EEPROM
00060 #define CMD_EEPROM_TEST 0x41 //Test EEPROM from address to address
00061
00062
00063 #define CMD_SEN_READ_TRANSMIT 0x46 //Read Sensors and Transmit
00064 #define CMD_SEN_READ_STORE 0x47 //Read Sensors and Store in ext. EEPROM
00065 #define CMD_SEN_READ_STORE_TRANSMIT 0x48 //Read Sensors, store in ext EEPROM and Transmit
00066 #define CMD_SEN_READ_STORED 0x49 //Read Readings stored in ext. EEPROM from EE_RD to EE_WR (multiple replies possible)
00067
00068 #define CMD_SEN_TEMP_READ 0x4A //Read temp sensor
00069 #define CMD_SEN_TILT_READ 0x4B //Read accelerometers
00070 #define CMD_SEN_TILT_CALIBRATE 0x4C //Read Calibrate accelerometers
00071 #define CMD_SEN_PRES_READ 0x4D //Read pressure sensor
00072 #define CMD_SEN_STRAIN_READ 0x4E //Read straing gauge
00073 #define CMD_SEN_RES_READ 0x4F //Read resistor reading
00074
00075
00076
00077 #define CMD_CNT_RESET 0x64 //Reset Counter
00078 #define CMD_CNT_CALIBRATE 0x65 //Calibrate CNT_STOP threshold
00079 #define CMD_CNT_READ 0x66 //Counter value (32 bits)
00080 #define CMD_CNT_ENABLE 0x67 //Enable/disable counter
00081
00082
00085 typedef struct probe_packet_struct
00086 {
00091 unsigned char header;
00093 unsigned char size;
00095 unsigned char id;
00097 unsigned char command;
00099 unsigned char data[16];
00100
00101 } glacsweb_packet;
00102
00103
00104 #endif // GLACSWEB_GLACSWEB_PROTOCOL_H