CN / EN
Doc Feedback
Thanks for your interest, welcome to contact us.
Thanks for your feedback

Enable Sleep Mode

Users can configure Active Mode, Idle Mode, and Sleep Mode of the system by using the pwr_mgmt_mode_set() function.

/**
*********************************************************************
 * @brief  Set the specified sleep mode. When the setting is completed, the system will
 *         automatically enter the specified sleep mode through the strategy.  
 * @param[in] pm_mode : sleep level
 * @retval : void
******************************************************************
 */
 void pwr_mgmt_mode_set(pwr_mgmt_mode_t pm_mode); 
Note:

Name: gr55xx_pwr.h

Path: SDK_Folder\components\sdk

The parameter pm_mode of pwr_mgmt_mode_set() function is used to set Sleep Mode of the system.

Table 4 Values of pwr_mgmt_mode_t
Value of pm_mode Description

PMR_MGMT_ACTIVE_MODE

The system goes into Active Mode and remains in this state, and runs at full speed.

PMR_MGMT_IDLE_MODE

The system is permitted to go into Idle Mode and switch between Active Mode and Idle Mode.

  • If there is any task to be processed, the system remains in Active Mode.
  • If not, the system remains in Idle Mode, waits to be woken up when an interrupt arrives, and then enters Active Mode.

PMR_MGMT_SLEEP_MODE

The system is permitted to go into Sleep Mode and switch between Active Mode, Idle Mode, and Sleep Mode according to the sleep policy.

  • If there is any task to be processed, the system remains in Active Mode.
  • If not, the system goes into Idle Mode or Sleep Mode based on predictable sleep time, which can be predicted by both AON Timer and Bluetooth LE Timer.

Configure Active Mode

Set the value of pm_mode of pwr_mgmt_mode_set() function to PMR_MGMT_ACTIVE_MODE, to keep the system in Active Mode. Unused memory blocks are configured automatically during system initialization. Users can also control the power supply and clocks of unused memory blocks, to reduce power consumption in Active Mode.

Configure Idle Mode

Set the value of pm_mode of pwr_mgmt_mode_set() function to PMR_MGMT_IDLE_MODE, so as to allow the system to switch between Active Mode and Idle Mode, depending on whether any task is to be processed. In the main() function of the example project, the pwr_mgmt_schedule() function automatically disables corresponding modules according to the sleep policy. For example, if no Bluetooth task is to be processed, the ble_core_sleep() function will power off the Bluetooth Subsystem, and enable the MCU Subsystem to automatically go into Idle Mode after it completes current tasks.

Configure Sleep Mode

Generally, the warm boot model of the system shall by applied in the Sleep Mode.

  • Sleep Mode

    Set the value of pm_mode of pwr_mgmt_mode_set() function to PMR_MGMT_SLEEP_MODE, so as to enable the system to switch between Active Mode, Idle Mode, and Sleep Mode according to the sleep policy. In the main() function of the example project, the pwr_mgmt_schedule() function automatically powers all the power domains off (except for Always-on Domain), and sets part of RAM to Retention RAM to lower power consumption according to the sleep policy.

  • Warm boot

    The driver interface supports recovery from warm boot, and the warm boot process requires no user involvement.

Note:

Name: system_gr55xx.c

Path: SDK_Folder\toolchain\gr55xx\source\

Scan to follow

Open WeChat, use "Scan" to follow.