Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pwm_input_arch.h File Reference

handling of smt32 PWM input using a timer with capture. More...

#include "std.h"
#include "mcu_periph/pwm_input.h"
+ Include dependency graph for pwm_input_arch.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PWM_INPUT_TICKS_PER_USEC   6
 The pwm counter is set-up to have 1/6 us resolution. More...
 
#define PWM_INPUT_TICKS_OF_USEC(_v)   ((_v)*PWM_INPUT_TICKS_PER_USEC)
 
#define PWM_INPUT_SIGNED_TICKS_OF_USEC(_v)   (int32_t)((_v)*PWM_INPUT_TICKS_PER_USEC)
 
#define USEC_OF_PWM_INPUT_TICKS(_v)   ((_v)/PWM_INPUT_TICKS_PER_USEC)
 

Enumerations

enum  pwm_input_channels {
  PWM_INPUT1, PWM_INPUT2, PWM_INPUT_NB, PWM_INPUT1,
  PWM_INPUT2, PWM_INPUT_NB
}
 

Detailed Description

handling of smt32 PWM input using a timer with capture.

Definition in file pwm_input_arch.h.

Macro Definition Documentation

#define PWM_INPUT_SIGNED_TICKS_OF_USEC (   _v)    (int32_t)((_v)*PWM_INPUT_TICKS_PER_USEC)

Definition at line 55 of file pwm_input_arch.h.

#define PWM_INPUT_TICKS_OF_USEC (   _v)    ((_v)*PWM_INPUT_TICKS_PER_USEC)

Definition at line 54 of file pwm_input_arch.h.

#define PWM_INPUT_TICKS_PER_USEC   6

The pwm counter is set-up to have 1/6 us resolution.

The timer clock frequency (before prescaling): STM32F1: TIM1 -> APB2 = HCLK = 72MHz TIM2 -> 2 * APB1 = 2 * 36MHz = 72MHz STM32F4: TIM1 -> 2 * APB2 = 2 * 84MHz = 168MHz TIM2 -> 2 * APB1 = 2 * 42MHz = 84MHz

Definition at line 52 of file pwm_input_arch.h.

Referenced by pwm_input_set_timer().

#define USEC_OF_PWM_INPUT_TICKS (   _v)    ((_v)/PWM_INPUT_TICKS_PER_USEC)

Definition at line 56 of file pwm_input_arch.h.

Referenced by mf_ptu_periodic().

Enumeration Type Documentation

Enumerator
PWM_INPUT1 
PWM_INPUT2 
PWM_INPUT_NB 
PWM_INPUT1 
PWM_INPUT2 
PWM_INPUT_NB 

Definition at line 35 of file pwm_input_arch.h.