/* Write USB Endpoint Data Parameters: EPNum: Endpoint Number EPNum.0..3: Address EPNum.7: Dir pData: Pointer to Data Buffer cnt: Number of bytes to write Return Value: Number of bytes written  */
uint32_t USB_WriteEP(uint32_t EPNum, uint8_t *pData, uint32_t cnt)
/* Write USB Endpoint Data Parameters: EPNum: Endpoint Number EPNum.0..3: Address EPNum.7: Dir pData: Pointer to Data Buffer cnt: Number of bytes to write Return Value: Number of bytes written  */
uint32_t USB_WriteEP(uint32_t EPNum, uint8_t *pData, uint32_t cnt)
{
    USB_TXDATA = *((uint32_t __attribute__((packed)) *)pData);
    pData += 4;
  }
  USB_CTRL = 0;
  WrCmdEP(EPNum, CMD_VALID_BUF);
  return (cnt);
}