Texas Instruments CC2650DK 사용자 설명서

다운로드
페이지 1570
Functional Description
Master bus time-out
Slave transaction received
Slave transaction requested
Stop condition on bus detected
Start condition on bus detected
The I
2
C master and I
2
C slave modules have separate interrupt signals. While both modules can generate
interrupts for multiple conditions, only a single interrupt signal is sent to the interrupt controller (INTC).
21.3.3.1 I
2
C Master Interrupts
The I
2
C master module generates an interrupt when a transaction completes (either transmit or receive),
when arbitration is lost, or when an error occurs during a transaction. To enable the I
2
C master interrupt,
software must set the IM bit in the I
2
C Master Interrupt Mask [I2C_MIMR] register. When an interrupt
condition is met, software must check the ERR and ARBLST bits in the I
2
C Master Control and Status
[I2C_MSTAT] register to verify that an error did not occur during the last transaction, and to ensure that
arbitration has not been lost. An error condition is asserted if the last transaction was not acknowledged
by the slave. If an error is not detected and the master has not lost arbitration, the application can proceed
with the transfer. The interrupt is cleared by setting the IC bit in the I
2
C Master Interrupt Clear [I2C_MICR]
register to 1.
If the application does not require the use of interrupts, the raw interrupt status is always visible through
the I
2
C Master Raw Interrupt Status [I2C_MRIS] register.
21.3.3.2 I
2
C Slave Interrupts
The slave module can generate an interrupt when data is received or requested. This interrupt is enabled
by setting the DATAIM bit in the I
2
C Slave Interrupt Mask [I2C_SIMR] register. Software determines
whether the module should write (transmit) or read (receive) data from the I
2
C Slave Data [I2C_SDR]
register, by checking the RREQ and TREQ bits of the I
2
C Slave Control and Status [I2C_SSTAT] register.
If the slave module is in receive mode and the first byte of a transfer is received, the FBR and RREQ bits
are set. The interrupt is cleared by setting the DATAIC bit in the I
2
C Slave Interrupt Clear [I2C_SICR]
register.
In addition, the slave module can generate an interrupt when a Start and Stop condition is detected.
These interrupts are enabled by setting the STARTIM and STOPIM bits of the [I2C_SIMR] register, and
cleared by setting the STOPIC and STARTIC bits of the [I2C_SICR] register to 1.
If the application does not require the use of interrupts, the raw interrupt status is always visible through
the I
2
C Slave Raw Interrupt Status [I2C_SRIS] register.
21.3.4 Loopback Operation
The I
2
C modules can be placed into an internal-loopback mode for diagnostic or debug work by setting the
LPBK bit in the I
2
C Master Configuration [I2C_MCR] register. In loopback mode, the SDA and SCL signals
from the master and slave modules are tied together.
21.3.5 Command Sequence Flow Charts
This section details the steps required to perform the various I
2
C transfer types in both master and slave
mode. To do this, the SDA and SCL signal configuration must be done in the IOC IOCFG registers.
1383
SWCU117A – February 2015 – Revised March 2015
Inter-Integrated Circuit (I
2
C) Interface
Copyright © 2015, Texas Instruments Incorporated