void I2C_EE_WaitEepromStandbyState(void) { vu16 SR1_Tmp = 0;
do { /* Send START condition */ I2C_GenerateSTART(I2C1, ENABLE); /* Read I2C1 SR1 register */ SR1_Tmp = I2C_ReadRegister(I2C1, I2C_Register_SR1); /* Send EEPROM address for write */ I2C_Send7bitAddress(I2C1, EEPROM_ADDRESS, I2C_Direction_Transmitter); }while(!(I2C_ReadRegister(I2C1, I2C_Register_SR1) & 0x0002));
/* Clear AF flag */ I2C_ClearFlag(I2C1, I2C_FLAG_AF); } 这段程序的作用是 Wait for EEPROM Standby state, 谁能给讲讲这里的原理, 这里只有开始条件,没有结束条件,为什么?? |