\n
address_offset : 0x0 Bytes (0x0)
size : 0x1000 byte (0x0)
mem_usage : registers
protection : not protected
I2C Control register
address_offset : 0x0 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
PE : I2C enable disable:
Enumeration:
0 : DISABLE
I2C disable
1 : ENABLE
I2C enable
End of enumeration elements list.
OM : Select the operating mode:
Enumeration:
0x00 : SLAVE
The peripheral can only respond (transmit/receive) when addressed by a master device
0x01 : MASTER
The peripheral works in a multi-master system where itself cannot be addressed by another master device. It can only initiate a new transfer as master device
0x02 : MASTER_SLAVE
The peripheral works in a multi-master system where itself can be addressed by another master device, besides to initiate a transfer as master device
End of enumeration elements list.
SAM : Slave addressing mode. SAM defines the slave addressing mode when the peripheral works in slave or master/slave mode. The received address is compared with the content of the register SCR.
Enumeration:
0x00 : ADDR_7BIT
7-bit addressing mode
0x01 : ADDR_10BIT
10-bit addressing mode
End of enumeration elements list.
SM : Speed mode. SM defines the speed mode related to the serial bit rate:
Enumeration:
0x00 : STANDARD_MODE
Standard mode (up to 100 K/s)
0x01 : FAST_MODE
Fast mode (up to 400 K/s)
End of enumeration elements list.
SGCM : Slave general call mode defines the operating mode of the slave controller when a general call is received. This setting does not affect the hardware general call that is always managed in transparent mode.
Enumeration:
0x00 : TRANSPARENT_MODE
Transparent mode, the slave receiver recognizes the general call ut any action is taken by software after the decoding of the message included in the Rx FIFO
0x01 : DIRECT_MODE
Direct mode, the slave receiver recognizes the general call and executes directly (without software intervention) the related actions. Only the status code word is stored in the SR register for notification to the application
End of enumeration elements list.
FTX : FTX flushes the transmit circuitry (FIFO, fsm). The configuration of the I2C node (register setting) is not affected by the flushing operation. The flushing operation is performed on modules working on different clock domains (system and I2C clocks) and needs several system clock cycles before being completed. Upon completion, the I2C node (internal logic) clears this bit. The application must not access the Tx FIFO during the flushing operation and should poll on this bit waiting for completion.
FRX : FRX flushes the receive circuitry (FIFO, fsm).The configuration of the I2C node (register setting) is not affected by the flushing operation. The flushing operation is performed on modules working on different clock domains (system and I2C clocks) and needs several system clock cycles before to be completed. Upon completion, the I2C node (internal logic) clears this bit. The application must not access the Rx FIFO during the flushing operation and should poll on this bit waiting for the completion.
DMA_TX_EN : Enables the DMA TX interface.
Enumeration:
0x00 : DISABLE
DMA TX interface disable
0x01 : ENABLE
DMA TX interface enable
End of enumeration elements list.
DMA_RX_EN : Enables the DMA RX interface.
Enumeration:
0x00 : DISABLE
DMA RX interface disable
0x01 : ENABLE
DMA RX interface enable
End of enumeration elements list.
FON : Filtering on sets the digital filters on the SDA, SCL line, according to the I2C bus requirements, when standard open-drain pads are used:
Enumeration:
0x00 : NONE
No digital filters are inserted
0x01 : CK1_SPIKES
Digital filters (filter 1 ck wide spikes) are inserted
0x02 : CK2_SPIKES
Digital filters (filter 2 ck wide spikes) are inserted
0x03 : CK4_SPIKES
Digital filters (filter 4 ck wide spikes) are inserted
End of enumeration elements list.
FS_1 : Force stop enable bit. When set to 1b, the STOP condition is generated.
Enumeration:
0x00 : DISABLE
Force stop disable
0x01 : ENABLE
Force stop enable
End of enumeration elements list.
I2C transmit FIFO register
address_offset : 0x10 Bytes (0x0)
size : 8 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
TDATA : Transmission Data. TDATA contains the payload related to a master write or read-from-slave operation to be written in the Tx FIFO. TDATA(0) is the first LSB bit transmitted over the I2C line.
In case of master write operation, the Tx FIFO shall be preloaded otherwise the I2C controller cannot start the operation until data are available.
In case of read-from-slave operation, when the slave is addressed, the interrupt RISR:RFSR bit is asserted and the CPU shall download the data in the FIFO. If the FIFO is empty and the I2C master is still requiring data, a new request (RISR:RFSE interrupt bit) is asserted to require additional data to the CPU. The slave controller stretches the I2C clock line when no data are available for transmission. Since the Tx FIFO could contain some pending data related to the previous transfer (the transfer length may be unknown to the slave controller), the Tx FIFO is self-flushed before asserting the I2C_RISR:RFSR bit. Upon completion of the read-from-slave operation the interrupt bit I2C_RISR:STD is asserted and the related status of the operation is stored in the I2C_SR register. In CPU mode, the FIFO management shall be based on the assertion of the interrupt bit RISR:TXFNE, related to the nearly-empty threshold.
In DMA mode, the single/burst requests are automatically executed based on the number of entries available in the TX FIFO and the related destination burst size programmed in the I2C_DMAR:DBSIZE_TX register field. The DMA requests are terminated at the end of the I2C read operation (notacknowledge received by the master) by a dummy last single/burst request.
I2C status register
address_offset : 0x14 Bytes (0x0)
size : 32 bit
access : read-only
reset_value : 0x0
reset_Mask : 0x0
OP : Operation:
Enumeration:
0x00 : MW
Master write operation
0x01 : MR
Master read operation
0x02 : WTS
Write to slave operation
0x03 : RFS
Read from slave operation
End of enumeration elements list.
STATUS : Controller status. Valid for the operations MW, MR, WTS RFS:
Enumeration:
0x00 : NOP
No operation is in progress
0x01 : ON_GOING
An operation is ongoing
0x02 : OK
The operation (OP field) has been completed successfully
0x03 : ABORT
The operation (OP field) has been aborted due to the occurrence of the event descried in the CAUSE field
End of enumeration elements list.
CAUSE : Abort cause. This field is valid only when the STATUS field contains the ABORT tag. Others: RESERVED.
Enumeration:
0x00 : NACK_ADDR
The master receives a not-acknowledge after the transmission of the address
0x01 : NACK_DATA
The master receives a not-acknowledge during the data phase of a MW operation
0x03 : ARB_LOST
The master loses the arbitration during a MW or MR operation
0x04 : BERR_START
Slave restarts, a START Condition occurs while the byte transfer is not terminated
0x05 : BERR_STOP
Slave reset, a STOP Condition while the byte transfer is not terminated
0x06 : OVFL
The slave receives a frame related to the WTS operation longer than the maximum size = 2047 bytes
End of enumeration elements list.
TYPE : Receive type. Valid only for the operation WTS:
Enumeration:
0x00 : FRAME
The slave has received a normal frame
0x01 : GCALL
The slave has received a general call
0x02 : HW_GCALL
The slave has received a hardware general call
End of enumeration elements list.
LENGTH : Transfer length. For an MR, WTS operation the LENGTH field defines the actual size of the subsequent payload, in terms of number of bytes. For an MW, RFS operation the LENGTH field defines the actual number of bytes transferred by the master/slave device. For a WTS operation if the transfer length exceeds 2047 bytes, the operation is stopped by the slave returning a NACK handshake and the flag OVFL is set. For an RFS operation if the transfer length exceeds 2047 bytes, the operation continues normally but the LENGTH field is reset to 0.
bits : 9 - 18 (10 bit)
DUALF : Dual flag (slave mode):
Enumeration:
0 : DUAL_SLAVE_ADDR_OFF
Received address matched with slave address (SA7)
1 : DUAL_SLAVE_ADDR_ON
Received address matched with dual slave address (DSA7)
End of enumeration elements list.
I2C receive FIFO register
address_offset : 0x18 Bytes (0x0)
size : 8 bit
access : read-only
reset_value : 0x0
reset_Mask : 0x0
RDATA : Receive data. RDATA contains the received payload, related to a master read or write-to-slave operation, to be read from the Rx FIFO. The RDATA(0) is the first LSB bit received over the I2C line. In case the FIFO is full, the I2C controller stretches automatically the I2C clock line until a new entry is available.
For a write-to-slave operation, when the slave is addressed, the interrupt I2C_RISR:WTSR bit is asserted for notification to the CPU. In CPU mode the FIFO management shall be based on the assertion of the interrupt bit I2C_RISR:RXFNF, related to the nearly-full threshold.
In DMA mode, the single requests are automatically executed based on the number of entries contained in the Rx FIFO.
I2C transmit FIFO threshold register
address_offset : 0x1C Bytes (0x0)
size : 16 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
THRESH_TX : Threshold TX, contains the threshold value, in terms of number of bytes, of the Tx FIFO.
When the number of entries of the Tx FIFO is less or equal than the threshold value, the interrupt bit I2C_RISR:TXFNE is set in order to request the loading of data to the application.
I2C receive FIFO threshold register
address_offset : 0x20 Bytes (0x0)
size : 16 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
THRESH_RX : Threshold RX, contains the threshold value, in terms of number of bytes, of the Rx FIFO.
When the number of entries of the RX FIFO is greater than or equal to the threshold value, the interrupt bit RISR:RXFNF is set in order to request the download of received data to the application. The application shall download the received data based on the threshold. (RISR:RXFNF).
I2C DMA register
address_offset : 0x24 Bytes (0x0)
size : 16 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
DBSIZE_TX : Destination burst size. This register field is valid only if the BURST_TX bit is set to '1'. If burst size is smaller than the transaction length, only single request are generated.
bits : 8 - 10 (3 bit)
BURST_TX : Defines the type of DMA request generated by the DMA TX interface.
I2C Baud-rate counter register
address_offset : 0x28 Bytes (0x0)
size : 16 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
BRCNT : Baud rate counter. BRCNT defines the counter value used to set up the I2C baud rate in standard and fast mode, when the peripheral is operating in master mode.
bits : 0 - 15 (16 bit)
I2C interrupt mask set/clear register
address_offset : 0x2C Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
TXFEM : TX FIFO empty mask. TXFEM enables the interrupt bit TXFE:
Enumeration:
0 : DISABLE
Disable the interrupt mask
1 : ENABLE
Enable the interrupt mask
End of enumeration elements list.
TXFNEM : TX FIFO nearly empty mask. TXFNEM enables the interrupt bit TXFNE:
TXFFM : TX FIFO full mask. TXFFM enables the interrupt bit TXFF:
TXFOVRM : TX FIFO overrun mask. TXOVRM enables the interrupt bit TXOVR:
RXFEM : RX FIFO empty mask. RXFEM enables the interrupt bit RXFE:
RXFNFM : RX FIFO nearly full mask. RXNFM enables the interrupt bit RXNF:
RXFFM : RX FIFO full mask. RXFFM enables the interrupt bit RXFF:
RFSRM : Read-from-Slave request mask. RFSRM enables the interrupt bit RFSR:
RFSEM : Read-from-Slave empty mask. RFSEM enables the interrupt bit RFSE:
WTSRM : Write-to-Slave request mask. WTSRM enables the interrupt bit WTSR:
MTDM : Master Transaction done mask. MTDM enables the interrupt bit MTD:
STDM : Slave Transaction done mask. STDM enables the interrupt bit STD:
MALM : Master Arbitration lost mask. MALM enables the interrupt bit MAL:
BERRM : Bus Error mask. BERRM enables the interrupt bit BERR:
MTDWSM : Master Transaction done without stop mask. MTDWSM enables the interrupt bit MTDWS:
I2C raw interrupt status register
address_offset : 0x30 Bytes (0x0)
size : 32 bit
access : read-only
reset_value : 0x0
reset_Mask : 0x0
TXFE : TX FIFO empty. TXFE is set when TX FIFO is empty. This bit is self-cleared by writing in TX FIFO.
TXFNE : TX FIFO nearly empty. TXFNE is set when the number of entries in TX FIFO is less than or equal to the threshold value programmed in the I2C_TFTR:THRESHOLD_TX register. It is self-cleared when the threshold level is over the programmed threshold.
TXFF : TX FIFO full. TXFF is set when a full condition occurs in TX FIFO. This bit is self-cleared when the TX FIFO is not full:
TXFOVR : TX FIFO overrun. TXFOVR is set when a write operation in TX FIFO is performed and TX FIFO is full. The application must avoid an overflow condition by a proper data flow control. Anyway in case of overrun, the application shall flush the transmitter (CR:FTX bit to set) because the TX FIFO content is corrupted (at least one word has been lost in FIFO). This interrupt is cleared by setting the related bit of the ICR register:
RXFE : RX FIFO empty. RXFE is set when the RX FIFO is empty. This bit is self-cleared when the slave RX FIFO is not empty:
RXFNF : RX FIFO nearly full. RXFNF is set when the number of entries in RX FIFO is greater than or equal to the threshold value programmed in the RFTR:THRESHOLD_RX register. Its self-cleared when the threshold level is under the programmed threshold:
RXFF : RX FIFO full. RXFF is set when a full condition occurs in RX FIFO. This bit is self-cleared when the data are read from the RX FIFO.
LBR : Length number of bytes received. LBR is set in case of MR or WTS and when the number of bytes received is equal to the transaction length programmed in the MCR:LENGTH (master mode) or SMB_SCR:LENGTH (slave mode). On the assertion of this interrupt and when the bit CR:FRC_STRTCH is set, the hardware starts clock stretching, the CPU shall download the data byte (Command code, Byte Count, Data...) from RX FIFO, re-set the expected length of the transaction in SMB_SCR:LENGTH and clear the interrupt. When clearing this interrupt the hardware continues the transfer. This interrupt is cleared by setting the related bit of the ICR register.
RFSR : Read-from-slave request. RFSR is set when a read-from-slave "Slavetransmitter" request is received (I2C slave is addressed) from the I2C line. On the assertion of this interrupt the TX FIFO is flushed (pending data are cleared) and the CPU shall put the data in TX FIFO. This bit is self-cleared by writing data in FIFO. In case the FIFO is empty before the completion of the read operation, the RISR:RFSE interrupt bit is set.This interrupt is cleared by setting the related bit of the ICR register.
RFSE : Read-from-Slave empty. RFSE is set when a read-from-slave operation is in progress and TX FIFO is empty. On the assertion of this interrupt, the CPU shall download in TX FIFO the data required for the slave operation. This bit is self-cleared by writing in TX FIFO. At the end of the read-from-slave operation this bit is cleared although the TX FIFO is empty.
WTSR : Write-to-Slave request. WTSR is set when a write-to-slave operation is received (I2C slave is addressed) from the I2C line. This notification can be used by the application to program the DMA descriptor when required. This interrupt is cleared by setting the related bit of the ICR register:
MTD : Master Transaction done. MTD is set when a master operation (master write or master read) has been executed after a stop condition. The application shall read the related transaction status (SR register), the pending data in the RX FIFO (only for a master read operation) and clear this interrupt (transaction acknowledgment). A subsequent master operation can be issued (writing the MCR register) after the clearing of this interrupt. A subsequent slave operation will be notified (RISR:WTSR and RISR:RFSR interrupt bits assertion) after clearing this interrupt, meanwhile the I2C clock line will be stretched low. This interrupt is cleared by setting the related bit of the ICR register.
STD : Slave Transaction done. STD is set when a slave operation (write-to-slave or read-from-slave) has been executed. The application shall read the related transaction status (SR register), the pending data in the RX FIFO (only for a write-to-slave operation) and clear this interrupt (transaction acknowledgment). A subsequent slave operation will be notified (RISR:WTSR and RISR:RFSR interrupt bits assertion) after clearing this interrupt, meanwhile the I2C clock line will be stretched low. A subsequent master operation can be issued (by writing the MCR register) after clearing this interrupt. This interrupt is cleared by setting the related bit of the ICR register:
SAL : Slave Arbitration lost. SAL is set when the slave loses the arbitration during the data phase. A collision occurs when 2 devices transmit simultaneously 2 opposite values on the serial data line. The device that is pulling up the line, identifies the collision reading a 0 value on the sda_in signal, stops the transmission, releases the bus and waits for the idle state (STOP condition received) on the bus line. The device which transmits the first unique zero wins the bus arbitration. This interrupt is cleared by setting the related bit of the ICR register.
MAL : Master arbitration lost. MAL is set when the master loses the arbitration. The status code word in the SR contains a specific error tag (CAUSE field) for this error condition. A collision occurs when 2 stations transmit simultaneously 2 opposite values on the serial line. The station that is pulling up the line, identifies the collision reading a 0 value on the sda_in signal, stops the transmission, leaves the bus and waits for the idle state (STOP condition received) on the bus line before retrying the same transaction. The station which transmits the first unique zero wins the bus arbitration. This interrupt is cleared by setting the related bit of the ICR register.
BERR : Bus Error. BERR is set when an unexpected Start/Stop condition occurs during a transaction. The related actions are different, depending on the type of operation in progress.The status code word in the SR contains a specific error tag (CAUSE field) for this error condition. This interrupt is cleared by setting the related bit of the ICR register.
MTDWS : Master transaction done without stop. MTDWS is set when a master operation (write or read) has been executed and a stop (MCR:P field) is not programmed. The application shall read the related transaction status (SR register), the pending data in the RX FIFO (only for a master read operation) and clear this interrupt (transaction acknowledgment). A subsequent master operation can be issued (by writing the MCR register) after clearing this interrupt. A subsequent slave operation will be notified (RISR:WTSR and RISR:RFSR interrupt bits assertion) after clearing this interrupt, meanwhile the I2C clock line will be stretched low. This interrupt is cleared by setting the related bit of the ICR register:
I2C masked interrupt status register
address_offset : 0x34 Bytes (0x0)
size : 32 bit
access : read-only
reset_value : 0x0
reset_Mask : 0x0
TXFEMIS : TX FIFO empty masked interrupt status.
TXFNEMIS : TX FIFO nearly empty masked interrupt status.
TXFFMIS : Tx FIFO full masked interrupt status.
TXFOVRMIS : Tx FIFO overrun masked interrupt status.
RXFEMIS : RX FIFO empty masked interrupt status.
RXFNFMIS : RX FIFO nearly full masked interrupt status.
RXFFMIS : RX FIFO full masked interrupt status.
LBRMIS : Length number of bytes received masked interrupt status.
RFSRMIS : Read-from-Slave request masked interrupt status.
RFSEMIS : Read-from-Slave empty masked interrupt status.
WTSRMIS : Write-to-Slave request masked interrupt status.
MTDMIS : Master Transaction done masked interrupt status.
STDMIS : Slave Transaction done masked interrupt status.
SALMIS : Slave Arbitration lost masked interrupt status.
MALMIS : Master Arbitration lost masked interrupt status.
BERRMIS : Bus Error masked interrupt status.
MTDWSMIS : Master Transaction done without stop masked interrupt status.
TIMEOUTMIS : Timeout or Tlow error masked interrupt status.
I2C interrupt clear register
address_offset : 0x38 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
TXFOVRIC : Tx FIFO overrun interrupt clear.
LBRIC : Length number of bytes received interrupt clear.
RFSRIC : Read-from-Slave request interrupt clear.
RFSEIC : Read-from-Slave empty interrupt clear.
WTSRIC : Write-to-Slave request interrupt clear.
MTDIC : Master Transaction done interrupt clear.
STDIC : Slave Transaction done interrupt clear.
SALIC : Slave Arbitration lost interrupt clear.
MALIC : Master Arbitration lost interrupt clear.
BERRIC : Bus Error interrupt clear.
MTDWSIC : Master Transaction done without stop interrupt clear.
TIMEOUTIC : Timeout or Tlow error interrupt clear.
I2C Slave Control register
address_offset : 0x4 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
SA7 : Slave address 7-bit. SA7 includes the slave address 7-bit or the LSB bits of the slave address 10-bit
bits : 0 - 6 (7 bit)
ESA10 : Extended slave address 10-bit. ESA10 includes the extension (MSB bits) to the SA7 register field in case of slave addressing mode set to 10-bit
bits : 7 - 9 (3 bit)
SLSU : Slave data setup time. SLSU defines the data setup time after SCL clock stretching in terms of i2c_clk cycles. Data setup time is actually equal to SLSU-1 clock cycles. The typical values for i2c_clk of 16 MHz are SLSU = 5 in standard mode and SLSU = 3 in fast modes.
bits : 16 - 31 (16 bit)
I2C hold time data
address_offset : 0x4C Bytes (0x0)
size : 16 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
THDDAT : Hold time data value. In master or slave mode, when the I2C controller detects a falling edge in the SCL line, the counter, which is loaded by the THDDAT, is launched. Once the THDDAT value is reached, the data is transferred.
bits : 0 - 8 (9 bit)
I2C hold time start condition F/S
address_offset : 0x50 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
THDSTA_STD : Hold time start condition value for standard mode. When the start condition is asserted, the decimeter loads the value of THDSTA_STD for standard mode, once the THDSTA_STD value is reached, the SCL line asserts low.
bits : 0 - 8 (9 bit)
THDSTA_FST : Hold time start condition value for fast mode. When the start condition is asserted, the decimeter loads the value of THDSTA_FST for fast mode, once the THDSTA_FST value is reached, the SCL line assert slow.
bits : 16 - 24 (9 bit)
I2C setup time start condition F/S
address_offset : 0x58 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
TSUSTA_STD : Setup time start condition value for standard mode. After a non-stop on the SCL line the decimeter loads the value of TSUSTA_STD according to standard mode. Once the counter is expired, the start condition is generated.
bits : 0 - 8 (9 bit)
TSUSTA_FST : Setup time start condition value for fast mode. After a non-stop on the SCL line the decimeter loads the value of TSUSTA_FST according to fast mode. Once the counter is expired the start condition is generated.
bits : 16 - 24 (9 bit)
I2C master control register
address_offset : 0xC Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0
OP : Operation
Enumeration:
0x00 : MASTER_WRITE
Indicates a master write operation
0x01 : MASTER_READ
Indicates a master read operation
End of enumeration elements list.
A7 : Address. Includes the 7-bit address or the LSB bits of the10-bit address used to initiate the current transaction
bits : 1 - 7 (7 bit)
EA10 : Extended address. Includes the extension (MSB bits) of the field A7 used to initiate the current transaction
bits : 8 - 10 (3 bit)
SB : Start byte:
AM : Address type:
Enumeration:
0x00 : GENERAL_CALL
The transaction is initiated by a general call command
0x01 : BIT7_ADDRESS
The transaction is initiated by the 7-bit address included in the A7 field
0x02 : BIT10_ADDRESS
The transaction is initiated by the 10-bit address included in the EA10 and A7 fields
End of enumeration elements list.
P : Stop condition:
LENGTH : Transaction length. Defines the length, in terms of the number of bytes to be transmitted (MW) or received (MR). In case of write operation, the payload is stored in the Tx FIFO. A transaction can be larger than the Tx FIFO size. In case of read operation the length refers to the number of bytes to be received before generating a not-acknowledge response. A transaction can be larger than the Rx FIFO size. The I2C clock line is stretched low until the data in Rx FIFO are consumed.
bits : 15 - 25 (11 bit)
Is something missing? Is something wrong? can you help correct it ? Please contact us at info@chipselect.org !
This website is sponsored by Embeetle, an IDE designed from scratch for embedded software developers.