/* Write data element to the SPI interface with Noblock.  */
long xSPIDataPutNonBlocking(unsigned long ulBase, unsigned long ulData)
/* Write data element to the SPI interface with Noblock.  */
long xSPIDataPutNonBlocking(unsigned long ulBase, unsigned long ulData)
{
    unsigned char ucBitLength = SPIBitLengthGet(ulBase);
	unsigned long ulFlag;
    xASSERT(ulBase == SPI0_BASE);
	ulFlag = xHWREG(ulBase + SPI_FCR) & SPI_FCR_FIFOEN;
	if(ulFlag != SPI_FCR_FIFOEN)
	{
	    if(!(xHWREG(ulBase + SPI_SR) & SPI_SR_TXE))
        {
		    return 0;
        }
	}
	else
	{
	    if(!(xHWREG(ulBase + SPI_SR) & SPI_SR_TXBE))
        {	return 0;
        }
	}  
	if(ucBitLength <= 8 && ucBitLength != 0)
	{
	    xHWREG(ulBase + SPI_DR) = ulData & 0xFF;
	}
	else
	{
	    xHWREG(ulBase + SPI_DR) = ulData & 0xFFFF;
	}
	return 1;
}