/* Send a master receive request when the bus is idle.(Read Step1) 
For this function returns immediately, it is always using in the interrupt hander. */
void I2CMasterReadRequestS1(unsigned long ulBase, unsigned char ucSlaveAddr, xtBoolean bEndTransmition)
/* Send a master receive request when the bus is idle.(Read Step1) 
For this function returns immediately, it is always using in the interrupt hander. */
void I2CMasterReadRequestS1(unsigned long ulBase, unsigned char ucSlaveAddr, xtBoolean bEndTransmition)
{
    unsigned long ulStatus;
    xASSERT((ulBase == I2C0_BASE));
    xHWREG(ulBase + I2C_CR) |= I2C_CR_AA;
    xHWREG(ulBase + I2C_TAR) = ucSlaveAddr | (I2C_TAR_RWD);
    do
    {
        ulStatus = I2CStatusGet(ulBase);  
        if(xHWREG(ulBase + I2C_CSR) & 0x0700)
            break;
    }
    while(!(ulStatus == I2C_MASTER_RECEIVER_MODE));
    if(bEndTransmition)
    {
        xHWREG(ulBase + I2C_CR) &= ~I2C_CR_AA;
        do
        {
            ulStatus = I2CStatusGet(ulBase);  
            if(xHWREG(ulBase + I2C_CSR) & 0x0700)
                break;
        }
        while(!(ulStatus == I2C_MASTER_RX_NOT_EMPTY));
        I2CStopSend(ulBase);
    }
}