* When set, the I2C is at reset state.
*/
I2C_SoftwareResetCmd(ENABLE);
/*
* Before resetting this bit, make sure the I2C lines are released and
* the bus is free.
*/
GPIO_Init(GPIOB, GPIO_PIN_4, GPIO_MODE_OUT_OD_LOW_FAST);
GPIO_Init(GPIOB, GPIO_PIN_5, GPIO_MODE_OUT_OD_LOW_FAST);
GPIO_WriteHigh(GPIOB,GPIO_PIN_4);
GPIO_WriteHigh(GPIOB,GPIO_PIN_5);
kkk=10000;
while(kkk--);//50ms
I2C_SoftwareResetCmd(DISABLE);
I2C_Init(10000, 0xA0, I2C_DUTYCYCLE_2, I2C_ACK_CURR, I2C_ADDMODE_7BIT, 16);
kkk=2000;
while(kkk--);//10ms