Function stm32wlxx_hal::pwr::enable_shutdown
source · pub fn enable_shutdown(pwr: &mut PWR, scb: &mut SCB)
Expand description
Enable shutdown on the next WFI or WFE.
Example
use stm32wlxx_hal::{pac, pwr::enable_shutdown};
let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
let mut cp: pac::CorePeripherals = pac::CorePeripherals::take().unwrap();
// SLEEPDEEP is implemented with retention
// generally you will want to clear this at power-on when using shutdown
cp.SCB.clear_sleepdeep();
// ... do things
enable_shutdown(&mut dp.PWR, &mut cp.SCB);