-
Notifications
You must be signed in to change notification settings - Fork 840
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3645 from wackazong/power-wake-on-field
Add System Off and Wake on Field
- Loading branch information
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//! Power | ||
#[cfg(feature = "nrf52840")] | ||
use crate::chip::pac::POWER; | ||
#[cfg(any(feature = "nrf9160-s", feature = "nrf9160-ns"))] | ||
use crate::chip::pac::REGULATORS; | ||
|
||
/// Puts the MCU into "System Off" mode with minimal power usage | ||
pub fn set_system_off() { | ||
#[cfg(feature = "nrf52840")] | ||
POWER.systemoff().write(|w| w.set_systemoff(true)); | ||
#[cfg(any(feature = "nrf9160-s", feature = "nrf9160-ns"))] | ||
REGULATORS.systemoff().write(|w| w.set_systemoff(true)); | ||
} |