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
servos_ppm_hw.h File Reference

Efficient driving of MAT0.1 (SERVO_CLOCK_PIN) using TIMER0 to produce PPM for a R/C receiver which has a microcontroller to drive the servos (not a 4015 or 4017 decade counter chip). More...

#include "std.h"
#include "LPC21xx.h"
#include "mcu_periph/sys_time.h"
#include <BOARD_CONFIG>
+ Include dependency graph for servos_ppm_hw.h:

Go to the source code of this file.

Macros

#define SERVOS_TICS_OF_USEC(s)   cpu_ticks_of_usec(s)
 
#define ChopServo(x, a, b)   Chop(x, a, b)
 
#define _PPM_NB_CHANNELS   8
 
#define ActuatorPpmSet(_i, _v)   { servos_values[_i] = SERVOS_TICS_OF_USEC(_v); }
 
#define ActuatorsPpmCommit()   {}
 
#define ActuatorsPpmInit()   actuators_ppm_init()
 
#define SERVO_REFRESH_TICS   SERVOS_TICS_OF_USEC(22000)
 
#define PPM_WIDTH   SERVOS_TICS_OF_USEC(550)
 
#define ACTUATORS_IT   TIR_MR1I
 
#define ServosPPMMat_ISR()
 

Functions

void actuators_ppm_init (void)
 

Variables

uint16_t servos_values [_PPM_NB_CHANNELS]
 
uint8_t servos_PPM_idx
 
uint32_t servos_delay
 
uint8_t ppm_pulse
 

Detailed Description

Efficient driving of MAT0.1 (SERVO_CLOCK_PIN) using TIMER0 to produce PPM for a R/C receiver which has a microcontroller to drive the servos (not a 4015 or 4017 decade counter chip).

Definition in file servos_ppm_hw.h.

Macro Definition Documentation

#define _PPM_NB_CHANNELS   8

Definition at line 43 of file servos_ppm_hw.h.

Referenced by actuators_ppm_init().

#define ActuatorPpmSet (   _i,
  _v 
)    { servos_values[_i] = SERVOS_TICS_OF_USEC(_v); }

Definition at line 45 of file servos_ppm_hw.h.

#define ACTUATORS_IT   TIR_MR1I

Definition at line 59 of file servos_ppm_hw.h.

#define ActuatorsPpmCommit ( )    {}

Definition at line 48 of file servos_ppm_hw.h.

#define ActuatorsPpmInit ( )    actuators_ppm_init()

Definition at line 49 of file servos_ppm_hw.h.

#define ChopServo (   x,
  a,
 
)    Chop(x, a, b)

Definition at line 41 of file servos_ppm_hw.h.

#define PPM_WIDTH   SERVOS_TICS_OF_USEC(550)

Definition at line 57 of file servos_ppm_hw.h.

#define SERVO_REFRESH_TICS   SERVOS_TICS_OF_USEC(22000)

Definition at line 55 of file servos_ppm_hw.h.

#define SERVOS_TICS_OF_USEC (   s)    cpu_ticks_of_usec(s)

Definition at line 40 of file servos_ppm_hw.h.

#define ServosPPMMat_ISR ( )
Value:
{ \
} \
} else { \
} \
} else { /* servos_PPM_idx=_PPM_NB_CHANNELS */ \
} else { \
} \
} \
if (!ppm_pulse) { \
/* lower clock pin */ \
} \
/* toggle ppm_pulse flag */ \
ppm_pulse ^= 1; \
}
uint32_t servos_delay
#define PPM_WIDTH
Definition: servos_ppm_hw.h:57
uint8_t servos_PPM_idx
Definition: servos_ppm_hw.c:35
uint16_t servos_values[_PPM_NB_CHANNELS]
#define T0EMR
Definition: LPC21xx.h:65
#define T0MR1
Definition: LPC21xx.h:57
#define SERVO_REFRESH_TICS
Definition: servos_ppm_hw.h:55
#define TEMR_EM1
Definition: lpcTMR.h:150
#define _PPM_NB_CHANNELS
Definition: servos_ppm_hw.h:43
uint8_t ppm_pulse
Definition: servos_ppm_hw.c:36
if(PrimarySpektrumState.SpektrumTimer)

Definition at line 60 of file servos_ppm_hw.h.

Referenced by TIMER0_ISR().

Function Documentation

Variable Documentation

uint8_t ppm_pulse

Definition at line 36 of file servos_ppm_hw.c.

uint32_t servos_delay

Definition at line 33 of file servos_4015_MAT_hw.c.

Referenced by actuators_4015_init(), and actuators_ppm_init().

uint8_t servos_PPM_idx

Definition at line 35 of file servos_ppm_hw.c.

Referenced by actuators_ppm_init().