This is the firmware for the base version of the OpenSTEM Ranging Board hardware.
Dependencies: Servo USBDevice mbed
Fork of USBSerial_HelloWorld by
command_matrix.h@10:d74124f266cb, 2016-08-10 (annotated)
- Committer:
- matthewgascoyne
- Date:
- Wed Aug 10 08:01:00 2016 +0000
- Revision:
- 10:d74124f266cb
base version of OpenSTEM Ranging Board Firmware
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
matthewgascoyne | 10:d74124f266cb | 1 | // This file firstly defines a lookup table of all the valid |
matthewgascoyne | 10:d74124f266cb | 2 | // command IDs and the number of data bytes that each should have. |
matthewgascoyne | 10:d74124f266cb | 3 | // Below the lookup table is a memory used to store those data |
matthewgascoyne | 10:d74124f266cb | 4 | // bytes when a valid command is received. |
matthewgascoyne | 10:d74124f266cb | 5 | #include "stdint.h" |
matthewgascoyne | 10:d74124f266cb | 6 | |
matthewgascoyne | 10:d74124f266cb | 7 | /////////////////////LOOKUP TABLE//////////////////////////////////////// |
matthewgascoyne | 10:d74124f266cb | 8 | extern const uint8_t c_matrix[26]= { |
matthewgascoyne | 10:d74124f266cb | 9 | 'f' , 3 , // ID = "f"(0x66) , 3 data bytes |
matthewgascoyne | 10:d74124f266cb | 10 | 's' , 2 , // ID = "s"(0x73) , 2 data bytes |
matthewgascoyne | 10:d74124f266cb | 11 | 'i' , 0 , // ID = "i"(0x69) , 0 data bytes |
matthewgascoyne | 10:d74124f266cb | 12 | 'y' , 0 , // ID = "y"(0x79) , 0 data bytes |
matthewgascoyne | 10:d74124f266cb | 13 | 'p' , 0 , // ID = "p"(0x70) , 0 data bytes |
matthewgascoyne | 10:d74124f266cb | 14 | 'm' , 2 , // ID = "m"(0x6D) , 2 data bytes |
matthewgascoyne | 10:d74124f266cb | 15 | 'd' , 0 , // ID = "d"(0x64) , 0 data bytes |
matthewgascoyne | 10:d74124f266cb | 16 | 'r' , 3 , // ID = "r"(0x72) , 3 data bytes |
matthewgascoyne | 10:d74124f266cb | 17 | 'q' , 3 , // ID = "q"(0x71) , 3 data bytes |
matthewgascoyne | 10:d74124f266cb | 18 | 't' , 0 , // ID = "t"(0x74) , 0 data bytes |
matthewgascoyne | 10:d74124f266cb | 19 | 'v' , 0 , // ID = "v"(0x76) , 0 data bytes |
matthewgascoyne | 10:d74124f266cb | 20 | 'o' , 1 , // ID = "o"(0x6F) , 1 data bytes |
matthewgascoyne | 10:d74124f266cb | 21 | 'u' , 0 , // ID = "u"(0x75) , 0 data bytes |
matthewgascoyne | 10:d74124f266cb | 22 | }; |
matthewgascoyne | 10:d74124f266cb | 23 | ///////////////////////////////////////////////////////////////////////// |
matthewgascoyne | 10:d74124f266cb | 24 | |
matthewgascoyne | 10:d74124f266cb | 25 | ///////////////////DATA BYTE STORAGE///////////////////////////////////// |
matthewgascoyne | 10:d74124f266cb | 26 | extern uint8_t c_data_0x66[3]= { 0, 0, 0, }; //data holder for "f" 0x66 |
matthewgascoyne | 10:d74124f266cb | 27 | extern uint8_t c_data_0x73[2]= { 0, 0, }; //data holder for "s" 0x73 |
matthewgascoyne | 10:d74124f266cb | 28 | //do not need a data holder for "i" 0x69 |
matthewgascoyne | 10:d74124f266cb | 29 | //do not need a data holder for "y" 0x79 |
matthewgascoyne | 10:d74124f266cb | 30 | //do not need a data holder for "p" 0x70 |
matthewgascoyne | 10:d74124f266cb | 31 | extern uint8_t c_data_0x6D[2]= { 0, 0, }; //data holder for "m" 0x6D |
matthewgascoyne | 10:d74124f266cb | 32 | //do not need a data holder for "d" 0x64 |
matthewgascoyne | 10:d74124f266cb | 33 | extern uint8_t c_data_0x72[3]= { 0, 0, 0, }; //data holder for "r" 0x72 |
matthewgascoyne | 10:d74124f266cb | 34 | extern uint8_t c_data_0x71[3]= { 0, 0, 0, }; //data holder for "q" 0x71 |
matthewgascoyne | 10:d74124f266cb | 35 | //do not need a data holder for "t" 0x74 |
matthewgascoyne | 10:d74124f266cb | 36 | //do not need a data holder for "v" 0x76 |
matthewgascoyne | 10:d74124f266cb | 37 | extern uint8_t c_data_0x6F[1]= { 0, }; //data holder for "o" 0x6F |
matthewgascoyne | 10:d74124f266cb | 38 | //do not need a data holder for "u" 0x75 |
matthewgascoyne | 10:d74124f266cb | 39 | ///////////////////////////////////////////////////////////////////////// |