KugleFirmware/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c
/**
  * @brief  Enable the Wake-up PINx functionality.
  * @param  sPinParams: pointer to an PWREx_WakeupPinTypeDef structure that contains
  *                     the configuration informations for the wake-up Pin.
  * @retval None
  */
@brief  Enable the Wake-up PINx functionality.
@param  sPinParams: pointer to an PWREx_WakeupPinTypeDef structure that contains
the configuration informations for the wake-up Pin.
@retval None
@brief Enable the Wake - up PINx functionality . @param sPinParams : pointer to an PWREx_WakeupPinTypeDef structure that contains the configuration informations for the wake - up Pin . @retval None
void HAL_PWREx_EnableWakeUpPin(PWREx_WakeupPinTypeDef *sPinParams)
{
  uint32_t pinConfig;
  uint32_t regMask;
  const uint32_t pullMask = PWR_WKUPEPR_WKUPPUPD1;
  assert_param(IS_PWR_WAKEUP_PIN(sPinParams->WakeUpPin));
  assert_param(IS_PWR_WAKEUP_PIN_POLARITY(sPinParams->PinPolarity));
  assert_param(IS_PWR_WAKEUP_PIN_PULL(sPinParams->PinPull));
  pinConfig = sPinParams->WakeUpPin | \
              (sPinParams->PinPolarity << (POSITION_VAL(sPinParams->WakeUpPin) + PWR_WAKEUP_PINS_POLARITY_REGISTER_OFFSET)) | \
              (sPinParams->PinPull << ((POSITION_VAL(sPinParams->WakeUpPin) * PWR_WAKEUP_PINS_PULL_POSITION_OFFSET) + PWR_WAKEUP_PINS_PULL_REGISTER_OFFSET));
  regMask   = sPinParams->WakeUpPin | \
              (PWR_WKUPEPR_WKUPP_1 << POSITION_VAL(sPinParams->WakeUpPin)) | \
              (pullMask << (POSITION_VAL(sPinParams->WakeUpPin) * PWR_WAKEUP_PINS_PULL_POSITION_OFFSET));
  MODIFY_REG(PWR->WKUPEPR, regMask, pinConfig);
  MODIFY_REG(EXTI_D1->IMR2, PWR_EXTI_WAKEUP_PINS_MASK, (sPinParams->WakeUpPin << PWR_EXTI_WAKEUP_PINS_PULL_POSITION_OFFSET));
}
void HAL_PWREx_EnableWakeUpPin ( PWREx_WakeupPinTypeDef * sPinParams ) { uint32_t pinConfig ; uint32_t regMask ; const uint32_t pullMask = PWR_WKUPEPR_WKUPPUPD1 ; assert_param ( IS_PWR_WAKEUP_PIN ( sPinParams -> WakeUpPin ) ) ; assert_param ( IS_PWR_WAKEUP_PIN_POLARITY ( sPinParams -> PinPolarity ) ) ; assert_param ( IS_PWR_WAKEUP_PIN_PULL ( sPinParams -> PinPull ) ) ; pinConfig = sPinParams -> WakeUpPin | ( sPinParams -> PinPolarity << ( POSITION_VAL ( sPinParams -> WakeUpPin ) + PWR_WAKEUP_PINS_POLARITY_REGISTER_OFFSET ) ) | ( sPinParams -> PinPull << ( ( POSITION_VAL ( sPinParams -> WakeUpPin ) * PWR_WAKEUP_PINS_PULL_POSITION_OFFSET ) + PWR_WAKEUP_PINS_PULL_REGISTER_OFFSET ) ) ; regMask = sPinParams -> WakeUpPin | ( PWR_WKUPEPR_WKUPP_1 << POSITION_VAL ( sPinParams -> WakeUpPin ) ) | ( pullMask << ( POSITION_VAL ( sPinParams -> WakeUpPin ) * PWR_WAKEUP_PINS_PULL_POSITION_OFFSET ) ) ; MODIFY_REG ( PWR -> WKUPEPR , regMask , pinConfig ) ; MODIFY_REG ( EXTI_D1 -> IMR2 , PWR_EXTI_WAKEUP_PINS_MASK , ( sPinParams -> WakeUpPin << PWR_EXTI_WAKEUP_PINS_PULL_POSITION_OFFSET ) ) ; }
@brief  Enable the Wake-up PINx functionality.
@brief Enable the Wake - up PINx functionality .
/* Check the parameters */ /* Enable and Specify the Wake-Up pin polarity and the pull configuration
     for the event detection (rising or falling edge) */ /* Configure the Wakeup Pin EXTI Line */