/* Write USB Device 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 USBD_WriteEP(uint32_t EPNum, uint8_t *pData, uint32_t cnt)
/* Write USB Device 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 USBD_WriteEP(uint32_t EPNum, uint8_t *pData, uint32_t cnt)
{
    return 0U;
  }
  if (ep_dir == 0U) {
    return 0U;
  }
  if ((ep_num == 0U) && (ep0_no_data_stage != 0)) {
    return 0U;
  }
  if ((ep_num == 0U) && (ep0_dir == 0)) {
    return 0U;
  }
  ep_max_len =  ep_config[ep_dir][ep_num].max_packet_size;
  if (len > ep_max_len) {
    len = ep_max_len;
  }
  if ((ep_num == 0U) && (len < ep_max_len)) {
      ep0_status_next = 1U;
  }
  memcpy((void *)&ep_buf[ep_dir][ep_num][0], (const void *)pData, len);
  usbd_dma(EPNum, &ep_buf[ep_dir][ep_num][0], len);
  return len;
}