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.h File Reference
#include "std.h"
#include "generated/airframe.h"
#include "subsystems/radio_control/ppm_arch.h"
#include "generated/radio.h"
+ Include dependency graph for ppm.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RADIO_CONTROL_NB_CHANNEL   RADIO_CTL_NB
 Generated code holding the description of a given transmitter. More...
 
#define PPM_PULSE_TYPE_POSITIVE   0
 ppm pulse type : futaba is falling edge clocked whereas JR is rising edge More...
 
#define PPM_PULSE_TYPE_NEGATIVE   1
 
#define RadioControlEvent(_received_frame_handler)   radio_control_impl_event(_received_frame_handler)
 

Functions

void ppm_arch_init (void)
 Architecture dependant code. More...
 
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
 

Macro Definition Documentation

#define PPM_PULSE_TYPE_NEGATIVE   1

Definition at line 58 of file ppm.h.

#define PPM_PULSE_TYPE_POSITIVE   0

ppm pulse type : futaba is falling edge clocked whereas JR is rising edge

Definition at line 57 of file ppm.h.

#define RADIO_CONTROL_NB_CHANNEL   RADIO_CTL_NB

Generated code holding the description of a given transmitter.

Default number of channels to actually use.

Definition at line 47 of file ppm.h.

#define RadioControlEvent (   _received_frame_handler)    radio_control_impl_event(_received_frame_handler)

Definition at line 69 of file ppm.h.

Function Documentation

void ppm_arch_init ( void  )

Architecture dependant code.

Definition at line 32 of file ppm_arch.c.

References FALSE, gpio_setup_pin_af(), ONE_MHZ_CLK, PPM_CC_IE, PPM_CCR_CRF, PPM_CCR_CRI, PPM_CCR_CRR, PPM_CHANNEL, PPM_GPIO_AF, PPM_GPIO_PIN, PPM_GPIO_PORT, PPM_IRQ, PPM_IRQ2, PPM_IRQ_PRIO, PPM_PINSEL, PPM_PINSEL_BIT, PPM_PINSEL_VAL, PPM_TIMER_INPUT, RC_PPM_TICKS_PER_USEC, T0CCR, timer_get_frequency(), and timer_rollover_cnt.

Referenced by radio_control_impl_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

Variable Documentation

volatile bool_t ppm_frame_available
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().