27.3.2.3.2 Receiving Data Packets
Assuming the above S1 case, the slave must
be ready to receive data. When a data packet is received, the Data Interrupt Flag (DIF) in
the Slave Status (TWIn.SSTATUS) register is set to ‘1
’. The action
selected by the Acknowledge Action (ACKACT) bit in the Slave Control B (TWIn.SCTRLB)
register is automatically sent on the bus when a command is written to the Command (SCMD)
bit field in the TWIn.SCTRLB register.
The software can prepare to take one of the following actions:
- Respond with an ACK by writing
‘
0
’ to the ACKACT bit in the TWIn.SCTRLB register, indicating that the slave is ready to receive more data - Respond with a NACK by writing
‘
1
’ to the ACKACT bit, indicating that the slave cannot receive any more data and the master must issue a Stop or repeated Start condition