nrf53: Add APIs to change Low Frequency Clock source in the runtime#2993
Open
m-gorecki wants to merge 4 commits intoapache:masterfrom
Open
nrf53: Add APIs to change Low Frequency Clock source in the runtime#2993m-gorecki wants to merge 4 commits intoapache:masterfrom
m-gorecki wants to merge 4 commits intoapache:masterfrom
Conversation
andrzej-kaczmarek
requested changes
May 11, 2023
| NRF_CLOCK_NS->TASKS_LFCLKSTOP = 1; | ||
| NRF_CLOCK_NS->EVENTS_LFCLKSTARTED = 0; | ||
| NRF_CLOCK_NS->LFCLKSRC = clksrc; | ||
| NRF_CLOCK_NS->TASKS_LFCLKSTART = 1; |
Contributor
There was a problem hiding this comment.
lfclk source can be changes without restarting lfclk:
The LFCLK source can be configured at any time (for instance, when the LFCLK has already been started). The content of the LFCLKSRC register only takes effect when the LFCLKSTART task is triggered.
so we can only start lfclk once on system startup, then this API can change source at any time only taking care of hfxo when switching to/from lfsynth
Contributor
There was a problem hiding this comment.
LFCLKSRC can be used instead of masking
Contributor
There was a problem hiding this comment.
while (!NRF_CLOCK_NS->EVENTS_HFCLKSTARTED) {
}
Code from function hal_system_clock_start was moved into new API, so now we can call that API with proper argument to avoid code repetition.
Code from function hal_system_clock_start was moved into new API, so now we can call that API with proper argument to avoid code repetition.
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.
This adds the same API for appcore and netcore.