/* Wait for 24LC64 Standby state. 
A Stop condition at the end of a Write command triggers the internal Write cycle. */
void _24LC64_WaitEepromStandbyState(void)
/* Wait for 24LC64 Standby state. 
A Stop condition at the end of a Write command triggers the internal Write cycle. */
void _24LC64_WaitEepromStandbyState(void)
{
	unsigned long ulCodeStatus;
	do
	{
		ulCodeStatus = I2CStartSend(_24LC64_I2C_PORT);
		if ((ulCodeStatus != I2C_I2STAT_M_TX_START) &&
			(ulCodeStatus != I2C_I2STAT_M_TX_RESTART))
		{
			I2CStopSend(_24LC64_I2C_PORT);
			continue;
		}
		ulCodeStatus = I2CByteSend(_24LC64_I2C_PORT, (_24LC64_ADDRESS << 1));
		if (ulCodeStatus != I2C_I2STAT_M_TX_SLAW_ACK)
		{
			I2CStopSend(_24LC64_I2C_PORT);
		}
	}while(ulCodeStatus != I2C_I2STAT_M_TX_SLAW_ACK);
}