/* Reset USB Device Endpoint Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None  */
void USBD_ResetEP(uint32_t EPNum)
/* Reset USB Device Endpoint Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None  */
void USBD_ResetEP(uint32_t EPNum)
{
    EPNum &= 0x0F;
    UDPHS->UDPHS_EPT[EPNum].UDPHS_EPTCLRSTA = (0x1 << 6) |
            (0x1 << 5);
    UDPHS->UDPHS_EPTRST |= (1 << EPNum);
    UDPHS->UDPHS_EPTRST &= ~(1 << EPNum);
    eptsta_copy[EPNum] = UDPHS->UDPHS_EPT[EPNum].UDPHS_EPTSETSTA;
}