Merge pull request #3514 from chrenderle/rcc

RCC: add lsi and lse clock frequency for STM32U5
This commit is contained in:
Dario Nieuwenhuis 2024-11-07 13:29:20 +00:00 committed by GitHub
commit 05d36233fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,6 +5,7 @@ pub use crate::pac::rcc::vals::{
}; };
use crate::pac::rcc::vals::{Hseext, Msirgsel, Pllmboost, Pllrge}; use crate::pac::rcc::vals::{Hseext, Msirgsel, Pllmboost, Pllrge};
use crate::pac::{FLASH, PWR, RCC}; use crate::pac::{FLASH, PWR, RCC};
use crate::rcc::LSI_FREQ;
use crate::time::Hertz; use crate::time::Hertz;
/// HSI speed /// HSI speed
@ -294,6 +295,9 @@ pub(crate) unsafe fn init(config: Config) {
let rtc = config.ls.init(); 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(); config.mux.init();
set_clocks!( set_clocks!(
@ -309,6 +313,8 @@ pub(crate) unsafe fn init(config: Config) {
msik: msik, msik: msik,
hsi48: hsi48, hsi48: hsi48,
rtc: rtc, rtc: rtc,
lse: lse,
lsi: lsi,
hse: hse, hse: hse,
hse_div_2: hse.map(|clk| clk / 2u32), hse_div_2: hse.map(|clk| clk / 2u32),
hsi: hsi, hsi: hsi,
@ -329,8 +335,6 @@ pub(crate) unsafe fn init(config: Config) {
// TODO // TODO
audioclk: None, audioclk: None,
hsi48_div_2: None, hsi48_div_2: None,
lse: None,
lsi: None,
shsi: None, shsi: None,
shsi_div_2: None, shsi_div_2: None,
); );