From 383beb37b33fd1346150f756e3281ac1b3651f48 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 16 Jun 2021 16:07:21 +0200 Subject: [PATCH] Rename from wl55 to wl5x and enable debug wfe --- embassy-stm32/src/rcc/mod.rs | 12 ++++++------ embassy-stm32/src/rcc/{wl55 => wl5x}/mod.rs | 13 +++++++++++++ stm32-data | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) rename embassy-stm32/src/rcc/{wl55 => wl5x}/mod.rs (92%) diff --git a/embassy-stm32/src/rcc/mod.rs b/embassy-stm32/src/rcc/mod.rs index 70bf675aa..e84021272 100644 --- a/embassy-stm32/src/rcc/mod.rs +++ b/embassy-stm32/src/rcc/mod.rs @@ -16,13 +16,13 @@ pub struct Clocks { #[cfg(any(rcc_l0))] pub ahb: Hertz, - #[cfg(any(rcc_l4, rcc_f4, rcc_h7, rcc_wb55, rcc_wl55))] + #[cfg(any(rcc_l4, rcc_f4, rcc_h7, rcc_wb55, rcc_wl5x))] pub ahb1: Hertz, - #[cfg(any(rcc_l4, rcc_f4, rcc_h7, rcc_wb55, rcc_wl55))] + #[cfg(any(rcc_l4, rcc_f4, rcc_h7, rcc_wb55, rcc_wl5x))] pub ahb2: Hertz, - #[cfg(any(rcc_l4, rcc_f4, rcc_h7, rcc_wb55, rcc_wl55))] + #[cfg(any(rcc_l4, rcc_f4, rcc_h7, rcc_wb55, rcc_wl5x))] pub ahb3: Hertz, #[cfg(any(rcc_h7))] @@ -62,9 +62,9 @@ cfg_if::cfg_if! { } else if #[cfg(rcc_wb55)] { mod wb55; pub use wb55::*; - } else if #[cfg(rcc_wl55)] { - mod wl55; - pub use wl55::*; + } else if #[cfg(rcc_wl5x)] { + mod wl5x; + pub use wl5x::*; } } diff --git a/embassy-stm32/src/rcc/wl55/mod.rs b/embassy-stm32/src/rcc/wl5x/mod.rs similarity index 92% rename from embassy-stm32/src/rcc/wl55/mod.rs rename to embassy-stm32/src/rcc/wl5x/mod.rs index 2170b7b72..6fa31ce2d 100644 --- a/embassy-stm32/src/rcc/wl55/mod.rs +++ b/embassy-stm32/src/rcc/wl5x/mod.rs @@ -116,6 +116,19 @@ impl<'d> Rcc<'d> { pub fn clocks(&self) -> &'static Clocks { unsafe { get_freqs() } } + + pub fn enable_debug_wfe(&mut self, _dbg: &mut peripherals::DBGMCU, enable_dma: bool) { + // NOTE(unsafe) We have exclusive access to the RCC and DBGMCU + unsafe { + pac::RCC.ahb1enr().modify(|w| w.set_dma1en(enable_dma)); + + pac::DBGMCU.cr().modify(|w| { + w.set_dbg_sleep(true); + w.set_dbg_standby(true); + w.set_dbg_stop(true); + }); + } + } } /// Extension trait that freezes the `RCC` peripheral with provided clocks configuration diff --git a/stm32-data b/stm32-data index e104fc21f..d368153cd 160000 --- a/stm32-data +++ b/stm32-data @@ -1 +1 @@ -Subproject commit e104fc21fea271a5d407086ac7ff19e448ac1b34 +Subproject commit d368153cd36a52c8a2c9283270520ce97b265eff