From cf2424f5c21416571ccd695ccea61b447094c9ef Mon Sep 17 00:00:00 2001 From: Christian Enderle Date: Thu, 7 Nov 2024 14:16:10 +0100 Subject: [PATCH] RCC: add lsi and lse clock frequency for STM32U5 --- embassy-stm32/src/rcc/u5.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/embassy-stm32/src/rcc/u5.rs b/embassy-stm32/src/rcc/u5.rs index bb3d5f320..af99c77bc 100644 --- a/embassy-stm32/src/rcc/u5.rs +++ b/embassy-stm32/src/rcc/u5.rs @@ -5,6 +5,7 @@ pub use crate::pac::rcc::vals::{ }; use crate::pac::rcc::vals::{Hseext, Msirgsel, Pllmboost, Pllrge}; use crate::pac::{FLASH, PWR, RCC}; +use crate::rcc::LSI_FREQ; use crate::time::Hertz; /// HSI speed @@ -294,6 +295,9 @@ pub(crate) unsafe fn init(config: Config) { let rtc = config.ls.init(); + let lse = config.ls.lse.map(|l| l.frequency); + let lsi = config.ls.lsi.then_some(LSI_FREQ); + config.mux.init(); set_clocks!( @@ -309,6 +313,8 @@ pub(crate) unsafe fn init(config: Config) { msik: msik, hsi48: hsi48, rtc: rtc, + lse: lse, + lsi: lsi, hse: hse, hse_div_2: hse.map(|clk| clk / 2u32), hsi: hsi, @@ -329,8 +335,6 @@ pub(crate) unsafe fn init(config: Config) { // TODO audioclk: None, hsi48_div_2: None, - lse: None, - lsi: None, shsi: None, shsi_div_2: None, );