Add DeInit Function in hrtim backend and SPIN PwmHal#155
Open
EdamAbdelhedi wants to merge 3 commits into
Open
Conversation
Member
|
From our discussion, the goal of the global deinit is to allow a full HRTIM reinitialization so the prescaler can be computed again and the minimum frequency can be changed. For that, deinitializing only the timing units is not sufficient: the master timer must also be stopped/reset and its software state must be marked as My suggestion
|
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.
Add HRTIM deinitialization API to allow PWM reconfiguration
Problem
The HRTIM peripheral can currently be initialized, but there is no public API to deinitialize it.
This creates a limitation for applications that need to change the PWM frequency range after a first initialization. In particular, the HRTIM prescaler is computed during initialization and cannot be safely changed while the peripheral is already configured and running.
As a result, once the HRTIM has been initialized, applications cannot fully reconfigure the PWM timing setup without resetting the board.
Why this is needed
Some applications need to switch between different PWM frequency ranges at runtime or between operating modes. These ranges may require a different HRTIM prescaler.
Today, functions such as frequency initialization are effectively one-shot because the peripheral and timing units remain marked as initialized. Even if outputs are stopped, the software state and hardware configuration do not return to a clean pre-initialization state.
Adding deinitialization functions allows applications to:
Proposed API
Add a low-level HRTIM driver API: