KugleFirmware/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c
/**
  * @brief  Configure the analog voltage threshold detected by the Analog Voltage Detector(AVD).
  * @param  sConfigAVD: pointer to an PWR_AVDTypeDef structure that contains the configuration
  *                     information for the AVD.
  * @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 analog voltage threshold detected by the Analog Voltage Detector(AVD).
@param  sConfigAVD: pointer to an PWR_AVDTypeDef structure that contains the configuration
information for the AVD.
@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 analog voltage threshold detected by the Analog Voltage Detector ( AVD ) . @param sConfigAVD : pointer to an PWR_AVDTypeDef structure that contains the configuration information for the AVD . @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_PWREx_ConfigAVD(PWREx_AVDTypeDef *sConfigAVD)
{
  assert_param(IS_PWR_AVD_LEVEL(sConfigAVD->AVDLevel));
  assert_param(IS_PWR_AVD_MODE(sConfigAVD->Mode));
  MODIFY_REG(PWR->CR1, PWR_CR1_ALS, sConfigAVD->AVDLevel);
  __HAL_PWR_AVD_EXTI_DISABLE_EVENT();
  __HAL_PWR_AVD_EXTI_DISABLE_IT();
  __HAL_PWR_AVD_EXTI_DISABLE_RISING_EDGE();
  __HAL_PWR_AVD_EXTI_DISABLE_FALLING_EDGE();
  if(AVD_MODE_IT == (sConfigAVD->Mode & AVD_MODE_IT))
  {
    __HAL_PWR_AVD_EXTI_ENABLE_IT();
  }
  if(AVD_MODE_EVT == (sConfigAVD->Mode & AVD_MODE_EVT))
  {
    __HAL_PWR_AVD_EXTI_ENABLE_EVENT();
  }
  if(AVD_RISING_EDGE == (sConfigAVD->Mode & AVD_RISING_EDGE))
  {
    __HAL_PWR_AVD_EXTI_ENABLE_RISING_EDGE();
  }
  if(AVD_FALLING_EDGE == (sConfigAVD->Mode & AVD_FALLING_EDGE))
  {
    __HAL_PWR_AVD_EXTI_ENABLE_FALLING_EDGE();
  }
}
void HAL_PWREx_ConfigAVD ( PWREx_AVDTypeDef * sConfigAVD ) { assert_param ( IS_PWR_AVD_LEVEL ( sConfigAVD -> AVDLevel ) ) ; assert_param ( IS_PWR_AVD_MODE ( sConfigAVD -> Mode ) ) ; MODIFY_REG ( PWR -> CR1 , PWR_CR1_ALS , sConfigAVD -> AVDLevel ) ; __HAL_PWR_AVD_EXTI_DISABLE_EVENT ( ) ; __HAL_PWR_AVD_EXTI_DISABLE_IT ( ) ; __HAL_PWR_AVD_EXTI_DISABLE_RISING_EDGE ( ) ; __HAL_PWR_AVD_EXTI_DISABLE_FALLING_EDGE ( ) ; if ( AVD_MODE_IT == ( sConfigAVD -> Mode & AVD_MODE_IT ) ) { __HAL_PWR_AVD_EXTI_ENABLE_IT ( ) ; } if ( AVD_MODE_EVT == ( sConfigAVD -> Mode & AVD_MODE_EVT ) ) { __HAL_PWR_AVD_EXTI_ENABLE_EVENT ( ) ; } if ( AVD_RISING_EDGE == ( sConfigAVD -> Mode & AVD_RISING_EDGE ) ) { __HAL_PWR_AVD_EXTI_ENABLE_RISING_EDGE ( ) ; } if ( AVD_FALLING_EDGE == ( sConfigAVD -> Mode & AVD_FALLING_EDGE ) ) { __HAL_PWR_AVD_EXTI_ENABLE_FALLING_EDGE ( ) ; } }
@brief  Configure the analog voltage threshold detected by the Analog Voltage Detector(AVD).
@brief Configure the analog voltage threshold detected by the Analog Voltage Detector ( AVD ) .
/* Check the parameters */ /* Set the ALS[18:17] bits according to AVDLevel value */ /* Clear any previous config */ /* Configure the interrupt mode */ /* Configure the event mode */ /* Configure the edge */