/* This function will set an interface to the usb device. */
rt_err_t rt_usb_set_interface(uinst_t uinst, int intf)
/* This function will set an interface to the usb device. */
rt_err_t rt_usb_set_interface(uinst_t uinst, int intf)
{
    struct ureqest setup;
    int timeout = 100;
    RT_ASSERT(uinst != RT_NULL);
    setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD | 
        USB_REQ_TYPE_INTERFACE;
    setup.request = USB_REQ_SET_INTERFACE;
    setup.index = 0;
    setup.length = 0;
    setup.value = intf;
    if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, RT_NULL, 0, 
        timeout) != 0) return -RT_EIO;
    return RT_EOK;    
}