/* Test on I2C1 EV8 and clear it */ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED)) /* EV8 */ { } I2C_SendData(I2C1, (u8)(RomAddress &0xff));
/* Test on I2C1 EV8 and clear it */ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED)) /* EV8 */ { } /*----- Reception Phase -----*/ /* Send Re-STRAT condition */ I2C_GenerateSTART(I2C1, ENABLE);
/* Test on EV5 and clear it */ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT)) /* EV5 */ { }
/* Test on I2C1 EV8 and clear it */ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED)) /* EV8 */ { } I2C_SendData(I2C1, (u8)(RomAddress &0xff));
/* Test on I2C1 EV8 and clear it */ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED)) /* EV8 */ { } for(;bytes!=0;bytes--) { // Write8Bit(*Wdata); I2C_SendData(I2C1, *Wdata++);
/* Test on I2C1 EV8 and clear it */ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED)) /* EV8 */ { }