28 #include "mcu_periph/pwm_input_arch.h"
34 #define ONE_MHZ_CLK 1000000
37 static void input1_period_cb(ICUDriver *icup) {
42 static void input1_width_cb(ICUDriver *icup) {
47 static ICUConfig pwm_input1_cfg = {
48 #if USE_PWM_INPUT1 == PWM_PULSE_TYPE_ACTIVE_LOW
50 #elif USE_PWM_INPUT1 == PWM_PULSE_TYPE_ACTIVE_HIGH
51 ICU_INPUT_ACTIVE_HIGH,
53 #error "Unknown PWM_INPUT1_PULSE_TYPE"
65 static void input2_period_cb(ICUDriver *icup) {
70 static void input2_width_cb(ICUDriver *icup) {
75 static ICUConfig pwm_input2_cfg = {
76 #if USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_LOW
78 #elif USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_HIGH
79 ICU_INPUT_ACTIVE_HIGH,
81 #error "Unknown PWM_INPUT2_PULSE_TYPE"
103 #ifdef USE_PWM_INPUT1
110 #ifdef USE_PWM_INPUT2
void gpio_setup_pin_af(ioportid_t port, uint16_t pin, uint8_t af, bool is_output)
Setup a gpio for input or output with alternate function.
#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
#define PWM_INPUT2_GPIO_PORT
#define PWM_INPUT2_GPIO_PIN
#define PWM_INPUT1_CHANNEL