/* Get EP CmdStat pointer Parameters: EPNum: endpoint number  */
uint32_t* GetEpCmdStatPtr(uint32_t EPNum)
/* Get EP CmdStat pointer Parameters: EPNum: endpoint number  */
uint32_t* GetEpCmdStatPtr(uint32_t EPNum)
{
    uint32_t *ptr = (uint32_t *)EP_LIST_BASE;
    ptr += (EPNum & USB_LOGICAL_EP_MASK) * 4;
    if (EPNum & USB_IN_MASK) {
        ptr += 2;
    }
    return ptr;
}