/* read a packet from the Rx FIFO associated with the endpoint  */
void* usb_rxfifo_read(usb_core_regs *usb_regs, uint8_t *dest_buf, uint16_t byte_count)
/* read a packet from the Rx FIFO associated with the endpoint  */
void* usb_rxfifo_read(usb_core_regs *usb_regs, uint8_t *dest_buf, uint16_t byte_count)
{
    uint32_t word_count = (byte_count + 3U) / 4U;
    __IO uint32_t *fifo = usb_regs->DFIFO[0];
    while (word_count-- > 0U) {
        *(__packed uint32_t *)dest_buf = *fifo;
        dest_buf += 4U;
    }
    return ((void *)dest_buf);
}