/* Gets a data element from the SPI interface with block.  */
void xSPIDataGet(unsigned long ulBase, unsigned long *pulData)
/* Gets a data element from the SPI interface with block.  */
void xSPIDataGet(unsigned long ulBase, unsigned long *pulData)
{
    unsigned char ucBitLength = xSPIBitLengthGet(ulBase);
    xASSERT((ulBase == SPI0_BASE) || (ulBase == SPI1_BASE)||
            (ulBase == SPI2_BASE) || (ulBase == SPI3_BASE));
    while((xHWREG(ulBase + SPI_STATUS) & SPI_STATUS_BUSY))
    {
    }
    if (ucBitLength <= 8)
    {
        *pulData = xHWREG(ulBase + SPI_RX) & 0xFF;
    }
    else if(ucBitLength <= 16)
    {
        *pulData = xHWREG(ulBase + SPI_RX) & 0xFFFF;
    }
    else
    {
    	*pulData = xHWREG(ulBase + SPI_RX);
    }
}