www.geehy.com Page 281
IDLECLKTO=1 and the high-level time of SDA and SCL exceeds the
time defined by TIMEOUTA[11:0] bit field.
(
2
)
SMBus idle timeout is detected
The accumulative time of low extension of master clock reaches the
time (t
LOW:MEXT
) defined by TIMEOUTB[11:0] bit field.
The accumulative time of low extension of slave clock reaches the
time (t
LOW:SEXT
) defined by TIMEOUTB[11:0] bit field.
When a TIMEOUT error is detected, TTEFLG flag of I2C_STS register will be set
to 1 by hardware; if ERRIEN bit of I2C_CTRL1 register is set to 1, an interrupt
will be generated.
22.5.4.5
DMA request
DMA transmission can be enabled by setting DMATXEN bit of I2C_CTRL1
register. The data is put into the SRAM area set by DMA peripheral in advance
and transmitted to I2C_TXDATA register (not needing to consider the state of
TXINTFLG bit).
Only use DMA to transmit bytes:
Master mode: Initialization, slave address, direction, byte number and
start bit are set by software (when the slave address has been
transmitted, DMA cannot be used for transmission). When all data are
transmitted by DMA, DMA must be initialized before START bit is set to
1.
Slave mode: DMA must be initialized before the address matching
event.
I2C Interrupt
Table 74 Interrupt Request List
Interrupt event
Event flag bit
Method of clearing the event
flag bit
Interrupt enable
control bit
Received character is not
empty
RXBNEFLG
Read I2C_RXDATA register
RXIEN
Transmit interrupt state
TXINTFLG
Write I2C_TXDATA register
TXIEN
Stop signal detection flag
STOPFLG
Write STOPCLR=1
STOPIEN
Transmission completion
reload
TXCRFLG
Write I2C_CTRL2 and
NUMBYT[7:0] is not 0
TXCIEN
Transmission completed
TXCFLG
Write START=1 or STOP=1
Address match
ADDRMFLG
Write ADDRMCLR=1
SADDRMIEN
Receive NACK flag bit
NACKFLG
Write NACKCLR=1
NACKRXIEN
Bus error
BERRFLG
Write BERRCLR=1
ERRIEN
Arbitration loss
ALFLG
Write ALCLR=1
Overrun/Underrun error
OVRURFLG
Write OVRURCLR=1
PEC error
PECEFLG
Write PECECLR=1
Clock timeout
TTEFLG
Write TTECLR=1
SMBus reminder
SMBALTFLG
Write SMBALTCLR=1
To enable I2C interrupt, it is required to: