Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
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"
Go to the source code of this file.
Macros | |
#define | PWM_CMD_TO_US(_t) (PWM_FREQUENCY * _t / 1000000) |
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] |
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.
#define PWM_CMD_TO_US | ( | _t | ) | (PWM_FREQUENCY * _t / 1000000) |
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().
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().
void actuators_pwm_commit | ( | void | ) |
Definition at line 170 of file actuators_pwm_arch.c.
Referenced by actuators_xvert_commit().
|
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).
[in] | pwmp | pointer to a PWMDriver object |
Definition at line 61 of file actuators_pwm_arch.c.
int32_t actuators_pwm_values[ACTUATORS_PWM_NB] |
Definition at line 50 of file actuators_pwm_arch.c.
Referenced by actuators_ardrone_commit(), actuators_pwm_commit(), and actuators_xvert_commit().