1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/stm32: add qdec support for CPU_FAM_STM32F1

This commit is contained in:
Gabriel Moyano 2020-05-29 21:11:54 +02:00
parent 172c63209c
commit 52ddeeedb0
2 changed files with 4 additions and 0 deletions

View File

@ -513,7 +513,9 @@ typedef struct {
uint32_t rcc_mask; /**< bit in clock enable register */
qdec_chan_t chan[QDEC_CHAN]; /**< channel mapping, set to {GPIO_UNDEF, 0}
* if not used */
#ifndef CPU_FAM_STM32F1
gpio_af_t af; /**< alternate function used */
#endif
uint8_t bus; /**< APB bus */
uint8_t irqn; /**< global IRQ channel */
} qdec_conf_t;

View File

@ -98,7 +98,9 @@ int32_t qdec_init(qdec_t qdec, qdec_mode_t mode, qdec_cb_t cb, void *arg)
i = 0;
while ((i < QDEC_CHAN) && (qdec_config[qdec].chan[i].pin != GPIO_UNDEF)) {
gpio_init(qdec_config[qdec].chan[i].pin, GPIO_IN);
#ifndef CPU_FAM_STM32F1
gpio_init_af(qdec_config[qdec].chan[i].pin, qdec_config[qdec].af);
#endif
i++;
}