PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Go to the source code of this file.
Macros | |
#define | ST24_RANGE_MIN 500.0f |
#define | ST24_RANGE_MAX 3500.0f |
#define | ST24_TARGET_MIN 1000.0f |
#define | ST24_TARGET_MAX 2000.0f |
#define | ST24_SCALE_FACTOR ((ST24_TARGET_MAX - ST24_TARGET_MIN) / (ST24_RANGE_MAX - ST24_RANGE_MIN)) |
#define | ST24_SCALE_OFFSET (int)(ST24_TARGET_MIN - (ST24_SCALE_FACTOR * ST24_RANGE_MIN + 0.5f)) |
Functions | |
uint8_t | st24_common_crc8 (uint8_t *ptr, uint8_t len) |
CRC8 implementation for ST24 protocol. More... | |
int | st24_decode (uint8_t byte, uint8_t *rssi, uint8_t *lost_count, uint16_t *channel_count, uint16_t *channels, uint16_t max_chan_count) |
Decoder for ST24 protocol. More... | |
Variables | |
const char * | decode_states [] |
static enum ST24_DECODE_STATE | _decode_state = ST24_DECODE_STATE_UNSYNCED |
static uint8_t | _rxlen |
static ReceiverFcPacket & | _rxpacket = rc_decode_buf._strxpacket |
#define ST24_SCALE_FACTOR ((ST24_TARGET_MAX - ST24_TARGET_MIN) / (ST24_RANGE_MAX - ST24_RANGE_MIN)) |
Definition at line 63 of file st24.cpp.
Referenced by st24_decode().
#define ST24_SCALE_OFFSET (int)(ST24_TARGET_MIN - (ST24_SCALE_FACTOR * ST24_RANGE_MIN + 0.5f)) |
Definition at line 64 of file st24.cpp.
Referenced by st24_decode().
uint8_t st24_common_crc8 | ( | uint8_t * | ptr, |
uint8_t | len | ||
) |
CRC8 implementation for ST24 protocol.
prt | Pointer to the data to CRC |
len | number of bytes to accumulate in the checksum |
Definition at line 71 of file st24.cpp.
Referenced by st24_decode().
int st24_decode | ( | uint8_t | byte, |
uint8_t * | rssi, | ||
uint8_t * | lost_count, | ||
uint16_t * | channel_count, | ||
uint16_t * | channels, | ||
uint16_t | max_chan_count | ||
) |
Decoder for ST24 protocol.
byte | current char to read |
rssi | pointer to a byte where the RSSI value is written back to |
lost_count | pointer to a byte where the receive count of packets since last wireless frame is written back to ( > 0 if RC is lost) |
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 |
Definition at line 98 of file st24.cpp.
References _decode_state, _rxlen, sbus_bit_pick::byte, ChannelData12::channel, ChannelData24::channel, ReceiverFcPacket::crc8, f(), ReceiverFcPacket::length, ChannelData12::lost_count, ChannelData24::lost_count, ChannelData12::rssi, ChannelData24::rssi, st24_common_crc8(), ReceiverFcPacket::st24_data, ST24_DECODE_STATE_GOT_DATA, ST24_DECODE_STATE_GOT_LEN, ST24_DECODE_STATE_GOT_STX1, ST24_DECODE_STATE_GOT_STX2, ST24_DECODE_STATE_GOT_TYPE, ST24_DECODE_STATE_UNSYNCED, ST24_PACKET_TYPE_CHANNELDATA12, ST24_PACKET_TYPE_CHANNELDATA24, ST24_PACKET_TYPE_TRANSMITTERGPSDATA, ST24_SCALE_FACTOR, ST24_SCALE_OFFSET, ST24_STX1, ST24_STX2, and ReceiverFcPacket::type.
Referenced by RCInput::cycle(), dsm_port_input(), and RCTest::st24Test().
|
static |
Definition at line 66 of file st24.cpp.
Referenced by st24_decode().
|
static |
Definition at line 67 of file st24.cpp.
Referenced by st24_decode().
|
static |