RM0016 Inter-integrated circuit (I
2
C) interface
Doc ID 14587 Rev 8 299/449
Bit 4 STOPF: Stop detection (Slave mode)
(4)(5)
0: No Stop condition detected
1: Stop condition detected
– Set by hardware when a Stop condition is detected on the bus by the slave after an acknowledge (if
ACK=1).
– Cleared by software reading the SR1 register followed by a write in the CR2 register, or by hardware
when PE=0
Bit 3 ADD10: 10-bit header sent (Master mode)
(6)
0: No ADD10 event occurred.
1: Master has sent first address byte (header).
– Set by hardware when the master has sent the first byte in 10-bit address mode.
– Cleared by software reading the SR1 register followed by a write in the DR register of the second
address byte, or by hardware when PE=0.
Bit 2 BTF: Byte transfer finished
(7)(8)
0: Data byte transfer not done
1: Data byte transfer succeeded
– Set by hardware when NOSTRETCH=0 and:
– In reception when a new byte is received (including ACK pulse) and DR has not been read
yet (RXNE=1).
– In transmission when a new byte should be sent and DR has not been written yet (TXE=1).
– Cleared by software reading SR1 followed by either a read or write in the DR register or by hardware
after a start or a stop condition in transmission or when PE=0.
Bit 1 ADDR: Address sent (master mode)/matched (slave mode)
(8)(9)
This bit is cleared by software reading SR1 register followed reading SR3, or by hardware when PE=0.
– Address matched (Slave)
0: Address mismatched or not received.
1: Received address matched.
– Set by hardware as soon as the received slave address matched with the OAR registers
content or a general call or a SMBus is recognized. (when enabled depending on
configuration).
– Address sent (Master)
0: No end of address transmission
1: End of address transmission
– For 10-bit addressing, the bit is set after the ACK of the 2nd byte.
– For 7-bit addressing, the bit is set after the ACK of the byte.
Note: ADDR is not set after a NACK reception
Bit 0 SB: Start bit (Master mode)
(8)
0: No Start condition
1: Start condition generated.
– Set when a Start condition generated.
– Cleared by software by reading the SR1 register followed by writing the DR register, or by
hardware when PE=0
1. The interrupt will be generated when DR is copied into shift register after an ACK pulse. If a NACK is received, copy is not
done and TXE is not set.
2. The interrupt will be generated when Shift register is copied into DR after an ACK pulse.
3. RXNE is not set in case of ARLO event.
4. The STOPF bit is not set after a NACK reception.
5. It is recommended to perform the complete clearing sequence (READ SR1 then WRITE CR2) after STOPF is set. Refer to
Figure 103: Transfer sequence diagram for slave receiver on page 283