Paparazzi UAS  v5.15_devel-81-gd13dafb
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.

Referenced by actuators_xvert_init().

+ Here is the caller graph for this function:

void actuators_pwm_commit ( void  )

Definition at line 155 of file actuators_pwm_arch.c.

Referenced by actuators_xvert_commit().

+ Here is the caller graph for this function:

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]