Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
radio_control.h File Reference

Generic interface for radio control modules. More...

#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)
#define RadioControlIsLost()

Functions

static void radio_control_set (uint8_t idx, pprz_t value)
 Set a radio control channel value.
static pprz_t radio_control_get (uint8_t idx)
 Get a radio control channel value.
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 ( )
Value:
struct RadioControl radio_control
#define RC_REALLY_LOST

Definition at line 76 of file radio_control.h.

Referenced by autopilot_failsafe_checks().

◆ RadioControlValues

#define RadioControlValues ( _chan)
Value:
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.

Referenced by radio_control_periodic_task().

◆ RC_LOST_TIME

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

Definition at line 39 of file radio_control.h.

Referenced by radio_control_periodic_task().

◆ RC_OK

◆ RC_OK_CPT

#define RC_OK_CPT   15

Definition at line 46 of file radio_control.h.

Referenced by radio_control_periodic_task().

◆ RC_REALLY_LOST

◆ RC_REALLY_LOST_TIME

#define RC_REALLY_LOST_TIME   60 /* ~1s */

Definition at line 42 of file radio_control.h.

Referenced by radio_control_init(), and radio_control_periodic_task().

Function Documentation

◆ radio_control_get()

◆ radio_control_init()

void radio_control_init ( void )
extern

Definition at line 44 of file radio_control.c.

References DefaultPeriodic, radio_control, RADIO_CONTROL_NB_CHANNEL, RC_REALLY_LOST, RC_REALLY_LOST_TIME, register_periodic_telemetry(), and send_rc().

Here is the call graph for this function:

◆ radio_control_periodic_task()

void radio_control_periodic_task ( void )
extern

◆ radio_control_set()

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, and radio_control.

Variable Documentation

◆ radio_control