29 #ifndef RADIO_CONTROL_SPEKTRUM_H
30 #define RADIO_CONTROL_SPEKTRUM_H
38 #define SPEKTRUM_SATELLITES_NB 2
41 #define SPEKTRUM_FRAME_LEN 16
42 #define SPEKTRUM_CHANNELS_PER_FRAME 7
43 #define SPEKTRUM_MAX_FRAMES 2
44 #define SPEKTRUM_MAX_CHANNELS (SPEKTRUM_CHANNELS_PER_FRAME * SPEKTRUM_MAX_FRAMES)
45 #define SPEKTRUM_MIN_FRAME_SPACE 7
48 #define RadioControlEvent(_received_frame_handler) spektrum_event(_received_frame_handler)
#define SPEKTRUM_MAX_CHANNELS
struct spektrum_sat_t satellites[SPEKTRUM_SATELLITES_NB]
All the satellites connected.
#define RADIO_CONTROL_NB_CHANNEL
uint8_t buf[SPEKTRUM_FRAME_LEN]
input buffer
bool valid
True when we received a packet else false.
uint32_t timer
Timer to keep track of the UART synchronisation.
#define SPEKTRUM_FRAME_LEN
16 bytes in a standard frame
uint8_t lost_frame_cnt
Amount of RC frames lost.
uint8_t tx_type
Transmitter type encoded (see wiki)
void spektrum_try_bind(void)
#define SPEKTRUM_SATELLITES_NB
int8_t signs[RADIO_CONTROL_NB_CHANNEL]
Signs for the RC channels.
int16_t values[SPEKTRUM_MAX_CHANNELS]
RC channel values.
bool valid
True when we received a packet else false.
uint8_t idx
input buffer index
void spektrum_event(void(*_received_frame_handler)(void))
Checks if there is one valid satellite and sets the radio_control structure.
Radio control channels defaults, because they are digital.