Functions
Low power mode configuration
Peripheral Driver » LL Driver » PWR » PWR Exported Functions

## Functions
__STATIC_INLINE void | ll_pwr_set_wakeup_condition (uint32_t condition)
| Set the DeepSleep WakeUp Condition. More...
__STATIC_INLINE void | ll_pwr_clear_wakeup_condition (uint32_t condition)
| Clear the DeepSleep WakeUp Condition. More...
__STATIC_INLINE uint32_t | ll_pwr_get_wakeup_condition (void)
| Get the Selected DeepSleep WakeUp Condition. More...
__STATIC_INLINE uint32_t | ll_pwr_get_wakeup_event (void)
| Get the Event that triggered the DeepSleep WakeUp. More...
__STATIC_INLINE void | ll_pwr_set_sleep_timer_value (uint32_t value)
| Set the 32 bits AON Sleep Timer Value to WakeUp the MCU from DeepSleep Mode. More...
__STATIC_INLINE uint32_t | ll_pwr_get_sleep_timer_read_value (void)
| Read the AON Sleep Timer counter current value. More...
__STATIC_INLINE void | ll_pwr_enable_smc_wakeup_req (void)
| Enable the SMC WakeUp Request. More...
__STATIC_INLINE void | ll_pwr_disable_smc_wakeup_req (void)
| Disable the SMC WakeUp Request. More...
__STATIC_INLINE uint32_t | ll_pwr_is_enabled_smc_wakeup_req (void)
| Check if the SMC WakeUp Request was enabled or disabled. More...
__STATIC_INLINE void | ll_pwr_set_dpad_le_value (uint32_t sleep, uint32_t wakeup)
| Set the DPAD LE value during sleep and after wake up. More...

## Detailed Description

## Function Documentation

## ◆ ll_pwr_clear_wakeup_condition()

__STATIC_INLINE void ll_pwr_clear_wakeup_condition | ( | uint32_t | condition | ) |

Clear the DeepSleep WakeUp Condition.

Register|BitsName --------|-------- MCU_WAKEUP_CTRL | MCU_WAKEUP_CTRL

Parameters

  condition | This parameter can be one of the following values: LL_PWR_WKUP_COND_EXT LL_PWR_WKUP_COND_TIMER LL_PWR_WKUP_COND_BLE LL_PWR_WKUP_COND_CLDR LL_PWR_WKUP_COND_AON_WDT LL_PWR_WKUP_COND_COMP_RISE LL_PWR_WKUP_COND_COMP_FALL LL_PWR_WKUP_COND_ALL

Return values

  None |

Definition at line 194 of file ll_pwr.h.

References AON_CTL.

## ◆ ll_pwr_disable_smc_wakeup_req()

__STATIC_INLINE void ll_pwr_disable_smc_wakeup_req | ( | void |  | ) |

Disable the SMC WakeUp Request.

Note
  This function is used to clear SMC WakeUp Request.

Register|BitsName --------|-------- BLE_MISC | SMC_WAKEUP_REQ

Return values

  None |

Definition at line 300 of file ll_pwr.h.

References AON_CTL.

## ◆ ll_pwr_enable_smc_wakeup_req()

__STATIC_INLINE void ll_pwr_enable_smc_wakeup_req | ( | void |  | ) |

Enable the SMC WakeUp Request.

Note
  Once this is set up, MCU will wake up SMC, and this bit need to be cleared by MCU.

Register|BitsName --------|-------- BLE_MISC | SMC_WAKEUP_REQ

Return values

  None |

Definition at line 285 of file ll_pwr.h.

References AON_CTL.

## ◆ ll_pwr_get_sleep_timer_read_value()

__STATIC_INLINE uint32_t ll_pwr_get_sleep_timer_read_value | ( | void |  | ) |

Read the AON Sleep Timer counter current value.

Register|BitsName --------|-------- SLEEP_TIMER_R | PWR_CTL_TIMER_32B

Return values

  32 | bit AON Timer Count Value

Definition at line 269 of file ll_pwr.h.

References SLP_TIMER0.

## ◆ ll_pwr_get_wakeup_condition()

__STATIC_INLINE uint32_t ll_pwr_get_wakeup_condition | ( | void |  | ) |

Get the Selected DeepSleep WakeUp Condition.

Register|BitsName --------|-------- MCU_WAKEUP_CTRL | MCU_WAKEUP_CTRL

