diff --git a/boards/nucleo-f446/Makefile.features b/boards/nucleo-f446/Makefile.features index 9e60ed80e26631c8d139c2b988282c9ee3e0f569..085ad2f1553a0833389f91a8deb02fdac28053f7 100644 --- a/boards/nucleo-f446/Makefile.features +++ b/boards/nucleo-f446/Makefile.features @@ -7,6 +7,7 @@ FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart +FEATURES_PROVIDED += periph_qdec # load the common Makefile.features for Nucleo boards include $(RIOTBOARD)/common/nucleo64/Makefile.features diff --git a/boards/nucleo-f446/include/periph_conf.h b/boards/nucleo-f446/include/periph_conf.h index b2e428011b00ce4facc8f3dea3707c85ebb2a774..6b1c23762d590ea9cfce1889f2059e901de3c793 100644 --- a/boards/nucleo-f446/include/periph_conf.h +++ b/boards/nucleo-f446/include/periph_conf.h @@ -161,16 +161,6 @@ static const pwm_conf_t pwm_config[] = { .af = GPIO_AF1, .bus = APB1 }, - { - .dev = TIM3, - .rcc_mask = RCC_APB1ENR_TIM3EN, - .chan = { { .pin = GPIO_PIN(PORT_B, 4), .cc_chan = 0 }, - { .pin = GPIO_UNDEF, .cc_chan = 0 }, - { .pin = GPIO_UNDEF, .cc_chan = 0 }, - { .pin = GPIO_UNDEF, .cc_chan = 0 } }, - .af = GPIO_AF2, - .bus = APB1 - }, { .dev = TIM8, .rcc_mask = RCC_APB2ENR_TIM8EN, @@ -186,6 +176,39 @@ static const pwm_conf_t pwm_config[] = { #define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0])) /** @} */ +/** + * @name QDEC configuration + * @{ + */ +static const qdec_conf_t qdec_config[] = { + { + .dev = TIM3, + .max = 0xffffffff, + .rcc_mask = RCC_APB1ENR_TIM3EN, + .chan = { { .pin = GPIO_PIN(PORT_A, 6), .cc_chan = 0 }, + { .pin = GPIO_PIN(PORT_A, 7), .cc_chan = 1 } }, + .af = GPIO_AF2, + .bus = APB1, + .irqn = TIM3_IRQn + }, + { + .dev = TIM4, + .max = 0xffffffff, + .rcc_mask = RCC_APB1ENR_TIM4EN, + .chan = { { .pin = GPIO_PIN(PORT_B, 6), .cc_chan = 0 }, + { .pin = GPIO_PIN(PORT_B, 7), .cc_chan = 1 } }, + .af = GPIO_AF2, + .bus = APB1, + .irqn = TIM4_IRQn + }, +}; + +#define QDEC_0_ISR isr_tim3 +#define QDEC_1_ISR isr_tim4 + +#define QDEC_NUMOF (sizeof(qdec_config) / sizeof(qdec_config[0])) +/** @} */ + /** * @name SPI configuration *