Added system off and wake-on-field

This commit is contained in:
Alexander Walter 2024-12-13 19:38:30 +01:00
parent 45d9bd5757
commit 415db448c7
2 changed files with 16 additions and 0 deletions

View File

@ -107,6 +107,9 @@ pub mod nvmc;
))]
pub mod pdm;
#[cfg(not(feature = "_nrf54l"))] // TODO
#[cfg(feature = "nrf52840")]
pub mod power;
#[cfg(not(feature = "_nrf54l"))] // TODO
pub mod ppi;
#[cfg(not(feature = "_nrf54l"))] // TODO
#[cfg(not(any(

13
embassy-nrf/src/power.rs Normal file
View File

@ -0,0 +1,13 @@
//! Power
use crate::chip::pac::{NFCT, POWER};
/// Puts the MCU into "System Off" mode with a power usage 0f 0.4 uA
pub fn set_system_off() {
POWER.systemoff().write(|w| w.set_systemoff(true));
}
/// Wake the system if there if an NFC field close to the nrf52840's antenna
pub fn wake_on_nfc_sense() {
NFCT.tasks_sense().write_value(0x01);
}