Return values

  Returned | value can be one of the following values: LL_PWR_WKUP_COND_EXT LL_PWR_WKUP_COND_TIMER LL_PWR_WKUP_COND_BLE LL_PWR_WKUP_COND_CLDR LL_PWR_WKUP_COND_AON_WDT LL_PWR_WKUP_COND_COMP_RISE LL_PWR_WKUP_COND_COMP_FALL LL_PWR_WKUP_COND_ALL

Definition at line 216 of file ll_pwr.h.

References AON_CTL, and LL_PWR_WKUP_COND_ALL.

## ◆ ll_pwr_get_wakeup_event()

__STATIC_INLINE uint32_t ll_pwr_get_wakeup_event | ( | void |  | ) |

Get the Event that triggered the DeepSleep WakeUp.

Note
  Only available on GR551xx_B2 and later version

Register|BitsName --------|-------- AON_SLP_EVENT | AON_SLP_EVENT

Return values

  Returned | value can be combination of the following values: LL_PWR_WKUP_EVENT_BLE LL_PWR_WKUP_EVENT_TIMER LL_PWR_WKUP_EVENT_EXT LL_PWR_WKUP_EVENT_COMP_RISE LL_PWR_WKUP_EVENT_COMP_FALL LL_PWR_WKUP_EVENT_WDT LL_PWR_WKUP_EVENT_CLDR

Definition at line 238 of file ll_pwr.h.

References AON_CTL, and LL_PWR_WKUP_EVENT_ALL.

## ◆ ll_pwr_is_enabled_smc_wakeup_req()

__STATIC_INLINE uint32_t ll_pwr_is_enabled_smc_wakeup_req | ( | void |  | ) |

Check if the SMC WakeUp Request was enabled or disabled.

Register|BitsName --------|-------- BLE_MISC | SMC_WAKEUP_REQ

Return values

  State | of bit (1 or 0).

Definition at line 314 of file ll_pwr.h.

References AON_CTL.

## ◆ ll_pwr_set_dpad_le_value()

__STATIC_INLINE void ll_pwr_set_dpad_le_value | ( | uint32_t | sleep,
|  | uint32_t | wakeup
| ) |  |

Set the DPAD LE value during sleep and after wake up.

Register|BitsName --------|-------- DPAD_LE_CTRL | DPAD_LE_SLP_VAL DPAD_LE_CTRL | DPAD_LE_WKUP_VAL

Parameters

  sleep | This parameter can be one of the following values: LL_PWR_DPAD_LE_OFF LL_PWR_DPAD_LE_ON
  wakeup | This parameter can be one of the following values: LL_PWR_DPAD_LE_OFF LL_PWR_DPAD_LE_ON

Return values

  None |

Definition at line 335 of file ll_pwr.h.

## ◆ ll_pwr_set_sleep_timer_value()

__STATIC_INLINE void ll_pwr_set_sleep_timer_value | ( | uint32_t | value | ) |

Set the 32 bits AON Sleep Timer Value to WakeUp the MCU from DeepSleep Mode.

Note
  After the value was set, use LL_PWR_CMD_32_TIMER_LD command to load the configuration into Power State Controller.

Register|BitsName --------|-------- SLEEP_TIMER_W | SLEEP_TIMER_W

Parameters

  value | 32 bits count value loaded into the t32bit_timer

Return values

  None |

Definition at line 255 of file ll_pwr.h.

References SLP_TIMER0.

## ◆ ll_pwr_set_wakeup_condition()

__STATIC_INLINE void ll_pwr_set_wakeup_condition | ( | uint32_t | condition | ) |

Set the DeepSleep WakeUp Condition.

Register|BitsName --------|-------- MCU_WAKEUP_CTRL | MCU_WAKEUP_CTRL

Parameters

  condition | This parameter can be one of the following values: LL_PWR_WKUP_COND_EXT LL_PWR_WKUP_COND_TIMER LL_PWR_WKUP_COND_BLE LL_PWR_WKUP_COND_CLDR LL_PWR_WKUP_COND_AON_WDT LL_PWR_WKUP_COND_COMP_RISE LL_PWR_WKUP_COND_COMP_FALL LL_PWR_WKUP_COND_ALL

Return values

  None |

Definition at line 171 of file ll_pwr.h.

References AON_CTL.