Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
actuators_dualpwm_arch.c File Reference

STM32 dual PWM servos handling. More...

#include "subsystems/actuators/actuators_shared_arch.h"
#include "subsystems/actuators/actuators_dualpwm_arch.h"
#include "subsystems/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"
+ Include dependency graph for actuators_dualpwm_arch.c:

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]
 

Detailed Description

STM32 dual PWM servos handling.

Definition in file actuators_dualpwm_arch.c.

Function Documentation

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.

+ Here is the call graph for this function:

void actuators_dualpwm_commit ( void  )

Set pulse widths from actuator values, assumed to be in us.

Definition at line 172 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 117 of file actuators_dualpwm_arch.c.

Referenced by dual_pwm_isr().

+ Here is the caller graph for this function:

void dual_pwm_isr ( void  )

Definition at line 147 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().

+ Here is the call graph for this function:

void set_dual_pwm_timer_s_oc ( uint32_t  oc_value,
uint32_t  oc_value2 
)

Definition at line 135 of file actuators_dualpwm_arch.c.

Referenced by dual_pwm_isr().

+ Here is the caller graph for this function:

void set_dual_pwm_timer_s_period ( uint32_t  period)

Definition at line 126 of file actuators_dualpwm_arch.c.

Referenced by dual_pwm_isr().

+ Here is the caller graph for this function:

Variable Documentation

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().