aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf
diff options
context:
space:
mode:
authorAlexander Walter <[email protected]>2024-12-14 15:40:08 +0100
committerAlexander Walter <[email protected]>2024-12-14 15:40:08 +0100
commit3b5993cf48c0a1a5f88f5d0f771df16ceb4de3fb (patch)
tree89bf964a8e9b34ae150724c1b3d860c4aec315fe /embassy-nrf
parentc4f6509cf28e1a8c2401a67f771dd8b959ae7c49 (diff)
Move wake on sense to nfct
Diffstat (limited to 'embassy-nrf')
-rw-r--r--embassy-nrf/src/nfct.rs7
-rw-r--r--embassy-nrf/src/power.rs6
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;
18pub use vals::{Bitframesdd as SddPat, Discardmode as DiscardMode}; 18pub use vals::{Bitframesdd as SddPat, Discardmode as DiscardMode};
19 19
20use crate::interrupt::InterruptExt; 20use crate::interrupt::InterruptExt;
21use crate::pac::nfct::vals; 21use crate::pac::{nfct::vals, NFCT};
22use crate::peripherals::NFCT; 22use crate::peripherals::NFCT;
23use crate::util::slice_in_ram; 23use crate::util::slice_in_ram;
24use crate::{interrupt, pac, Peripheral}; 24use 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
425pub 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")]
20pub fn wake_on_nfc_sense() {
21 NFCT.tasks_sense().write_value(0x01);
22}