/* sends a data packet to the USB device  */
void usb_host_sendctrldata(usb_core_instance *pdev, uint8_t *buff, uint16_t length, uint8_t hc_num)
/* sends a data packet to the USB device  */
void usb_host_sendctrldata(usb_core_instance *pdev, uint8_t *buff, uint16_t length, uint8_t hc_num)
{
    pdev->host.hc[hc_num].is_epin   = 0;
    pdev->host.hc[hc_num].xfer_buff = buff;
    pdev->host.hc[hc_num].xfer_len  = length;
    if (length == 0U) {
        pdev->host.hc[hc_num].out_toggle = 1;
    }
    if (pdev->host.hc[hc_num].out_toggle == 0U) {
        pdev->host.hc[hc_num].pid_type = PID_DATA0;
    } else {
        pdev->host.hc[hc_num].pid_type = PID_DATA1 ;
    }
    (void)host_driver_submitrequest(pdev, hc_num);
}