KugleFirmware/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c
/**
  * @brief  Enter CM7 core to Sleep mode.
  * @param  Regulator: Specifies the regulator state in SLEEP mode.
  *          This parameter can be one of the following values:
  *            @arg PWR_MAINREGULATOR_ON: SLEEP mode with regulator ON
  *            @arg PWR_LOWPOWERREGULATOR_ON: SLEEP mode with low power regulator ON
  * @note   This parameter is not used for the STM32H7 family and is kept as parameter
  *         just to maintain compatibility with the lower power families.
  * @param  SLEEPEntry: Specifies if SLEEP mode in entered with WFI or WFE instruction.
  *          This parameter can be one of the following values:
  *            @arg PWR_SLEEPENTRY_WFI: enter SLEEP mode with WFI instruction
  *            @arg PWR_SLEEPENTRY_WFE: enter SLEEP mode with WFE instruction
  * @retval None
  */
@brief  Enter CM7 core to Sleep mode.
@param  Regulator: Specifies the regulator state in SLEEP mode.
This parameter can be one of the following values:
@arg PWR_MAINREGULATOR_ON: SLEEP mode with regulator ON
@arg PWR_LOWPOWERREGULATOR_ON: SLEEP mode with low power regulator ON
@note   This parameter is not used for the STM32H7 family and is kept as parameter
just to maintain compatibility with the lower power families.
@brief Enter CM7 core to Sleep mode . @param Regulator : Specifies the regulator state in SLEEP mode . This parameter can be one of the following values : @arg PWR_MAINREGULATOR_ON : SLEEP mode with regulator ON @arg PWR_LOWPOWERREGULATOR_ON : SLEEP mode with low power regulator ON @note This parameter is not used for the STM32H7 family and is kept as parameter just to maintain compatibility with the lower power families .
void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry)
{
  assert_param(IS_PWR_REGULATOR(Regulator));
  assert_param(IS_PWR_SLEEP_ENTRY(SLEEPEntry));
  CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
  if(SLEEPEntry == PWR_SLEEPENTRY_WFI)
  {
    __WFI();
  }
  else
  {
    __SEV();
    __WFE();
    __WFE();
  }
}
void HAL_PWR_EnterSLEEPMode ( uint32_t Regulator , uint8_t SLEEPEntry ) { assert_param ( IS_PWR_REGULATOR ( Regulator ) ) ; assert_param ( IS_PWR_SLEEP_ENTRY ( SLEEPEntry ) ) ; CLEAR_BIT ( SCB -> SCR , ( ( uint32_t ) SCB_SCR_SLEEPDEEP_Msk ) ) ; if ( SLEEPEntry == PWR_SLEEPENTRY_WFI ) { __WFI ( ) ; } else { __SEV ( ) ; __WFE ( ) ; __WFE ( ) ; } }
@brief  Enter CM7 core to Sleep mode.
@brief Enter CM7 core to Sleep mode .
/* Check the parameters */ /* Clear SLEEPDEEP bit of Cortex System Control Register */ /* Select SLEEP mode entry */ /* Request Wait For Interrupt */ /* Request Wait For Event */