I am trying to perform the interrupt service routine of an i2c slave receiver on stm32f4. Here is my smart piece of code.
void I2C2_EV_IRQHandler() { switch (I2C_GetLastEvent(I2C2)) {
}
The interrupt will be called and the case I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED will be introduced. Now SCL is low. The reference manual says that if I clear the address flag, the clock will continue and the data will be sent (Page 579 - slave receiver). In my opinion, an interrupt is always called if any data arrives, and the next state will be I2C_EVENT_SLAVE_BYTE_RECEIVED.
I can not find any example from stm or via google. Can someone help me or show me an example.
source share