Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
actuators_dualpwm_arch.h File Reference

STM32 PWM servos handling. More...

#include "std.h"
#include <BOARD_CONFIG>
+ Include dependency graph for actuators_dualpwm_arch.h:

Go to the source code of this file.

Macros

#define ACTUATORS_DUALPWM_NB   4
 
#define SERVOS_TICS_OF_USEC(_v)   (_v)
 
#define ActuatorDualpwmSet(_i, _v)   { actuators_dualpwm_values[_i] = _v; }
 
#define ActuatorsDualpwmCommit   actuators_dualpwm_commit
 

Functions

void actuators_dualpwm_commit (void)
 Set pulse widths from actuator values, assumed to be in us. More...
 
void dual_pwm_isr (void)
 
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)
 

Variables

uint32_t actuators_dualpwm_values [ACTUATORS_DUALPWM_NB]
 

Detailed Description

STM32 PWM servos handling.

Definition in file actuators_dualpwm_arch.h.

Macro Definition Documentation

◆ ActuatorDualpwmSet

#define ActuatorDualpwmSet (   _i,
  _v 
)    { actuators_dualpwm_values[_i] = _v; }

Definition at line 53 of file actuators_dualpwm_arch.h.

◆ ACTUATORS_DUALPWM_NB

#define ACTUATORS_DUALPWM_NB   4

Definition at line 35 of file actuators_dualpwm_arch.h.

◆ ActuatorsDualpwmCommit

#define ActuatorsDualpwmCommit   actuators_dualpwm_commit

Definition at line 54 of file actuators_dualpwm_arch.h.

◆ SERVOS_TICS_OF_USEC

#define SERVOS_TICS_OF_USEC (   _v)    (_v)

Definition at line 51 of file actuators_dualpwm_arch.h.

Function Documentation

◆ actuators_dualpwm_commit()

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.

◆ clear_timer_flag()

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

+ Here is the caller graph for this function:

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

+ Here is the call graph for this function:

◆ set_dual_pwm_timer_s_oc()

void set_dual_pwm_timer_s_oc ( uint32_t  oc_value,
uint32_t  oc_value2 
)

Definition at line 136 of file actuators_dualpwm_arch.c.

Referenced by dual_pwm_isr().

+ Here is the caller graph for this function:

◆ set_dual_pwm_timer_s_period()

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

+ Here is the caller graph for this function:

Variable Documentation

◆ actuators_dualpwm_values

uint32_t actuators_dualpwm_values[ACTUATORS_DUALPWM_NB]
extern

Definition at line 42 of file actuators_dualpwm_arch.c.

Referenced by dual_pwm_isr().