SWCU193 April 2023 CC2340R2 , CC2340R5 , CC2340R5-Q1
Table 21-1 lists the memory-mapped registers for the I2C registers. All register offset addresses not listed in Table 21-1 should be considered as reserved locations and the register contents should not be modified.
Offset | Acronym | Register Name | Section |
---|---|---|---|
0h | TOAR | Target Own Address | Go |
4h | TSTA | Target Control and Status | Go |
4h | TCTL | Target control | Go |
8h | TDR | Target Data | Go |
Ch | TIMR | Target Interrupt Mask | Go |
10h | TRIS | Target Raw Interrupt Status | Go |
14h | TMIS | Target Masked Interrupt Status | Go |
18h | TICR | Target Interrupt Clear | Go |
800h | CTA | Controller Target Address | Go |
804h | CSTA | Controller Control and Status | Go |
804h | CCTL | Controller control | Go |
808h | CDR | Controller Data | Go |
80Ch | CTPR | Controller Timer Period | Go |
810h | CIMR | Controller Interrupt Mask | Go |
814h | CRIS | Controller Raw Interrupt Status | Go |
818h | CMIS | Controller Masked Interrupt Status | Go |
81Ch | CICR | Controller Interrupt Clear | Go |
820h | CCR | Controller Configuration | Go |
Complex bit access types are encoded to fit into small table cells. Table 21-2 shows the codes that are used for access types in this section.
Access Type | Code | Description |
---|---|---|
Read Type | ||
R | R | Read |
Write Type | ||
W | W | Write |
Reset or Default Value | ||
-n | Value after reset or the default value |
TOAR is shown in Table 21-3.
Return to the Summary Table.
Target Own Address
This register consists of seven address bits that identify this I2C device on the I2C bus.
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-7 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
6-0 | OAR | R/W | 0h | Target own address. This field specifies bits a6 through a0 of the target address. |
TSTA is shown in Table 21-4.
Return to the Summary Table.
Target status
This register functions as a status register of the target.
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-3 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
2 | FBR | R | 0h | First byte received. This bit is only applicable when the TSTA.RREQ bit is set and is automatically cleared when data has been read from the TDR register. Note: This bit is not used for target transmit operations. 0h = The first byte following the target's own address has not been received 1h = The first byte following the target's own address has been received. |
1 | TREQ | R | 0h | This field reflects the transmit request status
0h = No outstanding transmit request 1h = The I2C has been addressed as a target transmitter and is using clock stretching to delay the controller until data has been written to the TDR register |
0 | RREQ | R | 0h | This field reflects the receive request status.
0h = No outstanding receive data 1h = The target has outstanding receive data from the external controller and is using clock stretching to delay the controller until data has been read from the TDR register |
TCTL is shown in Table 21-5.
Return to the Summary Table.
Target control
This registers functions as a target control register
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-1 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
0 | DA | W | 0h | This field sets the device active control
0h = Disable the target operation 1h = Enable the target operation |
TDR is shown in Table 21-6.
Return to the Summary Table.
Target data register
This register contains the data to be transmitted when in the target transmit state, and the data received
when in the target receive state.
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-8 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
7-0 | DATA | R/W | 0h | Data for transfer. This field contains the data for transfer during a target receive or a transmit operation. When written, the register data is used as transmit data. When read, this register returns the last data received. Data is stored until next update, either by a system write to the controller for transmit or by an external controller to the target for receive. |
TIMR is shown in Table 21-7.
Return to the Summary Table.
Target interrupt mask
This register controls whether a raw interrupt is promoted to a controller interrupt
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-3 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
2 | STOPIM | R/W | 0h | Stop condition interrupt mask
0h = Disable interrupt mask 1h = Enable interrupt mask |
1 | STARTIM | R/W | 0h | Start condition interrupt mask
0h = Disable interrupt mask 1h = Enable interrupt mask |
0 | DATAIM | R/W | 0h | Data interrupt mask
0h = Disable interrupt mask 1h = Enable interrupt mask |
TRIS is shown in Table 21-8.
Return to the Summary Table.
Target raw interrupt status
This register shows the unmasked interrupt status.
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-3 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
2 | STOPRIS | R | 0h | Stop condition raw interrupt status This bit is cleared by writing a 1 to TICR.STOPIC. 0h = Interrupt did not occur 1h = Interrupt occured |
1 | STARTRIS | R | 0h | Start condition raw interrupt status This bit is cleared by writing a 1 to TICR.STARTIC. 0h = Interrupt did not occur 1h = Interrupt occured |
0 | DATARIS | R | 0h | Data raw interrupt status This bit is cleared by writing a 1 to TICR.DATAIC. 0h = Interrupt did not occur 1h = Interrupt occured |
TMIS is shown in Table 21-9.
Return to the Summary Table.
Target Masked Interrupt Status
This register shows which interrupt is active (based on result from TRIS and TIMR registers).
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-3 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
2 | STOPMIS | R | 0h | Stop condition masked interrupt status This bit is cleared by writing a 1 to TICR.STOPIC. 0h = Masked interrupt did not occur 1h = Masked interrupt occured |
1 | STARTMIS | R | 0h | Start condition masked interrupt status This bit is cleared by writing a 1 to TICR.STARTIC. 0h = Masked interrupt did not occur 1h = Masked interrput occured |
0 | DATAMIS | R | 0h | Start condition masked interrupt status This bit is cleared by writing a 1 to TICR.DATAIC. 0h = Masked interrupt did not occur 1h = Masked interrupt occured |
TICR is shown in Table 21-10.
Return to the Summary Table.
Target Interrupt Clear
This register clears the raw interrupt TRIS
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-3 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
2 | STOPIC | W | 0h | Stop condition interrupt clear
0h = No effect 1h = Clear interrupt Writing 1 to this bit clears TRIS.STOPRIS and TMIS.STOPMIS |
1 | STARTIC | W | 0h | Start condition interrupt clear
0h = No effect 1h = Clear interrupt Writing 1 to this bit clears TRIS.STARTRIS and TMIS.STARTMIS |
0 | DATAIC | W | 0h | Data interrupt clear
0h = No effect 1h = Clear interrupt Writing 1 to this bit clears TRIS.DATARIS and TMIS.DATAMIS |
CTA is shown in Table 21-11.
Return to the Summary Table.
Controller target address
This register contains seven address bits of the target to be accessed by the controller (a6-a0), and an CTA.RS bit determining if the next operation is a receive or transmit
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-8 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
7-1 | SA | R/W | 0h | Controller target address Defines which target is addressed for the transaction in controller mode |
0 | RS | R/W | 0h | Receive or Send This bit-field specifies the next operation with addressed target CTA.SA. 0h = Transmit/send data to target 1h = Receive data from target |
CSTA is shown in Table 21-12.
Return to the Summary Table.
Controller status
This register functions as a controller status register
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-7 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
6 | BUSBSY | R | 0h | Bus busy Note:The bit changes based on the CCTRL.START and CCTRL.STOP conditions. 0h = The bus is idle. 1h = The bus is busy. |
5 | IDLE | R | 1h | This field specifies whether I2C is idle or not
0h = The controller is not idle. 1h = The controller is idle. |
4 | ARBLST | R | 0h | The filed specifies the arbitration status
0h = The controller won arbitration. 1h = The controller lost arbitration. |
3 | DATACKN | R | 0h | This field contains Data acknowledge status
0h = The transmitted data was acknowledged 1h = The transmitted data was not acknowledged |
2 | ADRACKN | R | 0h | This field reflects the address acknowledge status
0h = The transmitted address was acknowledged 1h = The transmitted address was not acknowledged |
1 | ERR | R | 0h | This field reflects the error status
0h = No error was detected on the last operation 1h = An error occurred with the last operation |
0 | BUSY | R | 0h | This field reflects the I2C busy status Note: The I2C controller requires four CLKSVT clock cycles to assert the BUSY status after I2C controller operation has been initiated through a write into CCTL register. Hence after programming CCTL register, application is requested to wait for four CLKSVT clock cycles before issuing a controller status inquiry through a read from CSTA register. Any prior inquiry would result in wrong status being reported. 0h = The controller is idle 1h = The controller is busy |
CCTL is shown in Table 21-13.
Return to the Summary Table.
Controller control
This register functions as a controller control register
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-4 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
3 | ACK | W | 0h | This field is to enable the data acknowledge. Note:This bit-field must be cleared when the I2C bus controller requires no further data to be transmitted from the target transmitter. 0h = The received data byte is not acknowledged automatically by the controller 1h = The received data byte is acknowledged automatically by the controller |
2 | STOP | W | 0h | This field is to set stop condition . Note: This bit-field determines if the cycle stops at the end of the data cycle or continues on to a repeated start condition. 0h = The controller does not generate the stop condition 1h = The controller generates the stop condition |
1 | START | W | 0h | This field is to set start or repeated start condition.
0h = The controller does not generate the start condition 1h = The controller generates the start condition. |
0 | RUN | W | 0h | This field is to set the controller enable.
0h = The controller is disabled. 1h = The controller is enabled to transmit or receive data |
CDR is shown in Table 21-14.
Return to the Summary Table.
Controller data
This register contains the data to be transmitted when in the controller transmit state and the data received when in the controller receive state.
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-8 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
7-0 | DATA | R/W | 0h | When Read: Last RX Data is returned When Written: Data is transferred during TX transaction |
CTPR is shown in Table 21-15.
Return to the Summary Table.
Controller timer period
This register specifies the period of the SCL clock.
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-8 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
7 | TPR_7 | R/W | 0h | Must be set to 0 to set CTPR.TPR. If set to 1, a write to CTPR.TPR will be ignored. |
6-0 | TPR | R/W | 1h | SCL clock period This field specifies the period of the SCL clock. SCL_PRD = 2*(1+TPR)*(SCL_LP + SCL_HP)*CLK_PRD, where: SCL_PRD is the SCL line period (I2C clock). TPR is the timer period register value (range of 1 to 127) SCL_LP is the SCL low period (fixed at 6). SCL_HP is the SCL high period (fixed at 4). CLK_PRD is the CLKSVT period in ns. |
CIMR is shown in Table 21-16.
Return to the Summary Table.
Controller interrupt mask
This register controls whether a raw interrupt is promoted to a controller interrupt.
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-1 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
0 | IM | R/W | 0h | Interrupt mask
0h = Disable interrupt mask 1h = Enable interrupt mask |
CRIS is shown in Table 21-17.
Return to the Summary Table.
Controller raw interrupt status
This register shows the unmasked interrupt status.
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-1 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
0 | RIS | R | 0h | Raw interrupt status This bit is cleared by writing 1 to CICR.IC bit. 0h = Interrupt did not occur 1h = Interrupt occured |
CMIS is shown in Table 21-18.
Return to the Summary Table.
Controller masked interrupt status
This register shows which interrupt is active (based on result from CRIS and CIMR registers).
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-1 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
0 | MIS | R | 0h | Masked interrupt status This bit is cleared by writing 1 to CICR.IC bit. 0h = Masked interrupt did not occur 1h = Masked interrupt occured |
CICR is shown in Table 21-19.
Return to the Summary Table.
Controller interrupt clear
This register clears the raw and masked interrupt.
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-1 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
0 | IC | W | 0h | Interrupt clear
0h = No effect 1h = Clear Interrupt Writing 1 to this bit clears CRIS.RIS and CMIS.MIS. |
CCR is shown in Table 21-20.
Return to the Summary Table.
Controller Configuration
This register configures the mode (Controller or Target) and sets the interface for test mode loopback.
Bit | Field | Type | Reset | Description |
---|---|---|---|---|
31-6 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
5 | TFE | R/W | 0h | I2C target function enable 0h = Target mode disabled 1h = Target mode enabled |
4 | CFE | R/W | 0h | I2C controller function enable
0h = Controller mode disabled 1h = Controller mode enabled |
3-1 | RESERVED | R | 0h | Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior. |
0 | LPBK | R/W | 0h | I2C loopback
0h = Test mode (Loopback operation) disabled 1h = Test mode (Loopback operation) enabled |