1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-18 19:13:51 +01:00
Marian Buschsieweke 7c0a4b8390
cpu/stm32/periph_timer: Support timers with channels != 4
The assumption that all STM32 timers have exactly four channels no
longer holds. E.g. the STM32L4 has the following general purpose timers:

- TIM2: 32 bit, 4 channels
- TIM15: 16 bit, 2 channels
- TIM16: 16 bit, 1 channel

Hence, a new field is added to the timer configuration to also contain
the number of timer channels. Due to alignment the `struct` previously
was padded by 16 bit, so adding another 8 bit field doesn't increase
its size.

For backward compatibility, a value of `0` is considered as alias for
`TIMER_CHANNEL_NUMOF` (or 4), so that the number of timer channels
only needs to be set when the timer is different from the typical 4
channel timer. This helps backward compatibility.
2023-05-30 12:55:29 +02:00
..
2022-02-21 10:49:43 +01:00
2022-02-21 10:49:43 +01:00
2022-02-21 10:49:43 +01:00
2022-02-21 10:49:43 +01:00
2022-02-21 10:49:43 +01:00
2022-02-21 10:49:43 +01:00
2022-02-21 10:49:43 +01:00
2022-02-21 10:49:43 +01:00
2022-02-21 10:49:43 +01:00
2022-10-26 09:36:45 -04:00
2022-04-06 12:29:25 +02:00
2022-02-21 10:49:43 +01:00