www
.mcu.com.cn
189
/
239
Rev.
1.00
CMS80F731x Reference Manual
The status register consists of three bits: sendfin bit, RREQ bit, TREQ bit. The SENDFIN bit of Send Complete indicates
that the Master I2C controller has completed the receipt of data during a single or continuous I2CS transmit operation. The
Receive Request RREQ bit indicates that the I2CS device has receiveda data byte from the I2C master, and the I2CS device
should read a data byte from the receiving data register I2CSBUF. The Send Request TREQ bit indicates that the I2CS device
is addressed as a slave transmitter, and the I2CS device should write a byte of data to the transmit data register I2CSBUF. If
the I2C interrupt enable is on, any of the 3 flags at 1 will produce an interrupt.
The bus busy flag in the slave mode is judged by bit6 (BUS_BUSY) of the master mode status register I2CMSR, which is
0x20 when the bus is idle, the I2CMSR register is 0x60 when the start condition is generated and the stop condition is generated,
and the I2CMSR is 0x20 when the stop condition is generated.
Slave mode status register I2CSSR
0xF2
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
I2CSSR
--
--
--
--
--
SENDFIN
TREQ
RREQ
R/W
--
--
--
--
--
R
R
R
Reset value
0
0
0
0
0
0
0
0
Bit7~Bit3
--
Reserved, must be 0.
Bit2
SENDFIN:
I2C Slave mode sends the operation completion flag bit, read-only.
1=
The data is no longer required by the master device, the TREQ is no longer set to 1, and the data
transfer has been completed. (Automatic zeroing after reading I2CSCR).
0=
--
Bit1
TREQ:
I2C Slave mode prepares to send flag bits, read-only.
1=
As the transmitting device has been addressed, the master device is ready to receive data. (Auto
zero after writing I2CSBUF).
0=
--
Bit0
RREQ:
I2C slave mode receives completion flag bits, read-only.
1=
Received. (Automatic zeroing after reading I2CSBUF).
0=
Not received.
21.4.3
I2C Slave Mode Transmit and Receive Buffer Registers I2CSBUF
0xF3
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
I2CSBUF
I2CSBUF7
I2CSBUF6
I2CSBUF5
I2CSBUF4
I2CSBUF3
I2CSBUF2
I2CSBUF1
I2CSBUF0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Reset value
0
0
0
0
0
0
0
0
Bit7~Bit0
I2CSBUF<7:0>:
data sent or received by I 2C;
Write operation:
Write the data that will be sent (the order of sending is from the high bit to the low bit);
Read operation:
Data that has been received.