/* Returns the USB Host Speed from the Low Level Driver.  */
USBH_SpeedTypeDef USBH_LL_GetSpeed(USBH_HandleTypeDef *phost)
/* Returns the USB Host Speed from the Low Level Driver.  */
USBH_SpeedTypeDef USBH_LL_GetSpeed(USBH_HandleTypeDef *phost)
{
  USBH_SpeedTypeDef speed = USBH_SPEED_LOW;
  switch (HAL_HCD_GetCurrentSpeed(phost->pData))
  {
  case 0:
    speed = USBH_SPEED_HIGH;
    break;
  case 1:
    speed = USBH_SPEED_FULL;
    break;
  case 2:
    speed = USBH_SPEED_LOW;
    break;
  default:
    speed = USBH_SPEED_HIGH;
    break;
  }
  return speed;
}