1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-14 17:13:50 +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
2021-12-03 10:12:35 +01:00
2020-10-23 00:46:26 +02:00
2023-01-07 09:47:44 +01:00
2022-09-15 12:12:23 +02:00
2021-09-07 10:06:31 +02:00
2020-10-23 00:46:26 +02:00
2021-09-07 10:06:31 +02:00
2020-10-23 00:46:26 +02:00
2022-02-21 10:49:43 +01:00
2020-10-23 11:29:57 +02:00