The following figure shows the TWIS state machine.
The following table contains descriptions of the symbols used in the state machine.
| Symbol | Type | Description |
|---|---|---|
| ENABLE | Register | TWIS enabled via the ENABLE register. |
| PREPARETX | Task | The TASKS_PREPARETX task was triggered. |
| STOP | Task | The TASKS_STOP task was triggered. |
| PREPARERX | Task | The TASKS_PREPARERX task was triggered. |
| STOPPED | Event | The EVENTS_STOPPED event was generated. |
| DMA.RX.READY | Event | The EVENTS_DMA.RX.READY event was generated. |
| DMA.TX.READY | Event | The EVENTS_DMA.TX.READY event was generated. |
| TX prepared | Internal | Internal flag indicating that a TASKS_PREPARETX task was triggered. |
| RX prepared | Internal | Internal flag indicating that a TASKS_PREPARERX task was triggered. |
| Unprepare TX | Internal | Clears the TX prepared flag until the next TASKS_PREPARETX task. |
| Unprepare RX | Internal | Clears the RX prepared flag until the next TASKS_PREPARERX task. |
| Stop condition | TWI protocol | A TWI stop condition was detected. |
| Restart condition | TWI protocol | A TWI restart condition was detected. |
TWIS supports clock stretching. In order to use this feature, the controller must also support clock stretching for the feature to execute properly. TWIS operates in a low-power mode while waiting for the TWI controller to initiate a transfer. As long as TWIS is not addressed, it will remain in this mode.
For TWIS to run correctly, PSEL.SCL, PSEL.SDA, CONFIG, and the ADDRESS[n] registers must be configured, the SCL and SDA lines must both be high, before enabling TWIS through the ENABLE register. Similarly, changing these settings must be performed while TWIS is disabled. Failing to do so may result in unpredictable behavior.