/* Initializes the device stack and load the class driver.  */
void usb_dev_init(usb_core_instance *pdev, stc_usb_port_identify *pstcPortIdentify, usb_dev_desc_func *pdesc, usb_dev_class_func *class_cb, usb_dev_user_func *usr_cb)
/* Initializes the device stack and load the class driver.  */
void usb_dev_init(usb_core_instance *pdev, stc_usb_port_identify *pstcPortIdentify, usb_dev_desc_func *pdesc, usb_dev_class_func *class_cb, usb_dev_user_func *usr_cb)
{
    usb_bsp_init(pdev, pstcPortIdentify);
    pdev->dev.class_callback = class_cb;
    pdev->dev.user_callback  = usr_cb;
    pdev->dev.desc_callback  = pdesc;
    usb_initdev(pdev, pstcPortIdentify);
    pdev->dev.user_callback->user_init();
    pdev->dev.device_state   = USB_EP0_IDLE;
    usb_bsp_nvicconfig(pdev);
}