boards/nucleo-l432k: provide three periph_timer instances#19677
Merged
bors[bot] merged 3 commits intoRIOT-OS:masterfrom May 30, 2023
Merged
boards/nucleo-l432k: provide three periph_timer instances#19677bors[bot] merged 3 commits intoRIOT-OS:masterfrom
bors[bot] merged 3 commits intoRIOT-OS:masterfrom
Conversation
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.
This adds the three general purpose timers on STM32L4 boards in a central place so that STM32L4 boards can just include it. Some other families may also have TIM15 and TIM16 and could use this, but likely some generalization is needed to use this for other families as well. This can be added later on.
bors bot
added a commit
that referenced
this pull request
May 30, 2023
19677: boards/nucleo-l432k: provide three periph_timer instances r=aabadie a=maribu ### Contribution description - `cpu/stm32/periph_timer`: Generalize to also work with timers that do not have 4 channels - `boards/common/stm32`: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4) - `boards/nucleo-l432kc`: Make use of the new timer config Co-authored-by: Marian Buschsieweke <[email protected]>
Contributor
|
Build failed: |
Member
Author
|
bors merge (failed due to CI glitch) |
bors bot
added a commit
that referenced
this pull request
May 30, 2023
19677: boards/nucleo-l432k: provide three periph_timer instances r=maribu a=maribu ### Contribution description - `cpu/stm32/periph_timer`: Generalize to also work with timers that do not have 4 channels - `boards/common/stm32`: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4) - `boards/nucleo-l432kc`: Make use of the new timer config 19681: sys/xtimer: improve documentation r=maribu a=maribu ### Contribution description - Add a warning that xtimer is deprecated, so that new code hopefully starts using ztimer - Add a hint that `ztimer_xtimer_compat` can be used even after `xtimer` is gone Co-authored-by: Marian Buschsieweke <[email protected]>
Member
Author
|
bors cancel |
Contributor
|
Canceled. |
bors bot
added a commit
that referenced
this pull request
May 30, 2023
19677: boards/nucleo-l432k: provide three periph_timer instances r=maribu a=maribu ### Contribution description - `cpu/stm32/periph_timer`: Generalize to also work with timers that do not have 4 channels - `boards/common/stm32`: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4) - `boards/nucleo-l432kc`: Make use of the new timer config 19678: gnrc_sixlowpan_iphc: fix NULL pointer dereference r=maribu a=miri64 19681: sys/xtimer: improve documentation r=maribu a=maribu ### Contribution description - Add a warning that xtimer is deprecated, so that new code hopefully starts using ztimer - Add a hint that `ztimer_xtimer_compat` can be used even after `xtimer` is gone Co-authored-by: Marian Buschsieweke <[email protected]> Co-authored-by: Martine Lenders <[email protected]>
Contributor
|
Build failed (retrying...): |
bors bot
added a commit
that referenced
this pull request
May 30, 2023
19677: boards/nucleo-l432k: provide three periph_timer instances r=maribu a=maribu ### Contribution description - `cpu/stm32/periph_timer`: Generalize to also work with timers that do not have 4 channels - `boards/common/stm32`: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4) - `boards/nucleo-l432kc`: Make use of the new timer config 19683: cpu/sam0_eth: clean up init() r=dylad a=benpicco Co-authored-by: Marian Buschsieweke <[email protected]> Co-authored-by: Benjamin Valentin <[email protected]>
Member
Author
|
bors cancel |
Contributor
|
Canceled. |
bors bot
added a commit
that referenced
this pull request
May 30, 2023
19677: boards/nucleo-l432k: provide three periph_timer instances r=maribu a=maribu ### Contribution description - `cpu/stm32/periph_timer`: Generalize to also work with timers that do not have 4 channels - `boards/common/stm32`: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4) - `boards/nucleo-l432kc`: Make use of the new timer config 19683: cpu/sam0_eth: clean up init() r=dylad a=benpicco Co-authored-by: Marian Buschsieweke <[email protected]> Co-authored-by: Benjamin Valentin <[email protected]>
Member
Author
|
C'mon... |
Contributor
|
Canceled. |
Contributor
|
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Member
Author
|
Thx :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
cpu/stm32/periph_timer: Generalize to also work with timers that do not have 4 channelsboards/common/stm32: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4)boards/nucleo-l432kc: Make use of the new timer configTesting procedure
make BOARD=nucleo-l432kc -C tests/periph/timer flash testIssues/PRs references
None