/* Writes a packet whose byte number is len into the Tx FIFO associated with the EP.  */
void usb_wrpkt(LL_USB_TypeDef *USBx, uint8_t *src, uint8_t ch_ep_num, uint16_t len, uint8_t u8DmaEn)
/* Writes a packet whose byte number is len into the Tx FIFO associated with the EP.  */
void usb_wrpkt(LL_USB_TypeDef *USBx, uint8_t *src, uint8_t ch_ep_num, uint16_t len, uint8_t u8DmaEn)
{
    __IO uint32_t u32pAddr;
    __IO uint32_t *fifo;
    uint32_t u32Count32b;
    uint32_t u32Tmp;
    if (u8DmaEn == 0U) {
        u32Count32b = (len + 3UL);
        u32Count32b = u32Count32b >> 2U;
        fifo = USBx->DFIFO[ch_ep_num];
        u32Tmp = 0UL;
        while (u32Tmp < u32Count32b) {
            WRITE_REG32(*fifo, *((uint32_t *)src));
            u32pAddr = (uint32_t)src;
            src = (uint8_t *)(u32pAddr + 4U);
            u32Tmp++;
        }
    }
}