/* Gets a data element from the SPI receive FIFO. 
This function replaces the original SPIDataNonBlockingGet() API and performs the same actions. A macro is provided in  */
long SPIDataGetNonBlocking(unsigned long ulBase, unsigned long *pulData)
/* Gets a data element from the SPI receive FIFO. 
This function replaces the original SPIDataNonBlockingGet() API and performs the same actions. A macro is provided in  */
long SPIDataGetNonBlocking(unsigned long ulBase, unsigned long *pulData)
{
    xASSERT((ulBase == SPI3_BASE) || (ulBase == SPI1_BASE)||
            (ulBase == SPI2_BASE));
    if(xHWREG(ulBase + SPI_SR) & SPI_SR_RXNE)
    {
        *pulData = xHWREG(ulBase + SPI_DR);
        return(1);
    }
    else
    {
        return(0);
    }
}