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"
66 static void input2_period_cb(ICUDriver *icup) {
71 static void input2_width_cb(ICUDriver *icup) {
76 static ICUConfig pwm_input2_cfg = {
77 #if USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_LOW
79 #elif USE_PWM_INPUT2 == PWM_PULSE_TYPE_ACTIVE_HIGH
80 ICU_INPUT_ACTIVE_HIGH,
82 #error "Unknown PWM_INPUT2_PULSE_TYPE"
105 #ifdef USE_PWM_INPUT1
112 #ifdef USE_PWM_INPUT2
#define PWM_INPUT2_GPIO_PORT
#define PWM_INPUT2_GPIO_AF
#define PWM_INPUT2_GPIO_PIN
#define PWM_INPUT2_CHANNEL
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_PORT
#define PWM_INPUT1_CHANNEL
#define PWM_INPUT1_GPIO_AF
#define PWM_INPUT1_GPIO_PIN
Some architecture independent helper functions for GPIOs.