/* This function parses the endpoint descriptor from the received buffer.  */
void usb_host_parseepdesc(USB_HOST_EPDesc_TypeDef *ep_descriptor, uint8_t *buf)
/* This function parses the endpoint descriptor from the received buffer.  */
void usb_host_parseepdesc(USB_HOST_EPDesc_TypeDef *ep_descriptor, uint8_t *buf)
{
    ep_descriptor->bLength          = buf[0];
    ep_descriptor->bDescriptorType  = buf[1];
    ep_descriptor->bEndpointAddress = buf[2];
    ep_descriptor->bmAttributes     = buf[3];
    ep_descriptor->wMaxPacketSize   = SMALL_END(&buf[4]);
    ep_descriptor->bInterval        = buf[6];
}