The direction of data flow on SDA can be changed by the controller, without first stopping a transfer, by issuing a repeated START condition. This is called a RESTART, see data format in Figure 13-7. After a RESTART is issued, the target address is again sent out with the new data direction specified by the R/W bit.
A repeated start sequence for a Controller transmit is as follows:
- When the device is in the idle state, the Controller writes the target address to the I2Cx.MSA register and configures the DIR bit for the desired transfer type.
- Data is written to the I2Cx.MTXDATA register.
- When the BUSY bit in the MSR register is 0, the BURSTRUN and START bit in the I2Cx.MCTR register need to be set to initiate a transfer.
- Wait till the BUSY bit in the I2Cx.MSR register gets 0.
- The Controller does not generate a STOP condition but instead writes another target address to the I2Cx.MSA register and then sets the BURSTRUN and START bit again with a write operation to
initiate the repeated START.
A repeated start sequence for a Controller receive is similar:
- When the device is in idle, the Controller writes the target address to the I2Cx.MSA register and configures the DIR bit for the desired transfer type.
- When the BUSY bit in the I2Cx.MSR register is 0, the BURSTRUN and START bit in the I2Cx.MCTR register need to be set to initiate a transfer.
- The controller reads data from the I2Cx.MRXDATA register.
- Wait till the BUSY bit in the I2Cx.MSR register gets 0.
- The Controller does not generate a STOP condition but instead writes another target address to the I2Cx.MSA register and then sets the BURSTRUN and START bit again with a write operation to
initiate the repeated START.