Rename from wl55 to wl5x and enable debug wfe

This commit is contained in:
Ulf Lilleengen 2021-06-16 16:07:21 +02:00
parent b6a8703698
commit 383beb37b3
3 changed files with 20 additions and 7 deletions

View File

@ -16,13 +16,13 @@ pub struct Clocks {
#[cfg(any(rcc_l0))] #[cfg(any(rcc_l0))]
pub ahb: Hertz, 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, 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, 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, pub ahb3: Hertz,
#[cfg(any(rcc_h7))] #[cfg(any(rcc_h7))]
@ -62,9 +62,9 @@ cfg_if::cfg_if! {
} else if #[cfg(rcc_wb55)] { } else if #[cfg(rcc_wb55)] {
mod wb55; mod wb55;
pub use wb55::*; pub use wb55::*;
} else if #[cfg(rcc_wl55)] { } else if #[cfg(rcc_wl5x)] {
mod wl55; mod wl5x;
pub use wl55::*; pub use wl5x::*;
} }
} }

View File

@ -116,6 +116,19 @@ impl<'d> Rcc<'d> {
pub fn clocks(&self) -> &'static Clocks { pub fn clocks(&self) -> &'static Clocks {
unsafe { get_freqs() } 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 /// Extension trait that freezes the `RCC` peripheral with provided clocks configuration

@ -1 +1 @@
Subproject commit e104fc21fea271a5d407086ac7ff19e448ac1b34 Subproject commit d368153cd36a52c8a2c9283270520ce97b265eff