/* Read available data from the read FIFO, as 8-bit data items. */
unsigned long EPINonBlockingReadGet8(unsigned long ulBase, unsigned long ulCount, unsigned char *pucBuf)
/* Read available data from the read FIFO, as 8-bit data items. */
unsigned long EPINonBlockingReadGet8(unsigned long ulBase, unsigned long ulCount, unsigned char *pucBuf)
{
    unsigned long ulCountRead = 0;
    ASSERT(ulBase == EPI0_BASE);
    ASSERT(ulCount < 4096);
    ASSERT(pucBuf);
    while(HWREG(ulBase + EPI_O_RFIFOCNT) && ulCount--)
    {
        *pucBuf = (unsigned char)HWREG(ulBase + EPI_O_READFIFO);
        pucBuf++;
        ulCountRead++;
    }
    return(ulCountRead);
}