/* Set the clock rate of the specified I2C port. 
The  */
void I2CSlaveInit(unsigned long ulBase, unsigned short usSlaveAddr, unsigned long ulGeneralCall, unsigned long ulAddrBit)
/* Set the clock rate of the specified I2C port. 
The  */
void I2CSlaveInit(unsigned long ulBase, unsigned short usSlaveAddr, unsigned long ulGeneralCall, unsigned long ulAddrBit)
{
    xASSERT((ulBase == I2C0_BASE) || ((ulBase == I2C1_BASE)));    
    xHWREGB(ulBase + I2C_CON2) &= ~(I2C_CON2_GCAEN | I2C_CON2_ADEXT);
    xHWREGB(ulBase + I2C_CON2) = ulGeneralCall | ulAddrBit;
    if(ulAddrBit == I2C_ADDRESS_7BIT)
    {
        xHWREGB(ulBase + I2C_A1) = (usSlaveAddr << 1);
    }
    else
    {
        xHWREGB(ulBase + I2C_A1) = (usSlaveAddr & 0xFF) << 1;
        xHWREGB(ulBase + I2C_CON2) = (usSlaveAddr & 0x700) >> 8;
    }
    xHWREGB(ulBase + I2C_CON1) &= ~I2C_CON1_MST;
}