KugleFirmware/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c
/**
  * @brief  Configure the voltage threshold detected by the Power Voltage Detector(PVD).
  * @param  sConfigPVD: pointer to an PWR_PVDTypeDef structure that contains the configuration
  *         information for the PVD.
  * @note   Refer to the electrical characteristics of your device datasheet for
  *         more details about the voltage threshold corresponding to each
  *         detection level.
  * @retval None
  */
@brief  Configure the voltage threshold detected by the Power Voltage Detector(PVD).
@param  sConfigPVD: pointer to an PWR_PVDTypeDef structure that contains the configuration
information for the PVD.
@note   Refer to the electrical characteristics of your device datasheet for
more details about the voltage threshold corresponding to each
detection level.
@retval None
@brief Configure the voltage threshold detected by the Power Voltage Detector ( PVD ) . @param sConfigPVD : pointer to an PWR_PVDTypeDef structure that contains the configuration information for the PVD . @note Refer to the electrical characteristics of your device datasheet for more details about the voltage threshold corresponding to each detection level . @retval None
void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD)
{
  assert_param(IS_PWR_PVD_LEVEL(sConfigPVD->PVDLevel));
  assert_param(IS_PWR_PVD_MODE(sConfigPVD->Mode));
  MODIFY_REG(PWR->CR1, PWR_CR1_PLS, sConfigPVD->PVDLevel);
  __HAL_PWR_PVD_EXTI_DISABLE_EVENT();
  __HAL_PWR_PVD_EXTI_DISABLE_IT();
  __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();
  __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE();
  if((sConfigPVD->Mode & PVD_MODE_IT) == PVD_MODE_IT)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_IT();
  }
  if((sConfigPVD->Mode & PVD_MODE_EVT) == PVD_MODE_EVT)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_EVENT();
  }
  if((sConfigPVD->Mode & PVD_RISING_EDGE) == PVD_RISING_EDGE)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE();
  }
  if((sConfigPVD->Mode & PVD_FALLING_EDGE) == PVD_FALLING_EDGE)
  {
    __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE();
  }
}
void HAL_PWR_ConfigPVD ( PWR_PVDTypeDef * sConfigPVD ) { assert_param ( IS_PWR_PVD_LEVEL ( sConfigPVD -> PVDLevel ) ) ; assert_param ( IS_PWR_PVD_MODE ( sConfigPVD -> Mode ) ) ; MODIFY_REG ( PWR -> CR1 , PWR_CR1_PLS , sConfigPVD -> PVDLevel ) ; __HAL_PWR_PVD_EXTI_DISABLE_EVENT ( ) ; __HAL_PWR_PVD_EXTI_DISABLE_IT ( ) ; __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE ( ) ; __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE ( ) ; if ( ( sConfigPVD -> Mode & PVD_MODE_IT ) == PVD_MODE_IT ) { __HAL_PWR_PVD_EXTI_ENABLE_IT ( ) ; } if ( ( sConfigPVD -> Mode & PVD_MODE_EVT ) == PVD_MODE_EVT ) { __HAL_PWR_PVD_EXTI_ENABLE_EVENT ( ) ; } if ( ( sConfigPVD -> Mode & PVD_RISING_EDGE ) == PVD_RISING_EDGE ) { __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE ( ) ; } if ( ( sConfigPVD -> Mode & PVD_FALLING_EDGE ) == PVD_FALLING_EDGE ) { __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE ( ) ; } }
@brief  Configure the voltage threshold detected by the Power Voltage Detector(PVD).
@brief Configure the voltage threshold detected by the Power Voltage Detector ( PVD ) .
/* Check the parameters */ /* Set PLS[7:5] bits according to PVDLevel value */ /* Clear any previous config */ /* Configure interrupt mode */ /* Configure event mode */ /* Configure the edge */