/* Disable USB Device Endpoint Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None  */
void USBD_DisableEP(uint32_t EPNum)
/* Disable USB Device Endpoint Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None  */
void USBD_DisableEP(uint32_t EPNum)
{
    uint32_t *ptr;
    ptr = GetEpCmdStatPtr(EPNum);
    *ptr = EP_DISABLED;
    if (EPNum & USB_IN_MASK) {
        EPNum &= ~USB_IN_MASK;
        USBHSD->INTEN &= ~(1 << EP_IN_IDX(EPNum));
    } else {
        USBHSD->INTEN &= ~(1 << EP_OUT_IDX(EPNum));
    }
}