Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
actuators_pwm_arch.c File Reference

Interface from actuators to ChibiOS PWM driver. More...

#include "subsystems/actuators/actuators_pwm_arch.h"
#include "subsystems/actuators/actuators_pwm.h"
#include "mcu_periph/gpio.h"
+ Include dependency graph for actuators_pwm_arch.c:

Go to the source code of this file.

Macros

#define PWM_CMD_TO_US(_t)   (1000000 * _t / PWM_FREQUENCY)
 CMD_TO_US() is depending on architecture (e.g STM32 vs LPC), and on the hardware settings (clock speed etc.). More...
 

Functions

static void pwmpcb (PWMDriver *pwmp)
 PWM callback function. More...
 
void actuators_pwm_arch_init (void)
 Arch dependent init file. More...
 
void actuators_pwm_commit (void)
 

Variables

int32_t actuators_pwm_values [ACTUATORS_PWM_NB]
 

Detailed Description

Interface from actuators to ChibiOS PWM driver.

PWM configuration files are defined in the board file, so maximal architecture independence is ensured.

Definition in file actuators_pwm_arch.c.

Macro Definition Documentation

#define PWM_CMD_TO_US (   _t)    (1000000 * _t / PWM_FREQUENCY)

CMD_TO_US() is depending on architecture (e.g STM32 vs LPC), and on the hardware settings (clock speed etc.).

Hence it has to be defined separately for each board.

It converts the actuator command from paparazzi. which is in pulse width in milliseconds to microseconds (required by pwmEnableChannel())

Definition at line 47 of file actuators_pwm_arch.c.

Referenced by actuators_pwm_commit().

Function Documentation

void actuators_pwm_arch_init ( void  )

Arch dependent init file.

implemented in arch files

Definition at line 86 of file actuators_pwm_arch.c.

void actuators_pwm_commit ( void  )

Definition at line 155 of file actuators_pwm_arch.c.

static void pwmpcb ( PWMDriver *  pwmp)
static

PWM callback function.

Called after each period. All PWM configurations (from board.h) should reference to this callback. Empty for now, can be used later for fail safe monitoring (i.e. reset counter or something).

Parameters
[in]pwmppointer to a PWMDriver object

Definition at line 61 of file actuators_pwm_arch.c.

Variable Documentation

int32_t actuators_pwm_values[ACTUATORS_PWM_NB]

Definition at line 50 of file actuators_pwm_arch.c.

Referenced by actuators_ardrone_commit(), and actuators_pwm_commit().