This commit is contained in:
Ulf Lilleengen
2021-09-14 14:58:37 +02:00
committed by Ulf Lilleengen
parent bb72f7eb98
commit fb697a2657
24 changed files with 158 additions and 43 deletions

View File

@ -113,6 +113,17 @@ impl<'d> Rcc<'d> {
}
}
pub fn enable_lsi(&mut self) {
let rcc = pac::RCC;
unsafe {
let csr = rcc.csr().read();
if !csr.lsion() {
rcc.csr().modify(|w| w.set_lsion(true));
while !rcc.csr().read().lsirdy() {}
}
}
}
// Safety: RCC init must have been called
pub fn clocks(&self) -> &'static Clocks {
unsafe { get_freqs() }