aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/power.rs
blob: f93bf8f49583dabce456099c9ab2454eabec12cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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));
}