cpu/nrf5x: implement pm_off() for nRF53/9160#20590
Merged
dylad merged 1 commit intoRIOT-OS:masterfrom Apr 18, 2024
Merged
Conversation
benpicco
reviewed
Apr 17, 2024
Contributor
There was a problem hiding this comment.
Want to take the opportuninty to untangle that #ifdef mess? It's really hard to read.
How about
#if defined(REGULATORS_SYSTEMOFF_SYSTEMOFF_Enter)
NRF_REGULATORS_S->SYSTEMOFF = REGULATORS_SYSTEMOFF_SYSTEMOFF_Enter;
#elif defined(CPU_FAM_NRF51)
NRF_POWER->RAMON = 0;
#else
for (int i = 0; i < ARRAY_SIZE(NRF_POWER->RAM); i++) {
NRF_POWER->RAM[i].POWERCLR = (POWER_RAM_POWERCLR_S1RETENTION_Msk |
POWER_RAM_POWERCLR_S0RETENTION_Msk);
}
#endiff2f9656 to
46f3253
Compare
Member
Author
|
@benpicco I've updated the commit and squashed. |
benpicco
approved these changes
Apr 18, 2024
benpicco
reviewed
Apr 18, 2024
Signed-off-by: Dylan Laduranty <[email protected]>
46f3253 to
7aa7e79
Compare
Member
Author
|
Thanks for the review ! |
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
This PR implements
pm_off()support for nRF9160 and nRF53.The register moved to the regulator peripheral compared to nRF52.
Nordic also have two different names for the same bit of this register, so I add a small workaround. (Could have use '1' instead but I prefer to clearly identify bits within registers).
Testing procedure
Run
tests/periph/pmonnrf9160dkornrf5340dk-appand use
pm offcommandIssues/PRs references
None.