Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
ppm.h File Reference
#include "std.h"
#include "generated/airframe.h"
#include "modules/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 PPM_PULSE_TYPE_POSITIVE   0
 Generated code holding the description of a given transmitter. More...
 
#define PPM_PULSE_TYPE_NEGATIVE   1
 

Functions

void ppm_arch_init (void)
 Architecture dependant code. More...
 
void ppm_init (void)
 RC init function. More...
 
void ppm_event (void)
 RC event function. More...
 
void ppm_decode_frame (uint32_t ppm_time)
 Decode a PPM frame from global timer value. More...
 
void ppm_decode_frame_width (uint32_t ppm_width)
 Decode a PPM frame from last width. More...
 

Variables

uint16_t ppm_pulses [RADIO_CTL_NB]
 
volatile bool ppm_frame_available
 

Macro Definition Documentation

◆ PPM_PULSE_TYPE_NEGATIVE

#define PPM_PULSE_TYPE_NEGATIVE   1

Definition at line 47 of file ppm.h.

◆ PPM_PULSE_TYPE_POSITIVE

#define PPM_PULSE_TYPE_POSITIVE   0

Generated code holding the description of a given transmitter.

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

Definition at line 46 of file ppm.h.

Function Documentation

◆ ppm_arch_init()

void ppm_arch_init ( void  )

Architecture dependant code.

Definition at line 90 of file ppm_arch.c.

References FALSE, gpio_setup_pin_af(), ONE_MHZ_CLK, PPM_CC_IE, PPM_CHANNEL, ppm_cur_pulse, PPM_GPIO_AF, PPM_GPIO_PIN, PPM_GPIO_PORT, ppm_icucfg, PPM_IRQ, PPM_IRQ2, PPM_IRQ_PRIO, ppm_last_pulse_time, PPM_TIMER, PPM_TIMER_INPUT, RADIO_CONTROL_NB_CHANNEL, RC_PPM_TICKS_PER_USEC, timer_get_frequency(), and timer_rollover_cnt.

Referenced by ppm_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ppm_decode_frame()

void ppm_decode_frame ( uint32_t  ppm_time)

Decode a PPM frame from global timer value.

A valid ppm frame:

  • synchro blank
  • correct number of channels
  • synchro blank

Definition at line 105 of file ppm.c.

References ppm_decode_frame_width(), and ppm_last_pulse_time.

+ Here is the call graph for this function:

◆ ppm_decode_frame_width()

void ppm_decode_frame_width ( uint32_t  ppm_width)

Decode a PPM frame from last width.

A valid ppm frame:

  • synchro blank
  • correct number of channels
  • synchro blank

Definition at line 120 of file ppm.c.

References ppm_cur_pulse, ppm_data_valid, ppm_frame_available, ppm_pulses, RC_PPM_TICKS_OF_USEC, and RssiValid.

Referenced by icuperiodcb(), and ppm_decode_frame().

+ Here is the caller graph for this function:

◆ ppm_event()

void ppm_event ( void  )

RC event function.

PPM frames are normalized using the IIR filter.

Definition at line 86 of file ppm.c.

References RadioControl::frame_cpt, ppm_frame_available, ppm_pulses, radio_control, RADIO_CONTROL_PPM_ID, RadioControl::radio_ok_cpt, RC_OK, RadioControl::status, and RadioControl::time_since_last_frame.

◆ ppm_init()

void ppm_init ( void  )

RC init function.

Definition at line 71 of file ppm.c.

References DefaultPeriodic, RadioControl::nb_channel, ppm_arch_init(), ppm_cur_pulse, ppm_data_valid, ppm_frame_available, ppm_last_pulse_time, radio_control, register_periodic_telemetry(), and send_ppm().

+ Here is the call graph for this function:

Variable Documentation

◆ ppm_frame_available

volatile bool ppm_frame_available
extern

Definition at line 37 of file ppm.c.

Referenced by ppm_decode_frame_width(), ppm_event(), ppm_init(), and radio_control_feed().

◆ ppm_pulses

uint16_t ppm_pulses[RADIO_CTL_NB]
extern

Definition at line 36 of file ppm.c.

Referenced by ppm_decode_frame_width(), ppm_event(), radio_control_feed(), and send_ppm().