RC protocol definition for Graupner HoTT transmitter.
More...
#include <stdint.h>
Go to the source code of this file.
|
#define | SUMD_MAX_CHANNELS 32 |
|
#define | SUMD_HEADER_LENGTH 3 |
|
#define | SUMD_HEADER_ID 0xA8 |
|
#define | SUMD_ID_SUMH 0x00 |
|
#define | SUMD_ID_SUMD 0x01 |
|
#define | SUMD_ID_FAILSAFE 0x81 |
|
|
uint16_t | sumd_crc16 (uint16_t crc, uint8_t value) |
| CRC16 implementation for SUMD protocol. More...
|
|
uint8_t | sumd_crc8 (uint8_t crc, uint8_t value) |
| CRC8 implementation for SUMH protocol. More...
|
|
__EXPORT int | sumd_decode (uint8_t byte, uint8_t *rssi, uint8_t *rx_count, uint16_t *channel_count, uint16_t *channels, uint16_t max_chan_count, bool *failsafe) |
| Decoder for SUMD/SUMH protocol. More...
|
|
RC protocol definition for Graupner HoTT transmitter.
- Author
- Marco Bauer marco.nosp@m.@wtn.nosp@m.s.de
§ sumd_crc16()
uint16_t sumd_crc16 |
( |
uint16_t |
crc, |
|
|
uint8_t |
value |
|
) |
| |
CRC16 implementation for SUMD protocol.
- Parameters
-
crc | Initial CRC Value |
value | to accumulate in the checksum |
- Returns
- the checksum
§ sumd_crc8()
uint8_t sumd_crc8 |
( |
uint8_t |
crc, |
|
|
uint8_t |
value |
|
) |
| |
CRC8 implementation for SUMH protocol.
- Parameters
-
crc | Initial CRC Value |
value | to accumulate in the checksum |
- Returns
- the checksum
§ sumd_decode()
__EXPORT int sumd_decode |
( |
uint8_t |
byte, |
|
|
uint8_t * |
rssi, |
|
|
uint8_t * |
rx_count, |
|
|
uint16_t * |
channel_count, |
|
|
uint16_t * |
channels, |
|
|
uint16_t |
max_chan_count, |
|
|
bool * |
failsafe |
|
) |
| |
Decoder for SUMD/SUMH protocol.
- Parameters
-
byte | current char to read |
rssi | pointer to a byte where the RSSI value is written back to |
rx_count | pointer to a byte where the receive count of packets signce last wireless frame is written back to |
channels | pointer to a datastructure of size max_chan_count where channel values (12 bit) are written back to |
max_chan_count | maximum channels to decode - if more channels are decoded, the last n are skipped and success (0) is returned |
failsafe | pointer to a boolean where the decoded failsafe flag is written back to |
- Returns
- 0 for success (a decoded packet), 1 for no packet yet (accumulating), 2 for unknown packet, 3 for out of sync, 4 for checksum error