Function stm32wlxx_hal::rcc::set_sysclk_msi
source · pub unsafe fn set_sysclk_msi(
flash: &mut FLASH,
pwr: &mut PWR,
rcc: &mut RCC,
range: MsiRange,
cs: &CriticalSection
)
Expand description
Set the sysclk from an MSI range.
Safety
- Peripherals must not be in-use before calling this function.
- Peripherals may need their prescalers adjusted for the new sysclk frequency.
Example
use stm32wlxx_hal::{
pac,
rcc::{set_sysclk_msi, MsiRange},
};
let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
cortex_m::interrupt::free(|cs| unsafe {
set_sysclk_msi(
&mut dp.FLASH,
&mut dp.PWR,
&mut dp.RCC,
MsiRange::Range48M,
cs,
)
});