/* Returns the current speed of the USB device connected. */
uint32_t USBHostSpeedGet(uint32_t ui32Base)
/* Returns the current speed of the USB device connected. */
uint32_t USBHostSpeedGet(uint32_t ui32Base)
{
    ASSERT(ui32Base == USB0_BASE);
    if(HWREGB(ui32Base + USB_O_POWER) & USB_POWER_HSMODE)
    {
        return(USB_HIGH_SPEED);
    }
    if(HWREGB(ui32Base + USB_O_DEVCTL) & USB_DEVCTL_FSDEV)
    {
        return(USB_FULL_SPEED);
    }
    if(HWREGB(ui32Base + USB_O_DEVCTL) & USB_DEVCTL_LSDEV)
    {
        return(USB_LOW_SPEED);
    }
    return(USB_UNDEF_SPEED);
}