Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
radio_control.h File Reference
#include "generated/airframe.h"
#include "paparazzi.h"
+ Include dependency graph for radio_control.h:

Go to the source code of this file.

Data Structures

struct  RadioControl
 

Macros

#define RC_AVG_PERIOD   8 /* TODO remove if IIR filter is used */
 
#define RC_LOST_TIME   30 /* 500ms with a 60Hz timer */
 
#define RC_REALLY_LOST_TIME   60 /* ~1s */
 
#define RC_OK_CPT   15
 
#define RC_OK   0
 
#define RC_LOST   1
 
#define RC_REALLY_LOST   2
 
#define RADIO_CONTROL_NB_CHANNEL   32
 
#define RadioControlValues(_chan)   radio_control.values[_chan]
 
#define RadioControlIsLost()   (radio_control.status == RC_REALLY_LOST)
 

Functions

static void radio_control_set (uint8_t idx, pprz_t value)
 Set a radio control channel value. More...
 
static pprz_t radio_control_get (uint8_t idx)
 Get a radio control channel value. More...
 
void radio_control_init (void)
 
void radio_control_periodic_task (void)
 

Variables

struct RadioControl radio_control
 

Detailed Description

Generic interface for radio control modules

Definition in file radio_control.h.


Data Structure Documentation

◆ RadioControl

struct RadioControl

Definition at line 60 of file radio_control.h.

Data Fields
uint8_t frame_cpt
uint8_t frame_rate
uint8_t nb_channel
uint8_t radio_ok_cpt
uint8_t status
uint8_t time_since_last_frame
pprz_t values[RADIO_CONTROL_NB_CHANNEL]

Macro Definition Documentation

◆ RADIO_CONTROL_NB_CHANNEL

#define RADIO_CONTROL_NB_CHANNEL   32

Definition at line 56 of file radio_control.h.

◆ RadioControlIsLost

#define RadioControlIsLost ( )    (radio_control.status == RC_REALLY_LOST)

Definition at line 76 of file radio_control.h.

◆ RadioControlValues

#define RadioControlValues (   _chan)    radio_control.values[_chan]

Definition at line 73 of file radio_control.h.

◆ RC_AVG_PERIOD

#define RC_AVG_PERIOD   8 /* TODO remove if IIR filter is used */

Definition at line 36 of file radio_control.h.

◆ RC_LOST

#define RC_LOST   1

Definition at line 50 of file radio_control.h.

◆ RC_LOST_TIME

#define RC_LOST_TIME   30 /* 500ms with a 60Hz timer */

Definition at line 39 of file radio_control.h.

◆ RC_OK

#define RC_OK   0

Definition at line 49 of file radio_control.h.

◆ RC_OK_CPT

#define RC_OK_CPT   15

Definition at line 46 of file radio_control.h.

◆ RC_REALLY_LOST

#define RC_REALLY_LOST   2

Definition at line 51 of file radio_control.h.

◆ RC_REALLY_LOST_TIME

#define RC_REALLY_LOST_TIME   60 /* ~1s */

Definition at line 42 of file radio_control.h.

Function Documentation

◆ radio_control_get()

static pprz_t radio_control_get ( uint8_t  idx)
inlinestatic

Get a radio control channel value.

Parameters
idxrc channel index
Returns
current value, 0 if index is invalid

Definition at line 94 of file radio_control.h.

References idx, RadioControl::nb_channel, radio_control, and RadioControl::values.

Referenced by autopilot_failsafe_checks(), autopilot_generated_on_rc_frame(), autopilot_static_on_rc_frame(), dc_shoot_rc_periodic(), periodic_auto1_commands(), periodic_gas_engine_idle_trim(), pprz_mode_update(), and vPoint().

+ Here is the caller graph for this function:

◆ radio_control_init()

◆ radio_control_periodic_task()

◆ radio_control_set()

static void radio_control_set ( uint8_t  idx,
pprz_t  value 
)
inlinestatic

Set a radio control channel value.

Parameters
idxrc channel index
valuenew value

Definition at line 82 of file radio_control.h.

References idx, RadioControl::nb_channel, radio_control, and RadioControl::values.

Variable Documentation

◆ radio_control

struct RadioControl radio_control