Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
STM32 dual PWM servos handling. More...
#include "modules/actuators/actuators_shared_arch.h"
#include "modules/actuators/actuators_dualpwm_arch.h"
#include "modules/actuators/actuators_dualpwm.h"
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/timer.h>
#include <libopencm3/cm3/nvic.h>
#include "mcu_periph/gpio_arch.h"
Go to the source code of this file.
Functions | |
void | actuators_dualpwm_arch_init (void) |
PWM arch init called by generic pwm driver. More... | |
void | clear_timer_flag (void) |
Interuption called at the end of the timer. More... | |
void | set_dual_pwm_timer_s_period (uint32_t period) |
void | set_dual_pwm_timer_s_oc (uint32_t oc_value, uint32_t oc_value2) |
void | dual_pwm_isr (void) |
void | actuators_dualpwm_commit (void) |
Set pulse widths from actuator values, assumed to be in us. More... | |
Variables | |
uint32_t | ratio_4ms |
uint32_t | ratio_16ms |
uint32_t | actuators_dualpwm_values [ACTUATORS_DUALPWM_NB] |
STM32 dual PWM servos handling.
Definition in file actuators_dualpwm_arch.c.
void actuators_dualpwm_arch_init | ( | void | ) |
PWM arch init called by generic pwm driver.
Arch dependent init file.
Definition at line 46 of file actuators_dualpwm_arch.c.
References gpio_setup_pin_af(), ONE_MHZ_CLK, PWM_TIM5_CHAN_MASK, ratio_16ms, ratio_4ms, set_servo_timer(), TIM5_SERVO_HZ, and TRUE.
void actuators_dualpwm_commit | ( | void | ) |
Set pulse widths from actuator values, assumed to be in us.
Definition at line 173 of file actuators_dualpwm_arch.c.
void clear_timer_flag | ( | void | ) |
Interuption called at the end of the timer.
In our case alternatively very 4ms and 16ms (twice every 20ms) Fonction that clears the flag of interuption in order to reactivate the interuption
Definition at line 118 of file actuators_dualpwm_arch.c.
Referenced by dual_pwm_isr().
void dual_pwm_isr | ( | void | ) |
Definition at line 148 of file actuators_dualpwm_arch.c.
References actuators_dualpwm_values, clear_timer_flag(), ratio_16ms, ratio_4ms, set_dual_pwm_timer_s_oc(), and set_dual_pwm_timer_s_period().
Definition at line 136 of file actuators_dualpwm_arch.c.
Referenced by dual_pwm_isr().
void set_dual_pwm_timer_s_period | ( | uint32_t | period | ) |
Definition at line 127 of file actuators_dualpwm_arch.c.
Referenced by dual_pwm_isr().
uint32_t actuators_dualpwm_values[ACTUATORS_DUALPWM_NB] |
Definition at line 42 of file actuators_dualpwm_arch.c.
Referenced by dual_pwm_isr().
uint32_t ratio_16ms |
Definition at line 39 of file actuators_dualpwm_arch.c.
Referenced by actuators_dualpwm_arch_init(), and dual_pwm_isr().
uint32_t ratio_4ms |
Definition at line 39 of file actuators_dualpwm_arch.c.
Referenced by actuators_dualpwm_arch_init(), and dual_pwm_isr().