Paparazzi UAS  v5.15_devel-109-gee85905
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
spektrum.h File Reference

Radio control spektrum interface. More...

#include "std.h"
#include "spektrum_radio.h"
+ Include dependency graph for spektrum.h:
+ This graph shows which files directly or indirectly include this file:

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...
 
#define RadioControlEvent(_received_frame_handler)   spektrum_event(_received_frame_handler)
 

Functions

void spektrum_event (void(*_received_frame_handler)(void))
 Checks if there is one valid satellite and sets the radio_control structure. More...
 
void spektrum_try_bind (void)
 

Detailed Description

Radio control spektrum interface.

Definition in file spektrum.h.


Data Structure Documentation

struct spektrum_sat_t

Definition at line 51 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 61 of file spektrum.h.

+ Collaboration diagram for spektrum_t:
Data Fields
struct spektrum_sat_t satellites[SPEKTRUM_SATELLITES_NB] All the satellites connected.
int8_t signs[RADIO_CONTROL_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.

Macro Definition Documentation

#define RadioControlEvent (   _received_frame_handler)    spektrum_event(_received_frame_handler)

Definition at line 48 of file spektrum.h.

#define SPEKTRUM_CHANNELS_PER_FRAME   7

Maximum amount of RC channels per frame.

Definition at line 42 of file spektrum.h.

Referenced by spektrum_parser().

#define SPEKTRUM_FRAME_LEN   16

16 bytes in a standard frame

Definition at line 41 of file spektrum.h.

Referenced by spektrum_uart_check().

#define SPEKTRUM_MAX_CHANNELS   (SPEKTRUM_CHANNELS_PER_FRAME * SPEKTRUM_MAX_FRAMES)

Definition at line 44 of file spektrum.h.

Referenced by spektrum_init_sat().

#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.

Referenced by spektrum_uart_check().

#define SPEKTRUM_SATELLITES_NB   2

Definition at line 38 of file spektrum.h.

Referenced by spektrum_event().

Function Documentation

void spektrum_event ( void(*)(void)  _received_frame_handler)
void spektrum_try_bind ( void  )

Definition at line 57 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().

+ Here is the call graph for this function: