/* Gets a data element from the SPI interface.  */
void SPIDataRead(unsigned long ulBase, void *pulRData, unsigned long ulLen)
/* Gets a data element from the SPI interface.  */
void SPIDataRead(unsigned long ulBase, void *pulRData, unsigned long ulLen)
{
    unsigned long i;
    unsigned char ucBitLength = SPIBitLengthGet(ulBase);
    xASSERT((ulBase == SPI0_BASE) || (ulBase == SPI1_BASE));
    for (i=0; i<ulLen; i++)
    {
        if (ucBitLength <= 8 && ucBitLength != 0)
        {
            ((unsigned char*)pulRData)[i] = 
            SPISingleDataReadWrite(ulBase, 0xFF);
        }
        else
        {
            ((unsigned short*)pulRData)[i] = 
            SPISingleDataReadWrite(ulBase, 0xFFFF);
        }   
    }
}