/* write a packet into the Tx FIFO associated with the endpoint  */
usb_status usb_txfifo_write(usb_core_regs *usb_regs, uint8_t *src_buf, uint8_t fifo_num, uint16_t byte_count)
/* write a packet into the Tx FIFO associated with the endpoint  */
usb_status usb_txfifo_write(usb_core_regs *usb_regs, uint8_t *src_buf, uint8_t fifo_num, uint16_t byte_count)
{
    uint32_t word_count = (byte_count + 3U) / 4U;
    __IO uint32_t *fifo = usb_regs->DFIFO[fifo_num];
    while (word_count-- > 0U) {
        *fifo = *((__packed uint32_t *)src_buf);
        src_buf += 4U;
    }
    return USB_OK;
}