GD32F20x User Manual
526
register and enters master mode. Now software should clear the SBSEND bit by reading
I2C_STAT0 and then writing a 7-bit address or header of a 10-bit address to I2C_DATA.
I2C begins to send address or header to I2C bus as soon as SBSEND bit is cleared. If
the address sent is a header of 10-bit address, the hardware sets ADD10S END bit after
sending header and software should clear the ADD10SEND bit by reading I2C_STAT0
and writing 10-bit lower address to I2C_DATA.
4.
After the 7-bit or 10-bit address is sent, the I2C hardware sets the ADDSEND bit and
software should clear the ADDSEND bit by reading I2C_STAT0 and then I2C_STAT1.
5.
Now I2C enters data transmission stage and hardware sets TBE bit because both the
shift register and data register I2C_DATA are empty. Software now write the first byte
data to I2C_DATA register, but the TBE is not cleared because the write byte in
I2C_DATA is moved to internal shift register immediately. The I2C begins to transmit data
to I2C bus as soon as shift register is not empty.
6.
During the first byte’s transmission, software can write the second byte to I2C_DATA,
and this time TBE is cleared because neither I2C_DATA nor shift register is empty.
7.
Any time TBE is set, software can write a byte to I2C_DATA as long as there are still data
to be transmitted.
8.
During the second last byte’s transmission, software write the last data to I2C_DATA to
clear the TBE flag and doesn’t care TBE anymore. So TBE will be asserted after the
byte’s transmission and not cleared until a STOP condition.
9.
After sending the last byte, I2C master sets BTC bit because both shift register and
I2C_DATA are empty. Software should program a STOP request now, and the I2C clears
both TBE and BTC flags after sending a STOP condition.
Содержание GD32F20 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F20x ARM Cortex M3 32 bit MCU User Manual Revision 2 2 Oct 2019 ...
Страница 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Страница 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Страница 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Страница 385: ...GD32F20x User Manual 385 ...
Страница 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...