Functions
Low Power mode configuration functions
Peripheral Driver » HAL Driver » PWR » Functions

## Functions
void | hal_pwr_set_wakeup_condition (uint32_t condition)
| Set the DeepSleep WakeUp Condition. More...
void | hal_pwr_config_timer_wakeup (uint8_t timer_mode, uint32_t load_count)
| Configure the AON Sleep Timer mode and count used to wakeup MCU. More...
void | hal_pwr_config_ext_wakeup (uint32_t ext_wakeup_pinx, uint32_t ext_wakeup_type)
| Configure the External AON GPIO pins and pin trigger type that is used to wakeup MCU. More...
void | hal_pwr_disable_ext_wakeup (uint32_t disable_wakeup_pinx)
| Disable the interrupt wake-up function of the specified AON GPIO pin. More...
void | hal_pwr_enter_chip_deepsleep (void)
| Enters DeepSleep mode. More...

## Detailed Description

## Function Documentation

## ◆ hal_pwr_config_ext_wakeup()

void hal_pwr_config_ext_wakeup | ( | uint32_t | ext_wakeup_pinx,
|  | uint32_t | ext_wakeup_type
| ) |  |

Configure the External AON GPIO pins and pin trigger type that is used to wakeup MCU.

Parameters

  [in] | ext_wakeup_pinx | This parameter can be a combination of the following values: PWR_EXTWKUP_PIN0 PWR_EXTWKUP_PIN1 PWR_EXTWKUP_PIN2 PWR_EXTWKUP_PIN3 PWR_EXTWKUP_PIN4 PWR_EXTWKUP_PIN5 PWR_EXTWKUP_PIN_ALL
  [in] | ext_wakeup_type | This parameter can be a combination of the following values: PWR_EXTWKUP_TYPE_LOW PWR_EXTWKUP_TYPE_HIGH PWR_EXTWKUP_TYPE_RISING PWR_EXTWKUP_TYPE_FALLING

Note
  When the level of any selected GPIO pin changes in accordance with the set trigger type, MCU will be waked up from DeepSleep mode.

## ◆ hal_pwr_config_timer_wakeup()

void hal_pwr_config_timer_wakeup | ( | uint8_t | timer_mode,
|  | uint32_t | load_count
| ) |  |

Configure the AON Sleep Timer mode and count used to wakeup MCU.

Parameters

  [in] | timer_mode | Specifies the sleep timer mode. This parameter can be a combination of the following values: PWR_SLP_TIMER_MODE_NORMAL PWR_SLP_TIMER_MODE_SINGLE PWR_SLP_TIMER_MODE_RELOAD PWR_SLP_TIMER_MODE_DISABLE
  [in] | load_count | Count value of the AON Sleep Timer.

Note
  The sleep clock of AON Timer is 32 KHz.

## ◆ hal_pwr_disable_ext_wakeup()

void hal_pwr_disable_ext_wakeup | ( | uint32_t | disable_wakeup_pinx | ) |

Disable the interrupt wake-up function of the specified AON GPIO pin.

Parameters

  [in] | disable_wakeup_pinx | This parameter can be a combination of the following values: PWR_EXTWKUP_PIN0 PWR_EXTWKUP_PIN1 PWR_EXTWKUP_PIN2 PWR_EXTWKUP_PIN3 PWR_EXTWKUP_PIN4 PWR_EXTWKUP_PIN5 PWR_EXTWKUP_PIN_ALL

## ◆ hal_pwr_enter_chip_deepsleep()

void hal_pwr_enter_chip_deepsleep | ( | void |  | ) |

Enters DeepSleep mode.

Note
  In DeepSleep mode, all I/O pins keep the same state as in Run mode.

## ◆ hal_pwr_set_wakeup_condition()

void hal_pwr_set_wakeup_condition | ( | uint32_t | condition | ) |

Set the DeepSleep WakeUp Condition.

Parameters

  [in] | condition | This parameter can be a combination of the following values: PWR_WKUP_COND_EXT PWR_WKUP_COND_TIMER PWR_WKUP_COND_BLE PWR_WKUP_COND_CALENDAR PWR_WKUP_COND_BOD_FEDGE PWR_WKUP_COND_MSIO_COMP PWR_WKUP_COND_ALL

Note
  When PWR_WKUP_COND_EXT is set, use hal_pwr_config_ext_wakeup() to configure wakeup pins and pin trigger type. When PWR_WKUP_COND_TIMER is set, use hal_pwr_config_timer_wakeup() to configure the time count to wakeup. When PWR_WKUP_COND_ALL is set, use hal_pwr_config_ext_wakeup() and hal_pwr_config_timer_wakeup() to configure AON timer and External AON GPIO.