aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/power.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-nrf/src/power.rs')
-rw-r--r--embassy-nrf/src/power.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/embassy-nrf/src/power.rs b/embassy-nrf/src/power.rs
index 440028380..66dfbae65 100644
--- a/embassy-nrf/src/power.rs
+++ b/embassy-nrf/src/power.rs
@@ -1,13 +1,24 @@
1//! Power 1//! Power
2 2
3use crate::chip::pac::{NFCT, POWER}; 3#[cfg(feature = "nrf52840")]
4use crate::chip::pac::NFCT;
4 5
5/// Puts the MCU into "System Off" mode with a power usage 0f 0.4 uA 6#[cfg(feature = "nrf52840")]
7use crate::chip::pac::POWER;
8
9#[cfg(any(feature = "nrf9160-s", feature = "nrf9160-ns"))]
10use crate::chip::pac::REGULATORS;
11
12/// Puts the MCU into "System Off" mode with minimal power usage
6pub fn set_system_off() { 13pub fn set_system_off() {
14 #[cfg(feature = "nrf52840")]
7 POWER.systemoff().write(|w| w.set_systemoff(true)); 15 POWER.systemoff().write(|w| w.set_systemoff(true));
16 #[cfg(any(feature = "nrf9160-s", feature = "nrf9160-ns"))]
17 REGULATORS.systemoff().write(|w| w.set_systemoff(true));
8} 18}
9 19
10/// Wake the system if there if an NFC field close to the nrf52840's antenna 20/// Wake the system if there if an NFC field close to the nrf52840's antenna
21#[cfg(feature = "nrf52840")]
11pub fn wake_on_nfc_sense() { 22pub fn wake_on_nfc_sense() {
12 NFCT.tasks_sense().write_value(0x01); 23 NFCT.tasks_sense().write_value(0x01);
13} 24}