/* Wait for M24LCxx Standby state. 
A Stop condition at the end of a Write command triggers the internal Write cycle. */
void M24LCxxWaitEepromStandbyState(void)
/* Wait for M24LCxx Standby state. 
A Stop condition at the end of a Write command triggers the internal Write cycle. */
void M24LCxxWaitEepromStandbyState(void)
{
    volatile unsigned short usSR1Tmp = 0; 
    do
    {
      xHWREG(M24LCxx_PIN_I2C_PORT + I2C_CR1) |= I2C_CR1_START;
      usSR1Tmp = xHWREG(M24LCxx_PIN_I2C_PORT + I2C_SR1);
      xI2CMasterDataPut(M24LCxx_PIN_I2C_PORT, (M24LCxx_ADDRESS << 1) | 0);
    }while(!((xHWREG(M24LCxx_PIN_I2C_PORT + I2C_SR1)) & I2C_SR1_ADDR));
    I2CFlagStatusClear(M24LCxx_PIN_I2C_PORT, I2C_SR1_AF);
    xHWREG(M24LCxx_PIN_I2C_PORT + I2C_CR1) |= I2C_CR1_STOP;
}