stm32/rcc: move rcc logic from ipcc

This commit is contained in:
xoviat
2023-07-23 17:01:34 -05:00
parent 4db63677f6
commit bd60f003e0
3 changed files with 294 additions and 110 deletions

View File

@ -78,6 +78,14 @@ pub struct Clocks {
/// The existence of this value indicates that the clock configuration can no longer be changed
static mut CLOCK_FREQS: MaybeUninit<Clocks> = MaybeUninit::uninit();
#[cfg(stm32wb)]
/// RCC initialization function
pub(crate) unsafe fn init(config: Config) {
set_freqs(compute_clocks(&config));
configure_clocks(&config);
}
/// Sets the clock frequencies
///
/// Safety: Sets a mutable global.