/* Send a master data transmit request when the master have obtained control of the bus.(Write Step2) 
For this function returns immediately, it is always using in the interrupt hander. */
void I2CMasterWriteRequestS2(unsigned long ulBase, unsigned char ucData, xtBoolean bEndTransmition)
/* Send a master data transmit request when the master have obtained control of the bus.(Write Step2) 
For this function returns immediately, it is always using in the interrupt hander. */
void I2CMasterWriteRequestS2(unsigned long ulBase, unsigned char ucData, xtBoolean bEndTransmition)
{
    unsigned long ulStatus;
    xASSERT((ulBase == I2C1_BASE) || (ulBase == I2C2_BASE));
    xHWREG(ulBase + I2C_DR) = ucData;
    if(bEndTransmition)
    {
        do
        {
            ulStatus = I2CStatusGet(ulBase);
            if(xHWREG(ulBase + I2C_SR1) & 0x0F00)
                break;
        }
        while(!(ulStatus == I2C_EVENT_MASTER_BYTE_TRANSMITTED));
        I2CStopSend(ulBase);
    }
}