The following two figures show the flow diagram for the I2C programming sequence.
Figure 1.
I2C Manager
Interrupt Example Software Flowchart
Figure 2.
I2C Polling
Example Flowchart