Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ppm.c File Reference

Architecture independent functions for PPM radio control. More...

+ Include dependency graph for ppm.c:

Go to the source code of this file.

Macros

#define RssiValid()   TRUE
 RssiValid test macro. More...
 

Functions

void radio_control_impl_init (void)
 
void radio_control_impl_event (void(*_received_frame_handler)(void))
 RC event function with handler callback. More...
 
void ppm_decode_frame (uint32_t ppm_time)
 Decode a PPM frame. More...
 

Variables

uint16_t ppm_pulses [RADIO_CTL_NB]
 
volatile bool_t ppm_frame_available
 
static uint8_t ppm_cur_pulse
 
static uint32_t ppm_last_pulse_time
 
static bool_t ppm_data_valid
 

Detailed Description

Architecture independent functions for PPM radio control.

Definition in file ppm.c.

Macro Definition Documentation

#define RssiValid ( )    TRUE

RssiValid test macro.

This macro has to be defined to test the validity of ppm frame from an other source (ex: GPIO). By default, always true.

Definition at line 48 of file ppm.c.

Referenced by ppm_decode_frame().

Function Documentation

void ppm_decode_frame ( uint32_t  ppm_time)

Decode a PPM frame.

A valid ppm frame:

  • synchro blank
  • correct number of channels
  • synchro blank

Definition at line 103 of file ppm.c.

References FALSE, ppm_cur_pulse, ppm_data_valid, ppm_frame_available, ppm_last_pulse_time, ppm_pulses, RC_PPM_TICKS_OF_USEC, RssiValid, and TRUE.

void radio_control_impl_event ( void(*)(void)  _received_frame_handler)

RC event function with handler callback.

PPM frames are normalized using the IIR filter.

Definition at line 80 of file ppm.c.

void radio_control_impl_init ( void  )

Definition at line 66 of file ppm.c.

References DefaultPeriodic, FALSE, ppm_arch_init(), ppm_cur_pulse, ppm_data_valid, ppm_frame_available, ppm_last_pulse_time, register_periodic_telemetry(), and send_ppm().

+ Here is the call graph for this function:

Variable Documentation

uint8_t ppm_cur_pulse
static

Definition at line 37 of file ppm.c.

Referenced by ppm_decode_frame(), and radio_control_impl_init().

bool_t ppm_data_valid
static

Definition at line 39 of file ppm.c.

Referenced by ppm_decode_frame(), and radio_control_impl_init().

volatile bool_t ppm_frame_available
uint32_t ppm_last_pulse_time
static

Definition at line 38 of file ppm.c.

Referenced by ppm_decode_frame(), and radio_control_impl_init().

uint16_t ppm_pulses[RADIO_CTL_NB]

Definition at line 31 of file ppm.c.

Referenced by ppm_decode_frame(), radio_control_impl_event(), and update_rc_channel().