/* Enable/disable the 3 wire feature of the specified SPI port. 
In no slave select signal mode, the BIDIROE, SPI_C2, shuld be set as 1. */
void SPI3WireEnable(unsigned long ulBase, unsigned long ulMode)
/* Enable/disable the 3 wire feature of the specified SPI port. 
In no slave select signal mode, the BIDIROE, SPI_C2, shuld be set as 1. */
void SPI3WireEnable(unsigned long ulBase, unsigned long ulMode)
{
    xASSERT((ulBase == SPI0_BASE) || (ulBase == SPI1_BASE));
	xASSERT((ulMode == SPI_MODE_MASTER) || (ulMode == SPI_MODE_SLAVE));
    xHWREGB(ulBase + SPI_C2) |= SPI_C2_SPC0;
    xHWREGB(ulBase + SPI_C2) &= ~SPI_C2_BIDIROE;
    if(ulMode == SPI_MODE_MASTER) 
    {
        xHWREGB(ulBase + SPI_C2) |= SPI_C2_BIDIROE;
    }
}