Function stm32wlxx_hal::rcc::setup_lsi
source · pub unsafe fn setup_lsi(rcc: &mut RCC, pre: LsiPre)
Expand description
Setup the LSI clock and wait for completion.
This will temporarily disable the LSI clock if the prescaler needs to be changed.
Safety
- Ensure there are no peripherals using the LSI clock source before calling this function.
Example
use stm32wlxx_hal::{
pac,
rcc::{setup_lsi, LsiPre},
};
let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
unsafe { setup_lsi(&mut dp.RCC, LsiPre::Div1) };