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_shared_arch.h File Reference

STM32 PWM and dualPWM servos shared functions. More...

#include "std.h"
#include <BOARD_CONFIG>
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/timer.h>
#include <libopencm3/cm3/nvic.h>
#include "mcu_arch.h"
+ Include dependency graph for actuators_shared_arch.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ONE_MHZ_CLK   1000000
 
#define PWM_BASE_FREQ   ONE_MHZ_CLK
 
#define SERVO_HZ   40
 Default servo update rate in Hz. More...
 
#define TIM1_SERVO_HZ   SERVO_HZ
 
#define TIM2_SERVO_HZ   SERVO_HZ
 
#define TIM3_SERVO_HZ   SERVO_HZ
 
#define TIM4_SERVO_HZ   SERVO_HZ
 
#define TIM5_SERVO_HZ   SERVO_HZ
 
#define TIM8_SERVO_HZ   SERVO_HZ
 
#define TIM9_SERVO_HZ   SERVO_HZ
 
#define TIM12_SERVO_HZ   SERVO_HZ
 

Functions

void actuators_pwm_arch_channel_init (uint32_t timer_peripheral, enum tim_oc_id oc_id)
 Set PWM channel configuration. More...
 
void set_servo_timer (uint32_t timer, uint32_t period, uint8_t channels_mask)
 Set Timer configuration. More...
 

Detailed Description

STM32 PWM and dualPWM servos shared functions.

Definition in file actuators_shared_arch.h.

Macro Definition Documentation

#define ONE_MHZ_CLK   1000000

Definition at line 39 of file actuators_shared_arch.h.

#define PWM_BASE_FREQ   ONE_MHZ_CLK

Definition at line 43 of file actuators_shared_arch.h.

Referenced by set_servo_timer().

#define SERVO_HZ   40

Default servo update rate in Hz.

Definition at line 49 of file actuators_shared_arch.h.

#define TIM12_SERVO_HZ   SERVO_HZ

Definition at line 75 of file actuators_shared_arch.h.

#define TIM1_SERVO_HZ   SERVO_HZ

Definition at line 54 of file actuators_shared_arch.h.

#define TIM2_SERVO_HZ   SERVO_HZ

Definition at line 57 of file actuators_shared_arch.h.

#define TIM3_SERVO_HZ   SERVO_HZ

Definition at line 60 of file actuators_shared_arch.h.

#define TIM4_SERVO_HZ   SERVO_HZ

Definition at line 63 of file actuators_shared_arch.h.

#define TIM5_SERVO_HZ   SERVO_HZ

Definition at line 66 of file actuators_shared_arch.h.

#define TIM8_SERVO_HZ   SERVO_HZ

Definition at line 69 of file actuators_shared_arch.h.

#define TIM9_SERVO_HZ   SERVO_HZ

Definition at line 72 of file actuators_shared_arch.h.

Function Documentation

void actuators_pwm_arch_channel_init ( uint32_t  timer_peripheral,
enum tim_oc_id  oc_id 
)

Set PWM channel configuration.

Definition at line 35 of file actuators_shared_arch.c.

Referenced by set_servo_timer().

+ Here is the caller graph for this function:

void set_servo_timer ( uint32_t  timer,
uint32_t  freq,
uint8_t  channels_mask 
)

Set Timer configuration.

Parameters
[in]timerTimer register address base
[in]freqPWM frequency in Hz (1 / auto-reload period)
[in]channels_maskoutput compare channels to enable

Definition at line 59 of file actuators_shared_arch.c.

References actuators_pwm_arch_channel_init(), PWM_BASE_FREQ, and timer_get_frequency().

Referenced by actuators_dualpwm_arch_init(), and actuators_pwm_arch_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: