.
Dependencies: L432KC_SPI_Pey_Lal
protocol.h@115:156b8234f2de, 2022-05-18 (annotated)
- Committer:
- voltxd
- Date:
- Wed May 18 18:07:09 2022 +0000
- Revision:
- 115:156b8234f2de
- Parent:
- 114:c1f7be27aa5d
- Child:
- 116:6dfcafa00e42
.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
voltxd | 109:4ee7ffc8f175 | 1 | #ifndef PROTOCOL_H |
voltxd | 109:4ee7ffc8f175 | 2 | #define PROTOCOL_H |
voltxd | 109:4ee7ffc8f175 | 3 | |
voltxd | 110:a6d1d3525014 | 4 | #include "mbed.h" |
voltxd | 109:4ee7ffc8f175 | 5 | |
voltxd | 115:156b8234f2de | 6 | #define PAYLOAD_MAX_SIZE 128 |
voltxd | 115:156b8234f2de | 7 | |
voltxd | 115:156b8234f2de | 8 | #define STATE_START_OF_FRAME 0 |
voltxd | 115:156b8234f2de | 9 | #define STATE_COMMAND_TYPE 1 |
voltxd | 115:156b8234f2de | 10 | #define STATE_PAYLOAD 2 |
voltxd | 115:156b8234f2de | 11 | #define STATE_CHECKSUM 3 |
voltxd | 109:4ee7ffc8f175 | 12 | |
voltxd | 115:156b8234f2de | 13 | #define COMMAND_PWM 0b10101010 |
voltxd | 115:156b8234f2de | 14 | #define COMMAND_ASSERVISSEMENT 0b01010101 |
voltxd | 115:156b8234f2de | 15 | #define COMMAND_PARAMETRES 0b10100101 |
voltxd | 115:156b8234f2de | 16 | |
voltxd | 115:156b8234f2de | 17 | |
voltxd | 115:156b8234f2de | 18 | char calculateChecksum(char command, char* payload, char payloadLength); |
voltxd | 109:4ee7ffc8f175 | 19 | void decodeMessage(char c); |
voltxd | 115:156b8234f2de | 20 | char getVerifiedPayload(char *payloadOutput); |
voltxd | 109:4ee7ffc8f175 | 21 | char isDataAvailable(); |
voltxd | 109:4ee7ffc8f175 | 22 | |
voltxd | 109:4ee7ffc8f175 | 23 | #endif |