/* Send a master transmit request when the bus is idle.(Write Step1) 
For this function returns immediately, it is always using in the interrupt hander. */
void xI2CMasterWriteRequestS1(unsigned long ulBase, unsigned char ucSlaveAddr, unsigned char ucData, xtBoolean bEndTransmition)
/* Send a master transmit request when the bus is idle.(Write Step1) 
For this function returns immediately, it is always using in the interrupt hander. */
void xI2CMasterWriteRequestS1(unsigned long ulBase, unsigned char ucSlaveAddr, unsigned char ucData, xtBoolean bEndTransmition)
{
    unsigned long ulStatus;
    xASSERT((ulBase == I2C0_BASE) || (ulBase == I2C1_BASE));
    xASSERT(!(ucSlaveAddr & 0x80));
    ulStatus = I2CStartSend(ulBase);
    if(!(ulStatus == I2C_I2STAT_M_TX_START))
    {
        I2CStopSend(ulBase);
        return;
    }
    ulStatus = I2CByteSend(ulBase, (ucSlaveAddr << 1)); 
    if(!(ulStatus == I2C_I2STAT_M_TX_SLAW_ACK))
    {
        I2CStopSend(ulBase);
        return;
    }
    xHWREG(ulBase + I2C_O_DAT) = ucData;
    xHWREG(ulBase + I2C_O_CON) |= I2C_CON_SI;
    if(bEndTransmition)
    {
        I2CStopSend(ulBase);
    }
}