diff options
| author | Alexander Walter <[email protected]> | 2024-12-14 15:40:08 +0100 |
|---|---|---|
| committer | Alexander Walter <[email protected]> | 2024-12-14 15:40:08 +0100 |
| commit | 3b5993cf48c0a1a5f88f5d0f771df16ceb4de3fb (patch) | |
| tree | 89bf964a8e9b34ae150724c1b3d860c4aec315fe | |
| parent | c4f6509cf28e1a8c2401a67f771dd8b959ae7c49 (diff) | |
Move wake on sense to nfct
| -rw-r--r-- | embassy-nrf/src/nfct.rs | 7 | ||||
| -rw-r--r-- | embassy-nrf/src/power.rs | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/embassy-nrf/src/nfct.rs b/embassy-nrf/src/nfct.rs index cbd3920ee..06cb0916c 100644 --- a/embassy-nrf/src/nfct.rs +++ b/embassy-nrf/src/nfct.rs | |||
| @@ -18,7 +18,7 @@ use embassy_sync::waitqueue::AtomicWaker; | |||
| 18 | pub use vals::{Bitframesdd as SddPat, Discardmode as DiscardMode}; | 18 | pub use vals::{Bitframesdd as SddPat, Discardmode as DiscardMode}; |
| 19 | 19 | ||
| 20 | use crate::interrupt::InterruptExt; | 20 | use crate::interrupt::InterruptExt; |
| 21 | use crate::pac::nfct::vals; | 21 | use crate::pac::{nfct::vals, NFCT}; |
| 22 | use crate::peripherals::NFCT; | 22 | use crate::peripherals::NFCT; |
| 23 | use crate::util::slice_in_ram; | 23 | use crate::util::slice_in_ram; |
| 24 | use crate::{interrupt, pac, Peripheral}; | 24 | use crate::{interrupt, pac, Peripheral}; |
| @@ -420,3 +420,8 @@ impl<'d> NfcT<'d> { | |||
| 420 | Ok(n) | 420 | Ok(n) |
| 421 | } | 421 | } |
| 422 | } | 422 | } |
| 423 | |||
| 424 | /// Wake the system if there if an NFC field close to the antenna | ||
| 425 | pub fn wake_on_nfc_sense() { | ||
| 426 | NFCT.tasks_sense().write_value(0x01); | ||
| 427 | } | ||
diff --git a/embassy-nrf/src/power.rs b/embassy-nrf/src/power.rs index ab6460625..730efe094 100644 --- a/embassy-nrf/src/power.rs +++ b/embassy-nrf/src/power.rs | |||
| @@ -14,9 +14,3 @@ pub fn set_system_off() { | |||
| 14 | #[cfg(any(feature = "nrf9160-s", feature = "nrf9160-ns"))] | 14 | #[cfg(any(feature = "nrf9160-s", feature = "nrf9160-ns"))] |
| 15 | REGULATORS.systemoff().write(|w| w.set_systemoff(true)); | 15 | REGULATORS.systemoff().write(|w| w.set_systemoff(true)); |
| 16 | } | 16 | } |
| 17 | |||
| 18 | /// Wake the system if there if an NFC field close to the nrf52840's antenna | ||
| 19 | #[cfg(feature = "nrf52840")] | ||
| 20 | pub fn wake_on_nfc_sense() { | ||
| 21 | NFCT.tasks_sense().write_value(0x01); | ||
| 22 | } | ||
