/* 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);
    while((xHWREG(ulBase + SPI_CNTRL) & SPI_CNTRL_GO_BUSY))
    {
    }
    if (ucBitLength <= 8)
    {
        *pulData = xHWREG(ulBase + SPI_RX0) & 0xFF;
    }
    else if(ucBitLength <= 16)
    {
        *pulData = xHWREG(ulBase + SPI_RX0) & 0xFFFF;
    }
    else
    {
    	*pulData = xHWREG(ulBase + SPI_RX0);
    }
}