/* Set the slave select pins of the specified SPI port.  */
void xSPISSSet(unsigned long ulBase, unsigned long ulSSMode, unsigned long ulSlaveSel)
/* Set the slave select pins of the specified SPI port.  */
void xSPISSSet(unsigned long ulBase, unsigned long ulSSMode, unsigned long ulSlaveSel)
{
    xASSERT(ulBase == SPI0_BASE);
    xHWREG(ulBase + SPI_CNTRL1) &= ~SPI_CNTRL1_SELM;
    xHWREG(ulBase + SPI_CNTRL1) |= ulSSMode;
    if(ulSSMode == xSPI_SS_SOFTWARE)
    {
        xHWREG(ulBase + SPI_CNTRL0) = SPI_CNTRL0_SELOEN;
        xHWREG(ulBase + SPI_CNTRL0) |= SPI_CNTRL0_SSELC;
    }
	else if(ulSSMode == xSPI_SS_HARDWARE)
	{
	    xHWREG(ulBase + SPI_CNTRL0) = SPI_CNTRL0_SELOEN;
	}
}