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


#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 RadioControlValues(_chan)   radio_control.values[_chan]
#define RadioControlIsLost()   (radio_control.status == RC_REALLY_LOST)


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)


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

Macro Definition Documentation



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.


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

Definition at line 36 of file radio_control.h.


#define RC_LOST   1

Definition at line 50 of file radio_control.h.


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

Definition at line 39 of file radio_control.h.


#define RC_OK   0

Definition at line 49 of file radio_control.h.


#define RC_OK_CPT   15

Definition at line 46 of file radio_control.h.


#define RC_REALLY_LOST   2

Definition at line 51 of file radio_control.h.


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

Get a radio control channel value.

idxrc channel index
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 

Set a radio control channel value.

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

Definition at line 1 of file radio_control.c.

Referenced by ap_mode_of_3way_switch(), autopilot_failsafe_checks(), autopilot_generated_on_rc_frame(), autopilot_static_on_rc_frame(), autopilot_static_SetModeHandler(), ctrl_eff_scheduling_periodic(), fbw_safety_check(), get_rc_pitch(), get_rc_pitch_f(), get_rc_roll(), get_rc_roll_f(), get_rc_yaw(), get_rc_yaw_f(), glide_wing_lock_event(), guidance_h_module_read_rc(), guidance_h_read_rc(), guidance_v_from_nav(), guidance_v_guided_run(), guidance_v_read_rc(), guidance_v_run(), hott_event(), hott_init(), intermcu_send_status(), main_recovery_periodic(), percent_from_rc(), ppm_event(), ppm_init(), px4_set_gimbal_angle_periodic(), radio_control_cc2500_event(), radio_control_cc2500_init(), radio_control_get(), radio_control_init(), radio_control_periodic_task(), radio_control_set(), rc_cb(), rc_datalink_event(), rc_datalink_init(), rc_intermcu_init(), rc_intermcu_parse_fbw_status(), rc_intermcu_parse_msg(), rc_mode_switch(), read_rc_setpoint_speed_i(), sbus_dual_event(), sbus_dual_init(), sbus_event(), sbus_init(), schdule_control_effectiveness(), send_cc2500_ppm(), send_fbw_status(), send_hott(), send_mode(), send_ppm(), send_rc(), send_rotorcraft_rc(), send_sbus(), send_status(), send_tune_hover(), spektrum_event(), spektrum_init(), stabilization_none_read_rc(), stabilization_rate_read_rc(), stabilization_rate_read_rc_switched_sticks(), superbitrf_rc_event(), superbitrf_rc_init(), sys_id_chirp_activate_handler(), sys_id_chirp_run(), sys_id_doublet_activate_handler(), sys_id_doublet_run(), throttle_curve_run(), and update_rc_channel().