PX4 Firmware
PX4 Autopilot Software http://px4.io
sumd.h File Reference

RC protocol definition for Graupner HoTT transmitter. More...

#include <stdint.h>
Include dependency graph for sumd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ReceiverFcPacketHoTT
 

Macros

#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
 

Functions

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...
 

Detailed Description

RC protocol definition for Graupner HoTT transmitter.

Author
Marco Bauer marco.nosp@m.@wtn.nosp@m.s.de

Definition in file sumd.h.

Macro Definition Documentation

◆ SUMD_HEADER_ID

#define SUMD_HEADER_ID   0xA8

Definition at line 50 of file sumd.h.

Referenced by sumd_decode().

◆ SUMD_HEADER_LENGTH

#define SUMD_HEADER_LENGTH   3

Definition at line 49 of file sumd.h.

◆ SUMD_ID_FAILSAFE

#define SUMD_ID_FAILSAFE   0x81

Definition at line 53 of file sumd.h.

Referenced by sumd_decode().

◆ SUMD_ID_SUMD

#define SUMD_ID_SUMD   0x01

Definition at line 52 of file sumd.h.

Referenced by sumd_decode().

◆ SUMD_ID_SUMH

#define SUMD_ID_SUMH   0x00

Definition at line 51 of file sumd.h.

Referenced by sumd_decode().

◆ SUMD_MAX_CHANNELS

#define SUMD_MAX_CHANNELS   32

Definition at line 48 of file sumd.h.

Referenced by sumd_decode().

Function Documentation

◆ sumd_crc16()

uint16_t sumd_crc16 ( uint16_t  crc,
uint8_t  value 
)

CRC16 implementation for SUMD protocol.

Parameters
crcInitial CRC Value
valueto accumulate in the checksum
Returns
the checksum

Definition at line 93 of file sumd.cpp.

Referenced by sumd_decode().

Here is the caller graph for this function:

◆ sumd_crc8()

uint8_t sumd_crc8 ( uint8_t  crc,
uint8_t  value 
)

CRC8 implementation for SUMH protocol.

Parameters
crcInitial CRC Value
valueto accumulate in the checksum
Returns
the checksum

Definition at line 105 of file sumd.cpp.

Referenced by sumd_decode().

Here is the caller graph for this function:

◆ 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
bytecurrent char to read
rssipointer to a byte where the RSSI value is written back to
rx_countpointer to a byte where the receive count of packets signce last wireless frame is written back to
channelspointer to a datastructure of size max_chan_count where channel values (12 bit) are written back to
max_chan_countmaximum channels to decode - if more channels are decoded, the last n are skipped and success (0) is returned
failsafepointer 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

Definition at line 111 of file sumd.cpp.

References _crc16, _crc8, _crcOK, _debug, _decode_state, _rxlen, _sumd, ReceiverFcPacketHoTT::crc16_high, ReceiverFcPacketHoTT::crc16_low, ReceiverFcPacketHoTT::crc8, ReceiverFcPacketHoTT::header, ReceiverFcPacketHoTT::length, ReceiverFcPacketHoTT::status, sumd_crc16(), sumd_crc8(), ReceiverFcPacketHoTT::sumd_data, SUMD_DECODE_STATE_GOT_CRC, SUMD_DECODE_STATE_GOT_CRC16_BYTE_1, SUMD_DECODE_STATE_GOT_CRC16_BYTE_2, SUMD_DECODE_STATE_GOT_DATA, SUMD_DECODE_STATE_GOT_HEADER, SUMD_DECODE_STATE_GOT_LEN, SUMD_DECODE_STATE_GOT_STATE, SUMD_DECODE_STATE_UNSYNCED, SUMD_HEADER_ID, SUMD_ID_FAILSAFE, SUMD_ID_SUMD, SUMD_ID_SUMH, SUMD_MAX_CHANNELS, and ReceiverFcPacketHoTT::telemetry.

Referenced by RCInput::cycle(), dsm_port_input(), and RCTest::sumdTest().

Here is the call graph for this function:
Here is the caller graph for this function: