The FREQUENCY register defines the speed at which data is transmitted over the interface. Enumerators for common frequencies, such as K100 or K400, are provided.
- Fast-mode: 90 kHz to 500 kHz
- Fast-mode plus: 900 kHz to 1100 kHz
TWIM is started by triggering the DMA.TX.START or DMA.RX.START tasks, and stopped by triggering the STOP task. If TWIM is running when the STOP task is triggered, it stops and generates a STOPPED event.
After TWIM starts, the DMA.TX.START and DMA.RX.START tasks must not be triggered again until TWIM has issued a LASTRX, LASTTX, or STOPPED event.
TWIM can be suspended using the SUSPEND task, which is useful when using TWIM in a low priority interrupt context. When TWIM enters the SUSPEND state, it will automatically issue a SUSPENDED event while performing a continuous clock stretching. This continues until a RESUME task is received. TWIM cannot be stopped while it is suspended. The STOP task must be issued after TWIM resumes operation.
If a NACK is clocked in from the target, TWIM generates an ERROR event.