GD32F10x User Manual
471
the address and read/write bit. The polynomial used is x8+x2+x+1 (the CRC-8-ATM HEC
algorithm, initialized to zero).
SMBus alert
The SMBus has an extra optional shared interrupt signal called SMBALERT# which can be
used by slaves to tell the host to ask its slaves about events of interest. SMBus also defines
a less common "Host Notify Protocol", providing similar notifications which is based on the
I2C multi-master mode but it can pass more data.
SMBus programming flow
The programming flow for SMBus is similar to normal I2C. In order to use SMBus mode, the
application should configure several SMBus specific registers, respond to some SMBus
specific flags and implement the upper protocols described in SMBus specification.
1.
Before communication, SMBEN bit in I2C_CTL0 should be set and SMBSEL and ARPEN
bits should be configured to desired values.
2.
In order to support address resolution protocol (ARP) (ARPEN=1), the software should
respond to HSTSMB flag in SMBus Host Mode (SMBSEL =1) or DEFSMB flag in SMBus
Device Mode, and implement the function of ARP protocol.
3.
In order to support SMBus Alert Mode, the software should respond to SMBALT flag and
implement the related function.
17.3.12.
Status, errors and interrupts
There are several status and error flags in I2C, and interrupts may be asserted from these
flags by setting some register bits (refer to
Table17-2. Event status flags
Event Flag Name
Description
SBSEND
START signal sent (master)
ADDSEND
Address sent or received
ADD10SEND
Header of 10-bit address sent
STPDET
STOP signal detected
BTC
Byte transmission completed
TBE
I2C_DATA is empty when transmitting
RBNE
I2C_DATA is not empty when receiving
Table17-3. I2C error flags
Error Name
Description
BERR
Bus error
LOSTARB
Arbitration lost
OUERR
Over-run or under-run when SCL stretch is disabled.
Summary of Contents for GD32F10 Series
Page 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Page 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Page 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Page 427: ...GD32F10x User Manual 427 value ...
Page 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...