/* find the interface index for a specific class  */
uint8_t usbh_interface_find(usb_dev_prop *udev, uint8_t main_class, uint8_t sub_class, uint8_t protocol)
/* find the interface index for a specific class  */
uint8_t usbh_interface_find(usb_dev_prop *udev, uint8_t main_class, uint8_t sub_class, uint8_t protocol)
{
    usb_desc_itf *pif;
    uint8_t if_ix = 0U;
    pif = (usb_desc_itf *)0;
    while (if_ix < udev->cfg_desc_set.cfg_desc.bNumInterfaces) {
        pif = &udev->cfg_desc_set.itf_desc_set[if_ix][0].itf_desc;
        if (((pif->bInterfaceClass == main_class) || (main_class == 0xFFU))&&
             ((pif->bInterfaceSubClass == sub_class) || (sub_class == 0xFFU))&&
               ((pif->bInterfaceProtocol == protocol) || (protocol == 0xFFU))) {
            return if_ix;
        }
        if_ix++;
    }
    return 0xFFU;
}