void I2C_Config(void)
{
// Initialize I/Os in Output Mode
GPIO_Init(LEDS_PORT, (LED1_PIN | LED2_PIN), GPIO_MODE_OUT_PP_LOW_FAST);
// Optional: put here as example only
I2C_DeInit();
// Initialize the I2C peripheral
I2C_Init(200000, 0x55, I2C_DUTYCYCLE_2, I2C_ACK_CURR, I2C_ADDMODE_7BIT, 16);
// All LEDs are ON per default
GPIO_WriteHigh(LEDS_PORT, (LED1_PIN | LED2_PIN));
}
这是我的从机初始化程式,可它会在
while(!I2C_CheckEvent(I2C_EVENT_SLAVE_ADDRESS_MATCHED));
I2C_ClearFlag(I2C_FLAG_ADDRESSSENTMATCHED);死等
很郁闷
那位高手能解,万分感激 |