From adc0fc0a974476e0424077c2cf6c652e6c42ea86 Mon Sep 17 00:00:00 2001 From: nerwalt Date: Fri, 8 Aug 2025 10:23:22 -0600 Subject: Adds WDT support for the nrf54l15 --- embassy-nrf/src/chips/nrf54l15_app.rs | 9 +++++++++ embassy-nrf/src/lib.rs | 1 - embassy-nrf/src/wdt.rs | 8 ++++---- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'embassy-nrf/src') diff --git a/embassy-nrf/src/chips/nrf54l15_app.rs b/embassy-nrf/src/chips/nrf54l15_app.rs index b133eb565..f8d1befd7 100644 --- a/embassy-nrf/src/chips/nrf54l15_app.rs +++ b/embassy-nrf/src/chips/nrf54l15_app.rs @@ -204,6 +204,11 @@ pub const EASY_DMA_SIZE: usize = (1 << 16) - 1; //pub const FLASH_SIZE: usize = 1024 * 1024; embassy_hal_internal::peripherals! { + // WDT + WDT0, + #[cfg(feature = "_s")] + WDT1, + // GPIO port 0 P0_00, P0_01, @@ -285,6 +290,10 @@ impl_pin!(P2_08, 2, 8); impl_pin!(P2_09, 2, 9); impl_pin!(P2_10, 2, 10); +impl_wdt!(WDT0, WDT31, WDT31, 0); +#[cfg(feature = "_s")] +impl_wdt!(WDT1, WDT30, WDT30, 1); + embassy_hal_internal::interrupt_mod!( SWI00, SWI01, diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs index ba8206d13..3d1f2d4c0 100644 --- a/embassy-nrf/src/lib.rs +++ b/embassy-nrf/src/lib.rs @@ -170,7 +170,6 @@ pub mod uarte; feature = "nrf52840" ))] pub mod usb; -#[cfg(not(feature = "_nrf54l"))] // TODO pub mod wdt; // This mod MUST go last, so that it sees all the `impl_foo!` macros diff --git a/embassy-nrf/src/wdt.rs b/embassy-nrf/src/wdt.rs index 308071726..7ab9adc29 100644 --- a/embassy-nrf/src/wdt.rs +++ b/embassy-nrf/src/wdt.rs @@ -37,9 +37,9 @@ impl Config { pub fn try_new(_wdt: &Peri<'_, T>) -> Option { let r = T::REGS; - #[cfg(not(any(feature = "_nrf91", feature = "_nrf5340")))] + #[cfg(not(any(feature = "_nrf91", feature = "_nrf5340", feature = "_nrf54l")))] let runstatus = r.runstatus().read().runstatus(); - #[cfg(any(feature = "_nrf91", feature = "_nrf5340"))] + #[cfg(any(feature = "_nrf91", feature = "_nrf5340", feature = "_nrf54l"))] let runstatus = r.runstatus().read().runstatuswdt(); if runstatus { @@ -90,9 +90,9 @@ impl Watchdog { let crv = config.timeout_ticks.max(MIN_TICKS); let rren = crate::pac::wdt::regs::Rren((1u32 << N) - 1); - #[cfg(not(any(feature = "_nrf91", feature = "_nrf5340")))] + #[cfg(not(any(feature = "_nrf91", feature = "_nrf5340", feature = "_nrf54l")))] let runstatus = r.runstatus().read().runstatus(); - #[cfg(any(feature = "_nrf91", feature = "_nrf5340"))] + #[cfg(any(feature = "_nrf91", feature = "_nrf5340", feature = "_nrf54l"))] let runstatus = r.runstatus().read().runstatuswdt(); if runstatus { -- cgit