/* Read a data from a slave when the bus is idle, and waiting for all bus transmiton complete.(Read Step1) 
This function is usually used in thread mode. */
unsigned long I2CMasterReadS1(unsigned long ulBase, unsigned char ucSlaveAddr, unsigned char *pucData, xtBoolean bEndTransmition)
/* Read a data from a slave when the bus is idle, and waiting for all bus transmiton complete.(Read Step1) 
This function is usually used in thread mode. */
unsigned long I2CMasterReadS1(unsigned long ulBase, unsigned char ucSlaveAddr, unsigned char *pucData, xtBoolean bEndTransmition)
{
    unsigned long ulStatus;
    xASSERT((ulBase == I2C0_BASE) || ((ulBase == I2C1_BASE)));
    xASSERT(pucData);
    xI2CMasterReadRequestS1(ulBase, ucSlaveAddr, xfalse);
    SysCtlDelay(100);
    xHWREGB(ulBase + I2C_STATUS) |= I2C_STATUS_IF;
    while (!(xHWREGB(ulBase + I2C_STATUS) & I2C_STATUS_IF));
    *pucData = xHWREGB(ulBase + I2C_DAT);
    ulStatus = (xHWREGB(ulBase + I2C_STATUS));
    if (ulStatus != I2C_MASTER_EVENT_RX)
    {
        ulStatus = xI2CMasterError(ulBase);
        I2CStopSend(ulBase);
        return ulStatus;
    }      
    if(bEndTransmition)
    {
        I2CStopSend(ulBase);
    }
    return xI2C_MASTER_ERR_NONE;       
}