Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Interface from actuators to ChibiOS PWM driver. More...
#include "modules/actuators/actuators_pwm_arch.h"
#include "modules/actuators/actuators_pwm.h"
#include "mcu_periph/gpio.h"
Go to the source code of this file.
Macros | |
#define | PWM_FREQUENCY 1000000 |
#define | SERVO_HZ 40 |
#define | TIM1_SERVO_HZ SERVO_HZ |
#define | TIM2_SERVO_HZ SERVO_HZ |
#define | TIM3_SERVO_HZ SERVO_HZ |
#define | TIM4_SERVO_HZ SERVO_HZ |
#define | TIM5_SERVO_HZ SERVO_HZ |
#define | TIM8_SERVO_HZ SERVO_HZ |
#define | TIM9_SERVO_HZ SERVO_HZ |
#define | TIM12_SERVO_HZ SERVO_HZ |
#define | PWM_CMD_TO_US(_t) (PWM_FREQUENCY * _t / 1000000) |
Print the configuration variables from the header. 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) |
Print the configuration variables from the header.
CMD_TO_US() is depending on architecture 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 89 of file actuators_pwm_arch.c.
#define PWM_FREQUENCY 1000000 |
Definition at line 39 of file actuators_pwm_arch.c.
#define SERVO_HZ 40 |
Definition at line 44 of file actuators_pwm_arch.c.
#define TIM12_SERVO_HZ SERVO_HZ |
Definition at line 70 of file actuators_pwm_arch.c.
#define TIM1_SERVO_HZ SERVO_HZ |
Definition at line 49 of file actuators_pwm_arch.c.
#define TIM2_SERVO_HZ SERVO_HZ |
Definition at line 52 of file actuators_pwm_arch.c.
#define TIM3_SERVO_HZ SERVO_HZ |
Definition at line 55 of file actuators_pwm_arch.c.
#define TIM4_SERVO_HZ SERVO_HZ |
Definition at line 58 of file actuators_pwm_arch.c.
#define TIM5_SERVO_HZ SERVO_HZ |
Definition at line 61 of file actuators_pwm_arch.c.
#define TIM8_SERVO_HZ SERVO_HZ |
Definition at line 64 of file actuators_pwm_arch.c.
#define TIM9_SERVO_HZ SERVO_HZ |
Definition at line 67 of file actuators_pwm_arch.c.
void actuators_pwm_arch_init | ( | void | ) |
Arch dependent init file.
implemented in arch files
Definition at line 267 of file actuators_pwm_arch.c.
References gpio_setup_pin_af(), PWM_SERVO_0_AF, PWM_SERVO_0_CHANNEL, PWM_SERVO_0_CONF, PWM_SERVO_0_GPIO, PWM_SERVO_0_PIN, PWM_SERVO_10_AF, PWM_SERVO_10_CHANNEL, PWM_SERVO_10_CONF, PWM_SERVO_10_GPIO, PWM_SERVO_10_PIN, PWM_SERVO_1_AF, PWM_SERVO_1_CHANNEL, PWM_SERVO_1_CONF, PWM_SERVO_1_GPIO, PWM_SERVO_1_PIN, PWM_SERVO_2_AF, PWM_SERVO_2_CHANNEL, PWM_SERVO_2_CONF, PWM_SERVO_2_GPIO, PWM_SERVO_2_PIN, PWM_SERVO_3_AF, PWM_SERVO_3_CHANNEL, PWM_SERVO_3_CONF, PWM_SERVO_3_GPIO, PWM_SERVO_3_PIN, PWM_SERVO_4_AF, PWM_SERVO_4_CHANNEL, PWM_SERVO_4_CONF, PWM_SERVO_4_GPIO, PWM_SERVO_4_PIN, PWM_SERVO_5_AF, PWM_SERVO_5_CHANNEL, PWM_SERVO_5_CONF, PWM_SERVO_5_GPIO, PWM_SERVO_5_PIN, PWM_SERVO_6_AF, PWM_SERVO_6_CHANNEL, PWM_SERVO_6_CONF, PWM_SERVO_6_GPIO, PWM_SERVO_6_PIN, PWM_SERVO_7_AF, PWM_SERVO_7_CHANNEL, PWM_SERVO_7_CONF, PWM_SERVO_7_GPIO, PWM_SERVO_7_PIN, PWM_SERVO_8_AF, PWM_SERVO_8_CHANNEL, PWM_SERVO_8_CONF, PWM_SERVO_8_GPIO, PWM_SERVO_8_PIN, PWM_SERVO_9_AF, PWM_SERVO_9_CHANNEL, PWM_SERVO_9_CONF, PWM_SERVO_9_GPIO, and PWM_SERVO_9_PIN.
void actuators_pwm_commit | ( | void | ) |
Definition at line 377 of file actuators_pwm_arch.c.
References actuators_pwm_values, PWM_CMD_TO_US, PWM_SERVO_0, PWM_SERVO_0_CHANNEL, PWM_SERVO_0_DRIVER, PWM_SERVO_1, PWM_SERVO_10, PWM_SERVO_10_CHANNEL, PWM_SERVO_10_DRIVER, PWM_SERVO_1_CHANNEL, PWM_SERVO_1_DRIVER, PWM_SERVO_2, PWM_SERVO_2_CHANNEL, PWM_SERVO_2_DRIVER, PWM_SERVO_3, PWM_SERVO_3_CHANNEL, PWM_SERVO_3_DRIVER, PWM_SERVO_4, PWM_SERVO_4_CHANNEL, PWM_SERVO_4_DRIVER, PWM_SERVO_5, PWM_SERVO_5_CHANNEL, PWM_SERVO_5_DRIVER, PWM_SERVO_6, PWM_SERVO_6_CHANNEL, PWM_SERVO_6_DRIVER, PWM_SERVO_7, PWM_SERVO_7_CHANNEL, PWM_SERVO_7_DRIVER, PWM_SERVO_8, PWM_SERVO_8_CHANNEL, PWM_SERVO_8_DRIVER, PWM_SERVO_9, PWM_SERVO_9_CHANNEL, and PWM_SERVO_9_DRIVER.
|
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 103 of file actuators_pwm_arch.c.
int32_t actuators_pwm_values[ACTUATORS_PWM_NB] |
Definition at line 92 of file actuators_pwm_arch.c.
Referenced by actuators_pwm_commit().