28 #include "mcu_periph/pwm_input_arch.h"
32 #define ONE_MHZ_CLK 1000000
35 static void input1_period_cb(ICUDriver *icup) {
40 static void input1_width_cb(ICUDriver *icup) {
45 static ICUConfig pwm_input1_cfg = {
46 #if USE_PWM_INPUT1 == PWM_PULSE_TYPE_ACTIVE_LOW
48 #elif USE_PWM_INPUT1 == PWM_PULSE_TYPE_ACTIVE_HIGH
49 ICU_INPUT_ACTIVE_HIGH,
51 #error "Unknown PWM_INPUT1_PULSE_TYPE"
63 static void input2_period_cb(ICUDriver *icup) {
68 static void input2_width_cb(ICUDriver *icup) {
73 static ICUConfig pwm_input2_cfg = {
74 #if USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_LOW
76 #elif USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_HIGH
77 ICU_INPUT_ACTIVE_HIGH,
79 #error "Unknown PWM_INPUT2_PULSE_TYPE"
101 #ifdef USE_PWM_INPUT1
108 #ifdef USE_PWM_INPUT2
#define PWM_INPUT1_GPIO_PIN
Some architecture independent helper functions for GPIOs.
#define PWM_INPUT2_GPIO_AF
#define PWM_INPUT1_GPIO_PORT
#define PWM_INPUT1_GPIO_AF
#define PWM_INPUT2_CHANNEL
void gpio_setup_pin_af(ioportid_t port, uint16_t pin, uint8_t af)
Setup a gpio for input or output with alternate function.
#define PWM_INPUT2_GPIO_PORT
#define PWM_INPUT2_GPIO_PIN
#define PWM_INPUT1_CHANNEL