pub unsafe fn enter_lprun_msi(
    flash: &mut FLASH,
    pwr: &mut PWR,
    rcc: &mut RCC,
    range: LprunRange,
    cs: &CriticalSection
)
Expand description

Enter low-power run mode with MSI as a clock source.

Safety

  1. This will disable the HSE32 clock if not already disabled. Before calling this method peripherals (e.g. SUBGHZ, RTC) should be switched to a different clock source.

Example

use stm32wlxx_hal::{
    pac,
    pwr::{enter_lprun_msi, LprunRange},
};

let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
cortex_m::interrupt::free(|cs| unsafe {
    enter_lprun_msi(
        &mut dp.FLASH,
        &mut dp.PWR,
        &mut dp.RCC,
        LprunRange::Range1M,
        cs,
    )
});