#include <stdio.h>
#include <stdint.h>
#include "st24.h"
Go to the source code of this file.
◆ ST24_DATA_LEN_MAX
#define ST24_DATA_LEN_MAX 64 |
◆ ST24_RANGE_MAX
#define ST24_RANGE_MAX 4096.0f |
◆ ST24_RANGE_MIN
#define ST24_RANGE_MIN 0.0f |
◆ ST24_SCALE_FACTOR
◆ ST24_SCALE_OFFSET
◆ ST24_STX1
◆ ST24_STX2
◆ ST24_TARGET_MAX
#define ST24_TARGET_MAX 2000.0f |
◆ ST24_TARGET_MIN
#define ST24_TARGET_MIN 1000.0f |
◆ ST24_DECODE_STATE
Enumerator |
---|
ST24_DECODE_STATE_UNSYNCED | |
ST24_DECODE_STATE_GOT_STX1 | |
ST24_DECODE_STATE_GOT_STX2 | |
ST24_DECODE_STATE_GOT_LEN | |
ST24_DECODE_STATE_GOT_TYPE | |
ST24_DECODE_STATE_GOT_DATA | |
Definition at line 143 of file st24.cpp.
◆ ST24_PACKET_TYPE
Enumerator |
---|
ST24_PACKET_TYPE_CHANNELDATA12 | |
ST24_PACKET_TYPE_CHANNELDATA24 | |
ST24_PACKET_TYPE_TRANSMITTERGPSDATA | |
Definition at line 54 of file st24.cpp.
◆ st24_common_crc8()
static uint8_t st24_common_crc8 |
( |
uint8_t * |
ptr, |
|
|
uint8_t |
len |
|
) |
| |
|
static |
◆ st24_decode()
int st24_decode |
( |
uint8_t |
byte, |
|
|
uint8_t * |
rssi, |
|
|
uint8_t * |
rx_count, |
|
|
uint16_t * |
channel_count, |
|
|
uint16_t * |
channels, |
|
|
uint16_t |
max_chan_count |
|
) |
| |
Decoder for ST24 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 |
- 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 195 of file st24.cpp.
Referenced by Linux::RCInput::add_st24_input().
◆ _decode_state
◆ _rxlen
◆ _rxpacket