46.6.3.13 Handling Errors in Alternative Command

If a NACK is generated by a client device or SMBus timeout error, the TWIHS stops the frame immediately, although the DMA transfer may still be active. To prevent a new frame from being restarted with the remaining DMA data (transmit), the TWIHS prevents any start of frame until the LOCK flag is cleared in TWIHS_SR.

TWIHS_SR.LOCK indicates the state of the TWIHS (locked or not locked).

When the TWIHS is locked, no transfer begins until the LOCK is cleared by TWIHS_CR.LOCKCLR and error flags are cleared by reading TWIHS_SR.

In case of error, TWIHS_THR may have been loaded with a new data. TWIHS_CR.THRCLR can be used to flush TWIHS_THR. If THRCLR is set, the TXRDY and TXCOMP flags are set.