Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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...
 

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)
 

Detailed Description

Radio control spektrum interface.

Definition in file spektrum.h.


Data Structure Documentation

◆ spektrum_sat_t

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.

◆ spektrum_t

struct spektrum_t

Definition at line 58 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[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.

Macro Definition Documentation

◆ SPEKTRUM_CHANNELS_PER_FRAME

#define SPEKTRUM_CHANNELS_PER_FRAME   7

Maximum amount of RC channels per frame.

Definition at line 42 of file spektrum.h.

◆ SPEKTRUM_FRAME_LEN

#define SPEKTRUM_FRAME_LEN   16

16 bytes in a standard frame

Definition at line 41 of file spektrum.h.

◆ SPEKTRUM_MAX_CHANNELS

#define SPEKTRUM_MAX_CHANNELS   (SPEKTRUM_CHANNELS_PER_FRAME * SPEKTRUM_MAX_FRAMES)

Definition at line 44 of file spektrum.h.

◆ SPEKTRUM_MAX_FRAMES

#define SPEKTRUM_MAX_FRAMES   2

Maximum amount of RC frames containing different channels.

Definition at line 43 of file spektrum.h.

◆ SPEKTRUM_MIN_FRAME_SPACE

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

◆ SPEKTRUM_SATELLITES_NB

#define SPEKTRUM_SATELLITES_NB   2

Definition at line 38 of file spektrum.h.

Function Documentation

◆ spektrum_event()

◆ spektrum_init()

void spektrum_init ( void  )

◆ spektrum_try_bind()

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().

+ Here is the call graph for this function: