KugleFirmware/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c
/**
  * @brief  Enable the USB Regulator.
  * @retval HAL status
  */
@brief  Enable the USB Regulator.
@retval HAL status
@brief Enable the USB Regulator . @retval HAL status
HAL_StatusTypeDef HAL_PWREx_EnableUSBReg(void)
{
  uint32_t tickstart = 0;
  SET_BIT(PWR->CR3, PWR_CR3_USBREGEN);
  tickstart = HAL_GetTick();
  while(READ_BIT(PWR->CR3, PWR_CR3_USB33RDY) == RESET)
  {
    if((HAL_GetTick() - tickstart ) > PWR_FLAG_SETTING_DELAY_US)
    {
      return HAL_TIMEOUT;
    }
  }
  return HAL_OK;
}
HAL_StatusTypeDef HAL_PWREx_EnableUSBReg ( void ) { uint32_t tickstart = 0 ; SET_BIT ( PWR -> CR3 , PWR_CR3_USBREGEN ) ; tickstart = HAL_GetTick ( ) ; while ( READ_BIT ( PWR -> CR3 , PWR_CR3_USB33RDY ) == RESET ) { if ( ( HAL_GetTick ( ) - tickstart ) > PWR_FLAG_SETTING_DELAY_US ) { return HAL_TIMEOUT ; } } return HAL_OK ; }
@brief  Enable the USB Regulator.
@brief Enable the USB Regulator .
/* Enable the USB regulator */ /* Get tick */ /* Wait till the USB regulator ready flag is set */