/* Returns the type of an endpoint given its descriptor.  */
unsigned char USBEndpointDescriptor_GetType(const USBEndpointDescriptor *endpoint)
/* Returns the type of an endpoint given its descriptor.  */
unsigned char USBEndpointDescriptor_GetType(const USBEndpointDescriptor *endpoint)
{
    return endpoint->bmAttributes & 0x3;
}