Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Radio control spektrum interface. More...
Go to the source code of this file.
Data Structures | |
struct | spektrum_sat_t |
struct | spektrum_t |
Macros | |
#define | SPEKTRUM_SATELLITES_NB 2 |
#define | SPEKTRUM_FRAME_LEN 16 |
16 bytes in a standard frame More... | |
#define | SPEKTRUM_CHANNELS_PER_FRAME 7 |
Maximum amount of RC channels per frame. More... | |
#define | SPEKTRUM_MAX_FRAMES 2 |
Maximum amount of RC frames containing different channels. More... | |
#define | SPEKTRUM_MAX_CHANNELS (SPEKTRUM_CHANNELS_PER_FRAME * SPEKTRUM_MAX_FRAMES) |
#define | SPEKTRUM_MIN_FRAME_SPACE 7 |
Minum amount of time between frames (7ms), in fact either 11 or 22 ms. More... | |
Functions | |
void | spektrum_init (void) |
Main Radio initialization. More... | |
void | spektrum_event (void) |
Checks if there is one valid satellite and sets the radio_control structure. More... | |
void | spektrum_try_bind (void) |
Radio control spektrum interface.
Definition in file spektrum.h.
struct spektrum_sat_t |
Definition at line 48 of file spektrum.h.
Data Fields | ||
---|---|---|
uint8_t | buf[SPEKTRUM_FRAME_LEN] | input buffer |
uint8_t | idx | input buffer index |
uint8_t | lost_frame_cnt | Amount of RC frames lost. |
uint32_t | timer | Timer to keep track of the UART synchronisation. |
bool | valid | True when we received a packet else false. |
int16_t | values[SPEKTRUM_MAX_CHANNELS] | RC channel values. |
struct spektrum_t |
Definition at line 58 of file spektrum.h.
Data Fields | ||
---|---|---|
struct spektrum_sat_t | satellites[SPEKTRUM_SATELLITES_NB] | All the satellites connected. |
int8_t | signs[SPEKTRUM_NB_CHANNEL] | Signs for the RC channels. |
uint8_t | tx_type | Transmitter type encoded (see wiki) |
bool | valid | True when we received a packet else false. |
#define SPEKTRUM_CHANNELS_PER_FRAME 7 |
Maximum amount of RC channels per frame.
Definition at line 42 of file spektrum.h.
#define SPEKTRUM_FRAME_LEN 16 |
16 bytes in a standard frame
Definition at line 41 of file spektrum.h.
#define SPEKTRUM_MAX_CHANNELS (SPEKTRUM_CHANNELS_PER_FRAME * SPEKTRUM_MAX_FRAMES) |
Definition at line 44 of file spektrum.h.
#define SPEKTRUM_MAX_FRAMES 2 |
Maximum amount of RC frames containing different channels.
Definition at line 43 of file spektrum.h.
#define SPEKTRUM_MIN_FRAME_SPACE 7 |
Minum amount of time between frames (7ms), in fact either 11 or 22 ms.
Definition at line 45 of file spektrum.h.
#define SPEKTRUM_SATELLITES_NB 2 |
Definition at line 38 of file spektrum.h.
void spektrum_event | ( | void | ) |
Checks if there is one valid satellite and sets the radio_control structure.
Definition at line 44 of file spektrum_arch.c.
References RadioControl::frame_cpt, MAX_PPRZ, RadioControl::nb_channel, radio_control, RADIO_CONTROL_SPEKTRUM_ID, RC_OK, spektrum_t::satellites, spektrum_t::signs, spektrum, spektrum_available, SPEKTRUM_SATELLITES_NB, spektrum_uart_check(), RadioControl::status, RadioControl::time_since_last_frame, spektrum_sat_t::valid, spektrum_t::valid, RadioControl::values, and spektrum_sat_t::values.
void spektrum_init | ( | void | ) |
Main Radio initialization.
Definition at line 39 of file spektrum_arch.c.
References gpio_setup_output(), RadioControl::nb_channel, radio_control, RC_POLARITY_GPIO_PIN, RC_POLARITY_GPIO_PORT, RC_SET_POLARITY, spektrum_t::satellites, spektrum_t::signs, spektrum, spektrum_available, spektrum_init_sat(), SPEKTRUM_NB_CHANNEL, and spektrum_signs.
void spektrum_try_bind | ( | void | ) |
Definition at line 55 of file spektrum_arch.c.
References gpio_get(), gpio_setup_input_pulldown(), gpio_setup_input_pullup(), spektrum_bind(), SPEKTRUM_BIND_PIN, SPEKTRUM_BIND_PIN_PORT, and sys_time_usleep().