Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pwm_input_arch.c File Reference

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

#include "mcu_periph/pwm_input.h"
#include <BOARD_CONFIG>
#include "generated/airframe.h"
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/stm32/timer.h>
#include <libopencm3/cm3/nvic.h>
#include "mcu_periph/sys_time.h"
#include "mcu_periph/gpio.h"
#include "mcu_arch.h"
+ Include dependency graph for pwm_input_arch.c:

Go to the source code of this file.

Macros

#define ONE_MHZ_CLK   1000000
 
#define PWM_INPUT_IRQ_PRIO   2
 

Functions

static void pwm_input_set_timer (uint32_t tim, uint32_t ticks_per_usec)
 
void pwm_input_init (void)
 
uint32_t get_pwm_input_duty_in_usec (uint32_t channel)
 
uint32_t get_pwm_input_period_in_usec (uint32_t channel)
 

Variables

static const uint32_t pwm_input_ticks_per_usec []
 

Detailed Description

handling of smt32 PWM input using a timer with capture.

Definition in file pwm_input_arch.c.

Macro Definition Documentation

#define ONE_MHZ_CLK   1000000

Definition at line 44 of file pwm_input_arch.c.

Referenced by pwm_input_set_timer().

#define PWM_INPUT_IRQ_PRIO   2

Definition at line 48 of file pwm_input_arch.c.

Referenced by pwm_input_init().

Function Documentation

uint32_t get_pwm_input_duty_in_usec ( uint32_t  channel)

Definition at line 189 of file pwm_input_arch.c.

References channel, pwm_input_duty_tics, and pwm_input_ticks_per_usec.

uint32_t get_pwm_input_period_in_usec ( uint32_t  channel)

Definition at line 193 of file pwm_input_arch.c.

References channel, pwm_input_period_tics, and pwm_input_ticks_per_usec.

static void pwm_input_set_timer ( uint32_t  tim,
uint32_t  ticks_per_usec 
)
inlinestatic

Definition at line 56 of file pwm_input_arch.c.

References ONE_MHZ_CLK, and timer_get_frequency().

Referenced by pwm_input_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const uint32_t pwm_input_ticks_per_usec[]
static
Initial value:
= {
}
#define PWM_INPUT1_TICKS_PER_USEC
The default pwm counter is set-up to have 1/6 us resolution.
#define PWM_INPUT2_TICKS_PER_USEC

Definition at line 51 of file pwm_input_arch.c.

Referenced by get_pwm_input_duty_in_usec(), and get_pwm_input_period_in_usec().