mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-10-02 14:44:32 +00:00
Add nrf9160
This commit is contained in:
parent
415db448c7
commit
6f08c62d5d
@ -107,7 +107,7 @@ pub mod nvmc;
|
||||
))]
|
||||
pub mod pdm;
|
||||
#[cfg(not(feature = "_nrf54l"))] // TODO
|
||||
#[cfg(feature = "nrf52840")]
|
||||
#[cfg(any(feature = "nrf52840", feature = "nrf9160-s", feature = "nrf9160-ns"))]
|
||||
pub mod power;
|
||||
#[cfg(not(feature = "_nrf54l"))] // TODO
|
||||
pub mod ppi;
|
||||
|
@ -1,13 +1,24 @@
|
||||
//! Power
|
||||
|
||||
use crate::chip::pac::{NFCT, POWER};
|
||||
#[cfg(feature = "nrf52840")]
|
||||
use crate::chip::pac::NFCT;
|
||||
|
||||
/// Puts the MCU into "System Off" mode with a power usage 0f 0.4 uA
|
||||
#[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));
|
||||
}
|
||||
|
||||
/// Wake the system if there if an NFC field close to the nrf52840's antenna
|
||||
#[cfg(feature = "nrf52840")]
|
||||
pub fn wake_on_nfc_sense() {
|
||||
NFCT.tasks_sense().write_value(0x01);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user