29 #include "modules/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"
50 rcc_periph_clock_enable(RCC_TIM1);
53 rcc_periph_clock_enable(RCC_TIM2);
56 rcc_periph_clock_enable(RCC_TIM3);
59 rcc_periph_clock_enable(RCC_TIM4);
62 rcc_periph_clock_enable(RCC_TIM5);
65 rcc_periph_clock_enable(RCC_TIM8);
68 rcc_periph_clock_enable(RCC_TIM9);
71 rcc_periph_clock_enable(RCC_TIM12);
115 rcc_periph_reset_pulse(RST_TIM1);
120 rcc_periph_reset_pulse(RST_TIM2);
125 rcc_periph_reset_pulse(RST_TIM3);
130 rcc_periph_reset_pulse(RST_TIM4);
135 rcc_periph_reset_pulse(RST_TIM5);
140 rcc_periph_reset_pulse(RST_TIM8);
145 rcc_periph_reset_pulse(RST_TIM9);
150 rcc_periph_reset_pulse(RST_TIM12);
void set_servo_timer(uint32_t timer, uint32_t freq, uint8_t channels_mask)
Set Timer configuration.
STM32 PWM and dualPWM servos shared functions.
#define PWM_SERVO_4_TIMER
#define PWM_SERVO_0_TIMER
#define PWM_SERVO_3_TIMER
#define PWM_SERVO_2_TIMER
#define PWM_TIM3_CHAN_MASK
#define PWM_SERVO_5_TIMER
#define PWM_TIM2_CHAN_MASK
#define PWM_SERVO_1_TIMER
#define PWM_TIM1_CHAN_MASK
#define PWM_TIM4_CHAN_MASK
void gpio_setup_pin_af(ioportid_t port, uint16_t pin, uint8_t af, bool is_output)
Setup a gpio for input or output with alternate function.
int32_t actuators_pwm_values[ACTUATORS_PWM_NB]
void actuators_pwm_arch_init(void)
Arch dependent init file.
void actuators_pwm_commit(void)
#define PWM_TIM5_CHAN_MASK
#define PWM_SERVO_6_TIMER
#define PWM_SERVO_7_TIMER
#define PWM_SERVO_9_TIMER
#define PWM_SERVO_8_TIMER
#define PWM_SERVO_10_GPIO
#define PWM_TIM12_CHAN_MASK
#define PWM_TIM8_CHAN_MASK
#define PWM_SERVO_10_TIMER
#define PWM_TIM9_CHAN_MASK
int int32_t
Typedef defining 32 bit int type.