/* Check the status of the FIFO buffer of the specified SPI port.  */
unsigned long SPIFIFOStatusGet(unsigned long ulBase, unsigned long ulRxTx)
/* Check the status of the FIFO buffer of the specified SPI port.  */
unsigned long SPIFIFOStatusGet(unsigned long ulBase, unsigned long ulRxTx)
{
    unsigned long ulDataNum;
    xASSERT(ulBase == SPI0_BASE);
    xASSERT((ulRxTx == SPI_FSR_RX) || (ulRxTx == SPI_FSR_TX));
    if(ulRxTx == SPI_FSR_RX)
    {
        ulDataNum = (xHWREG(ulBase + SPI_FSR) & SPI_FSR_RXFS_M) >> SPI_FSR_RXFS_S;
    }
    else
    {
        ulDataNum = (xHWREG(ulBase + SPI_FSR) & SPI_FSR_TXFS_M) >> SPI_FSR_TXFS_S;
    }
    return ulDataNum;
}