包括休眠与唤醒、电源管理、各模块的功耗配置。
三种模式:

  • Stop停止
  • StopLite简约停止
  • Standby待机

待机(Standby)模式下,除 RTC、SPM 本身外,所有数字模块均断电。
WFI 指令调用芯片的停止、简约停止和待机模式,处理器通过中断指令退出低功耗模式。
编程顺序:

    1. 配置唤醒源正常工作,并能正常产生中断;
    1. 设置唤醒源 REG_EN_PERIPH_WKUP;
    1. 使能 SPM 电源控制,REG_PWR_EN;
    1. 编程 spm 配置寄存器确定功耗模式, REG_SLEEP_MODE;
    1. 执行 WFI 指令。

      核心指令

      ```c /**
  • SysStop *
  • @return none *
  • @brief enter the Stop mode / void SysStop(void) { SPM_SetLowPowerMode(LOW_POWER_MODE_STOP); / Set the SLEEPDEEP bit to enable deep sleep mode (STOP) */ SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;

    if defined ( ICCARM )

    1. asm("WFI");

    elif defined ( GNUC)

    1. asm("WFI");

    elif defined (__CC_ARM)

    // If using KEIL’s uVision, use the CMSIS intrinsic
    1. __wfi();

    endif

    // Add Debug Interface to enable printf after wakeup } ```