Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
actuators_pwm_arch.c File Reference
#include "modules/actuators/actuators_pwm_arch.h"
#include "modules/actuators/actuators_pwm.h"
#include "mcu_periph/gpio.h"
+ Include dependency graph for actuators_pwm_arch.c:

Go to the source code of this file.


#define PWM_FREQUENCY   1000000
#define SERVO_HZ   40
#define PWM_CMD_TO_US(_t)   (PWM_FREQUENCY * _t / 1000000)
 Print the configuration variables from the header. More...


static void pwmpcb (PWMDriver *pwmp)
 PWM callback function. More...
void actuators_pwm_arch_init (void)
 Arch dependent init file. More...
void actuators_pwm_commit (void)


int32_t actuators_pwm_values [ACTUATORS_PWM_NB]

Detailed Description

Interface from actuators to ChibiOS PWM driver

PWM configuration files are defined in the board file, so maximal architecture independence is ensured.

Definition in file actuators_pwm_arch.c.

Macro Definition Documentation


#define PWM_CMD_TO_US (   _t)    (PWM_FREQUENCY * _t / 1000000)

Print the configuration variables from the header.

CMD_TO_US() is depending on architecture and on the hardware settings (clock speed etc.). Hence it has to be defined separately for each board.

It converts the actuator command from paparazzi. which is in pulse width in milliseconds to microseconds (required by pwmEnableChannel())

Definition at line 89 of file actuators_pwm_arch.c.


#define PWM_FREQUENCY   1000000

Definition at line 39 of file actuators_pwm_arch.c.


#define SERVO_HZ   40

Definition at line 44 of file actuators_pwm_arch.c.



Definition at line 70 of file actuators_pwm_arch.c.



Definition at line 49 of file actuators_pwm_arch.c.



Definition at line 52 of file actuators_pwm_arch.c.



Definition at line 55 of file actuators_pwm_arch.c.



Definition at line 58 of file actuators_pwm_arch.c.



Definition at line 61 of file actuators_pwm_arch.c.



Definition at line 64 of file actuators_pwm_arch.c.



Definition at line 67 of file actuators_pwm_arch.c.

Function Documentation

◆ actuators_pwm_arch_init()

void actuators_pwm_arch_init ( void  )

Arch dependent init file.

implemented in arch files

Definition at line 267 of file actuators_pwm_arch.c.

◆ actuators_pwm_commit()

void actuators_pwm_commit ( void  )

Definition at line 377 of file actuators_pwm_arch.c.

◆ pwmpcb()

static void pwmpcb ( PWMDriver *  pwmp)

PWM callback function.

Called after each period. All PWM configurations (from board.h) should reference to this callback. Empty for now, can be used later for fail safe monitoring (i.e. reset counter or something).

[in]pwmppointer to a PWMDriver object

Definition at line 103 of file actuators_pwm_arch.c.

Variable Documentation

◆ actuators_pwm_values

int32_t actuators_pwm_values[ACTUATORS_PWM_NB]

Definition at line 92 of file actuators_pwm_arch.c.

Referenced by actuators_ardrone_commit(), and actuators_pwm_commit().