The MGC3130 is the world’s first electrical-field (E-field) based three-dimensional (3D) tracking and gesture controller
Dependents: NucleoMGC3130 i2c_master
GestILibrarMessage/GestICMsg.h@8:de7934ec7ea2, 2015-11-14 (annotated)
- Committer:
- yangcq88517
- Date:
- Sat Nov 14 15:44:44 2015 +0000
- Revision:
- 8:de7934ec7ea2
- Parent:
- 6:b511421e7dc8
change to unsigned char array
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yangcq88517 | 1:621c4e9238ef | 1 | #ifndef UK_AC_HERTS_SMARTLAB_MGC3130_GestICMsg |
yangcq88517 | 1:621c4e9238ef | 2 | #define UK_AC_HERTS_SMARTLAB_MGC3130_GestICMsg |
yangcq88517 | 0:92f17b057d6b | 3 | |
yangcq88517 | 6:b511421e7dc8 | 4 | #include "BufferedArray.h" |
yangcq88517 | 0:92f17b057d6b | 5 | |
yangcq88517 | 2:c7d984193741 | 6 | /** |
yangcq88517 | 2:c7d984193741 | 7 | *A message is the container to exchange data between GestIC Library and the |
yangcq88517 | 2:c7d984193741 | 8 | *application host. Each message has a minimum length of 4 bytes and a maximum of |
yangcq88517 | 2:c7d984193741 | 9 | *255 bytes, and fits into the data packets of the communication interface (e.g., I2C). |
yangcq88517 | 2:c7d984193741 | 10 | *Each frame transports a single message (see Figure 3-1). |
yangcq88517 | 2:c7d984193741 | 11 | */ |
yangcq88517 | 6:b511421e7dc8 | 12 | class GestICMsg : public BufferedArray |
yangcq88517 | 0:92f17b057d6b | 13 | { |
yangcq88517 | 0:92f17b057d6b | 14 | public: |
yangcq88517 | 0:92f17b057d6b | 15 | static const int System_Status = 0x15; |
yangcq88517 | 0:92f17b057d6b | 16 | static const int Request_Message = 0x06; |
yangcq88517 | 0:92f17b057d6b | 17 | static const int Fw_Version_Info = 0x83; |
yangcq88517 | 0:92f17b057d6b | 18 | static const int Set_Runtime_Parameter = 0xA2; |
yangcq88517 | 0:92f17b057d6b | 19 | |
yangcq88517 | 0:92f17b057d6b | 20 | static const int Sensor_Data_Output = 0x91; |
yangcq88517 | 0:92f17b057d6b | 21 | |
yangcq88517 | 0:92f17b057d6b | 22 | static const int Fw_Update_Start = 0x80; |
yangcq88517 | 0:92f17b057d6b | 23 | static const int Fw_Update_Block = 0x81; |
yangcq88517 | 0:92f17b057d6b | 24 | static const int Fw_Update_Completed = 0x82; |
yangcq88517 | 0:92f17b057d6b | 25 | |
yangcq88517 | 2:c7d984193741 | 26 | /// Construct a empty message. |
yangcq88517 | 0:92f17b057d6b | 27 | GestICMsg(); |
yangcq88517 | 0:92f17b057d6b | 28 | |
yangcq88517 | 2:c7d984193741 | 29 | /** Complete size of the message in bytes including the header |
yangcq88517 | 2:c7d984193741 | 30 | * |
yangcq88517 | 2:c7d984193741 | 31 | * @returns payload length, include head. |
yangcq88517 | 2:c7d984193741 | 32 | * |
yangcq88517 | 2:c7d984193741 | 33 | */ |
yangcq88517 | 0:92f17b057d6b | 34 | int getMsgSize(); |
yangcq88517 | 0:92f17b057d6b | 35 | |
yangcq88517 | 2:c7d984193741 | 36 | /** Reserved for future use. |
yangcq88517 | 2:c7d984193741 | 37 | * |
yangcq88517 | 2:c7d984193741 | 38 | * @returns always be 0x00 |
yangcq88517 | 2:c7d984193741 | 39 | * |
yangcq88517 | 2:c7d984193741 | 40 | */ |
yangcq88517 | 0:92f17b057d6b | 41 | int getFlags(); |
yangcq88517 | 0:92f17b057d6b | 42 | |
yangcq88517 | 2:c7d984193741 | 43 | /** Sequence number which is increased for each message sent out by |
yangcq88517 | 2:c7d984193741 | 44 | * MGC3X30. Range is 0…255. The host controller can use that information |
yangcq88517 | 2:c7d984193741 | 45 | * to verify if the messages got lost during I2C™ transmission. |
yangcq88517 | 2:c7d984193741 | 46 | * MGC3X30 ignores the sequence number in the received messages. |
yangcq88517 | 2:c7d984193741 | 47 | * |
yangcq88517 | 2:c7d984193741 | 48 | * @returns the sqeuence number |
yangcq88517 | 2:c7d984193741 | 49 | * |
yangcq88517 | 2:c7d984193741 | 50 | */ |
yangcq88517 | 0:92f17b057d6b | 51 | int getSeq(); |
yangcq88517 | 0:92f17b057d6b | 52 | |
yangcq88517 | 2:c7d984193741 | 53 | /** For each ID, the GestIC Library holds a |
yangcq88517 | 2:c7d984193741 | 54 | * dedicated structure containing the message direction, its payload |
yangcq88517 | 2:c7d984193741 | 55 | * elements and possible reply actions. |
yangcq88517 | 2:c7d984193741 | 56 | * |
yangcq88517 | 2:c7d984193741 | 57 | * @returns ID of the messag. |
yangcq88517 | 2:c7d984193741 | 58 | * |
yangcq88517 | 2:c7d984193741 | 59 | */ |
yangcq88517 | 0:92f17b057d6b | 60 | int getID(); |
yangcq88517 | 0:92f17b057d6b | 61 | }; |
yangcq88517 | 0:92f17b057d6b | 62 | |
yangcq88517 | 0:92f17b057d6b | 63 | #endif |