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:
parent
172c63209c
commit
52ddeeedb0
@ -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;
|
||||
|
@ -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++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user