29 #include "subsystems/actuators/actuators_pwm_arch.h"
32 #include <libopencm3/stm32/gpio.h>
33 #include <libopencm3/stm32/rcc.h>
34 #include <libopencm3/stm32/timer.h>
36 #include "mcu_periph/gpio_arch.h"
51 rcc_periph_clock_enable(RCC_TIM1);
54 rcc_periph_clock_enable(RCC_TIM2);
57 rcc_periph_clock_enable(RCC_TIM3);
60 rcc_periph_clock_enable(RCC_TIM4);
63 rcc_periph_clock_enable(RCC_TIM5);
66 rcc_periph_clock_enable(RCC_TIM8);
69 rcc_periph_clock_enable(RCC_TIM9);
72 rcc_periph_clock_enable(RCC_TIM12);
void set_servo_timer(uint32_t timer, uint32_t freq, uint8_t channels_mask)
Set Timer configuration.
#define PWM_SERVO_8_TIMER
#define PWM_TIM9_CHAN_MASK
#define PWM_SERVO_4_TIMER
void actuators_pwm_commit(void)
Set pulse widths from actuator values, assumed to be in us.
#define PWM_SERVO_0_TIMER
#define PWM_SERVO_2_TIMER
#define PWM_SERVO_7_TIMER
#define PWM_SERVO_1_TIMER
#define PWM_SERVO_5_TIMER
int32_t actuators_pwm_values[ACTUATORS_PWM_NB]
#define PWM_TIM4_CHAN_MASK
#define PWM_TIM5_CHAN_MASK
#define PWM_TIM1_CHAN_MASK
#define PWM_TIM2_CHAN_MASK
#define PWM_TIM12_CHAN_MASK
STM32 PWM and dualPWM servos shared functions.
void gpio_setup_pin_af(uint32_t port, uint16_t pin, uint8_t af, bool_t is_output)
Setup a gpio for input or output with alternate function.
#define PWM_SERVO_6_TIMER
#define PWM_TIM8_CHAN_MASK
#define PWM_SERVO_9_TIMER
void actuators_pwm_arch_init(void)
Arch dependent init file.
#define PWM_TIM3_CHAN_MASK
#define PWM_SERVO_3_TIMER