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