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
void radio_control_feed(void)
#define SPEKTRUM_MAX_CHANNELS
int8_t signs[SPEKTRUM_NB_CHANNEL]
Signs for the RC channels.
uint8_t lost_frame_cnt
Amount of RC frames lost.
bool valid
True when we received a packet else false.
#define SPEKTRUM_SATELLITES_NB
void spektrum_event(void)
Checks if there is one valid satellite and sets the radio_control structure.
uint8_t idx
input buffer index
struct spektrum_sat_t satellites[SPEKTRUM_SATELLITES_NB]
All the satellites connected.
#define SPEKTRUM_FRAME_LEN
16 bytes in a standard frame
bool valid
True when we received a packet else false.
uint8_t buf[SPEKTRUM_FRAME_LEN]
input buffer
int16_t values[SPEKTRUM_MAX_CHANNELS]
RC channel values.
uint32_t timer
Timer to keep track of the UART synchronisation.
void spektrum_init(void)
Main Radio initialization.
uint8_t tx_type
Transmitter type encoded (see wiki)
void spektrum_try_bind(void)
Radio control channels defaults, because they are digital.
#define SPEKTRUM_NB_CHANNEL
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
signed char int8_t
Typedef defining 8 bit char type.