1 /**
2  * Copyright (c) 2021 Raspberry Pi (Trading) Ltd.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 // =============================================================================
7 // Register block : I2C
8 // Version        : 1
9 // Bus type       : apb
10 // Description    : DW_apb_i2c address block
11 // =============================================================================
12 #ifndef HARDWARE_REGS_I2C_DEFINED
13 #define HARDWARE_REGS_I2C_DEFINED
14 // =============================================================================
15 // Register    : I2C_IC_CON
16 // Description : I2C Control Register. This register can be written only when
17 //               the DW_apb_i2c is disabled, which corresponds to the
18 //               IC_ENABLE[0] register being set to 0. Writes at other times
19 //               have no effect.
20 //
21 //               Read/Write Access: - bit 10 is read only. - bit 11 is read only
22 //               - bit 16 is read only - bit 17 is read only - bits 18 and 19
23 //               are read only.
24 #define I2C_IC_CON_OFFSET 0x00000000
25 #define I2C_IC_CON_BITS   0x000007ff
26 #define I2C_IC_CON_RESET  0x00000065
27 // -----------------------------------------------------------------------------
28 // Field       : I2C_IC_CON_STOP_DET_IF_MASTER_ACTIVE
29 // Description : Master issues the STOP_DET interrupt irrespective of whether
30 //               master is active or not
31 #define I2C_IC_CON_STOP_DET_IF_MASTER_ACTIVE_RESET  0x0
32 #define I2C_IC_CON_STOP_DET_IF_MASTER_ACTIVE_BITS   0x00000400
33 #define I2C_IC_CON_STOP_DET_IF_MASTER_ACTIVE_MSB    10
34 #define I2C_IC_CON_STOP_DET_IF_MASTER_ACTIVE_LSB    10
35 #define I2C_IC_CON_STOP_DET_IF_MASTER_ACTIVE_ACCESS "RO"
36 // -----------------------------------------------------------------------------
37 // Field       : I2C_IC_CON_RX_FIFO_FULL_HLD_CTRL
38 // Description : This bit controls whether DW_apb_i2c should hold the bus when
39 //               the Rx FIFO is physically full to its RX_BUFFER_DEPTH, as
40 //               described in the IC_RX_FULL_HLD_BUS_EN parameter.
41 //
42 //               Reset value: 0x0.
43 //               0x0 -> Overflow when RX_FIFO is full
44 //               0x1 -> Hold bus when RX_FIFO is full
45 #define I2C_IC_CON_RX_FIFO_FULL_HLD_CTRL_RESET          0x0
46 #define I2C_IC_CON_RX_FIFO_FULL_HLD_CTRL_BITS           0x00000200
47 #define I2C_IC_CON_RX_FIFO_FULL_HLD_CTRL_MSB            9
48 #define I2C_IC_CON_RX_FIFO_FULL_HLD_CTRL_LSB            9
49 #define I2C_IC_CON_RX_FIFO_FULL_HLD_CTRL_ACCESS         "RW"
50 #define I2C_IC_CON_RX_FIFO_FULL_HLD_CTRL_VALUE_DISABLED 0x0
51 #define I2C_IC_CON_RX_FIFO_FULL_HLD_CTRL_VALUE_ENABLED  0x1
52 // -----------------------------------------------------------------------------
53 // Field       : I2C_IC_CON_TX_EMPTY_CTRL
54 // Description : This bit controls the generation of the TX_EMPTY interrupt, as
55 //               described in the IC_RAW_INTR_STAT register.
56 //
57 //               Reset value: 0x0.
58 //               0x0 -> Default behaviour of TX_EMPTY interrupt
59 //               0x1 -> Controlled generation of TX_EMPTY interrupt
60 #define I2C_IC_CON_TX_EMPTY_CTRL_RESET          0x0
61 #define I2C_IC_CON_TX_EMPTY_CTRL_BITS           0x00000100
62 #define I2C_IC_CON_TX_EMPTY_CTRL_MSB            8
63 #define I2C_IC_CON_TX_EMPTY_CTRL_LSB            8
64 #define I2C_IC_CON_TX_EMPTY_CTRL_ACCESS         "RW"
65 #define I2C_IC_CON_TX_EMPTY_CTRL_VALUE_DISABLED 0x0
66 #define I2C_IC_CON_TX_EMPTY_CTRL_VALUE_ENABLED  0x1
67 // -----------------------------------------------------------------------------
68 // Field       : I2C_IC_CON_STOP_DET_IFADDRESSED
69 // Description : In slave mode: - 1'b1:  issues the STOP_DET interrupt only when
70 //               it is addressed. - 1'b0:  issues the STOP_DET irrespective of
71 //               whether it's addressed or not. Reset value: 0x0
72 //
73 //               NOTE: During a general call address, this slave does not issue
74 //               the STOP_DET interrupt if STOP_DET_IF_ADDRESSED = 1'b1, even if
75 //               the slave responds to the general call address by generating
76 //               ACK. The STOP_DET interrupt is generated only when the
77 //               transmitted address matches the slave address (SAR).
78 //               0x0 -> slave issues STOP_DET intr always
79 //               0x1 -> slave issues STOP_DET intr only if addressed
80 #define I2C_IC_CON_STOP_DET_IFADDRESSED_RESET          0x0
81 #define I2C_IC_CON_STOP_DET_IFADDRESSED_BITS           0x00000080
82 #define I2C_IC_CON_STOP_DET_IFADDRESSED_MSB            7
83 #define I2C_IC_CON_STOP_DET_IFADDRESSED_LSB            7
84 #define I2C_IC_CON_STOP_DET_IFADDRESSED_ACCESS         "RW"
85 #define I2C_IC_CON_STOP_DET_IFADDRESSED_VALUE_DISABLED 0x0
86 #define I2C_IC_CON_STOP_DET_IFADDRESSED_VALUE_ENABLED  0x1
87 // -----------------------------------------------------------------------------
88 // Field       : I2C_IC_CON_IC_SLAVE_DISABLE
89 // Description : This bit controls whether I2C has its slave disabled, which
90 //               means once the presetn signal is applied, then this bit is set
91 //               and the slave is disabled.
92 //
93 //               If this bit is set (slave is disabled), DW_apb_i2c functions
94 //               only as a master and does not perform any action that requires
95 //               a slave.
96 //
97 //               NOTE: Software should ensure that if this bit is written with
98 //               0, then bit 0 should also be written with a 0.
99 //               0x0 -> Slave mode is enabled
100 //               0x1 -> Slave mode is disabled
101 #define I2C_IC_CON_IC_SLAVE_DISABLE_RESET                0x1
102 #define I2C_IC_CON_IC_SLAVE_DISABLE_BITS                 0x00000040
103 #define I2C_IC_CON_IC_SLAVE_DISABLE_MSB                  6
104 #define I2C_IC_CON_IC_SLAVE_DISABLE_LSB                  6
105 #define I2C_IC_CON_IC_SLAVE_DISABLE_ACCESS               "RW"
106 #define I2C_IC_CON_IC_SLAVE_DISABLE_VALUE_SLAVE_ENABLED  0x0
107 #define I2C_IC_CON_IC_SLAVE_DISABLE_VALUE_SLAVE_DISABLED 0x1
108 // -----------------------------------------------------------------------------
109 // Field       : I2C_IC_CON_IC_RESTART_EN
110 // Description : Determines whether RESTART conditions may be sent when acting
111 //               as a master. Some older slaves do not support handling RESTART
112 //               conditions; however, RESTART conditions are used in several
113 //               DW_apb_i2c operations. When RESTART is disabled, the master is
114 //               prohibited from performing the following functions: - Sending a
115 //               START BYTE - Performing any high-speed mode operation -
116 //               High-speed mode operation - Performing direction changes in
117 //               combined format mode - Performing a read operation with a
118 //               10-bit address By replacing RESTART condition followed by a
119 //               STOP and a subsequent START condition, split operations are
120 //               broken down into multiple DW_apb_i2c transfers. If the above
121 //               operations are performed, it will result in setting bit 6
122 //               (TX_ABRT) of the IC_RAW_INTR_STAT register.
123 //
124 //               Reset value: ENABLED
125 //               0x0 -> Master restart disabled
126 //               0x1 -> Master restart enabled
127 #define I2C_IC_CON_IC_RESTART_EN_RESET          0x1
128 #define I2C_IC_CON_IC_RESTART_EN_BITS           0x00000020
129 #define I2C_IC_CON_IC_RESTART_EN_MSB            5
130 #define I2C_IC_CON_IC_RESTART_EN_LSB            5
131 #define I2C_IC_CON_IC_RESTART_EN_ACCESS         "RW"
132 #define I2C_IC_CON_IC_RESTART_EN_VALUE_DISABLED 0x0
133 #define I2C_IC_CON_IC_RESTART_EN_VALUE_ENABLED  0x1
134 // -----------------------------------------------------------------------------
135 // Field       : I2C_IC_CON_IC_10BITADDR_MASTER
136 // Description : Controls whether the DW_apb_i2c starts its transfers in 7- or
137 //               10-bit addressing mode when acting as a master. - 0: 7-bit
138 //               addressing - 1: 10-bit addressing
139 //               0x0 -> Master 7Bit addressing mode
140 //               0x1 -> Master 10Bit addressing mode
141 #define I2C_IC_CON_IC_10BITADDR_MASTER_RESET             0x0
142 #define I2C_IC_CON_IC_10BITADDR_MASTER_BITS              0x00000010
143 #define I2C_IC_CON_IC_10BITADDR_MASTER_MSB               4
144 #define I2C_IC_CON_IC_10BITADDR_MASTER_LSB               4
145 #define I2C_IC_CON_IC_10BITADDR_MASTER_ACCESS            "RW"
146 #define I2C_IC_CON_IC_10BITADDR_MASTER_VALUE_ADDR_7BITS  0x0
147 #define I2C_IC_CON_IC_10BITADDR_MASTER_VALUE_ADDR_10BITS 0x1
148 // -----------------------------------------------------------------------------
149 // Field       : I2C_IC_CON_IC_10BITADDR_SLAVE
150 // Description : When acting as a slave, this bit controls whether the
151 //               DW_apb_i2c responds to 7- or 10-bit addresses. - 0: 7-bit
152 //               addressing. The DW_apb_i2c ignores transactions that involve
153 //               10-bit addressing; for 7-bit addressing, only the lower 7 bits
154 //               of the IC_SAR register are compared. - 1: 10-bit addressing.
155 //               The DW_apb_i2c responds to only 10-bit addressing transfers
156 //               that match the full 10 bits of the IC_SAR register.
157 //               0x0 -> Slave 7Bit addressing
158 //               0x1 -> Slave 10Bit addressing
159 #define I2C_IC_CON_IC_10BITADDR_SLAVE_RESET             0x0
160 #define I2C_IC_CON_IC_10BITADDR_SLAVE_BITS              0x00000008
161 #define I2C_IC_CON_IC_10BITADDR_SLAVE_MSB               3
162 #define I2C_IC_CON_IC_10BITADDR_SLAVE_LSB               3
163 #define I2C_IC_CON_IC_10BITADDR_SLAVE_ACCESS            "RW"
164 #define I2C_IC_CON_IC_10BITADDR_SLAVE_VALUE_ADDR_7BITS  0x0
165 #define I2C_IC_CON_IC_10BITADDR_SLAVE_VALUE_ADDR_10BITS 0x1
166 // -----------------------------------------------------------------------------
167 // Field       : I2C_IC_CON_SPEED
168 // Description : These bits control at which speed the DW_apb_i2c operates; its
169 //               setting is relevant only if one is operating the DW_apb_i2c in
170 //               master mode. Hardware protects against illegal values being
171 //               programmed by software. These bits must be programmed
172 //               appropriately for slave mode also, as it is used to capture
173 //               correct value of spike filter as per the speed mode.
174 //
175 //               This register should be programmed only with a value in the
176 //               range of 1 to IC_MAX_SPEED_MODE; otherwise, hardware updates
177 //               this register with the value of IC_MAX_SPEED_MODE.
178 //
179 //               1: standard mode (100 kbit/s)
180 //
181 //               2: fast mode (<=400 kbit/s) or fast mode plus (<=1000Kbit/s)
182 //
183 //               3: high speed mode (3.4 Mbit/s)
184 //
185 //               Note: This field is not applicable when IC_ULTRA_FAST_MODE=1
186 //               0x1 -> Standard Speed mode of operation
187 //               0x2 -> Fast or Fast Plus mode of operation
188 //               0x3 -> High Speed mode of operation
189 #define I2C_IC_CON_SPEED_RESET          0x2
190 #define I2C_IC_CON_SPEED_BITS           0x00000006
191 #define I2C_IC_CON_SPEED_MSB            2
192 #define I2C_IC_CON_SPEED_LSB            1
193 #define I2C_IC_CON_SPEED_ACCESS         "RW"
194 #define I2C_IC_CON_SPEED_VALUE_STANDARD 0x1
195 #define I2C_IC_CON_SPEED_VALUE_FAST     0x2
196 #define I2C_IC_CON_SPEED_VALUE_HIGH     0x3
197 // -----------------------------------------------------------------------------
198 // Field       : I2C_IC_CON_MASTER_MODE
199 // Description : This bit controls whether the DW_apb_i2c master is enabled.
200 //
201 //               NOTE: Software should ensure that if this bit is written with
202 //               '1' then bit 6 should also be written with a '1'.
203 //               0x0 -> Master mode is disabled
204 //               0x1 -> Master mode is enabled
205 #define I2C_IC_CON_MASTER_MODE_RESET          0x1
206 #define I2C_IC_CON_MASTER_MODE_BITS           0x00000001
207 #define I2C_IC_CON_MASTER_MODE_MSB            0
208 #define I2C_IC_CON_MASTER_MODE_LSB            0
209 #define I2C_IC_CON_MASTER_MODE_ACCESS         "RW"
210 #define I2C_IC_CON_MASTER_MODE_VALUE_DISABLED 0x0
211 #define I2C_IC_CON_MASTER_MODE_VALUE_ENABLED  0x1
212 // =============================================================================
213 // Register    : I2C_IC_TAR
214 // Description : I2C Target Address Register
215 //
216 //               This register is 12 bits wide, and bits 31:12 are reserved.
217 //               This register can be written to only when IC_ENABLE[0] is set
218 //               to 0.
219 //
220 //               Note: If the software or application is aware that the
221 //               DW_apb_i2c is not using the TAR address for the pending
222 //               commands in the Tx FIFO, then it is possible to update the TAR
223 //               address even while the Tx FIFO has entries (IC_STATUS[2]= 0). -
224 //               It is not necessary to perform any write to this register if
225 //               DW_apb_i2c is enabled as an I2C slave only.
226 #define I2C_IC_TAR_OFFSET 0x00000004
227 #define I2C_IC_TAR_BITS   0x00000fff
228 #define I2C_IC_TAR_RESET  0x00000055
229 // -----------------------------------------------------------------------------
230 // Field       : I2C_IC_TAR_SPECIAL
231 // Description : This bit indicates whether software performs a Device-ID or
232 //               General Call or START BYTE command. - 0: ignore bit 10
233 //               GC_OR_START and use IC_TAR normally - 1: perform special I2C
234 //               command as specified in Device_ID or GC_OR_START bit Reset
235 //               value: 0x0
236 //               0x0 -> Disables programming of GENERAL_CALL or START_BYTE
237 //               transmission
238 //               0x1 -> Enables programming of GENERAL_CALL or START_BYTE
239 //               transmission
240 #define I2C_IC_TAR_SPECIAL_RESET          0x0
241 #define I2C_IC_TAR_SPECIAL_BITS           0x00000800
242 #define I2C_IC_TAR_SPECIAL_MSB            11
243 #define I2C_IC_TAR_SPECIAL_LSB            11
244 #define I2C_IC_TAR_SPECIAL_ACCESS         "RW"
245 #define I2C_IC_TAR_SPECIAL_VALUE_DISABLED 0x0
246 #define I2C_IC_TAR_SPECIAL_VALUE_ENABLED  0x1
247 // -----------------------------------------------------------------------------
248 // Field       : I2C_IC_TAR_GC_OR_START
249 // Description : If bit 11 (SPECIAL) is set to 1 and bit 13(Device-ID) is set to
250 //               0, then this bit indicates whether a General Call or START byte
251 //               command is to be performed by the DW_apb_i2c. - 0: General Call
252 //               Address - after issuing a General Call, only writes may be
253 //               performed. Attempting to issue a read command results in
254 //               setting bit 6 (TX_ABRT) of the IC_RAW_INTR_STAT register. The
255 //               DW_apb_i2c remains in General Call mode until the SPECIAL bit
256 //               value (bit 11) is cleared. - 1: START BYTE Reset value: 0x0
257 //               0x0 -> GENERAL_CALL byte transmission
258 //               0x1 -> START byte transmission
259 #define I2C_IC_TAR_GC_OR_START_RESET              0x0
260 #define I2C_IC_TAR_GC_OR_START_BITS               0x00000400
261 #define I2C_IC_TAR_GC_OR_START_MSB                10
262 #define I2C_IC_TAR_GC_OR_START_LSB                10
263 #define I2C_IC_TAR_GC_OR_START_ACCESS             "RW"
264 #define I2C_IC_TAR_GC_OR_START_VALUE_GENERAL_CALL 0x0
265 #define I2C_IC_TAR_GC_OR_START_VALUE_START_BYTE   0x1
266 // -----------------------------------------------------------------------------
267 // Field       : I2C_IC_TAR_IC_TAR
268 // Description : This is the target address for any master transaction. When
269 //               transmitting a General Call, these bits are ignored. To
270 //               generate a START BYTE, the CPU needs to write only once into
271 //               these bits.
272 //
273 //               If the IC_TAR and IC_SAR are the same, loopback exists but the
274 //               FIFOs are shared between master and slave, so full loopback is
275 //               not feasible. Only one direction loopback mode is supported
276 //               (simplex), not duplex. A master cannot transmit to itself; it
277 //               can transmit to only a slave.
278 #define I2C_IC_TAR_IC_TAR_RESET  0x055
279 #define I2C_IC_TAR_IC_TAR_BITS   0x000003ff
280 #define I2C_IC_TAR_IC_TAR_MSB    9
281 #define I2C_IC_TAR_IC_TAR_LSB    0
282 #define I2C_IC_TAR_IC_TAR_ACCESS "RW"
283 // =============================================================================
284 // Register    : I2C_IC_SAR
285 // Description : I2C Slave Address Register
286 #define I2C_IC_SAR_OFFSET 0x00000008
287 #define I2C_IC_SAR_BITS   0x000003ff
288 #define I2C_IC_SAR_RESET  0x00000055
289 // -----------------------------------------------------------------------------
290 // Field       : I2C_IC_SAR_IC_SAR
291 // Description : The IC_SAR holds the slave address when the I2C is operating as
292 //               a slave. For 7-bit addressing, only IC_SAR[6:0] is used.
293 //
294 //               This register can be written only when the I2C interface is
295 //               disabled, which corresponds to the IC_ENABLE[0] register being
296 //               set to 0. Writes at other times have no effect.
297 //
298 //               Note: The default values cannot be any of the reserved address
299 //               locations: that is, 0x00 to 0x07, or 0x78 to 0x7f. The correct
300 //               operation of the device is not guaranteed if you program the
301 //               IC_SAR or IC_TAR to a reserved value. Refer to
302 //               <<table_I2C_firstbyte_bit_defs>> for a complete list of these
303 //               reserved values.
304 #define I2C_IC_SAR_IC_SAR_RESET  0x055
305 #define I2C_IC_SAR_IC_SAR_BITS   0x000003ff
306 #define I2C_IC_SAR_IC_SAR_MSB    9
307 #define I2C_IC_SAR_IC_SAR_LSB    0
308 #define I2C_IC_SAR_IC_SAR_ACCESS "RW"
309 // =============================================================================
310 // Register    : I2C_IC_DATA_CMD
311 // Description : I2C Rx/Tx Data Buffer and Command Register; this is the
312 //               register the CPU writes to when filling the TX FIFO and the CPU
313 //               reads from when retrieving bytes from RX FIFO.
314 //
315 //               The size of the register changes as follows:
316 //
317 //               Write: - 11 bits when IC_EMPTYFIFO_HOLD_MASTER_EN=1 - 9 bits
318 //               when IC_EMPTYFIFO_HOLD_MASTER_EN=0 Read: - 12 bits when
319 //               IC_FIRST_DATA_BYTE_STATUS = 1 - 8 bits when
320 //               IC_FIRST_DATA_BYTE_STATUS = 0 Note: In order for the DW_apb_i2c
321 //               to continue acknowledging reads, a read command should be
322 //               written for every byte that is to be received; otherwise the
323 //               DW_apb_i2c will stop acknowledging.
324 #define I2C_IC_DATA_CMD_OFFSET 0x00000010
325 #define I2C_IC_DATA_CMD_BITS   0x00000fff
326 #define I2C_IC_DATA_CMD_RESET  0x00000000
327 // -----------------------------------------------------------------------------
328 // Field       : I2C_IC_DATA_CMD_FIRST_DATA_BYTE
329 // Description : Indicates the first data byte received after the address phase
330 //               for receive transfer in Master receiver or Slave receiver mode.
331 //
332 //               Reset value : 0x0
333 //
334 //               NOTE:  In case of APB_DATA_WIDTH=8,
335 //
336 //               1. The user has to perform two APB Reads to IC_DATA_CMD in
337 //               order to get status on 11 bit.
338 //
339 //               2. In order to read the 11 bit, the user has to perform the
340 //               first data byte read [7:0] (offset 0x10) and then perform the
341 //               second read [15:8] (offset 0x11) in order to know the status of
342 //               11 bit (whether the data received in previous read is a first
343 //               data byte or not).
344 //
345 //               3. The 11th bit is an optional read field, user can ignore 2nd
346 //               byte read [15:8] (offset 0x11) if not interested in
347 //               FIRST_DATA_BYTE status.
348 //               0x0 -> Sequential data byte received
349 //               0x1 -> Non sequential data byte received
350 #define I2C_IC_DATA_CMD_FIRST_DATA_BYTE_RESET          0x0
351 #define I2C_IC_DATA_CMD_FIRST_DATA_BYTE_BITS           0x00000800
352 #define I2C_IC_DATA_CMD_FIRST_DATA_BYTE_MSB            11
353 #define I2C_IC_DATA_CMD_FIRST_DATA_BYTE_LSB            11
354 #define I2C_IC_DATA_CMD_FIRST_DATA_BYTE_ACCESS         "RO"
355 #define I2C_IC_DATA_CMD_FIRST_DATA_BYTE_VALUE_INACTIVE 0x0
356 #define I2C_IC_DATA_CMD_FIRST_DATA_BYTE_VALUE_ACTIVE   0x1
357 // -----------------------------------------------------------------------------
358 // Field       : I2C_IC_DATA_CMD_RESTART
359 // Description : This bit controls whether a RESTART is issued before the byte
360 //               is sent or received.
361 //
362 //               1 - If IC_RESTART_EN is 1, a RESTART is issued before the data
363 //               is sent/received (according to the value of CMD), regardless of
364 //               whether or not the transfer direction is changing from the
365 //               previous command; if IC_RESTART_EN is 0, a STOP followed by a
366 //               START is issued instead.
367 //
368 //               0 - If IC_RESTART_EN is 1, a RESTART is issued only if the
369 //               transfer direction is changing from the previous command; if
370 //               IC_RESTART_EN is 0, a STOP followed by a START is issued
371 //               instead.
372 //
373 //               Reset value: 0x0
374 //               0x0 -> Don't Issue RESTART before this command
375 //               0x1 -> Issue RESTART before this command
376 #define I2C_IC_DATA_CMD_RESTART_RESET         0x0
377 #define I2C_IC_DATA_CMD_RESTART_BITS          0x00000400
378 #define I2C_IC_DATA_CMD_RESTART_MSB           10
379 #define I2C_IC_DATA_CMD_RESTART_LSB           10
380 #define I2C_IC_DATA_CMD_RESTART_ACCESS        "SC"
381 #define I2C_IC_DATA_CMD_RESTART_VALUE_DISABLE 0x0
382 #define I2C_IC_DATA_CMD_RESTART_VALUE_ENABLE  0x1
383 // -----------------------------------------------------------------------------
384 // Field       : I2C_IC_DATA_CMD_STOP
385 // Description : This bit controls whether a STOP is issued after the byte is
386 //               sent or received.
387 //
388 //               - 1 - STOP is issued after this byte, regardless of whether or
389 //               not the Tx FIFO is empty. If the Tx FIFO is not empty, the
390 //               master immediately tries to start a new transfer by issuing a
391 //               START and arbitrating for the bus. - 0 - STOP is not issued
392 //               after this byte, regardless of whether or not the Tx FIFO is
393 //               empty. If the Tx FIFO is not empty, the master continues the
394 //               current transfer by sending/receiving data bytes according to
395 //               the value of the CMD bit. If the Tx FIFO is empty, the master
396 //               holds the SCL line low and stalls the bus until a new command
397 //               is available in the Tx FIFO. Reset value: 0x0
398 //               0x0 -> Don't Issue STOP after this command
399 //               0x1 -> Issue STOP after this command
400 #define I2C_IC_DATA_CMD_STOP_RESET         0x0
401 #define I2C_IC_DATA_CMD_STOP_BITS          0x00000200
402 #define I2C_IC_DATA_CMD_STOP_MSB           9
403 #define I2C_IC_DATA_CMD_STOP_LSB           9
404 #define I2C_IC_DATA_CMD_STOP_ACCESS        "SC"
405 #define I2C_IC_DATA_CMD_STOP_VALUE_DISABLE 0x0
406 #define I2C_IC_DATA_CMD_STOP_VALUE_ENABLE  0x1
407 // -----------------------------------------------------------------------------
408 // Field       : I2C_IC_DATA_CMD_CMD
409 // Description : This bit controls whether a read or a write is performed. This
410 //               bit does not control the direction when the DW_apb_i2con acts
411 //               as a slave. It controls only the direction when it acts as a
412 //               master.
413 //
414 //               When a command is entered in the TX FIFO, this bit
415 //               distinguishes the write and read commands. In slave-receiver
416 //               mode, this bit is a 'don't care' because writes to this
417 //               register are not required. In slave-transmitter mode, a '0'
418 //               indicates that the data in IC_DATA_CMD is to be transmitted.
419 //
420 //               When programming this bit, you should remember the following:
421 //               attempting to perform a read operation after a General Call
422 //               command has been sent results in a TX_ABRT interrupt (bit 6 of
423 //               the IC_RAW_INTR_STAT register), unless bit 11 (SPECIAL) in the
424 //               IC_TAR register has been cleared. If a '1' is written to this
425 //               bit after receiving a RD_REQ interrupt, then a TX_ABRT
426 //               interrupt occurs.
427 //
428 //               Reset value: 0x0
429 //               0x0 -> Master Write Command
430 //               0x1 -> Master Read Command
431 #define I2C_IC_DATA_CMD_CMD_RESET       0x0
432 #define I2C_IC_DATA_CMD_CMD_BITS        0x00000100
433 #define I2C_IC_DATA_CMD_CMD_MSB         8
434 #define I2C_IC_DATA_CMD_CMD_LSB         8
435 #define I2C_IC_DATA_CMD_CMD_ACCESS      "SC"
436 #define I2C_IC_DATA_CMD_CMD_VALUE_WRITE 0x0
437 #define I2C_IC_DATA_CMD_CMD_VALUE_READ  0x1
438 // -----------------------------------------------------------------------------
439 // Field       : I2C_IC_DATA_CMD_DAT
440 // Description : This register contains the data to be transmitted or received
441 //               on the I2C bus. If you are writing to this register and want to
442 //               perform a read, bits 7:0 (DAT) are ignored by the DW_apb_i2c.
443 //               However, when you read this register, these bits return the
444 //               value of data received on the DW_apb_i2c interface.
445 //
446 //               Reset value: 0x0
447 #define I2C_IC_DATA_CMD_DAT_RESET  0x00
448 #define I2C_IC_DATA_CMD_DAT_BITS   0x000000ff
449 #define I2C_IC_DATA_CMD_DAT_MSB    7
450 #define I2C_IC_DATA_CMD_DAT_LSB    0
451 #define I2C_IC_DATA_CMD_DAT_ACCESS "RW"
452 // =============================================================================
453 // Register    : I2C_IC_SS_SCL_HCNT
454 // Description : Standard Speed I2C Clock SCL High Count Register
455 #define I2C_IC_SS_SCL_HCNT_OFFSET 0x00000014
456 #define I2C_IC_SS_SCL_HCNT_BITS   0x0000ffff
457 #define I2C_IC_SS_SCL_HCNT_RESET  0x00000028
458 // -----------------------------------------------------------------------------
459 // Field       : I2C_IC_SS_SCL_HCNT_IC_SS_SCL_HCNT
460 // Description : This register must be set before any I2C bus transaction can
461 //               take place to ensure proper I/O timing. This register sets the
462 //               SCL clock high-period count for standard speed. For more
463 //               information, refer to 'IC_CLK Frequency Configuration'.
464 //
465 //               This register can be written only when the I2C interface is
466 //               disabled which corresponds to the IC_ENABLE[0] register being
467 //               set to 0. Writes at other times have no effect.
468 //
469 //               The minimum valid value is 6; hardware prevents values less
470 //               than this being written, and if attempted results in 6 being
471 //               set. For designs with APB_DATA_WIDTH = 8, the order of
472 //               programming is important to ensure the correct operation of the
473 //               DW_apb_i2c. The lower byte must be programmed first. Then the
474 //               upper byte is programmed.
475 //
476 //               NOTE: This register must not be programmed to a value higher
477 //               than 65525, because DW_apb_i2c uses a 16-bit counter to flag an
478 //               I2C bus idle condition when this counter reaches a value of
479 //               IC_SS_SCL_HCNT + 10.
480 #define I2C_IC_SS_SCL_HCNT_IC_SS_SCL_HCNT_RESET  0x0028
481 #define I2C_IC_SS_SCL_HCNT_IC_SS_SCL_HCNT_BITS   0x0000ffff
482 #define I2C_IC_SS_SCL_HCNT_IC_SS_SCL_HCNT_MSB    15
483 #define I2C_IC_SS_SCL_HCNT_IC_SS_SCL_HCNT_LSB    0
484 #define I2C_IC_SS_SCL_HCNT_IC_SS_SCL_HCNT_ACCESS "RW"
485 // =============================================================================
486 // Register    : I2C_IC_SS_SCL_LCNT
487 // Description : Standard Speed I2C Clock SCL Low Count Register
488 #define I2C_IC_SS_SCL_LCNT_OFFSET 0x00000018
489 #define I2C_IC_SS_SCL_LCNT_BITS   0x0000ffff
490 #define I2C_IC_SS_SCL_LCNT_RESET  0x0000002f
491 // -----------------------------------------------------------------------------
492 // Field       : I2C_IC_SS_SCL_LCNT_IC_SS_SCL_LCNT
493 // Description : This register must be set before any I2C bus transaction can
494 //               take place to ensure proper I/O timing. This register sets the
495 //               SCL clock low period count for standard speed. For more
496 //               information, refer to 'IC_CLK Frequency Configuration'
497 //
498 //               This register can be written only when the I2C interface is
499 //               disabled which corresponds to the IC_ENABLE[0] register being
500 //               set to 0. Writes at other times have no effect.
501 //
502 //               The minimum valid value is 8; hardware prevents values less
503 //               than this being written, and if attempted, results in 8 being
504 //               set. For designs with APB_DATA_WIDTH = 8, the order of
505 //               programming is important to ensure the correct operation of
506 //               DW_apb_i2c. The lower byte must be programmed first, and then
507 //               the upper byte is programmed.
508 #define I2C_IC_SS_SCL_LCNT_IC_SS_SCL_LCNT_RESET  0x002f
509 #define I2C_IC_SS_SCL_LCNT_IC_SS_SCL_LCNT_BITS   0x0000ffff
510 #define I2C_IC_SS_SCL_LCNT_IC_SS_SCL_LCNT_MSB    15
511 #define I2C_IC_SS_SCL_LCNT_IC_SS_SCL_LCNT_LSB    0
512 #define I2C_IC_SS_SCL_LCNT_IC_SS_SCL_LCNT_ACCESS "RW"
513 // =============================================================================
514 // Register    : I2C_IC_FS_SCL_HCNT
515 // Description : Fast Mode or Fast Mode Plus I2C Clock SCL High Count Register
516 #define I2C_IC_FS_SCL_HCNT_OFFSET 0x0000001c
517 #define I2C_IC_FS_SCL_HCNT_BITS   0x0000ffff
518 #define I2C_IC_FS_SCL_HCNT_RESET  0x00000006
519 // -----------------------------------------------------------------------------
520 // Field       : I2C_IC_FS_SCL_HCNT_IC_FS_SCL_HCNT
521 // Description : This register must be set before any I2C bus transaction can
522 //               take place to ensure proper I/O timing. This register sets the
523 //               SCL clock high-period count for fast mode or fast mode plus. It
524 //               is used in high-speed mode to send the Master Code and START
525 //               BYTE or General CALL. For more information, refer to 'IC_CLK
526 //               Frequency Configuration'.
527 //
528 //               This register goes away and becomes read-only returning 0s if
529 //               IC_MAX_SPEED_MODE = standard. This register can be written only
530 //               when the I2C interface is disabled, which corresponds to the
531 //               IC_ENABLE[0] register being set to 0. Writes at other times
532 //               have no effect.
533 //
534 //               The minimum valid value is 6; hardware prevents values less
535 //               than this being written, and if attempted results in 6 being
536 //               set. For designs with APB_DATA_WIDTH == 8 the order of
537 //               programming is important to ensure the correct operation of the
538 //               DW_apb_i2c. The lower byte must be programmed first. Then the
539 //               upper byte is programmed.
540 #define I2C_IC_FS_SCL_HCNT_IC_FS_SCL_HCNT_RESET  0x0006
541 #define I2C_IC_FS_SCL_HCNT_IC_FS_SCL_HCNT_BITS   0x0000ffff
542 #define I2C_IC_FS_SCL_HCNT_IC_FS_SCL_HCNT_MSB    15
543 #define I2C_IC_FS_SCL_HCNT_IC_FS_SCL_HCNT_LSB    0
544 #define I2C_IC_FS_SCL_HCNT_IC_FS_SCL_HCNT_ACCESS "RW"
545 // =============================================================================
546 // Register    : I2C_IC_FS_SCL_LCNT
547 // Description : Fast Mode or Fast Mode Plus I2C Clock SCL Low Count Register
548 #define I2C_IC_FS_SCL_LCNT_OFFSET 0x00000020
549 #define I2C_IC_FS_SCL_LCNT_BITS   0x0000ffff
550 #define I2C_IC_FS_SCL_LCNT_RESET  0x0000000d
551 // -----------------------------------------------------------------------------
552 // Field       : I2C_IC_FS_SCL_LCNT_IC_FS_SCL_LCNT
553 // Description : This register must be set before any I2C bus transaction can
554 //               take place to ensure proper I/O timing. This register sets the
555 //               SCL clock low period count for fast speed. It is used in
556 //               high-speed mode to send the Master Code and START BYTE or
557 //               General CALL. For more information, refer to 'IC_CLK Frequency
558 //               Configuration'.
559 //
560 //               This register goes away and becomes read-only returning 0s if
561 //               IC_MAX_SPEED_MODE = standard.
562 //
563 //               This register can be written only when the I2C interface is
564 //               disabled, which corresponds to the IC_ENABLE[0] register being
565 //               set to 0. Writes at other times have no effect.
566 //
567 //               The minimum valid value is 8; hardware prevents values less
568 //               than this being written, and if attempted results in 8 being
569 //               set. For designs with APB_DATA_WIDTH = 8 the order of
570 //               programming is important to ensure the correct operation of the
571 //               DW_apb_i2c. The lower byte must be programmed first. Then the
572 //               upper byte is programmed. If the value is less than 8 then the
573 //               count value gets changed to 8.
574 #define I2C_IC_FS_SCL_LCNT_IC_FS_SCL_LCNT_RESET  0x000d
575 #define I2C_IC_FS_SCL_LCNT_IC_FS_SCL_LCNT_BITS   0x0000ffff
576 #define I2C_IC_FS_SCL_LCNT_IC_FS_SCL_LCNT_MSB    15
577 #define I2C_IC_FS_SCL_LCNT_IC_FS_SCL_LCNT_LSB    0
578 #define I2C_IC_FS_SCL_LCNT_IC_FS_SCL_LCNT_ACCESS "RW"
579 // =============================================================================
580 // Register    : I2C_IC_INTR_STAT
581 // Description : I2C Interrupt Status Register
582 //
583 //               Each bit in this register has a corresponding mask bit in the
584 //               IC_INTR_MASK register. These bits are cleared by reading the
585 //               matching interrupt clear register. The unmasked raw versions of
586 //               these bits are available in the IC_RAW_INTR_STAT register.
587 #define I2C_IC_INTR_STAT_OFFSET 0x0000002c
588 #define I2C_IC_INTR_STAT_BITS   0x00003fff
589 #define I2C_IC_INTR_STAT_RESET  0x00000000
590 // -----------------------------------------------------------------------------
591 // Field       : I2C_IC_INTR_STAT_R_MASTER_ON_HOLD
592 // Description : See IC_RAW_INTR_STAT for a detailed description of
593 //               R_MASTER_ON_HOLD bit.
594 //
595 //               Reset value: 0x0
596 //               0x0 -> R_MASTER_ON_HOLD interrupt is inactive
597 //               0x1 -> R_MASTER_ON_HOLD interrupt is active
598 #define I2C_IC_INTR_STAT_R_MASTER_ON_HOLD_RESET          0x0
599 #define I2C_IC_INTR_STAT_R_MASTER_ON_HOLD_BITS           0x00002000
600 #define I2C_IC_INTR_STAT_R_MASTER_ON_HOLD_MSB            13
601 #define I2C_IC_INTR_STAT_R_MASTER_ON_HOLD_LSB            13
602 #define I2C_IC_INTR_STAT_R_MASTER_ON_HOLD_ACCESS         "RO"
603 #define I2C_IC_INTR_STAT_R_MASTER_ON_HOLD_VALUE_INACTIVE 0x0
604 #define I2C_IC_INTR_STAT_R_MASTER_ON_HOLD_VALUE_ACTIVE   0x1
605 // -----------------------------------------------------------------------------
606 // Field       : I2C_IC_INTR_STAT_R_RESTART_DET
607 // Description : See IC_RAW_INTR_STAT for a detailed description of
608 //               R_RESTART_DET bit.
609 //
610 //               Reset value: 0x0
611 //               0x0 -> R_RESTART_DET interrupt is inactive
612 //               0x1 -> R_RESTART_DET interrupt is active
613 #define I2C_IC_INTR_STAT_R_RESTART_DET_RESET          0x0
614 #define I2C_IC_INTR_STAT_R_RESTART_DET_BITS           0x00001000
615 #define I2C_IC_INTR_STAT_R_RESTART_DET_MSB            12
616 #define I2C_IC_INTR_STAT_R_RESTART_DET_LSB            12
617 #define I2C_IC_INTR_STAT_R_RESTART_DET_ACCESS         "RO"
618 #define I2C_IC_INTR_STAT_R_RESTART_DET_VALUE_INACTIVE 0x0
619 #define I2C_IC_INTR_STAT_R_RESTART_DET_VALUE_ACTIVE   0x1
620 // -----------------------------------------------------------------------------
621 // Field       : I2C_IC_INTR_STAT_R_GEN_CALL
622 // Description : See IC_RAW_INTR_STAT for a detailed description of R_GEN_CALL
623 //               bit.
624 //
625 //               Reset value: 0x0
626 //               0x0 -> R_GEN_CALL interrupt is inactive
627 //               0x1 -> R_GEN_CALL interrupt is active
628 #define I2C_IC_INTR_STAT_R_GEN_CALL_RESET          0x0
629 #define I2C_IC_INTR_STAT_R_GEN_CALL_BITS           0x00000800
630 #define I2C_IC_INTR_STAT_R_GEN_CALL_MSB            11
631 #define I2C_IC_INTR_STAT_R_GEN_CALL_LSB            11
632 #define I2C_IC_INTR_STAT_R_GEN_CALL_ACCESS         "RO"
633 #define I2C_IC_INTR_STAT_R_GEN_CALL_VALUE_INACTIVE 0x0
634 #define I2C_IC_INTR_STAT_R_GEN_CALL_VALUE_ACTIVE   0x1
635 // -----------------------------------------------------------------------------
636 // Field       : I2C_IC_INTR_STAT_R_START_DET
637 // Description : See IC_RAW_INTR_STAT for a detailed description of R_START_DET
638 //               bit.
639 //
640 //               Reset value: 0x0
641 //               0x0 -> R_START_DET interrupt is inactive
642 //               0x1 -> R_START_DET interrupt is active
643 #define I2C_IC_INTR_STAT_R_START_DET_RESET          0x0
644 #define I2C_IC_INTR_STAT_R_START_DET_BITS           0x00000400
645 #define I2C_IC_INTR_STAT_R_START_DET_MSB            10
646 #define I2C_IC_INTR_STAT_R_START_DET_LSB            10
647 #define I2C_IC_INTR_STAT_R_START_DET_ACCESS         "RO"
648 #define I2C_IC_INTR_STAT_R_START_DET_VALUE_INACTIVE 0x0
649 #define I2C_IC_INTR_STAT_R_START_DET_VALUE_ACTIVE   0x1
650 // -----------------------------------------------------------------------------
651 // Field       : I2C_IC_INTR_STAT_R_STOP_DET
652 // Description : See IC_RAW_INTR_STAT for a detailed description of R_STOP_DET
653 //               bit.
654 //
655 //               Reset value: 0x0
656 //               0x0 -> R_STOP_DET interrupt is inactive
657 //               0x1 -> R_STOP_DET interrupt is active
658 #define I2C_IC_INTR_STAT_R_STOP_DET_RESET          0x0
659 #define I2C_IC_INTR_STAT_R_STOP_DET_BITS           0x00000200
660 #define I2C_IC_INTR_STAT_R_STOP_DET_MSB            9
661 #define I2C_IC_INTR_STAT_R_STOP_DET_LSB            9
662 #define I2C_IC_INTR_STAT_R_STOP_DET_ACCESS         "RO"
663 #define I2C_IC_INTR_STAT_R_STOP_DET_VALUE_INACTIVE 0x0
664 #define I2C_IC_INTR_STAT_R_STOP_DET_VALUE_ACTIVE   0x1
665 // -----------------------------------------------------------------------------
666 // Field       : I2C_IC_INTR_STAT_R_ACTIVITY
667 // Description : See IC_RAW_INTR_STAT for a detailed description of R_ACTIVITY
668 //               bit.
669 //
670 //               Reset value: 0x0
671 //               0x0 -> R_ACTIVITY interrupt is inactive
672 //               0x1 -> R_ACTIVITY interrupt is active
673 #define I2C_IC_INTR_STAT_R_ACTIVITY_RESET          0x0
674 #define I2C_IC_INTR_STAT_R_ACTIVITY_BITS           0x00000100
675 #define I2C_IC_INTR_STAT_R_ACTIVITY_MSB            8
676 #define I2C_IC_INTR_STAT_R_ACTIVITY_LSB            8
677 #define I2C_IC_INTR_STAT_R_ACTIVITY_ACCESS         "RO"
678 #define I2C_IC_INTR_STAT_R_ACTIVITY_VALUE_INACTIVE 0x0
679 #define I2C_IC_INTR_STAT_R_ACTIVITY_VALUE_ACTIVE   0x1
680 // -----------------------------------------------------------------------------
681 // Field       : I2C_IC_INTR_STAT_R_RX_DONE
682 // Description : See IC_RAW_INTR_STAT for a detailed description of R_RX_DONE
683 //               bit.
684 //
685 //               Reset value: 0x0
686 //               0x0 -> R_RX_DONE interrupt is inactive
687 //               0x1 -> R_RX_DONE interrupt is active
688 #define I2C_IC_INTR_STAT_R_RX_DONE_RESET          0x0
689 #define I2C_IC_INTR_STAT_R_RX_DONE_BITS           0x00000080
690 #define I2C_IC_INTR_STAT_R_RX_DONE_MSB            7
691 #define I2C_IC_INTR_STAT_R_RX_DONE_LSB            7
692 #define I2C_IC_INTR_STAT_R_RX_DONE_ACCESS         "RO"
693 #define I2C_IC_INTR_STAT_R_RX_DONE_VALUE_INACTIVE 0x0
694 #define I2C_IC_INTR_STAT_R_RX_DONE_VALUE_ACTIVE   0x1
695 // -----------------------------------------------------------------------------
696 // Field       : I2C_IC_INTR_STAT_R_TX_ABRT
697 // Description : See IC_RAW_INTR_STAT for a detailed description of R_TX_ABRT
698 //               bit.
699 //
700 //               Reset value: 0x0
701 //               0x0 -> R_TX_ABRT interrupt is inactive
702 //               0x1 -> R_TX_ABRT interrupt is active
703 #define I2C_IC_INTR_STAT_R_TX_ABRT_RESET          0x0
704 #define I2C_IC_INTR_STAT_R_TX_ABRT_BITS           0x00000040
705 #define I2C_IC_INTR_STAT_R_TX_ABRT_MSB            6
706 #define I2C_IC_INTR_STAT_R_TX_ABRT_LSB            6
707 #define I2C_IC_INTR_STAT_R_TX_ABRT_ACCESS         "RO"
708 #define I2C_IC_INTR_STAT_R_TX_ABRT_VALUE_INACTIVE 0x0
709 #define I2C_IC_INTR_STAT_R_TX_ABRT_VALUE_ACTIVE   0x1
710 // -----------------------------------------------------------------------------
711 // Field       : I2C_IC_INTR_STAT_R_RD_REQ
712 // Description : See IC_RAW_INTR_STAT for a detailed description of R_RD_REQ
713 //               bit.
714 //
715 //               Reset value: 0x0
716 //               0x0 -> R_RD_REQ interrupt is inactive
717 //               0x1 -> R_RD_REQ interrupt is active
718 #define I2C_IC_INTR_STAT_R_RD_REQ_RESET          0x0
719 #define I2C_IC_INTR_STAT_R_RD_REQ_BITS           0x00000020
720 #define I2C_IC_INTR_STAT_R_RD_REQ_MSB            5
721 #define I2C_IC_INTR_STAT_R_RD_REQ_LSB            5
722 #define I2C_IC_INTR_STAT_R_RD_REQ_ACCESS         "RO"
723 #define I2C_IC_INTR_STAT_R_RD_REQ_VALUE_INACTIVE 0x0
724 #define I2C_IC_INTR_STAT_R_RD_REQ_VALUE_ACTIVE   0x1
725 // -----------------------------------------------------------------------------
726 // Field       : I2C_IC_INTR_STAT_R_TX_EMPTY
727 // Description : See IC_RAW_INTR_STAT for a detailed description of R_TX_EMPTY
728 //               bit.
729 //
730 //               Reset value: 0x0
731 //               0x0 -> R_TX_EMPTY interrupt is inactive
732 //               0x1 -> R_TX_EMPTY interrupt is active
733 #define I2C_IC_INTR_STAT_R_TX_EMPTY_RESET          0x0
734 #define I2C_IC_INTR_STAT_R_TX_EMPTY_BITS           0x00000010
735 #define I2C_IC_INTR_STAT_R_TX_EMPTY_MSB            4
736 #define I2C_IC_INTR_STAT_R_TX_EMPTY_LSB            4
737 #define I2C_IC_INTR_STAT_R_TX_EMPTY_ACCESS         "RO"
738 #define I2C_IC_INTR_STAT_R_TX_EMPTY_VALUE_INACTIVE 0x0
739 #define I2C_IC_INTR_STAT_R_TX_EMPTY_VALUE_ACTIVE   0x1
740 // -----------------------------------------------------------------------------
741 // Field       : I2C_IC_INTR_STAT_R_TX_OVER
742 // Description : See IC_RAW_INTR_STAT for a detailed description of R_TX_OVER
743 //               bit.
744 //
745 //               Reset value: 0x0
746 //               0x0 -> R_TX_OVER interrupt is inactive
747 //               0x1 -> R_TX_OVER interrupt is active
748 #define I2C_IC_INTR_STAT_R_TX_OVER_RESET          0x0
749 #define I2C_IC_INTR_STAT_R_TX_OVER_BITS           0x00000008
750 #define I2C_IC_INTR_STAT_R_TX_OVER_MSB            3
751 #define I2C_IC_INTR_STAT_R_TX_OVER_LSB            3
752 #define I2C_IC_INTR_STAT_R_TX_OVER_ACCESS         "RO"
753 #define I2C_IC_INTR_STAT_R_TX_OVER_VALUE_INACTIVE 0x0
754 #define I2C_IC_INTR_STAT_R_TX_OVER_VALUE_ACTIVE   0x1
755 // -----------------------------------------------------------------------------
756 // Field       : I2C_IC_INTR_STAT_R_RX_FULL
757 // Description : See IC_RAW_INTR_STAT for a detailed description of R_RX_FULL
758 //               bit.
759 //
760 //               Reset value: 0x0
761 //               0x0 -> R_RX_FULL interrupt is inactive
762 //               0x1 -> R_RX_FULL interrupt is active
763 #define I2C_IC_INTR_STAT_R_RX_FULL_RESET          0x0
764 #define I2C_IC_INTR_STAT_R_RX_FULL_BITS           0x00000004
765 #define I2C_IC_INTR_STAT_R_RX_FULL_MSB            2
766 #define I2C_IC_INTR_STAT_R_RX_FULL_LSB            2
767 #define I2C_IC_INTR_STAT_R_RX_FULL_ACCESS         "RO"
768 #define I2C_IC_INTR_STAT_R_RX_FULL_VALUE_INACTIVE 0x0
769 #define I2C_IC_INTR_STAT_R_RX_FULL_VALUE_ACTIVE   0x1
770 // -----------------------------------------------------------------------------
771 // Field       : I2C_IC_INTR_STAT_R_RX_OVER
772 // Description : See IC_RAW_INTR_STAT for a detailed description of R_RX_OVER
773 //               bit.
774 //
775 //               Reset value: 0x0
776 //               0x0 -> R_RX_OVER interrupt is inactive
777 //               0x1 -> R_RX_OVER interrupt is active
778 #define I2C_IC_INTR_STAT_R_RX_OVER_RESET          0x0
779 #define I2C_IC_INTR_STAT_R_RX_OVER_BITS           0x00000002
780 #define I2C_IC_INTR_STAT_R_RX_OVER_MSB            1
781 #define I2C_IC_INTR_STAT_R_RX_OVER_LSB            1
782 #define I2C_IC_INTR_STAT_R_RX_OVER_ACCESS         "RO"
783 #define I2C_IC_INTR_STAT_R_RX_OVER_VALUE_INACTIVE 0x0
784 #define I2C_IC_INTR_STAT_R_RX_OVER_VALUE_ACTIVE   0x1
785 // -----------------------------------------------------------------------------
786 // Field       : I2C_IC_INTR_STAT_R_RX_UNDER
787 // Description : See IC_RAW_INTR_STAT for a detailed description of R_RX_UNDER
788 //               bit.
789 //
790 //               Reset value: 0x0
791 //               0x0 -> RX_UNDER interrupt is inactive
792 //               0x1 -> RX_UNDER interrupt is active
793 #define I2C_IC_INTR_STAT_R_RX_UNDER_RESET          0x0
794 #define I2C_IC_INTR_STAT_R_RX_UNDER_BITS           0x00000001
795 #define I2C_IC_INTR_STAT_R_RX_UNDER_MSB            0
796 #define I2C_IC_INTR_STAT_R_RX_UNDER_LSB            0
797 #define I2C_IC_INTR_STAT_R_RX_UNDER_ACCESS         "RO"
798 #define I2C_IC_INTR_STAT_R_RX_UNDER_VALUE_INACTIVE 0x0
799 #define I2C_IC_INTR_STAT_R_RX_UNDER_VALUE_ACTIVE   0x1
800 // =============================================================================
801 // Register    : I2C_IC_INTR_MASK
802 // Description : I2C Interrupt Mask Register.
803 //
804 //               These bits mask their corresponding interrupt status bits. This
805 //               register is active low; a value of 0 masks the interrupt,
806 //               whereas a value of 1 unmasks the interrupt.
807 #define I2C_IC_INTR_MASK_OFFSET 0x00000030
808 #define I2C_IC_INTR_MASK_BITS   0x00003fff
809 #define I2C_IC_INTR_MASK_RESET  0x000008ff
810 // -----------------------------------------------------------------------------
811 // Field       : I2C_IC_INTR_MASK_M_MASTER_ON_HOLD_READ_ONLY
812 // Description : This M_MASTER_ON_HOLD_read_only bit masks the R_MASTER_ON_HOLD
813 //               interrupt in IC_INTR_STAT register.
814 //
815 //               Reset value: 0x0
816 //               0x0 -> MASTER_ON_HOLD interrupt is masked
817 //               0x1 -> MASTER_ON_HOLD interrupt is unmasked
818 #define I2C_IC_INTR_MASK_M_MASTER_ON_HOLD_READ_ONLY_RESET          0x0
819 #define I2C_IC_INTR_MASK_M_MASTER_ON_HOLD_READ_ONLY_BITS           0x00002000
820 #define I2C_IC_INTR_MASK_M_MASTER_ON_HOLD_READ_ONLY_MSB            13
821 #define I2C_IC_INTR_MASK_M_MASTER_ON_HOLD_READ_ONLY_LSB            13
822 #define I2C_IC_INTR_MASK_M_MASTER_ON_HOLD_READ_ONLY_ACCESS         "RO"
823 #define I2C_IC_INTR_MASK_M_MASTER_ON_HOLD_READ_ONLY_VALUE_ENABLED  0x0
824 #define I2C_IC_INTR_MASK_M_MASTER_ON_HOLD_READ_ONLY_VALUE_DISABLED 0x1
825 // -----------------------------------------------------------------------------
826 // Field       : I2C_IC_INTR_MASK_M_RESTART_DET
827 // Description : This bit masks the R_RESTART_DET interrupt in IC_INTR_STAT
828 //               register.
829 //
830 //               Reset value: 0x0
831 //               0x0 -> RESTART_DET interrupt is masked
832 //               0x1 -> RESTART_DET interrupt is unmasked
833 #define I2C_IC_INTR_MASK_M_RESTART_DET_RESET          0x0
834 #define I2C_IC_INTR_MASK_M_RESTART_DET_BITS           0x00001000
835 #define I2C_IC_INTR_MASK_M_RESTART_DET_MSB            12
836 #define I2C_IC_INTR_MASK_M_RESTART_DET_LSB            12
837 #define I2C_IC_INTR_MASK_M_RESTART_DET_ACCESS         "RW"
838 #define I2C_IC_INTR_MASK_M_RESTART_DET_VALUE_ENABLED  0x0
839 #define I2C_IC_INTR_MASK_M_RESTART_DET_VALUE_DISABLED 0x1
840 // -----------------------------------------------------------------------------
841 // Field       : I2C_IC_INTR_MASK_M_GEN_CALL
842 // Description : This bit masks the R_GEN_CALL interrupt in IC_INTR_STAT
843 //               register.
844 //
845 //               Reset value: 0x1
846 //               0x0 -> GEN_CALL interrupt is masked
847 //               0x1 -> GEN_CALL interrupt is unmasked
848 #define I2C_IC_INTR_MASK_M_GEN_CALL_RESET          0x1
849 #define I2C_IC_INTR_MASK_M_GEN_CALL_BITS           0x00000800
850 #define I2C_IC_INTR_MASK_M_GEN_CALL_MSB            11
851 #define I2C_IC_INTR_MASK_M_GEN_CALL_LSB            11
852 #define I2C_IC_INTR_MASK_M_GEN_CALL_ACCESS         "RW"
853 #define I2C_IC_INTR_MASK_M_GEN_CALL_VALUE_ENABLED  0x0
854 #define I2C_IC_INTR_MASK_M_GEN_CALL_VALUE_DISABLED 0x1
855 // -----------------------------------------------------------------------------
856 // Field       : I2C_IC_INTR_MASK_M_START_DET
857 // Description : This bit masks the R_START_DET interrupt in IC_INTR_STAT
858 //               register.
859 //
860 //               Reset value: 0x0
861 //               0x0 -> START_DET interrupt is masked
862 //               0x1 -> START_DET interrupt is unmasked
863 #define I2C_IC_INTR_MASK_M_START_DET_RESET          0x0
864 #define I2C_IC_INTR_MASK_M_START_DET_BITS           0x00000400
865 #define I2C_IC_INTR_MASK_M_START_DET_MSB            10
866 #define I2C_IC_INTR_MASK_M_START_DET_LSB            10
867 #define I2C_IC_INTR_MASK_M_START_DET_ACCESS         "RW"
868 #define I2C_IC_INTR_MASK_M_START_DET_VALUE_ENABLED  0x0
869 #define I2C_IC_INTR_MASK_M_START_DET_VALUE_DISABLED 0x1
870 // -----------------------------------------------------------------------------
871 // Field       : I2C_IC_INTR_MASK_M_STOP_DET
872 // Description : This bit masks the R_STOP_DET interrupt in IC_INTR_STAT
873 //               register.
874 //
875 //               Reset value: 0x0
876 //               0x0 -> STOP_DET interrupt is masked
877 //               0x1 -> STOP_DET interrupt is unmasked
878 #define I2C_IC_INTR_MASK_M_STOP_DET_RESET          0x0
879 #define I2C_IC_INTR_MASK_M_STOP_DET_BITS           0x00000200
880 #define I2C_IC_INTR_MASK_M_STOP_DET_MSB            9
881 #define I2C_IC_INTR_MASK_M_STOP_DET_LSB            9
882 #define I2C_IC_INTR_MASK_M_STOP_DET_ACCESS         "RW"
883 #define I2C_IC_INTR_MASK_M_STOP_DET_VALUE_ENABLED  0x0
884 #define I2C_IC_INTR_MASK_M_STOP_DET_VALUE_DISABLED 0x1
885 // -----------------------------------------------------------------------------
886 // Field       : I2C_IC_INTR_MASK_M_ACTIVITY
887 // Description : This bit masks the R_ACTIVITY interrupt in IC_INTR_STAT
888 //               register.
889 //
890 //               Reset value: 0x0
891 //               0x0 -> ACTIVITY interrupt is masked
892 //               0x1 -> ACTIVITY interrupt is unmasked
893 #define I2C_IC_INTR_MASK_M_ACTIVITY_RESET          0x0
894 #define I2C_IC_INTR_MASK_M_ACTIVITY_BITS           0x00000100
895 #define I2C_IC_INTR_MASK_M_ACTIVITY_MSB            8
896 #define I2C_IC_INTR_MASK_M_ACTIVITY_LSB            8
897 #define I2C_IC_INTR_MASK_M_ACTIVITY_ACCESS         "RW"
898 #define I2C_IC_INTR_MASK_M_ACTIVITY_VALUE_ENABLED  0x0
899 #define I2C_IC_INTR_MASK_M_ACTIVITY_VALUE_DISABLED 0x1
900 // -----------------------------------------------------------------------------
901 // Field       : I2C_IC_INTR_MASK_M_RX_DONE
902 // Description : This bit masks the R_RX_DONE interrupt in IC_INTR_STAT
903 //               register.
904 //
905 //               Reset value: 0x1
906 //               0x0 -> RX_DONE interrupt is masked
907 //               0x1 -> RX_DONE interrupt is unmasked
908 #define I2C_IC_INTR_MASK_M_RX_DONE_RESET          0x1
909 #define I2C_IC_INTR_MASK_M_RX_DONE_BITS           0x00000080
910 #define I2C_IC_INTR_MASK_M_RX_DONE_MSB            7
911 #define I2C_IC_INTR_MASK_M_RX_DONE_LSB            7
912 #define I2C_IC_INTR_MASK_M_RX_DONE_ACCESS         "RW"
913 #define I2C_IC_INTR_MASK_M_RX_DONE_VALUE_ENABLED  0x0
914 #define I2C_IC_INTR_MASK_M_RX_DONE_VALUE_DISABLED 0x1
915 // -----------------------------------------------------------------------------
916 // Field       : I2C_IC_INTR_MASK_M_TX_ABRT
917 // Description : This bit masks the R_TX_ABRT interrupt in IC_INTR_STAT
918 //               register.
919 //
920 //               Reset value: 0x1
921 //               0x0 -> TX_ABORT interrupt is masked
922 //               0x1 -> TX_ABORT interrupt is unmasked
923 #define I2C_IC_INTR_MASK_M_TX_ABRT_RESET          0x1
924 #define I2C_IC_INTR_MASK_M_TX_ABRT_BITS           0x00000040
925 #define I2C_IC_INTR_MASK_M_TX_ABRT_MSB            6
926 #define I2C_IC_INTR_MASK_M_TX_ABRT_LSB            6
927 #define I2C_IC_INTR_MASK_M_TX_ABRT_ACCESS         "RW"
928 #define I2C_IC_INTR_MASK_M_TX_ABRT_VALUE_ENABLED  0x0
929 #define I2C_IC_INTR_MASK_M_TX_ABRT_VALUE_DISABLED 0x1
930 // -----------------------------------------------------------------------------
931 // Field       : I2C_IC_INTR_MASK_M_RD_REQ
932 // Description : This bit masks the R_RD_REQ interrupt in IC_INTR_STAT register.
933 //
934 //               Reset value: 0x1
935 //               0x0 -> RD_REQ interrupt is masked
936 //               0x1 -> RD_REQ interrupt is unmasked
937 #define I2C_IC_INTR_MASK_M_RD_REQ_RESET          0x1
938 #define I2C_IC_INTR_MASK_M_RD_REQ_BITS           0x00000020
939 #define I2C_IC_INTR_MASK_M_RD_REQ_MSB            5
940 #define I2C_IC_INTR_MASK_M_RD_REQ_LSB            5
941 #define I2C_IC_INTR_MASK_M_RD_REQ_ACCESS         "RW"
942 #define I2C_IC_INTR_MASK_M_RD_REQ_VALUE_ENABLED  0x0
943 #define I2C_IC_INTR_MASK_M_RD_REQ_VALUE_DISABLED 0x1
944 // -----------------------------------------------------------------------------
945 // Field       : I2C_IC_INTR_MASK_M_TX_EMPTY
946 // Description : This bit masks the R_TX_EMPTY interrupt in IC_INTR_STAT
947 //               register.
948 //
949 //               Reset value: 0x1
950 //               0x0 -> TX_EMPTY interrupt is masked
951 //               0x1 -> TX_EMPTY interrupt is unmasked
952 #define I2C_IC_INTR_MASK_M_TX_EMPTY_RESET          0x1
953 #define I2C_IC_INTR_MASK_M_TX_EMPTY_BITS           0x00000010
954 #define I2C_IC_INTR_MASK_M_TX_EMPTY_MSB            4
955 #define I2C_IC_INTR_MASK_M_TX_EMPTY_LSB            4
956 #define I2C_IC_INTR_MASK_M_TX_EMPTY_ACCESS         "RW"
957 #define I2C_IC_INTR_MASK_M_TX_EMPTY_VALUE_ENABLED  0x0
958 #define I2C_IC_INTR_MASK_M_TX_EMPTY_VALUE_DISABLED 0x1
959 // -----------------------------------------------------------------------------
960 // Field       : I2C_IC_INTR_MASK_M_TX_OVER
961 // Description : This bit masks the R_TX_OVER interrupt in IC_INTR_STAT
962 //               register.
963 //
964 //               Reset value: 0x1
965 //               0x0 -> TX_OVER interrupt is masked
966 //               0x1 -> TX_OVER interrupt is unmasked
967 #define I2C_IC_INTR_MASK_M_TX_OVER_RESET          0x1
968 #define I2C_IC_INTR_MASK_M_TX_OVER_BITS           0x00000008
969 #define I2C_IC_INTR_MASK_M_TX_OVER_MSB            3
970 #define I2C_IC_INTR_MASK_M_TX_OVER_LSB            3
971 #define I2C_IC_INTR_MASK_M_TX_OVER_ACCESS         "RW"
972 #define I2C_IC_INTR_MASK_M_TX_OVER_VALUE_ENABLED  0x0
973 #define I2C_IC_INTR_MASK_M_TX_OVER_VALUE_DISABLED 0x1
974 // -----------------------------------------------------------------------------
975 // Field       : I2C_IC_INTR_MASK_M_RX_FULL
976 // Description : This bit masks the R_RX_FULL interrupt in IC_INTR_STAT
977 //               register.
978 //
979 //               Reset value: 0x1
980 //               0x0 -> RX_FULL interrupt is masked
981 //               0x1 -> RX_FULL interrupt is unmasked
982 #define I2C_IC_INTR_MASK_M_RX_FULL_RESET          0x1
983 #define I2C_IC_INTR_MASK_M_RX_FULL_BITS           0x00000004
984 #define I2C_IC_INTR_MASK_M_RX_FULL_MSB            2
985 #define I2C_IC_INTR_MASK_M_RX_FULL_LSB            2
986 #define I2C_IC_INTR_MASK_M_RX_FULL_ACCESS         "RW"
987 #define I2C_IC_INTR_MASK_M_RX_FULL_VALUE_ENABLED  0x0
988 #define I2C_IC_INTR_MASK_M_RX_FULL_VALUE_DISABLED 0x1
989 // -----------------------------------------------------------------------------
990 // Field       : I2C_IC_INTR_MASK_M_RX_OVER
991 // Description : This bit masks the R_RX_OVER interrupt in IC_INTR_STAT
992 //               register.
993 //
994 //               Reset value: 0x1
995 //               0x0 -> RX_OVER interrupt is masked
996 //               0x1 -> RX_OVER interrupt is unmasked
997 #define I2C_IC_INTR_MASK_M_RX_OVER_RESET          0x1
998 #define I2C_IC_INTR_MASK_M_RX_OVER_BITS           0x00000002
999 #define I2C_IC_INTR_MASK_M_RX_OVER_MSB            1
1000 #define I2C_IC_INTR_MASK_M_RX_OVER_LSB            1
1001 #define I2C_IC_INTR_MASK_M_RX_OVER_ACCESS         "RW"
1002 #define I2C_IC_INTR_MASK_M_RX_OVER_VALUE_ENABLED  0x0
1003 #define I2C_IC_INTR_MASK_M_RX_OVER_VALUE_DISABLED 0x1
1004 // -----------------------------------------------------------------------------
1005 // Field       : I2C_IC_INTR_MASK_M_RX_UNDER
1006 // Description : This bit masks the R_RX_UNDER interrupt in IC_INTR_STAT
1007 //               register.
1008 //
1009 //               Reset value: 0x1
1010 //               0x0 -> RX_UNDER interrupt is masked
1011 //               0x1 -> RX_UNDER interrupt is unmasked
1012 #define I2C_IC_INTR_MASK_M_RX_UNDER_RESET          0x1
1013 #define I2C_IC_INTR_MASK_M_RX_UNDER_BITS           0x00000001
1014 #define I2C_IC_INTR_MASK_M_RX_UNDER_MSB            0
1015 #define I2C_IC_INTR_MASK_M_RX_UNDER_LSB            0
1016 #define I2C_IC_INTR_MASK_M_RX_UNDER_ACCESS         "RW"
1017 #define I2C_IC_INTR_MASK_M_RX_UNDER_VALUE_ENABLED  0x0
1018 #define I2C_IC_INTR_MASK_M_RX_UNDER_VALUE_DISABLED 0x1
1019 // =============================================================================
1020 // Register    : I2C_IC_RAW_INTR_STAT
1021 // Description : I2C Raw Interrupt Status Register
1022 //
1023 //               Unlike the IC_INTR_STAT register, these bits are not masked so
1024 //               they always show the true status of the DW_apb_i2c.
1025 #define I2C_IC_RAW_INTR_STAT_OFFSET 0x00000034
1026 #define I2C_IC_RAW_INTR_STAT_BITS   0x00003fff
1027 #define I2C_IC_RAW_INTR_STAT_RESET  0x00000000
1028 // -----------------------------------------------------------------------------
1029 // Field       : I2C_IC_RAW_INTR_STAT_MASTER_ON_HOLD
1030 // Description : Indicates whether master is holding the bus and TX FIFO is
1031 //               empty. Enabled only when I2C_DYNAMIC_TAR_UPDATE=1 and
1032 //               IC_EMPTYFIFO_HOLD_MASTER_EN=1.
1033 //
1034 //               Reset value: 0x0
1035 //               0x0 -> MASTER_ON_HOLD interrupt is inactive
1036 //               0x1 -> MASTER_ON_HOLD interrupt is active
1037 #define I2C_IC_RAW_INTR_STAT_MASTER_ON_HOLD_RESET          0x0
1038 #define I2C_IC_RAW_INTR_STAT_MASTER_ON_HOLD_BITS           0x00002000
1039 #define I2C_IC_RAW_INTR_STAT_MASTER_ON_HOLD_MSB            13
1040 #define I2C_IC_RAW_INTR_STAT_MASTER_ON_HOLD_LSB            13
1041 #define I2C_IC_RAW_INTR_STAT_MASTER_ON_HOLD_ACCESS         "RO"
1042 #define I2C_IC_RAW_INTR_STAT_MASTER_ON_HOLD_VALUE_INACTIVE 0x0
1043 #define I2C_IC_RAW_INTR_STAT_MASTER_ON_HOLD_VALUE_ACTIVE   0x1
1044 // -----------------------------------------------------------------------------
1045 // Field       : I2C_IC_RAW_INTR_STAT_RESTART_DET
1046 // Description : Indicates whether a RESTART condition has occurred on the I2C
1047 //               interface when DW_apb_i2c is operating in Slave mode and the
1048 //               slave is being addressed. Enabled only when
1049 //               IC_SLV_RESTART_DET_EN=1.
1050 //
1051 //               Note: However, in high-speed mode or during a START BYTE
1052 //               transfer, the RESTART comes before the address field as per the
1053 //               I2C protocol. In this case, the slave is not the addressed
1054 //               slave when the RESTART is issued, therefore DW_apb_i2c does not
1055 //               generate the RESTART_DET interrupt.
1056 //
1057 //               Reset value: 0x0
1058 //               0x0 -> RESTART_DET interrupt is inactive
1059 //               0x1 -> RESTART_DET interrupt is active
1060 #define I2C_IC_RAW_INTR_STAT_RESTART_DET_RESET          0x0
1061 #define I2C_IC_RAW_INTR_STAT_RESTART_DET_BITS           0x00001000
1062 #define I2C_IC_RAW_INTR_STAT_RESTART_DET_MSB            12
1063 #define I2C_IC_RAW_INTR_STAT_RESTART_DET_LSB            12
1064 #define I2C_IC_RAW_INTR_STAT_RESTART_DET_ACCESS         "RO"
1065 #define I2C_IC_RAW_INTR_STAT_RESTART_DET_VALUE_INACTIVE 0x0
1066 #define I2C_IC_RAW_INTR_STAT_RESTART_DET_VALUE_ACTIVE   0x1
1067 // -----------------------------------------------------------------------------
1068 // Field       : I2C_IC_RAW_INTR_STAT_GEN_CALL
1069 // Description : Set only when a General Call address is received and it is
1070 //               acknowledged. It stays set until it is cleared either by
1071 //               disabling DW_apb_i2c or when the CPU reads bit 0 of the
1072 //               IC_CLR_GEN_CALL register. DW_apb_i2c stores the received data
1073 //               in the Rx buffer.
1074 //
1075 //               Reset value: 0x0
1076 //               0x0 -> GEN_CALL interrupt is inactive
1077 //               0x1 -> GEN_CALL interrupt is active
1078 #define I2C_IC_RAW_INTR_STAT_GEN_CALL_RESET          0x0
1079 #define I2C_IC_RAW_INTR_STAT_GEN_CALL_BITS           0x00000800
1080 #define I2C_IC_RAW_INTR_STAT_GEN_CALL_MSB            11
1081 #define I2C_IC_RAW_INTR_STAT_GEN_CALL_LSB            11
1082 #define I2C_IC_RAW_INTR_STAT_GEN_CALL_ACCESS         "RO"
1083 #define I2C_IC_RAW_INTR_STAT_GEN_CALL_VALUE_INACTIVE 0x0
1084 #define I2C_IC_RAW_INTR_STAT_GEN_CALL_VALUE_ACTIVE   0x1
1085 // -----------------------------------------------------------------------------
1086 // Field       : I2C_IC_RAW_INTR_STAT_START_DET
1087 // Description : Indicates whether a START or RESTART condition has occurred on
1088 //               the I2C interface regardless of whether DW_apb_i2c is operating
1089 //               in slave or master mode.
1090 //
1091 //               Reset value: 0x0
1092 //               0x0 -> START_DET interrupt is inactive
1093 //               0x1 -> START_DET interrupt is active
1094 #define I2C_IC_RAW_INTR_STAT_START_DET_RESET          0x0
1095 #define I2C_IC_RAW_INTR_STAT_START_DET_BITS           0x00000400
1096 #define I2C_IC_RAW_INTR_STAT_START_DET_MSB            10
1097 #define I2C_IC_RAW_INTR_STAT_START_DET_LSB            10
1098 #define I2C_IC_RAW_INTR_STAT_START_DET_ACCESS         "RO"
1099 #define I2C_IC_RAW_INTR_STAT_START_DET_VALUE_INACTIVE 0x0
1100 #define I2C_IC_RAW_INTR_STAT_START_DET_VALUE_ACTIVE   0x1
1101 // -----------------------------------------------------------------------------
1102 // Field       : I2C_IC_RAW_INTR_STAT_STOP_DET
1103 // Description : Indicates whether a STOP condition has occurred on the I2C
1104 //               interface regardless of whether DW_apb_i2c is operating in
1105 //               slave or master mode.
1106 //
1107 //               In Slave Mode: - If IC_CON[7]=1'b1  (STOP_DET_IFADDRESSED), the
1108 //               STOP_DET interrupt will be issued only if slave is addressed.
1109 //               Note: During a general call address, this slave does not issue
1110 //               a STOP_DET interrupt if STOP_DET_IF_ADDRESSED=1'b1, even if the
1111 //               slave responds to the general call address by generating ACK.
1112 //               The STOP_DET interrupt is generated only when the transmitted
1113 //               address matches the slave address (SAR). - If IC_CON[7]=1'b0
1114 //               (STOP_DET_IFADDRESSED), the STOP_DET interrupt is issued
1115 //               irrespective of whether it is being addressed. In Master Mode:
1116 //               - If IC_CON[10]=1'b1  (STOP_DET_IF_MASTER_ACTIVE),the STOP_DET
1117 //               interrupt will be issued only if Master is active. - If
1118 //               IC_CON[10]=1'b0  (STOP_DET_IFADDRESSED),the STOP_DET interrupt
1119 //               will be issued irrespective of whether master is active or not.
1120 //               Reset value: 0x0
1121 //               0x0 -> STOP_DET interrupt is inactive
1122 //               0x1 -> STOP_DET interrupt is active
1123 #define I2C_IC_RAW_INTR_STAT_STOP_DET_RESET          0x0
1124 #define I2C_IC_RAW_INTR_STAT_STOP_DET_BITS           0x00000200
1125 #define I2C_IC_RAW_INTR_STAT_STOP_DET_MSB            9
1126 #define I2C_IC_RAW_INTR_STAT_STOP_DET_LSB            9
1127 #define I2C_IC_RAW_INTR_STAT_STOP_DET_ACCESS         "RO"
1128 #define I2C_IC_RAW_INTR_STAT_STOP_DET_VALUE_INACTIVE 0x0
1129 #define I2C_IC_RAW_INTR_STAT_STOP_DET_VALUE_ACTIVE   0x1
1130 // -----------------------------------------------------------------------------
1131 // Field       : I2C_IC_RAW_INTR_STAT_ACTIVITY
1132 // Description : This bit captures DW_apb_i2c activity and stays set until it is
1133 //               cleared. There are four ways to clear it: - Disabling the
1134 //               DW_apb_i2c - Reading the IC_CLR_ACTIVITY register - Reading the
1135 //               IC_CLR_INTR register - System reset Once this bit is set, it
1136 //               stays set unless one of the four methods is used to clear it.
1137 //               Even if the DW_apb_i2c module is idle, this bit remains set
1138 //               until cleared, indicating that there was activity on the bus.
1139 //
1140 //               Reset value: 0x0
1141 //               0x0 -> RAW_INTR_ACTIVITY interrupt is inactive
1142 //               0x1 -> RAW_INTR_ACTIVITY interrupt is active
1143 #define I2C_IC_RAW_INTR_STAT_ACTIVITY_RESET          0x0
1144 #define I2C_IC_RAW_INTR_STAT_ACTIVITY_BITS           0x00000100
1145 #define I2C_IC_RAW_INTR_STAT_ACTIVITY_MSB            8
1146 #define I2C_IC_RAW_INTR_STAT_ACTIVITY_LSB            8
1147 #define I2C_IC_RAW_INTR_STAT_ACTIVITY_ACCESS         "RO"
1148 #define I2C_IC_RAW_INTR_STAT_ACTIVITY_VALUE_INACTIVE 0x0
1149 #define I2C_IC_RAW_INTR_STAT_ACTIVITY_VALUE_ACTIVE   0x1
1150 // -----------------------------------------------------------------------------
1151 // Field       : I2C_IC_RAW_INTR_STAT_RX_DONE
1152 // Description : When the DW_apb_i2c is acting as a slave-transmitter, this bit
1153 //               is set to 1 if the master does not acknowledge a transmitted
1154 //               byte. This occurs on the last byte of the transmission,
1155 //               indicating that the transmission is done.
1156 //
1157 //               Reset value: 0x0
1158 //               0x0 -> RX_DONE interrupt is inactive
1159 //               0x1 -> RX_DONE interrupt is active
1160 #define I2C_IC_RAW_INTR_STAT_RX_DONE_RESET          0x0
1161 #define I2C_IC_RAW_INTR_STAT_RX_DONE_BITS           0x00000080
1162 #define I2C_IC_RAW_INTR_STAT_RX_DONE_MSB            7
1163 #define I2C_IC_RAW_INTR_STAT_RX_DONE_LSB            7
1164 #define I2C_IC_RAW_INTR_STAT_RX_DONE_ACCESS         "RO"
1165 #define I2C_IC_RAW_INTR_STAT_RX_DONE_VALUE_INACTIVE 0x0
1166 #define I2C_IC_RAW_INTR_STAT_RX_DONE_VALUE_ACTIVE   0x1
1167 // -----------------------------------------------------------------------------
1168 // Field       : I2C_IC_RAW_INTR_STAT_TX_ABRT
1169 // Description : This bit indicates if DW_apb_i2c, as an I2C transmitter, is
1170 //               unable to complete the intended actions on the contents of the
1171 //               transmit FIFO. This situation can occur both as an I2C master
1172 //               or an I2C slave, and is referred to as a 'transmit abort'. When
1173 //               this bit is set to 1, the IC_TX_ABRT_SOURCE register indicates
1174 //               the reason why the transmit abort takes places.
1175 //
1176 //               Note:  The DW_apb_i2c flushes/resets/empties the TX_FIFO and
1177 //               RX_FIFO whenever there is a transmit abort caused by any of the
1178 //               events tracked by the IC_TX_ABRT_SOURCE register. The FIFOs
1179 //               remains in this flushed state until the register IC_CLR_TX_ABRT
1180 //               is read. Once this read is performed, the Tx FIFO is then ready
1181 //               to accept more data bytes from the APB interface.
1182 //
1183 //               Reset value: 0x0
1184 //               0x0 -> TX_ABRT interrupt is inactive
1185 //               0x1 -> TX_ABRT interrupt is active
1186 #define I2C_IC_RAW_INTR_STAT_TX_ABRT_RESET          0x0
1187 #define I2C_IC_RAW_INTR_STAT_TX_ABRT_BITS           0x00000040
1188 #define I2C_IC_RAW_INTR_STAT_TX_ABRT_MSB            6
1189 #define I2C_IC_RAW_INTR_STAT_TX_ABRT_LSB            6
1190 #define I2C_IC_RAW_INTR_STAT_TX_ABRT_ACCESS         "RO"
1191 #define I2C_IC_RAW_INTR_STAT_TX_ABRT_VALUE_INACTIVE 0x0
1192 #define I2C_IC_RAW_INTR_STAT_TX_ABRT_VALUE_ACTIVE   0x1
1193 // -----------------------------------------------------------------------------
1194 // Field       : I2C_IC_RAW_INTR_STAT_RD_REQ
1195 // Description : This bit is set to 1 when DW_apb_i2c is acting as a slave and
1196 //               another I2C master is attempting to read data from DW_apb_i2c.
1197 //               The DW_apb_i2c holds the I2C bus in a wait state (SCL=0) until
1198 //               this interrupt is serviced, which means that the slave has been
1199 //               addressed by a remote master that is asking for data to be
1200 //               transferred. The processor must respond to this interrupt and
1201 //               then write the requested data to the IC_DATA_CMD register. This
1202 //               bit is set to 0 just after the processor reads the
1203 //               IC_CLR_RD_REQ register.
1204 //
1205 //               Reset value: 0x0
1206 //               0x0 -> RD_REQ interrupt is inactive
1207 //               0x1 -> RD_REQ interrupt is active
1208 #define I2C_IC_RAW_INTR_STAT_RD_REQ_RESET          0x0
1209 #define I2C_IC_RAW_INTR_STAT_RD_REQ_BITS           0x00000020
1210 #define I2C_IC_RAW_INTR_STAT_RD_REQ_MSB            5
1211 #define I2C_IC_RAW_INTR_STAT_RD_REQ_LSB            5
1212 #define I2C_IC_RAW_INTR_STAT_RD_REQ_ACCESS         "RO"
1213 #define I2C_IC_RAW_INTR_STAT_RD_REQ_VALUE_INACTIVE 0x0
1214 #define I2C_IC_RAW_INTR_STAT_RD_REQ_VALUE_ACTIVE   0x1
1215 // -----------------------------------------------------------------------------
1216 // Field       : I2C_IC_RAW_INTR_STAT_TX_EMPTY
1217 // Description : The behavior of the TX_EMPTY interrupt status differs based on
1218 //               the TX_EMPTY_CTRL selection in the IC_CON register. - When
1219 //               TX_EMPTY_CTRL = 0: This bit is set to 1 when the transmit
1220 //               buffer is at or below the threshold value set in the IC_TX_TL
1221 //               register. - When TX_EMPTY_CTRL = 1: This bit is set to 1 when
1222 //               the transmit buffer is at or below the threshold value set in
1223 //               the IC_TX_TL register and the transmission of the address/data
1224 //               from the internal shift register for the most recently popped
1225 //               command is completed. It is automatically cleared by hardware
1226 //               when the buffer level goes above the threshold. When
1227 //               IC_ENABLE[0] is set to 0, the TX FIFO is flushed and held in
1228 //               reset. There the TX FIFO looks like it has no data within it,
1229 //               so this bit is set to 1, provided there is activity in the
1230 //               master or slave state machines. When there is no longer any
1231 //               activity, then with ic_en=0, this bit is set to 0.
1232 //
1233 //               Reset value: 0x0.
1234 //               0x0 -> TX_EMPTY interrupt is inactive
1235 //               0x1 -> TX_EMPTY interrupt is active
1236 #define I2C_IC_RAW_INTR_STAT_TX_EMPTY_RESET          0x0
1237 #define I2C_IC_RAW_INTR_STAT_TX_EMPTY_BITS           0x00000010
1238 #define I2C_IC_RAW_INTR_STAT_TX_EMPTY_MSB            4
1239 #define I2C_IC_RAW_INTR_STAT_TX_EMPTY_LSB            4
1240 #define I2C_IC_RAW_INTR_STAT_TX_EMPTY_ACCESS         "RO"
1241 #define I2C_IC_RAW_INTR_STAT_TX_EMPTY_VALUE_INACTIVE 0x0
1242 #define I2C_IC_RAW_INTR_STAT_TX_EMPTY_VALUE_ACTIVE   0x1
1243 // -----------------------------------------------------------------------------
1244 // Field       : I2C_IC_RAW_INTR_STAT_TX_OVER
1245 // Description : Set during transmit if the transmit buffer is filled to
1246 //               IC_TX_BUFFER_DEPTH and the processor attempts to issue another
1247 //               I2C command by writing to the IC_DATA_CMD register. When the
1248 //               module is disabled, this bit keeps its level until the master
1249 //               or slave state machines go into idle, and when ic_en goes to 0,
1250 //               this interrupt is cleared.
1251 //
1252 //               Reset value: 0x0
1253 //               0x0 -> TX_OVER interrupt is inactive
1254 //               0x1 -> TX_OVER interrupt is active
1255 #define I2C_IC_RAW_INTR_STAT_TX_OVER_RESET          0x0
1256 #define I2C_IC_RAW_INTR_STAT_TX_OVER_BITS           0x00000008
1257 #define I2C_IC_RAW_INTR_STAT_TX_OVER_MSB            3
1258 #define I2C_IC_RAW_INTR_STAT_TX_OVER_LSB            3
1259 #define I2C_IC_RAW_INTR_STAT_TX_OVER_ACCESS         "RO"
1260 #define I2C_IC_RAW_INTR_STAT_TX_OVER_VALUE_INACTIVE 0x0
1261 #define I2C_IC_RAW_INTR_STAT_TX_OVER_VALUE_ACTIVE   0x1
1262 // -----------------------------------------------------------------------------
1263 // Field       : I2C_IC_RAW_INTR_STAT_RX_FULL
1264 // Description : Set when the receive buffer reaches or goes above the RX_TL
1265 //               threshold in the IC_RX_TL register. It is automatically cleared
1266 //               by hardware when buffer level goes below the threshold. If the
1267 //               module is disabled (IC_ENABLE[0]=0), the RX FIFO is flushed and
1268 //               held in reset; therefore the RX FIFO is not full. So this bit
1269 //               is cleared once the IC_ENABLE bit 0 is programmed with a 0,
1270 //               regardless of the activity that continues.
1271 //
1272 //               Reset value: 0x0
1273 //               0x0 -> RX_FULL interrupt is inactive
1274 //               0x1 -> RX_FULL interrupt is active
1275 #define I2C_IC_RAW_INTR_STAT_RX_FULL_RESET          0x0
1276 #define I2C_IC_RAW_INTR_STAT_RX_FULL_BITS           0x00000004
1277 #define I2C_IC_RAW_INTR_STAT_RX_FULL_MSB            2
1278 #define I2C_IC_RAW_INTR_STAT_RX_FULL_LSB            2
1279 #define I2C_IC_RAW_INTR_STAT_RX_FULL_ACCESS         "RO"
1280 #define I2C_IC_RAW_INTR_STAT_RX_FULL_VALUE_INACTIVE 0x0
1281 #define I2C_IC_RAW_INTR_STAT_RX_FULL_VALUE_ACTIVE   0x1
1282 // -----------------------------------------------------------------------------
1283 // Field       : I2C_IC_RAW_INTR_STAT_RX_OVER
1284 // Description : Set if the receive buffer is completely filled to
1285 //               IC_RX_BUFFER_DEPTH and an additional byte is received from an
1286 //               external I2C device. The DW_apb_i2c acknowledges this, but any
1287 //               data bytes received after the FIFO is full are lost. If the
1288 //               module is disabled (IC_ENABLE[0]=0), this bit keeps its level
1289 //               until the master or slave state machines go into idle, and when
1290 //               ic_en goes to 0, this interrupt is cleared.
1291 //
1292 //               Note:  If bit 9 of the IC_CON register (RX_FIFO_FULL_HLD_CTRL)
1293 //               is programmed to HIGH, then the RX_OVER interrupt never occurs,
1294 //               because the Rx FIFO never overflows.
1295 //
1296 //               Reset value: 0x0
1297 //               0x0 -> RX_OVER interrupt is inactive
1298 //               0x1 -> RX_OVER interrupt is active
1299 #define I2C_IC_RAW_INTR_STAT_RX_OVER_RESET          0x0
1300 #define I2C_IC_RAW_INTR_STAT_RX_OVER_BITS           0x00000002
1301 #define I2C_IC_RAW_INTR_STAT_RX_OVER_MSB            1
1302 #define I2C_IC_RAW_INTR_STAT_RX_OVER_LSB            1
1303 #define I2C_IC_RAW_INTR_STAT_RX_OVER_ACCESS         "RO"
1304 #define I2C_IC_RAW_INTR_STAT_RX_OVER_VALUE_INACTIVE 0x0
1305 #define I2C_IC_RAW_INTR_STAT_RX_OVER_VALUE_ACTIVE   0x1
1306 // -----------------------------------------------------------------------------
1307 // Field       : I2C_IC_RAW_INTR_STAT_RX_UNDER
1308 // Description : Set if the processor attempts to read the receive buffer when
1309 //               it is empty by reading from the IC_DATA_CMD register. If the
1310 //               module is disabled (IC_ENABLE[0]=0), this bit keeps its level
1311 //               until the master or slave state machines go into idle, and when
1312 //               ic_en goes to 0, this interrupt is cleared.
1313 //
1314 //               Reset value: 0x0
1315 //               0x0 -> RX_UNDER interrupt is inactive
1316 //               0x1 -> RX_UNDER interrupt is active
1317 #define I2C_IC_RAW_INTR_STAT_RX_UNDER_RESET          0x0
1318 #define I2C_IC_RAW_INTR_STAT_RX_UNDER_BITS           0x00000001
1319 #define I2C_IC_RAW_INTR_STAT_RX_UNDER_MSB            0
1320 #define I2C_IC_RAW_INTR_STAT_RX_UNDER_LSB            0
1321 #define I2C_IC_RAW_INTR_STAT_RX_UNDER_ACCESS         "RO"
1322 #define I2C_IC_RAW_INTR_STAT_RX_UNDER_VALUE_INACTIVE 0x0
1323 #define I2C_IC_RAW_INTR_STAT_RX_UNDER_VALUE_ACTIVE   0x1
1324 // =============================================================================
1325 // Register    : I2C_IC_RX_TL
1326 // Description : I2C Receive FIFO Threshold Register
1327 #define I2C_IC_RX_TL_OFFSET 0x00000038
1328 #define I2C_IC_RX_TL_BITS   0x000000ff
1329 #define I2C_IC_RX_TL_RESET  0x00000000
1330 // -----------------------------------------------------------------------------
1331 // Field       : I2C_IC_RX_TL_RX_TL
1332 // Description : Receive FIFO Threshold Level.
1333 //
1334 //               Controls the level of entries (or above) that triggers the
1335 //               RX_FULL interrupt (bit 2 in IC_RAW_INTR_STAT register). The
1336 //               valid range is 0-255, with the additional restriction that
1337 //               hardware does not allow this value to be set to a value larger
1338 //               than the depth of the buffer. If an attempt is made to do that,
1339 //               the actual value set will be the maximum depth of the buffer. A
1340 //               value of 0 sets the threshold for 1 entry, and a value of 255
1341 //               sets the threshold for 256 entries.
1342 #define I2C_IC_RX_TL_RX_TL_RESET  0x00
1343 #define I2C_IC_RX_TL_RX_TL_BITS   0x000000ff
1344 #define I2C_IC_RX_TL_RX_TL_MSB    7
1345 #define I2C_IC_RX_TL_RX_TL_LSB    0
1346 #define I2C_IC_RX_TL_RX_TL_ACCESS "RW"
1347 // =============================================================================
1348 // Register    : I2C_IC_TX_TL
1349 // Description : I2C Transmit FIFO Threshold Register
1350 #define I2C_IC_TX_TL_OFFSET 0x0000003c
1351 #define I2C_IC_TX_TL_BITS   0x000000ff
1352 #define I2C_IC_TX_TL_RESET  0x00000000
1353 // -----------------------------------------------------------------------------
1354 // Field       : I2C_IC_TX_TL_TX_TL
1355 // Description : Transmit FIFO Threshold Level.
1356 //
1357 //               Controls the level of entries (or below) that trigger the
1358 //               TX_EMPTY interrupt (bit 4 in IC_RAW_INTR_STAT register). The
1359 //               valid range is 0-255, with the additional restriction that it
1360 //               may not be set to value larger than the depth of the buffer. If
1361 //               an attempt is made to do that, the actual value set will be the
1362 //               maximum depth of the buffer. A value of 0 sets the threshold
1363 //               for 0 entries, and a value of 255 sets the threshold for 255
1364 //               entries.
1365 #define I2C_IC_TX_TL_TX_TL_RESET  0x00
1366 #define I2C_IC_TX_TL_TX_TL_BITS   0x000000ff
1367 #define I2C_IC_TX_TL_TX_TL_MSB    7
1368 #define I2C_IC_TX_TL_TX_TL_LSB    0
1369 #define I2C_IC_TX_TL_TX_TL_ACCESS "RW"
1370 // =============================================================================
1371 // Register    : I2C_IC_CLR_INTR
1372 // Description : Clear Combined and Individual Interrupt Register
1373 #define I2C_IC_CLR_INTR_OFFSET 0x00000040
1374 #define I2C_IC_CLR_INTR_BITS   0x00000001
1375 #define I2C_IC_CLR_INTR_RESET  0x00000000
1376 // -----------------------------------------------------------------------------
1377 // Field       : I2C_IC_CLR_INTR_CLR_INTR
1378 // Description : Read this register to clear the combined interrupt, all
1379 //               individual interrupts, and the IC_TX_ABRT_SOURCE register. This
1380 //               bit does not clear hardware clearable interrupts but software
1381 //               clearable interrupts. Refer to Bit 9 of the IC_TX_ABRT_SOURCE
1382 //               register for an exception to clearing IC_TX_ABRT_SOURCE.
1383 //
1384 //               Reset value: 0x0
1385 #define I2C_IC_CLR_INTR_CLR_INTR_RESET  0x0
1386 #define I2C_IC_CLR_INTR_CLR_INTR_BITS   0x00000001
1387 #define I2C_IC_CLR_INTR_CLR_INTR_MSB    0
1388 #define I2C_IC_CLR_INTR_CLR_INTR_LSB    0
1389 #define I2C_IC_CLR_INTR_CLR_INTR_ACCESS "RO"
1390 // =============================================================================
1391 // Register    : I2C_IC_CLR_RX_UNDER
1392 // Description : Clear RX_UNDER Interrupt Register
1393 #define I2C_IC_CLR_RX_UNDER_OFFSET 0x00000044
1394 #define I2C_IC_CLR_RX_UNDER_BITS   0x00000001
1395 #define I2C_IC_CLR_RX_UNDER_RESET  0x00000000
1396 // -----------------------------------------------------------------------------
1397 // Field       : I2C_IC_CLR_RX_UNDER_CLR_RX_UNDER
1398 // Description : Read this register to clear the RX_UNDER interrupt (bit 0) of
1399 //               the IC_RAW_INTR_STAT register.
1400 //
1401 //               Reset value: 0x0
1402 #define I2C_IC_CLR_RX_UNDER_CLR_RX_UNDER_RESET  0x0
1403 #define I2C_IC_CLR_RX_UNDER_CLR_RX_UNDER_BITS   0x00000001
1404 #define I2C_IC_CLR_RX_UNDER_CLR_RX_UNDER_MSB    0
1405 #define I2C_IC_CLR_RX_UNDER_CLR_RX_UNDER_LSB    0
1406 #define I2C_IC_CLR_RX_UNDER_CLR_RX_UNDER_ACCESS "RO"
1407 // =============================================================================
1408 // Register    : I2C_IC_CLR_RX_OVER
1409 // Description : Clear RX_OVER Interrupt Register
1410 #define I2C_IC_CLR_RX_OVER_OFFSET 0x00000048
1411 #define I2C_IC_CLR_RX_OVER_BITS   0x00000001
1412 #define I2C_IC_CLR_RX_OVER_RESET  0x00000000
1413 // -----------------------------------------------------------------------------
1414 // Field       : I2C_IC_CLR_RX_OVER_CLR_RX_OVER
1415 // Description : Read this register to clear the RX_OVER interrupt (bit 1) of
1416 //               the IC_RAW_INTR_STAT register.
1417 //
1418 //               Reset value: 0x0
1419 #define I2C_IC_CLR_RX_OVER_CLR_RX_OVER_RESET  0x0
1420 #define I2C_IC_CLR_RX_OVER_CLR_RX_OVER_BITS   0x00000001
1421 #define I2C_IC_CLR_RX_OVER_CLR_RX_OVER_MSB    0
1422 #define I2C_IC_CLR_RX_OVER_CLR_RX_OVER_LSB    0
1423 #define I2C_IC_CLR_RX_OVER_CLR_RX_OVER_ACCESS "RO"
1424 // =============================================================================
1425 // Register    : I2C_IC_CLR_TX_OVER
1426 // Description : Clear TX_OVER Interrupt Register
1427 #define I2C_IC_CLR_TX_OVER_OFFSET 0x0000004c
1428 #define I2C_IC_CLR_TX_OVER_BITS   0x00000001
1429 #define I2C_IC_CLR_TX_OVER_RESET  0x00000000
1430 // -----------------------------------------------------------------------------
1431 // Field       : I2C_IC_CLR_TX_OVER_CLR_TX_OVER
1432 // Description : Read this register to clear the TX_OVER interrupt (bit 3) of
1433 //               the IC_RAW_INTR_STAT register.
1434 //
1435 //               Reset value: 0x0
1436 #define I2C_IC_CLR_TX_OVER_CLR_TX_OVER_RESET  0x0
1437 #define I2C_IC_CLR_TX_OVER_CLR_TX_OVER_BITS   0x00000001
1438 #define I2C_IC_CLR_TX_OVER_CLR_TX_OVER_MSB    0
1439 #define I2C_IC_CLR_TX_OVER_CLR_TX_OVER_LSB    0
1440 #define I2C_IC_CLR_TX_OVER_CLR_TX_OVER_ACCESS "RO"
1441 // =============================================================================
1442 // Register    : I2C_IC_CLR_RD_REQ
1443 // Description : Clear RD_REQ Interrupt Register
1444 #define I2C_IC_CLR_RD_REQ_OFFSET 0x00000050
1445 #define I2C_IC_CLR_RD_REQ_BITS   0x00000001
1446 #define I2C_IC_CLR_RD_REQ_RESET  0x00000000
1447 // -----------------------------------------------------------------------------
1448 // Field       : I2C_IC_CLR_RD_REQ_CLR_RD_REQ
1449 // Description : Read this register to clear the RD_REQ interrupt (bit 5) of the
1450 //               IC_RAW_INTR_STAT register.
1451 //
1452 //               Reset value: 0x0
1453 #define I2C_IC_CLR_RD_REQ_CLR_RD_REQ_RESET  0x0
1454 #define I2C_IC_CLR_RD_REQ_CLR_RD_REQ_BITS   0x00000001
1455 #define I2C_IC_CLR_RD_REQ_CLR_RD_REQ_MSB    0
1456 #define I2C_IC_CLR_RD_REQ_CLR_RD_REQ_LSB    0
1457 #define I2C_IC_CLR_RD_REQ_CLR_RD_REQ_ACCESS "RO"
1458 // =============================================================================
1459 // Register    : I2C_IC_CLR_TX_ABRT
1460 // Description : Clear TX_ABRT Interrupt Register
1461 #define I2C_IC_CLR_TX_ABRT_OFFSET 0x00000054
1462 #define I2C_IC_CLR_TX_ABRT_BITS   0x00000001
1463 #define I2C_IC_CLR_TX_ABRT_RESET  0x00000000
1464 // -----------------------------------------------------------------------------
1465 // Field       : I2C_IC_CLR_TX_ABRT_CLR_TX_ABRT
1466 // Description : Read this register to clear the TX_ABRT interrupt (bit 6) of
1467 //               the IC_RAW_INTR_STAT register, and the IC_TX_ABRT_SOURCE
1468 //               register. This also releases the TX FIFO from the flushed/reset
1469 //               state, allowing more writes to the TX FIFO. Refer to Bit 9 of
1470 //               the IC_TX_ABRT_SOURCE register for an exception to clearing
1471 //               IC_TX_ABRT_SOURCE.
1472 //
1473 //               Reset value: 0x0
1474 #define I2C_IC_CLR_TX_ABRT_CLR_TX_ABRT_RESET  0x0
1475 #define I2C_IC_CLR_TX_ABRT_CLR_TX_ABRT_BITS   0x00000001
1476 #define I2C_IC_CLR_TX_ABRT_CLR_TX_ABRT_MSB    0
1477 #define I2C_IC_CLR_TX_ABRT_CLR_TX_ABRT_LSB    0
1478 #define I2C_IC_CLR_TX_ABRT_CLR_TX_ABRT_ACCESS "RO"
1479 // =============================================================================
1480 // Register    : I2C_IC_CLR_RX_DONE
1481 // Description : Clear RX_DONE Interrupt Register
1482 #define I2C_IC_CLR_RX_DONE_OFFSET 0x00000058
1483 #define I2C_IC_CLR_RX_DONE_BITS   0x00000001
1484 #define I2C_IC_CLR_RX_DONE_RESET  0x00000000
1485 // -----------------------------------------------------------------------------
1486 // Field       : I2C_IC_CLR_RX_DONE_CLR_RX_DONE
1487 // Description : Read this register to clear the RX_DONE interrupt (bit 7) of
1488 //               the IC_RAW_INTR_STAT register.
1489 //
1490 //               Reset value: 0x0
1491 #define I2C_IC_CLR_RX_DONE_CLR_RX_DONE_RESET  0x0
1492 #define I2C_IC_CLR_RX_DONE_CLR_RX_DONE_BITS   0x00000001
1493 #define I2C_IC_CLR_RX_DONE_CLR_RX_DONE_MSB    0
1494 #define I2C_IC_CLR_RX_DONE_CLR_RX_DONE_LSB    0
1495 #define I2C_IC_CLR_RX_DONE_CLR_RX_DONE_ACCESS "RO"
1496 // =============================================================================
1497 // Register    : I2C_IC_CLR_ACTIVITY
1498 // Description : Clear ACTIVITY Interrupt Register
1499 #define I2C_IC_CLR_ACTIVITY_OFFSET 0x0000005c
1500 #define I2C_IC_CLR_ACTIVITY_BITS   0x00000001
1501 #define I2C_IC_CLR_ACTIVITY_RESET  0x00000000
1502 // -----------------------------------------------------------------------------
1503 // Field       : I2C_IC_CLR_ACTIVITY_CLR_ACTIVITY
1504 // Description : Reading this register clears the ACTIVITY interrupt if the I2C
1505 //               is not active anymore. If the I2C module is still active on the
1506 //               bus, the ACTIVITY interrupt bit continues to be set. It is
1507 //               automatically cleared by hardware if the module is disabled and
1508 //               if there is no further activity on the bus. The value read from
1509 //               this register to get status of the ACTIVITY interrupt (bit 8)
1510 //               of the IC_RAW_INTR_STAT register.
1511 //
1512 //               Reset value: 0x0
1513 #define I2C_IC_CLR_ACTIVITY_CLR_ACTIVITY_RESET  0x0
1514 #define I2C_IC_CLR_ACTIVITY_CLR_ACTIVITY_BITS   0x00000001
1515 #define I2C_IC_CLR_ACTIVITY_CLR_ACTIVITY_MSB    0
1516 #define I2C_IC_CLR_ACTIVITY_CLR_ACTIVITY_LSB    0
1517 #define I2C_IC_CLR_ACTIVITY_CLR_ACTIVITY_ACCESS "RO"
1518 // =============================================================================
1519 // Register    : I2C_IC_CLR_STOP_DET
1520 // Description : Clear STOP_DET Interrupt Register
1521 #define I2C_IC_CLR_STOP_DET_OFFSET 0x00000060
1522 #define I2C_IC_CLR_STOP_DET_BITS   0x00000001
1523 #define I2C_IC_CLR_STOP_DET_RESET  0x00000000
1524 // -----------------------------------------------------------------------------
1525 // Field       : I2C_IC_CLR_STOP_DET_CLR_STOP_DET
1526 // Description : Read this register to clear the STOP_DET interrupt (bit 9) of
1527 //               the IC_RAW_INTR_STAT register.
1528 //
1529 //               Reset value: 0x0
1530 #define I2C_IC_CLR_STOP_DET_CLR_STOP_DET_RESET  0x0
1531 #define I2C_IC_CLR_STOP_DET_CLR_STOP_DET_BITS   0x00000001
1532 #define I2C_IC_CLR_STOP_DET_CLR_STOP_DET_MSB    0
1533 #define I2C_IC_CLR_STOP_DET_CLR_STOP_DET_LSB    0
1534 #define I2C_IC_CLR_STOP_DET_CLR_STOP_DET_ACCESS "RO"
1535 // =============================================================================
1536 // Register    : I2C_IC_CLR_START_DET
1537 // Description : Clear START_DET Interrupt Register
1538 #define I2C_IC_CLR_START_DET_OFFSET 0x00000064
1539 #define I2C_IC_CLR_START_DET_BITS   0x00000001
1540 #define I2C_IC_CLR_START_DET_RESET  0x00000000
1541 // -----------------------------------------------------------------------------
1542 // Field       : I2C_IC_CLR_START_DET_CLR_START_DET
1543 // Description : Read this register to clear the START_DET interrupt (bit 10) of
1544 //               the IC_RAW_INTR_STAT register.
1545 //
1546 //               Reset value: 0x0
1547 #define I2C_IC_CLR_START_DET_CLR_START_DET_RESET  0x0
1548 #define I2C_IC_CLR_START_DET_CLR_START_DET_BITS   0x00000001
1549 #define I2C_IC_CLR_START_DET_CLR_START_DET_MSB    0
1550 #define I2C_IC_CLR_START_DET_CLR_START_DET_LSB    0
1551 #define I2C_IC_CLR_START_DET_CLR_START_DET_ACCESS "RO"
1552 // =============================================================================
1553 // Register    : I2C_IC_CLR_GEN_CALL
1554 // Description : Clear GEN_CALL Interrupt Register
1555 #define I2C_IC_CLR_GEN_CALL_OFFSET 0x00000068
1556 #define I2C_IC_CLR_GEN_CALL_BITS   0x00000001
1557 #define I2C_IC_CLR_GEN_CALL_RESET  0x00000000
1558 // -----------------------------------------------------------------------------
1559 // Field       : I2C_IC_CLR_GEN_CALL_CLR_GEN_CALL
1560 // Description : Read this register to clear the GEN_CALL interrupt (bit 11) of
1561 //               IC_RAW_INTR_STAT register.
1562 //
1563 //               Reset value: 0x0
1564 #define I2C_IC_CLR_GEN_CALL_CLR_GEN_CALL_RESET  0x0
1565 #define I2C_IC_CLR_GEN_CALL_CLR_GEN_CALL_BITS   0x00000001
1566 #define I2C_IC_CLR_GEN_CALL_CLR_GEN_CALL_MSB    0
1567 #define I2C_IC_CLR_GEN_CALL_CLR_GEN_CALL_LSB    0
1568 #define I2C_IC_CLR_GEN_CALL_CLR_GEN_CALL_ACCESS "RO"
1569 // =============================================================================
1570 // Register    : I2C_IC_ENABLE
1571 // Description : I2C Enable Register
1572 #define I2C_IC_ENABLE_OFFSET 0x0000006c
1573 #define I2C_IC_ENABLE_BITS   0x00000007
1574 #define I2C_IC_ENABLE_RESET  0x00000000
1575 // -----------------------------------------------------------------------------
1576 // Field       : I2C_IC_ENABLE_TX_CMD_BLOCK
1577 // Description : In Master mode: - 1'b1: Blocks the transmission of data on I2C
1578 //               bus even if Tx FIFO has data to transmit. - 1'b0: The
1579 //               transmission of data starts on I2C bus automatically, as soon
1580 //               as the first data is available in the Tx FIFO. Note: To block
1581 //               the execution of Master commands, set the TX_CMD_BLOCK bit only
1582 //               when Tx FIFO is empty (IC_STATUS[2]==1) and Master is in Idle
1583 //               state (IC_STATUS[5] == 0). Any further commands put in the Tx
1584 //               FIFO are not executed until TX_CMD_BLOCK bit is unset. Reset
1585 //               value:  IC_TX_CMD_BLOCK_DEFAULT
1586 //               0x0 -> Tx Command execution not blocked
1587 //               0x1 -> Tx Command execution blocked
1588 #define I2C_IC_ENABLE_TX_CMD_BLOCK_RESET             0x0
1589 #define I2C_IC_ENABLE_TX_CMD_BLOCK_BITS              0x00000004
1590 #define I2C_IC_ENABLE_TX_CMD_BLOCK_MSB               2
1591 #define I2C_IC_ENABLE_TX_CMD_BLOCK_LSB               2
1592 #define I2C_IC_ENABLE_TX_CMD_BLOCK_ACCESS            "RW"
1593 #define I2C_IC_ENABLE_TX_CMD_BLOCK_VALUE_NOT_BLOCKED 0x0
1594 #define I2C_IC_ENABLE_TX_CMD_BLOCK_VALUE_BLOCKED     0x1
1595 // -----------------------------------------------------------------------------
1596 // Field       : I2C_IC_ENABLE_ABORT
1597 // Description : When set, the controller initiates the transfer abort. - 0:
1598 //               ABORT not initiated or ABORT done - 1: ABORT operation in
1599 //               progress The software can abort the I2C transfer in master mode
1600 //               by setting this bit. The software can set this bit only when
1601 //               ENABLE is already set; otherwise, the controller ignores any
1602 //               write to ABORT bit. The software cannot clear the ABORT bit
1603 //               once set. In response to an ABORT, the controller issues a STOP
1604 //               and flushes the Tx FIFO after completing the current transfer,
1605 //               then sets the TX_ABORT interrupt after the abort operation. The
1606 //               ABORT bit is cleared automatically after the abort operation.
1607 //
1608 //               For a detailed description on how to abort I2C transfers, refer
1609 //               to 'Aborting I2C Transfers'.
1610 //
1611 //               Reset value: 0x0
1612 //               0x0 -> ABORT operation not in progress
1613 //               0x1 -> ABORT operation in progress
1614 #define I2C_IC_ENABLE_ABORT_RESET         0x0
1615 #define I2C_IC_ENABLE_ABORT_BITS          0x00000002
1616 #define I2C_IC_ENABLE_ABORT_MSB           1
1617 #define I2C_IC_ENABLE_ABORT_LSB           1
1618 #define I2C_IC_ENABLE_ABORT_ACCESS        "RW"
1619 #define I2C_IC_ENABLE_ABORT_VALUE_DISABLE 0x0
1620 #define I2C_IC_ENABLE_ABORT_VALUE_ENABLED 0x1
1621 // -----------------------------------------------------------------------------
1622 // Field       : I2C_IC_ENABLE_ENABLE
1623 // Description : Controls whether the DW_apb_i2c is enabled. - 0: Disables
1624 //               DW_apb_i2c (TX and RX FIFOs are held in an erased state) - 1:
1625 //               Enables DW_apb_i2c Software can disable DW_apb_i2c while it is
1626 //               active. However, it is important that care be taken to ensure
1627 //               that DW_apb_i2c is disabled properly. A recommended procedure
1628 //               is described in 'Disabling DW_apb_i2c'.
1629 //
1630 //               When DW_apb_i2c is disabled, the following occurs: - The TX
1631 //               FIFO and RX FIFO get flushed. - Status bits in the IC_INTR_STAT
1632 //               register are still active until DW_apb_i2c goes into IDLE
1633 //               state. If the module is transmitting, it stops as well as
1634 //               deletes the contents of the transmit buffer after the current
1635 //               transfer is complete. If the module is receiving, the
1636 //               DW_apb_i2c stops the current transfer at the end of the current
1637 //               byte and does not acknowledge the transfer.
1638 //
1639 //               In systems with asynchronous pclk and ic_clk when IC_CLK_TYPE
1640 //               parameter set to asynchronous (1), there is a two ic_clk delay
1641 //               when enabling or disabling the DW_apb_i2c. For a detailed
1642 //               description on how to disable DW_apb_i2c, refer to 'Disabling
1643 //               DW_apb_i2c'
1644 //
1645 //               Reset value: 0x0
1646 //               0x0 -> I2C is disabled
1647 //               0x1 -> I2C is enabled
1648 #define I2C_IC_ENABLE_ENABLE_RESET          0x0
1649 #define I2C_IC_ENABLE_ENABLE_BITS           0x00000001
1650 #define I2C_IC_ENABLE_ENABLE_MSB            0
1651 #define I2C_IC_ENABLE_ENABLE_LSB            0
1652 #define I2C_IC_ENABLE_ENABLE_ACCESS         "RW"
1653 #define I2C_IC_ENABLE_ENABLE_VALUE_DISABLED 0x0
1654 #define I2C_IC_ENABLE_ENABLE_VALUE_ENABLED  0x1
1655 // =============================================================================
1656 // Register    : I2C_IC_STATUS
1657 // Description : I2C Status Register
1658 //
1659 //               This is a read-only register used to indicate the current
1660 //               transfer status and FIFO status. The status register may be
1661 //               read at any time. None of the bits in this register request an
1662 //               interrupt.
1663 //
1664 //               When the I2C is disabled by writing 0 in bit 0 of the IC_ENABLE
1665 //               register: - Bits 1 and 2 are set to 1 - Bits 3 and 10 are set
1666 //               to 0 When the master or slave state machines goes to idle and
1667 //               ic_en=0: - Bits 5 and 6 are set to 0
1668 #define I2C_IC_STATUS_OFFSET 0x00000070
1669 #define I2C_IC_STATUS_BITS   0x0000007f
1670 #define I2C_IC_STATUS_RESET  0x00000006
1671 // -----------------------------------------------------------------------------
1672 // Field       : I2C_IC_STATUS_SLV_ACTIVITY
1673 // Description : Slave FSM Activity Status. When the Slave Finite State Machine
1674 //               (FSM) is not in the IDLE state, this bit is set. - 0: Slave FSM
1675 //               is in IDLE state so the Slave part of DW_apb_i2c is not Active
1676 //               - 1: Slave FSM is not in IDLE state so the Slave part of
1677 //               DW_apb_i2c is Active Reset value: 0x0
1678 //               0x0 -> Slave is idle
1679 //               0x1 -> Slave not idle
1680 #define I2C_IC_STATUS_SLV_ACTIVITY_RESET        0x0
1681 #define I2C_IC_STATUS_SLV_ACTIVITY_BITS         0x00000040
1682 #define I2C_IC_STATUS_SLV_ACTIVITY_MSB          6
1683 #define I2C_IC_STATUS_SLV_ACTIVITY_LSB          6
1684 #define I2C_IC_STATUS_SLV_ACTIVITY_ACCESS       "RO"
1685 #define I2C_IC_STATUS_SLV_ACTIVITY_VALUE_IDLE   0x0
1686 #define I2C_IC_STATUS_SLV_ACTIVITY_VALUE_ACTIVE 0x1
1687 // -----------------------------------------------------------------------------
1688 // Field       : I2C_IC_STATUS_MST_ACTIVITY
1689 // Description : Master FSM Activity Status. When the Master Finite State
1690 //               Machine (FSM) is not in the IDLE state, this bit is set. - 0:
1691 //               Master FSM is in IDLE state so the Master part of DW_apb_i2c is
1692 //               not Active - 1: Master FSM is not in IDLE state so the Master
1693 //               part of DW_apb_i2c is Active Note: IC_STATUS[0]-that is,
1694 //               ACTIVITY bit-is the OR of SLV_ACTIVITY and MST_ACTIVITY bits.
1695 //
1696 //               Reset value: 0x0
1697 //               0x0 -> Master is idle
1698 //               0x1 -> Master not idle
1699 #define I2C_IC_STATUS_MST_ACTIVITY_RESET        0x0
1700 #define I2C_IC_STATUS_MST_ACTIVITY_BITS         0x00000020
1701 #define I2C_IC_STATUS_MST_ACTIVITY_MSB          5
1702 #define I2C_IC_STATUS_MST_ACTIVITY_LSB          5
1703 #define I2C_IC_STATUS_MST_ACTIVITY_ACCESS       "RO"
1704 #define I2C_IC_STATUS_MST_ACTIVITY_VALUE_IDLE   0x0
1705 #define I2C_IC_STATUS_MST_ACTIVITY_VALUE_ACTIVE 0x1
1706 // -----------------------------------------------------------------------------
1707 // Field       : I2C_IC_STATUS_RFF
1708 // Description : Receive FIFO Completely Full. When the receive FIFO is
1709 //               completely full, this bit is set. When the receive FIFO
1710 //               contains one or more empty location, this bit is cleared. - 0:
1711 //               Receive FIFO is not full - 1: Receive FIFO is full Reset value:
1712 //               0x0
1713 //               0x0 -> Rx FIFO not full
1714 //               0x1 -> Rx FIFO is full
1715 #define I2C_IC_STATUS_RFF_RESET          0x0
1716 #define I2C_IC_STATUS_RFF_BITS           0x00000010
1717 #define I2C_IC_STATUS_RFF_MSB            4
1718 #define I2C_IC_STATUS_RFF_LSB            4
1719 #define I2C_IC_STATUS_RFF_ACCESS         "RO"
1720 #define I2C_IC_STATUS_RFF_VALUE_NOT_FULL 0x0
1721 #define I2C_IC_STATUS_RFF_VALUE_FULL     0x1
1722 // -----------------------------------------------------------------------------
1723 // Field       : I2C_IC_STATUS_RFNE
1724 // Description : Receive FIFO Not Empty. This bit is set when the receive FIFO
1725 //               contains one or more entries; it is cleared when the receive
1726 //               FIFO is empty. - 0: Receive FIFO is empty - 1: Receive FIFO is
1727 //               not empty Reset value: 0x0
1728 //               0x0 -> Rx FIFO is empty
1729 //               0x1 -> Rx FIFO not empty
1730 #define I2C_IC_STATUS_RFNE_RESET           0x0
1731 #define I2C_IC_STATUS_RFNE_BITS            0x00000008
1732 #define I2C_IC_STATUS_RFNE_MSB             3
1733 #define I2C_IC_STATUS_RFNE_LSB             3
1734 #define I2C_IC_STATUS_RFNE_ACCESS          "RO"
1735 #define I2C_IC_STATUS_RFNE_VALUE_EMPTY     0x0
1736 #define I2C_IC_STATUS_RFNE_VALUE_NOT_EMPTY 0x1
1737 // -----------------------------------------------------------------------------
1738 // Field       : I2C_IC_STATUS_TFE
1739 // Description : Transmit FIFO Completely Empty. When the transmit FIFO is
1740 //               completely empty, this bit is set. When it contains one or more
1741 //               valid entries, this bit is cleared. This bit field does not
1742 //               request an interrupt. - 0: Transmit FIFO is not empty - 1:
1743 //               Transmit FIFO is empty Reset value: 0x1
1744 //               0x0 -> Tx FIFO not empty
1745 //               0x1 -> Tx FIFO is empty
1746 #define I2C_IC_STATUS_TFE_RESET           0x1
1747 #define I2C_IC_STATUS_TFE_BITS            0x00000004
1748 #define I2C_IC_STATUS_TFE_MSB             2
1749 #define I2C_IC_STATUS_TFE_LSB             2
1750 #define I2C_IC_STATUS_TFE_ACCESS          "RO"
1751 #define I2C_IC_STATUS_TFE_VALUE_NON_EMPTY 0x0
1752 #define I2C_IC_STATUS_TFE_VALUE_EMPTY     0x1
1753 // -----------------------------------------------------------------------------
1754 // Field       : I2C_IC_STATUS_TFNF
1755 // Description : Transmit FIFO Not Full. Set when the transmit FIFO contains one
1756 //               or more empty locations, and is cleared when the FIFO is full.
1757 //               - 0: Transmit FIFO is full - 1: Transmit FIFO is not full Reset
1758 //               value: 0x1
1759 //               0x0 -> Tx FIFO is full
1760 //               0x1 -> Tx FIFO not full
1761 #define I2C_IC_STATUS_TFNF_RESET          0x1
1762 #define I2C_IC_STATUS_TFNF_BITS           0x00000002
1763 #define I2C_IC_STATUS_TFNF_MSB            1
1764 #define I2C_IC_STATUS_TFNF_LSB            1
1765 #define I2C_IC_STATUS_TFNF_ACCESS         "RO"
1766 #define I2C_IC_STATUS_TFNF_VALUE_FULL     0x0
1767 #define I2C_IC_STATUS_TFNF_VALUE_NOT_FULL 0x1
1768 // -----------------------------------------------------------------------------
1769 // Field       : I2C_IC_STATUS_ACTIVITY
1770 // Description : I2C Activity Status. Reset value: 0x0
1771 //               0x0 -> I2C is idle
1772 //               0x1 -> I2C is active
1773 #define I2C_IC_STATUS_ACTIVITY_RESET          0x0
1774 #define I2C_IC_STATUS_ACTIVITY_BITS           0x00000001
1775 #define I2C_IC_STATUS_ACTIVITY_MSB            0
1776 #define I2C_IC_STATUS_ACTIVITY_LSB            0
1777 #define I2C_IC_STATUS_ACTIVITY_ACCESS         "RO"
1778 #define I2C_IC_STATUS_ACTIVITY_VALUE_INACTIVE 0x0
1779 #define I2C_IC_STATUS_ACTIVITY_VALUE_ACTIVE   0x1
1780 // =============================================================================
1781 // Register    : I2C_IC_TXFLR
1782 // Description : I2C Transmit FIFO Level Register This register contains the
1783 //               number of valid data entries in the transmit FIFO buffer. It is
1784 //               cleared whenever: - The I2C is disabled - There is a transmit
1785 //               abort - that is, TX_ABRT bit is set in the IC_RAW_INTR_STAT
1786 //               register - The slave bulk transmit mode is aborted The register
1787 //               increments whenever data is placed into the transmit FIFO and
1788 //               decrements when data is taken from the transmit FIFO.
1789 #define I2C_IC_TXFLR_OFFSET 0x00000074
1790 #define I2C_IC_TXFLR_BITS   0x0000001f
1791 #define I2C_IC_TXFLR_RESET  0x00000000
1792 // -----------------------------------------------------------------------------
1793 // Field       : I2C_IC_TXFLR_TXFLR
1794 // Description : Transmit FIFO Level. Contains the number of valid data entries
1795 //               in the transmit FIFO.
1796 //
1797 //               Reset value: 0x0
1798 #define I2C_IC_TXFLR_TXFLR_RESET  0x00
1799 #define I2C_IC_TXFLR_TXFLR_BITS   0x0000001f
1800 #define I2C_IC_TXFLR_TXFLR_MSB    4
1801 #define I2C_IC_TXFLR_TXFLR_LSB    0
1802 #define I2C_IC_TXFLR_TXFLR_ACCESS "RO"
1803 // =============================================================================
1804 // Register    : I2C_IC_RXFLR
1805 // Description : I2C Receive FIFO Level Register This register contains the
1806 //               number of valid data entries in the receive FIFO buffer. It is
1807 //               cleared whenever: - The I2C is disabled - Whenever there is a
1808 //               transmit abort caused by any of the events tracked in
1809 //               IC_TX_ABRT_SOURCE The register increments whenever data is
1810 //               placed into the receive FIFO and decrements when data is taken
1811 //               from the receive FIFO.
1812 #define I2C_IC_RXFLR_OFFSET 0x00000078
1813 #define I2C_IC_RXFLR_BITS   0x0000001f
1814 #define I2C_IC_RXFLR_RESET  0x00000000
1815 // -----------------------------------------------------------------------------
1816 // Field       : I2C_IC_RXFLR_RXFLR
1817 // Description : Receive FIFO Level. Contains the number of valid data entries
1818 //               in the receive FIFO.
1819 //
1820 //               Reset value: 0x0
1821 #define I2C_IC_RXFLR_RXFLR_RESET  0x00
1822 #define I2C_IC_RXFLR_RXFLR_BITS   0x0000001f
1823 #define I2C_IC_RXFLR_RXFLR_MSB    4
1824 #define I2C_IC_RXFLR_RXFLR_LSB    0
1825 #define I2C_IC_RXFLR_RXFLR_ACCESS "RO"
1826 // =============================================================================
1827 // Register    : I2C_IC_SDA_HOLD
1828 // Description : I2C SDA Hold Time Length Register
1829 //
1830 //               The bits [15:0] of this register are used to control the hold
1831 //               time of SDA during transmit in both slave and master mode
1832 //               (after SCL goes from HIGH to LOW).
1833 //
1834 //               The bits [23:16] of this register are used to extend the SDA
1835 //               transition (if any) whenever SCL is HIGH in the receiver in
1836 //               either master or slave mode.
1837 //
1838 //               Writes to this register succeed only when IC_ENABLE[0]=0.
1839 //
1840 //               The values in this register are in units of ic_clk period. The
1841 //               value programmed in IC_SDA_TX_HOLD must be greater than the
1842 //               minimum hold time in each mode one cycle in master mode, seven
1843 //               cycles in slave mode for the value to be implemented.
1844 //
1845 //               The programmed SDA hold time during transmit (IC_SDA_TX_HOLD)
1846 //               cannot exceed at any time the duration of the low part of scl.
1847 //               Therefore the programmed value cannot be larger than
1848 //               N_SCL_LOW-2, where N_SCL_LOW is the duration of the low part of
1849 //               the scl period measured in ic_clk cycles.
1850 #define I2C_IC_SDA_HOLD_OFFSET 0x0000007c
1851 #define I2C_IC_SDA_HOLD_BITS   0x00ffffff
1852 #define I2C_IC_SDA_HOLD_RESET  0x00000001
1853 // -----------------------------------------------------------------------------
1854 // Field       : I2C_IC_SDA_HOLD_IC_SDA_RX_HOLD
1855 // Description : Sets the required SDA hold time in units of ic_clk period, when
1856 //               DW_apb_i2c acts as a receiver.
1857 //
1858 //               Reset value: IC_DEFAULT_SDA_HOLD[23:16].
1859 #define I2C_IC_SDA_HOLD_IC_SDA_RX_HOLD_RESET  0x00
1860 #define I2C_IC_SDA_HOLD_IC_SDA_RX_HOLD_BITS   0x00ff0000
1861 #define I2C_IC_SDA_HOLD_IC_SDA_RX_HOLD_MSB    23
1862 #define I2C_IC_SDA_HOLD_IC_SDA_RX_HOLD_LSB    16
1863 #define I2C_IC_SDA_HOLD_IC_SDA_RX_HOLD_ACCESS "RW"
1864 // -----------------------------------------------------------------------------
1865 // Field       : I2C_IC_SDA_HOLD_IC_SDA_TX_HOLD
1866 // Description : Sets the required SDA hold time in units of ic_clk period, when
1867 //               DW_apb_i2c acts as a transmitter.
1868 //
1869 //               Reset value: IC_DEFAULT_SDA_HOLD[15:0].
1870 #define I2C_IC_SDA_HOLD_IC_SDA_TX_HOLD_RESET  0x0001
1871 #define I2C_IC_SDA_HOLD_IC_SDA_TX_HOLD_BITS   0x0000ffff
1872 #define I2C_IC_SDA_HOLD_IC_SDA_TX_HOLD_MSB    15
1873 #define I2C_IC_SDA_HOLD_IC_SDA_TX_HOLD_LSB    0
1874 #define I2C_IC_SDA_HOLD_IC_SDA_TX_HOLD_ACCESS "RW"
1875 // =============================================================================
1876 // Register    : I2C_IC_TX_ABRT_SOURCE
1877 // Description : I2C Transmit Abort Source Register
1878 //
1879 //               This register has 32 bits that indicate the source of the
1880 //               TX_ABRT bit. Except for Bit 9, this register is cleared
1881 //               whenever the IC_CLR_TX_ABRT register or the IC_CLR_INTR
1882 //               register is read. To clear Bit 9, the source of the
1883 //               ABRT_SBYTE_NORSTRT must be fixed first; RESTART must be enabled
1884 //               (IC_CON[5]=1), the SPECIAL bit must be cleared (IC_TAR[11]), or
1885 //               the GC_OR_START bit must be cleared (IC_TAR[10]).
1886 //
1887 //               Once the source of the ABRT_SBYTE_NORSTRT is fixed, then this
1888 //               bit can be cleared in the same manner as other bits in this
1889 //               register. If the source of the ABRT_SBYTE_NORSTRT is not fixed
1890 //               before attempting to clear this bit, Bit 9 clears for one cycle
1891 //               and is then re-asserted.
1892 #define I2C_IC_TX_ABRT_SOURCE_OFFSET 0x00000080
1893 #define I2C_IC_TX_ABRT_SOURCE_BITS   0xff81ffff
1894 #define I2C_IC_TX_ABRT_SOURCE_RESET  0x00000000
1895 // -----------------------------------------------------------------------------
1896 // Field       : I2C_IC_TX_ABRT_SOURCE_TX_FLUSH_CNT
1897 // Description : This field indicates the number of Tx FIFO Data Commands which
1898 //               are flushed due to TX_ABRT interrupt. It is cleared whenever
1899 //               I2C is disabled.
1900 //
1901 //               Reset value: 0x0
1902 //
1903 //               Role of DW_apb_i2c:  Master-Transmitter or Slave-Transmitter
1904 #define I2C_IC_TX_ABRT_SOURCE_TX_FLUSH_CNT_RESET  0x000
1905 #define I2C_IC_TX_ABRT_SOURCE_TX_FLUSH_CNT_BITS   0xff800000
1906 #define I2C_IC_TX_ABRT_SOURCE_TX_FLUSH_CNT_MSB    31
1907 #define I2C_IC_TX_ABRT_SOURCE_TX_FLUSH_CNT_LSB    23
1908 #define I2C_IC_TX_ABRT_SOURCE_TX_FLUSH_CNT_ACCESS "RO"
1909 // -----------------------------------------------------------------------------
1910 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_USER_ABRT
1911 // Description : This is a master-mode-only bit. Master has detected the
1912 //               transfer abort (IC_ENABLE[1])
1913 //
1914 //               Reset value: 0x0
1915 //
1916 //               Role of DW_apb_i2c:  Master-Transmitter
1917 //               0x0 -> Transfer abort detected by master- scenario not present
1918 //               0x1 -> Transfer abort detected by master
1919 #define I2C_IC_TX_ABRT_SOURCE_ABRT_USER_ABRT_RESET                          0x0
1920 #define I2C_IC_TX_ABRT_SOURCE_ABRT_USER_ABRT_BITS                           0x00010000
1921 #define I2C_IC_TX_ABRT_SOURCE_ABRT_USER_ABRT_MSB                            16
1922 #define I2C_IC_TX_ABRT_SOURCE_ABRT_USER_ABRT_LSB                            16
1923 #define I2C_IC_TX_ABRT_SOURCE_ABRT_USER_ABRT_ACCESS                         "RO"
1924 #define I2C_IC_TX_ABRT_SOURCE_ABRT_USER_ABRT_VALUE_ABRT_USER_ABRT_VOID      0x0
1925 #define I2C_IC_TX_ABRT_SOURCE_ABRT_USER_ABRT_VALUE_ABRT_USER_ABRT_GENERATED 0x1
1926 // -----------------------------------------------------------------------------
1927 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_SLVRD_INTX
1928 // Description : 1: When the processor side responds to a slave mode request for
1929 //               data to be transmitted to a remote master and user writes a 1
1930 //               in CMD (bit 8) of IC_DATA_CMD register.
1931 //
1932 //               Reset value: 0x0
1933 //
1934 //               Role of DW_apb_i2c:  Slave-Transmitter
1935 //               0x0 -> Slave trying to transmit to remote master in read mode-
1936 //               scenario not present
1937 //               0x1 -> Slave trying to transmit to remote master in read mode
1938 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVRD_INTX_RESET                           0x0
1939 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVRD_INTX_BITS                            0x00008000
1940 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVRD_INTX_MSB                             15
1941 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVRD_INTX_LSB                             15
1942 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVRD_INTX_ACCESS                          "RO"
1943 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVRD_INTX_VALUE_ABRT_SLVRD_INTX_VOID      0x0
1944 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVRD_INTX_VALUE_ABRT_SLVRD_INTX_GENERATED 0x1
1945 // -----------------------------------------------------------------------------
1946 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_SLV_ARBLOST
1947 // Description : This field indicates that a Slave has lost the bus while
1948 //               transmitting data to a remote master. IC_TX_ABRT_SOURCE[12] is
1949 //               set at the same time. Note:  Even though the slave never 'owns'
1950 //               the bus, something could go wrong on the bus. This is a fail
1951 //               safe check. For instance, during a data transmission at the
1952 //               low-to-high transition of SCL, if what is on the data bus is
1953 //               not what is supposed to be transmitted, then DW_apb_i2c no
1954 //               longer own the bus.
1955 //
1956 //               Reset value: 0x0
1957 //
1958 //               Role of DW_apb_i2c:  Slave-Transmitter
1959 //               0x0 -> Slave lost arbitration to remote master- scenario not
1960 //               present
1961 //               0x1 -> Slave lost arbitration to remote master
1962 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLV_ARBLOST_RESET                            0x0
1963 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLV_ARBLOST_BITS                             0x00004000
1964 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLV_ARBLOST_MSB                              14
1965 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLV_ARBLOST_LSB                              14
1966 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLV_ARBLOST_ACCESS                           "RO"
1967 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLV_ARBLOST_VALUE_ABRT_SLV_ARBLOST_VOID      0x0
1968 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLV_ARBLOST_VALUE_ABRT_SLV_ARBLOST_GENERATED 0x1
1969 // -----------------------------------------------------------------------------
1970 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_SLVFLUSH_TXFIFO
1971 // Description : This field specifies that the Slave has received a read command
1972 //               and some data exists in the TX FIFO, so the slave issues a
1973 //               TX_ABRT interrupt to flush old data in TX FIFO.
1974 //
1975 //               Reset value: 0x0
1976 //
1977 //               Role of DW_apb_i2c:  Slave-Transmitter
1978 //               0x0 -> Slave flushes existing data in TX-FIFO upon getting read
1979 //               command- scenario not present
1980 //               0x1 -> Slave flushes existing data in TX-FIFO upon getting read
1981 //               command
1982 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVFLUSH_TXFIFO_RESET                                0x0
1983 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVFLUSH_TXFIFO_BITS                                 0x00002000
1984 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVFLUSH_TXFIFO_MSB                                  13
1985 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVFLUSH_TXFIFO_LSB                                  13
1986 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVFLUSH_TXFIFO_ACCESS                               "RO"
1987 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVFLUSH_TXFIFO_VALUE_ABRT_SLVFLUSH_TXFIFO_VOID      0x0
1988 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SLVFLUSH_TXFIFO_VALUE_ABRT_SLVFLUSH_TXFIFO_GENERATED 0x1
1989 // -----------------------------------------------------------------------------
1990 // Field       : I2C_IC_TX_ABRT_SOURCE_ARB_LOST
1991 // Description : This field specifies that the Master has lost arbitration, or
1992 //               if IC_TX_ABRT_SOURCE[14] is also set, then the slave
1993 //               transmitter has lost arbitration.
1994 //
1995 //               Reset value: 0x0
1996 //
1997 //               Role of DW_apb_i2c:  Master-Transmitter or Slave-Transmitter
1998 //               0x0 -> Master or Slave-Transmitter lost arbitration- scenario
1999 //               not present
2000 //               0x1 -> Master or Slave-Transmitter lost arbitration
2001 #define I2C_IC_TX_ABRT_SOURCE_ARB_LOST_RESET                     0x0
2002 #define I2C_IC_TX_ABRT_SOURCE_ARB_LOST_BITS                      0x00001000
2003 #define I2C_IC_TX_ABRT_SOURCE_ARB_LOST_MSB                       12
2004 #define I2C_IC_TX_ABRT_SOURCE_ARB_LOST_LSB                       12
2005 #define I2C_IC_TX_ABRT_SOURCE_ARB_LOST_ACCESS                    "RO"
2006 #define I2C_IC_TX_ABRT_SOURCE_ARB_LOST_VALUE_ABRT_LOST_VOID      0x0
2007 #define I2C_IC_TX_ABRT_SOURCE_ARB_LOST_VALUE_ABRT_LOST_GENERATED 0x1
2008 // -----------------------------------------------------------------------------
2009 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_MASTER_DIS
2010 // Description : This field indicates that the User tries to initiate a Master
2011 //               operation with the Master mode disabled.
2012 //
2013 //               Reset value: 0x0
2014 //
2015 //               Role of DW_apb_i2c:  Master-Transmitter or Master-Receiver
2016 //               0x0 -> User initiating master operation when MASTER disabled-
2017 //               scenario not present
2018 //               0x1 -> User initiating master operation when MASTER disabled
2019 #define I2C_IC_TX_ABRT_SOURCE_ABRT_MASTER_DIS_RESET                           0x0
2020 #define I2C_IC_TX_ABRT_SOURCE_ABRT_MASTER_DIS_BITS                            0x00000800
2021 #define I2C_IC_TX_ABRT_SOURCE_ABRT_MASTER_DIS_MSB                             11
2022 #define I2C_IC_TX_ABRT_SOURCE_ABRT_MASTER_DIS_LSB                             11
2023 #define I2C_IC_TX_ABRT_SOURCE_ABRT_MASTER_DIS_ACCESS                          "RO"
2024 #define I2C_IC_TX_ABRT_SOURCE_ABRT_MASTER_DIS_VALUE_ABRT_MASTER_DIS_VOID      0x0
2025 #define I2C_IC_TX_ABRT_SOURCE_ABRT_MASTER_DIS_VALUE_ABRT_MASTER_DIS_GENERATED 0x1
2026 // -----------------------------------------------------------------------------
2027 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_10B_RD_NORSTRT
2028 // Description : This field indicates that the restart is disabled
2029 //               (IC_RESTART_EN bit (IC_CON[5]) =0) and the master sends a read
2030 //               command in 10-bit addressing mode.
2031 //
2032 //               Reset value: 0x0
2033 //
2034 //               Role of DW_apb_i2c:  Master-Receiver
2035 //               0x0 -> Master not trying to read in 10Bit addressing mode when
2036 //               RESTART disabled
2037 //               0x1 -> Master trying to read in 10Bit addressing mode when
2038 //               RESTART disabled
2039 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10B_RD_NORSTRT_RESET                       0x0
2040 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10B_RD_NORSTRT_BITS                        0x00000400
2041 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10B_RD_NORSTRT_MSB                         10
2042 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10B_RD_NORSTRT_LSB                         10
2043 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10B_RD_NORSTRT_ACCESS                      "RO"
2044 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10B_RD_NORSTRT_VALUE_ABRT_10B_RD_VOID      0x0
2045 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10B_RD_NORSTRT_VALUE_ABRT_10B_RD_GENERATED 0x1
2046 // -----------------------------------------------------------------------------
2047 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_NORSTRT
2048 // Description : To clear Bit 9, the source of the ABRT_SBYTE_NORSTRT must be
2049 //               fixed first; restart must be enabled (IC_CON[5]=1), the SPECIAL
2050 //               bit must be cleared (IC_TAR[11]), or the GC_OR_START bit must
2051 //               be cleared (IC_TAR[10]). Once the source of the
2052 //               ABRT_SBYTE_NORSTRT is fixed, then this bit can be cleared in
2053 //               the same manner as other bits in this register. If the source
2054 //               of the ABRT_SBYTE_NORSTRT is not fixed before attempting to
2055 //               clear this bit, bit 9 clears for one cycle and then gets
2056 //               reasserted. When this field is set to 1, the restart is
2057 //               disabled (IC_RESTART_EN bit (IC_CON[5]) =0) and the user is
2058 //               trying to send a START Byte.
2059 //
2060 //               Reset value: 0x0
2061 //
2062 //               Role of DW_apb_i2c:  Master
2063 //               0x0 -> User trying to send START byte when RESTART disabled-
2064 //               scenario not present
2065 //               0x1 -> User trying to send START byte when RESTART disabled
2066 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_NORSTRT_RESET                              0x0
2067 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_NORSTRT_BITS                               0x00000200
2068 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_NORSTRT_MSB                                9
2069 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_NORSTRT_LSB                                9
2070 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_NORSTRT_ACCESS                             "RO"
2071 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_NORSTRT_VALUE_ABRT_SBYTE_NORSTRT_VOID      0x0
2072 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_NORSTRT_VALUE_ABRT_SBYTE_NORSTRT_GENERATED 0x1
2073 // -----------------------------------------------------------------------------
2074 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_HS_NORSTRT
2075 // Description : This field indicates that the restart is disabled
2076 //               (IC_RESTART_EN bit (IC_CON[5]) =0) and the user is trying to
2077 //               use the master to transfer data in High Speed mode.
2078 //
2079 //               Reset value: 0x0
2080 //
2081 //               Role of DW_apb_i2c:  Master-Transmitter or Master-Receiver
2082 //               0x0 -> User trying to switch Master to HS mode when RESTART
2083 //               disabled- scenario not present
2084 //               0x1 -> User trying to switch Master to HS mode when RESTART
2085 //               disabled
2086 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_NORSTRT_RESET                           0x0
2087 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_NORSTRT_BITS                            0x00000100
2088 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_NORSTRT_MSB                             8
2089 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_NORSTRT_LSB                             8
2090 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_NORSTRT_ACCESS                          "RO"
2091 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_NORSTRT_VALUE_ABRT_HS_NORSTRT_VOID      0x0
2092 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_NORSTRT_VALUE_ABRT_HS_NORSTRT_GENERATED 0x1
2093 // -----------------------------------------------------------------------------
2094 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_ACKDET
2095 // Description : This field indicates that the Master has sent a START Byte and
2096 //               the START Byte was acknowledged (wrong behavior).
2097 //
2098 //               Reset value: 0x0
2099 //
2100 //               Role of DW_apb_i2c:  Master
2101 //               0x0 -> ACK detected for START byte- scenario not present
2102 //               0x1 -> ACK detected for START byte
2103 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_ACKDET_RESET                             0x0
2104 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_ACKDET_BITS                              0x00000080
2105 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_ACKDET_MSB                               7
2106 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_ACKDET_LSB                               7
2107 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_ACKDET_ACCESS                            "RO"
2108 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_ACKDET_VALUE_ABRT_SBYTE_ACKDET_VOID      0x0
2109 #define I2C_IC_TX_ABRT_SOURCE_ABRT_SBYTE_ACKDET_VALUE_ABRT_SBYTE_ACKDET_GENERATED 0x1
2110 // -----------------------------------------------------------------------------
2111 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_HS_ACKDET
2112 // Description : This field indicates that the Master is in High Speed mode and
2113 //               the High Speed Master code was acknowledged (wrong behavior).
2114 //
2115 //               Reset value: 0x0
2116 //
2117 //               Role of DW_apb_i2c:  Master
2118 //               0x0 -> HS Master code ACKed in HS Mode- scenario not present
2119 //               0x1 -> HS Master code ACKed in HS Mode
2120 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_ACKDET_RESET                       0x0
2121 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_ACKDET_BITS                        0x00000040
2122 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_ACKDET_MSB                         6
2123 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_ACKDET_LSB                         6
2124 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_ACKDET_ACCESS                      "RO"
2125 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_ACKDET_VALUE_ABRT_HS_ACK_VOID      0x0
2126 #define I2C_IC_TX_ABRT_SOURCE_ABRT_HS_ACKDET_VALUE_ABRT_HS_ACK_GENERATED 0x1
2127 // -----------------------------------------------------------------------------
2128 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_READ
2129 // Description : This field indicates that DW_apb_i2c in the master mode has
2130 //               sent a General Call but the user programmed the byte following
2131 //               the General Call to be a read from the bus (IC_DATA_CMD[9] is
2132 //               set to 1).
2133 //
2134 //               Reset value: 0x0
2135 //
2136 //               Role of DW_apb_i2c:  Master-Transmitter
2137 //               0x0 -> GCALL is followed by read from bus-scenario not present
2138 //               0x1 -> GCALL is followed by read from bus
2139 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_READ_RESET                           0x0
2140 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_READ_BITS                            0x00000020
2141 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_READ_MSB                             5
2142 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_READ_LSB                             5
2143 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_READ_ACCESS                          "RO"
2144 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_READ_VALUE_ABRT_GCALL_READ_VOID      0x0
2145 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_READ_VALUE_ABRT_GCALL_READ_GENERATED 0x1
2146 // -----------------------------------------------------------------------------
2147 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_NOACK
2148 // Description : This field indicates that DW_apb_i2c in master mode has sent a
2149 //               General Call and no slave on the bus acknowledged the General
2150 //               Call.
2151 //
2152 //               Reset value: 0x0
2153 //
2154 //               Role of DW_apb_i2c:  Master-Transmitter
2155 //               0x0 -> GCALL not ACKed by any slave-scenario not present
2156 //               0x1 -> GCALL not ACKed by any slave
2157 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_NOACK_RESET                            0x0
2158 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_NOACK_BITS                             0x00000010
2159 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_NOACK_MSB                              4
2160 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_NOACK_LSB                              4
2161 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_NOACK_ACCESS                           "RO"
2162 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_NOACK_VALUE_ABRT_GCALL_NOACK_VOID      0x0
2163 #define I2C_IC_TX_ABRT_SOURCE_ABRT_GCALL_NOACK_VALUE_ABRT_GCALL_NOACK_GENERATED 0x1
2164 // -----------------------------------------------------------------------------
2165 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_TXDATA_NOACK
2166 // Description : This field indicates the master-mode only bit. When the master
2167 //               receives an acknowledgement for the address, but when it sends
2168 //               data byte(s) following the address, it did not receive an
2169 //               acknowledge from the remote slave(s).
2170 //
2171 //               Reset value: 0x0
2172 //
2173 //               Role of DW_apb_i2c:  Master-Transmitter
2174 //               0x0 -> Transmitted data non-ACKed by addressed slave-scenario
2175 //               not present
2176 //               0x1 -> Transmitted data not ACKed by addressed slave
2177 #define I2C_IC_TX_ABRT_SOURCE_ABRT_TXDATA_NOACK_RESET                             0x0
2178 #define I2C_IC_TX_ABRT_SOURCE_ABRT_TXDATA_NOACK_BITS                              0x00000008
2179 #define I2C_IC_TX_ABRT_SOURCE_ABRT_TXDATA_NOACK_MSB                               3
2180 #define I2C_IC_TX_ABRT_SOURCE_ABRT_TXDATA_NOACK_LSB                               3
2181 #define I2C_IC_TX_ABRT_SOURCE_ABRT_TXDATA_NOACK_ACCESS                            "RO"
2182 #define I2C_IC_TX_ABRT_SOURCE_ABRT_TXDATA_NOACK_VALUE_ABRT_TXDATA_NOACK_VOID      0x0
2183 #define I2C_IC_TX_ABRT_SOURCE_ABRT_TXDATA_NOACK_VALUE_ABRT_TXDATA_NOACK_GENERATED 0x1
2184 // -----------------------------------------------------------------------------
2185 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR2_NOACK
2186 // Description : This field indicates that the Master is in 10-bit address mode
2187 //               and that the second address byte of the 10-bit address was not
2188 //               acknowledged by any slave.
2189 //
2190 //               Reset value: 0x0
2191 //
2192 //               Role of DW_apb_i2c:  Master-Transmitter or Master-Receiver
2193 //               0x0 -> This abort is not generated
2194 //               0x1 -> Byte 2 of 10Bit Address not ACKed by any slave
2195 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR2_NOACK_RESET          0x0
2196 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR2_NOACK_BITS           0x00000004
2197 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR2_NOACK_MSB            2
2198 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR2_NOACK_LSB            2
2199 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR2_NOACK_ACCESS         "RO"
2200 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR2_NOACK_VALUE_INACTIVE 0x0
2201 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR2_NOACK_VALUE_ACTIVE   0x1
2202 // -----------------------------------------------------------------------------
2203 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR1_NOACK
2204 // Description : This field indicates that the Master is in 10-bit address mode
2205 //               and the first 10-bit address byte was not acknowledged by any
2206 //               slave.
2207 //
2208 //               Reset value: 0x0
2209 //
2210 //               Role of DW_apb_i2c:  Master-Transmitter or Master-Receiver
2211 //               0x0 -> This abort is not generated
2212 //               0x1 -> Byte 1 of 10Bit Address not ACKed by any slave
2213 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR1_NOACK_RESET          0x0
2214 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR1_NOACK_BITS           0x00000002
2215 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR1_NOACK_MSB            1
2216 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR1_NOACK_LSB            1
2217 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR1_NOACK_ACCESS         "RO"
2218 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR1_NOACK_VALUE_INACTIVE 0x0
2219 #define I2C_IC_TX_ABRT_SOURCE_ABRT_10ADDR1_NOACK_VALUE_ACTIVE   0x1
2220 // -----------------------------------------------------------------------------
2221 // Field       : I2C_IC_TX_ABRT_SOURCE_ABRT_7B_ADDR_NOACK
2222 // Description : This field indicates that the Master is in 7-bit addressing
2223 //               mode and the address sent was not acknowledged by any slave.
2224 //
2225 //               Reset value: 0x0
2226 //
2227 //               Role of DW_apb_i2c:  Master-Transmitter or Master-Receiver
2228 //               0x0 -> This abort is not generated
2229 //               0x1 -> This abort is generated because of NOACK for 7-bit
2230 //               address
2231 #define I2C_IC_TX_ABRT_SOURCE_ABRT_7B_ADDR_NOACK_RESET          0x0
2232 #define I2C_IC_TX_ABRT_SOURCE_ABRT_7B_ADDR_NOACK_BITS           0x00000001
2233 #define I2C_IC_TX_ABRT_SOURCE_ABRT_7B_ADDR_NOACK_MSB            0
2234 #define I2C_IC_TX_ABRT_SOURCE_ABRT_7B_ADDR_NOACK_LSB            0
2235 #define I2C_IC_TX_ABRT_SOURCE_ABRT_7B_ADDR_NOACK_ACCESS         "RO"
2236 #define I2C_IC_TX_ABRT_SOURCE_ABRT_7B_ADDR_NOACK_VALUE_INACTIVE 0x0
2237 #define I2C_IC_TX_ABRT_SOURCE_ABRT_7B_ADDR_NOACK_VALUE_ACTIVE   0x1
2238 // =============================================================================
2239 // Register    : I2C_IC_SLV_DATA_NACK_ONLY
2240 // Description : Generate Slave Data NACK Register
2241 //
2242 //               The register is used to generate a NACK for the data part of a
2243 //               transfer when DW_apb_i2c is acting as a slave-receiver. This
2244 //               register only exists when the IC_SLV_DATA_NACK_ONLY parameter
2245 //               is set to 1. When this parameter disabled, this register does
2246 //               not exist and writing to the register's address has no effect.
2247 //
2248 //               A write can occur on this register if both of the following
2249 //               conditions are met: - DW_apb_i2c is disabled (IC_ENABLE[0] = 0)
2250 //               - Slave part is inactive (IC_STATUS[6] = 0) Note: The
2251 //               IC_STATUS[6] is a register read-back location for the internal
2252 //               slv_activity signal; the user should poll this before writing
2253 //               the ic_slv_data_nack_only bit.
2254 #define I2C_IC_SLV_DATA_NACK_ONLY_OFFSET 0x00000084
2255 #define I2C_IC_SLV_DATA_NACK_ONLY_BITS   0x00000001
2256 #define I2C_IC_SLV_DATA_NACK_ONLY_RESET  0x00000000
2257 // -----------------------------------------------------------------------------
2258 // Field       : I2C_IC_SLV_DATA_NACK_ONLY_NACK
2259 // Description : Generate NACK. This NACK generation only occurs when DW_apb_i2c
2260 //               is a slave-receiver. If this register is set to a value of 1,
2261 //               it can only generate a NACK after a data byte is received;
2262 //               hence, the data transfer is aborted and the data received is
2263 //               not pushed to the receive buffer.
2264 //
2265 //               When the register is set to a value of 0, it generates
2266 //               NACK/ACK, depending on normal criteria. - 1: generate NACK
2267 //               after data byte received - 0: generate NACK/ACK normally Reset
2268 //               value: 0x0
2269 //               0x0 -> Slave receiver generates NACK normally
2270 //               0x1 -> Slave receiver generates NACK upon data reception only
2271 #define I2C_IC_SLV_DATA_NACK_ONLY_NACK_RESET          0x0
2272 #define I2C_IC_SLV_DATA_NACK_ONLY_NACK_BITS           0x00000001
2273 #define I2C_IC_SLV_DATA_NACK_ONLY_NACK_MSB            0
2274 #define I2C_IC_SLV_DATA_NACK_ONLY_NACK_LSB            0
2275 #define I2C_IC_SLV_DATA_NACK_ONLY_NACK_ACCESS         "RW"
2276 #define I2C_IC_SLV_DATA_NACK_ONLY_NACK_VALUE_DISABLED 0x0
2277 #define I2C_IC_SLV_DATA_NACK_ONLY_NACK_VALUE_ENABLED  0x1
2278 // =============================================================================
2279 // Register    : I2C_IC_DMA_CR
2280 // Description : DMA Control Register
2281 //
2282 //               The register is used to enable the DMA Controller interface
2283 //               operation. There is a separate bit for transmit and receive.
2284 //               This can be programmed regardless of the state of IC_ENABLE.
2285 #define I2C_IC_DMA_CR_OFFSET 0x00000088
2286 #define I2C_IC_DMA_CR_BITS   0x00000003
2287 #define I2C_IC_DMA_CR_RESET  0x00000000
2288 // -----------------------------------------------------------------------------
2289 // Field       : I2C_IC_DMA_CR_TDMAE
2290 // Description : Transmit DMA Enable. This bit enables/disables the transmit
2291 //               FIFO DMA channel. Reset value: 0x0
2292 //               0x0 -> transmit FIFO DMA channel disabled
2293 //               0x1 -> Transmit FIFO DMA channel enabled
2294 #define I2C_IC_DMA_CR_TDMAE_RESET          0x0
2295 #define I2C_IC_DMA_CR_TDMAE_BITS           0x00000002
2296 #define I2C_IC_DMA_CR_TDMAE_MSB            1
2297 #define I2C_IC_DMA_CR_TDMAE_LSB            1
2298 #define I2C_IC_DMA_CR_TDMAE_ACCESS         "RW"
2299 #define I2C_IC_DMA_CR_TDMAE_VALUE_DISABLED 0x0
2300 #define I2C_IC_DMA_CR_TDMAE_VALUE_ENABLED  0x1
2301 // -----------------------------------------------------------------------------
2302 // Field       : I2C_IC_DMA_CR_RDMAE
2303 // Description : Receive DMA Enable. This bit enables/disables the receive FIFO
2304 //               DMA channel. Reset value: 0x0
2305 //               0x0 -> Receive FIFO DMA channel disabled
2306 //               0x1 -> Receive FIFO DMA channel enabled
2307 #define I2C_IC_DMA_CR_RDMAE_RESET          0x0
2308 #define I2C_IC_DMA_CR_RDMAE_BITS           0x00000001
2309 #define I2C_IC_DMA_CR_RDMAE_MSB            0
2310 #define I2C_IC_DMA_CR_RDMAE_LSB            0
2311 #define I2C_IC_DMA_CR_RDMAE_ACCESS         "RW"
2312 #define I2C_IC_DMA_CR_RDMAE_VALUE_DISABLED 0x0
2313 #define I2C_IC_DMA_CR_RDMAE_VALUE_ENABLED  0x1
2314 // =============================================================================
2315 // Register    : I2C_IC_DMA_TDLR
2316 // Description : DMA Transmit Data Level Register
2317 #define I2C_IC_DMA_TDLR_OFFSET 0x0000008c
2318 #define I2C_IC_DMA_TDLR_BITS   0x0000000f
2319 #define I2C_IC_DMA_TDLR_RESET  0x00000000
2320 // -----------------------------------------------------------------------------
2321 // Field       : I2C_IC_DMA_TDLR_DMATDL
2322 // Description : Transmit Data Level. This bit field controls the level at which
2323 //               a DMA request is made by the transmit logic. It is equal to the
2324 //               watermark level; that is, the dma_tx_req signal is generated
2325 //               when the number of valid data entries in the transmit FIFO is
2326 //               equal to or below this field value, and TDMAE = 1.
2327 //
2328 //               Reset value: 0x0
2329 #define I2C_IC_DMA_TDLR_DMATDL_RESET  0x0
2330 #define I2C_IC_DMA_TDLR_DMATDL_BITS   0x0000000f
2331 #define I2C_IC_DMA_TDLR_DMATDL_MSB    3
2332 #define I2C_IC_DMA_TDLR_DMATDL_LSB    0
2333 #define I2C_IC_DMA_TDLR_DMATDL_ACCESS "RW"
2334 // =============================================================================
2335 // Register    : I2C_IC_DMA_RDLR
2336 // Description : I2C Receive Data Level Register
2337 #define I2C_IC_DMA_RDLR_OFFSET 0x00000090
2338 #define I2C_IC_DMA_RDLR_BITS   0x0000000f
2339 #define I2C_IC_DMA_RDLR_RESET  0x00000000
2340 // -----------------------------------------------------------------------------
2341 // Field       : I2C_IC_DMA_RDLR_DMARDL
2342 // Description : Receive Data Level. This bit field controls the level at which
2343 //               a DMA request is made by the receive logic. The watermark level
2344 //               = DMARDL+1; that is, dma_rx_req is generated when the number of
2345 //               valid data entries in the receive FIFO is equal to or more than
2346 //               this field value + 1, and RDMAE =1. For instance, when DMARDL
2347 //               is 0, then dma_rx_req is asserted when 1 or more data entries
2348 //               are present in the receive FIFO.
2349 //
2350 //               Reset value: 0x0
2351 #define I2C_IC_DMA_RDLR_DMARDL_RESET  0x0
2352 #define I2C_IC_DMA_RDLR_DMARDL_BITS   0x0000000f
2353 #define I2C_IC_DMA_RDLR_DMARDL_MSB    3
2354 #define I2C_IC_DMA_RDLR_DMARDL_LSB    0
2355 #define I2C_IC_DMA_RDLR_DMARDL_ACCESS "RW"
2356 // =============================================================================
2357 // Register    : I2C_IC_SDA_SETUP
2358 // Description : I2C SDA Setup Register
2359 //
2360 //               This register controls the amount of time delay (in terms of
2361 //               number of ic_clk clock periods) introduced in the rising edge
2362 //               of SCL - relative to SDA changing - when DW_apb_i2c services a
2363 //               read request in a slave-transmitter operation. The relevant I2C
2364 //               requirement is tSU:DAT (note 4) as detailed in the I2C Bus
2365 //               Specification. This register must be programmed with a value
2366 //               equal to or greater than 2.
2367 //
2368 //               Writes to this register succeed only when IC_ENABLE[0] = 0.
2369 //
2370 //               Note: The length of setup time is calculated using
2371 //               [(IC_SDA_SETUP - 1) * (ic_clk_period)], so if the user requires
2372 //               10 ic_clk periods of setup time, they should program a value of
2373 //               11. The IC_SDA_SETUP register is only used by the DW_apb_i2c
2374 //               when operating as a slave transmitter.
2375 #define I2C_IC_SDA_SETUP_OFFSET 0x00000094
2376 #define I2C_IC_SDA_SETUP_BITS   0x000000ff
2377 #define I2C_IC_SDA_SETUP_RESET  0x00000064
2378 // -----------------------------------------------------------------------------
2379 // Field       : I2C_IC_SDA_SETUP_SDA_SETUP
2380 // Description : SDA Setup. It is recommended that if the required delay is
2381 //               1000ns, then for an ic_clk frequency of 10 MHz, IC_SDA_SETUP
2382 //               should be programmed to a value of 11. IC_SDA_SETUP must be
2383 //               programmed with a minimum value of 2.
2384 #define I2C_IC_SDA_SETUP_SDA_SETUP_RESET  0x64
2385 #define I2C_IC_SDA_SETUP_SDA_SETUP_BITS   0x000000ff
2386 #define I2C_IC_SDA_SETUP_SDA_SETUP_MSB    7
2387 #define I2C_IC_SDA_SETUP_SDA_SETUP_LSB    0
2388 #define I2C_IC_SDA_SETUP_SDA_SETUP_ACCESS "RW"
2389 // =============================================================================
2390 // Register    : I2C_IC_ACK_GENERAL_CALL
2391 // Description : I2C ACK General Call Register
2392 //
2393 //               The register controls whether DW_apb_i2c responds with a ACK or
2394 //               NACK when it receives an I2C General Call address.
2395 //
2396 //               This register is applicable only when the DW_apb_i2c is in
2397 //               slave mode.
2398 #define I2C_IC_ACK_GENERAL_CALL_OFFSET 0x00000098
2399 #define I2C_IC_ACK_GENERAL_CALL_BITS   0x00000001
2400 #define I2C_IC_ACK_GENERAL_CALL_RESET  0x00000001
2401 // -----------------------------------------------------------------------------
2402 // Field       : I2C_IC_ACK_GENERAL_CALL_ACK_GEN_CALL
2403 // Description : ACK General Call. When set to 1, DW_apb_i2c responds with a ACK
2404 //               (by asserting ic_data_oe) when it receives a General Call.
2405 //               Otherwise, DW_apb_i2c responds with a NACK (by negating
2406 //               ic_data_oe).
2407 //               0x0 -> Generate NACK for a General Call
2408 //               0x1 -> Generate ACK for a General Call
2409 #define I2C_IC_ACK_GENERAL_CALL_ACK_GEN_CALL_RESET          0x1
2410 #define I2C_IC_ACK_GENERAL_CALL_ACK_GEN_CALL_BITS           0x00000001
2411 #define I2C_IC_ACK_GENERAL_CALL_ACK_GEN_CALL_MSB            0
2412 #define I2C_IC_ACK_GENERAL_CALL_ACK_GEN_CALL_LSB            0
2413 #define I2C_IC_ACK_GENERAL_CALL_ACK_GEN_CALL_ACCESS         "RW"
2414 #define I2C_IC_ACK_GENERAL_CALL_ACK_GEN_CALL_VALUE_DISABLED 0x0
2415 #define I2C_IC_ACK_GENERAL_CALL_ACK_GEN_CALL_VALUE_ENABLED  0x1
2416 // =============================================================================
2417 // Register    : I2C_IC_ENABLE_STATUS
2418 // Description : I2C Enable Status Register
2419 //
2420 //               The register is used to report the DW_apb_i2c hardware status
2421 //               when the IC_ENABLE[0] register is set from 1 to 0; that is,
2422 //               when DW_apb_i2c is disabled.
2423 //
2424 //               If IC_ENABLE[0] has been set to 1, bits 2:1 are forced to 0,
2425 //               and bit 0 is forced to 1.
2426 //
2427 //               If IC_ENABLE[0] has been set to 0, bits 2:1 is only be valid as
2428 //               soon as bit 0 is read as '0'.
2429 //
2430 //               Note: When IC_ENABLE[0] has been set to 0, a delay occurs for
2431 //               bit 0 to be read as 0 because disabling the DW_apb_i2c depends
2432 //               on I2C bus activities.
2433 #define I2C_IC_ENABLE_STATUS_OFFSET 0x0000009c
2434 #define I2C_IC_ENABLE_STATUS_BITS   0x00000007
2435 #define I2C_IC_ENABLE_STATUS_RESET  0x00000000
2436 // -----------------------------------------------------------------------------
2437 // Field       : I2C_IC_ENABLE_STATUS_SLV_RX_DATA_LOST
2438 // Description : Slave Received Data Lost. This bit indicates if a
2439 //               Slave-Receiver operation has been aborted with at least one
2440 //               data byte received from an I2C transfer due to the setting bit
2441 //               0 of IC_ENABLE from 1 to 0. When read as 1, DW_apb_i2c is
2442 //               deemed to have been actively engaged in an aborted I2C transfer
2443 //               (with matching address) and the data phase of the I2C transfer
2444 //               has been entered, even though a data byte has been responded
2445 //               with a NACK.
2446 //
2447 //               Note:  If the remote I2C master terminates the transfer with a
2448 //               STOP condition before the DW_apb_i2c has a chance to NACK a
2449 //               transfer, and IC_ENABLE[0] has been set to 0, then this bit is
2450 //               also set to 1.
2451 //
2452 //               When read as 0, DW_apb_i2c is deemed to have been disabled
2453 //               without being actively involved in the data phase of a
2454 //               Slave-Receiver transfer.
2455 //
2456 //               Note:  The CPU can safely read this bit when IC_EN (bit 0) is
2457 //               read as 0.
2458 //
2459 //               Reset value: 0x0
2460 //               0x0 -> Slave RX Data is not lost
2461 //               0x1 -> Slave RX Data is lost
2462 #define I2C_IC_ENABLE_STATUS_SLV_RX_DATA_LOST_RESET          0x0
2463 #define I2C_IC_ENABLE_STATUS_SLV_RX_DATA_LOST_BITS           0x00000004
2464 #define I2C_IC_ENABLE_STATUS_SLV_RX_DATA_LOST_MSB            2
2465 #define I2C_IC_ENABLE_STATUS_SLV_RX_DATA_LOST_LSB            2
2466 #define I2C_IC_ENABLE_STATUS_SLV_RX_DATA_LOST_ACCESS         "RO"
2467 #define I2C_IC_ENABLE_STATUS_SLV_RX_DATA_LOST_VALUE_INACTIVE 0x0
2468 #define I2C_IC_ENABLE_STATUS_SLV_RX_DATA_LOST_VALUE_ACTIVE   0x1
2469 // -----------------------------------------------------------------------------
2470 // Field       : I2C_IC_ENABLE_STATUS_SLV_DISABLED_WHILE_BUSY
2471 // Description : Slave Disabled While Busy (Transmit, Receive). This bit
2472 //               indicates if a potential or active Slave operation has been
2473 //               aborted due to the setting bit 0 of the IC_ENABLE register from
2474 //               1 to 0. This bit is set when the CPU writes a 0 to the
2475 //               IC_ENABLE register while:
2476 //
2477 //               (a) DW_apb_i2c is receiving the address byte of the
2478 //               Slave-Transmitter operation from a remote master;
2479 //
2480 //               OR,
2481 //
2482 //               (b) address and data bytes of the Slave-Receiver operation from
2483 //               a remote master.
2484 //
2485 //               When read as 1, DW_apb_i2c is deemed to have forced a NACK
2486 //               during any part of an I2C transfer, irrespective of whether the
2487 //               I2C address matches the slave address set in DW_apb_i2c (IC_SAR
2488 //               register) OR if the transfer is completed before IC_ENABLE is
2489 //               set to 0 but has not taken effect.
2490 //
2491 //               Note:  If the remote I2C master terminates the transfer with a
2492 //               STOP condition before the DW_apb_i2c has a chance to NACK a
2493 //               transfer, and IC_ENABLE[0] has been set to 0, then this bit
2494 //               will also be set to 1.
2495 //
2496 //               When read as 0, DW_apb_i2c is deemed to have been disabled when
2497 //               there is master activity, or when the I2C bus is idle.
2498 //
2499 //               Note:  The CPU can safely read this bit when IC_EN (bit 0) is
2500 //               read as 0.
2501 //
2502 //               Reset value: 0x0
2503 //               0x0 -> Slave is disabled when it is idle
2504 //               0x1 -> Slave is disabled when it is active
2505 #define I2C_IC_ENABLE_STATUS_SLV_DISABLED_WHILE_BUSY_RESET          0x0
2506 #define I2C_IC_ENABLE_STATUS_SLV_DISABLED_WHILE_BUSY_BITS           0x00000002
2507 #define I2C_IC_ENABLE_STATUS_SLV_DISABLED_WHILE_BUSY_MSB            1
2508 #define I2C_IC_ENABLE_STATUS_SLV_DISABLED_WHILE_BUSY_LSB            1
2509 #define I2C_IC_ENABLE_STATUS_SLV_DISABLED_WHILE_BUSY_ACCESS         "RO"
2510 #define I2C_IC_ENABLE_STATUS_SLV_DISABLED_WHILE_BUSY_VALUE_INACTIVE 0x0
2511 #define I2C_IC_ENABLE_STATUS_SLV_DISABLED_WHILE_BUSY_VALUE_ACTIVE   0x1
2512 // -----------------------------------------------------------------------------
2513 // Field       : I2C_IC_ENABLE_STATUS_IC_EN
2514 // Description : ic_en Status. This bit always reflects the value driven on the
2515 //               output port ic_en. - When read as 1, DW_apb_i2c is deemed to be
2516 //               in an enabled state. - When read as 0, DW_apb_i2c is deemed
2517 //               completely inactive. Note:  The CPU can safely read this bit
2518 //               anytime. When this bit is read as 0, the CPU can safely read
2519 //               SLV_RX_DATA_LOST (bit 2) and SLV_DISABLED_WHILE_BUSY (bit 1).
2520 //
2521 //               Reset value: 0x0
2522 //               0x0 -> I2C disabled
2523 //               0x1 -> I2C enabled
2524 #define I2C_IC_ENABLE_STATUS_IC_EN_RESET          0x0
2525 #define I2C_IC_ENABLE_STATUS_IC_EN_BITS           0x00000001
2526 #define I2C_IC_ENABLE_STATUS_IC_EN_MSB            0
2527 #define I2C_IC_ENABLE_STATUS_IC_EN_LSB            0
2528 #define I2C_IC_ENABLE_STATUS_IC_EN_ACCESS         "RO"
2529 #define I2C_IC_ENABLE_STATUS_IC_EN_VALUE_DISABLED 0x0
2530 #define I2C_IC_ENABLE_STATUS_IC_EN_VALUE_ENABLED  0x1
2531 // =============================================================================
2532 // Register    : I2C_IC_FS_SPKLEN
2533 // Description : I2C SS, FS or FM+ spike suppression limit
2534 //
2535 //               This register is used to store the duration, measured in ic_clk
2536 //               cycles, of the longest spike that is filtered out by the spike
2537 //               suppression logic when the component is operating in SS, FS or
2538 //               FM+ modes. The relevant I2C requirement is tSP (table 4) as
2539 //               detailed in the I2C Bus Specification. This register must be
2540 //               programmed with a minimum value of 1.
2541 #define I2C_IC_FS_SPKLEN_OFFSET 0x000000a0
2542 #define I2C_IC_FS_SPKLEN_BITS   0x000000ff
2543 #define I2C_IC_FS_SPKLEN_RESET  0x00000007
2544 // -----------------------------------------------------------------------------
2545 // Field       : I2C_IC_FS_SPKLEN_IC_FS_SPKLEN
2546 // Description : This register must be set before any I2C bus transaction can
2547 //               take place to ensure stable operation. This register sets the
2548 //               duration, measured in ic_clk cycles, of the longest spike in
2549 //               the SCL or SDA lines that will be filtered out by the spike
2550 //               suppression logic. This register can be written only when the
2551 //               I2C interface is disabled which corresponds to the IC_ENABLE[0]
2552 //               register being set to 0. Writes at other times have no effect.
2553 //               The minimum valid value is 1; hardware prevents values less
2554 //               than this being written, and if attempted results in 1 being
2555 //               set. or more information, refer to 'Spike Suppression'.
2556 #define I2C_IC_FS_SPKLEN_IC_FS_SPKLEN_RESET  0x07
2557 #define I2C_IC_FS_SPKLEN_IC_FS_SPKLEN_BITS   0x000000ff
2558 #define I2C_IC_FS_SPKLEN_IC_FS_SPKLEN_MSB    7
2559 #define I2C_IC_FS_SPKLEN_IC_FS_SPKLEN_LSB    0
2560 #define I2C_IC_FS_SPKLEN_IC_FS_SPKLEN_ACCESS "RW"
2561 // =============================================================================
2562 // Register    : I2C_IC_CLR_RESTART_DET
2563 // Description : Clear RESTART_DET Interrupt Register
2564 #define I2C_IC_CLR_RESTART_DET_OFFSET 0x000000a8
2565 #define I2C_IC_CLR_RESTART_DET_BITS   0x00000001
2566 #define I2C_IC_CLR_RESTART_DET_RESET  0x00000000
2567 // -----------------------------------------------------------------------------
2568 // Field       : I2C_IC_CLR_RESTART_DET_CLR_RESTART_DET
2569 // Description : Read this register to clear the RESTART_DET interrupt (bit 12)
2570 //               of IC_RAW_INTR_STAT register.
2571 //
2572 //               Reset value: 0x0
2573 #define I2C_IC_CLR_RESTART_DET_CLR_RESTART_DET_RESET  0x0
2574 #define I2C_IC_CLR_RESTART_DET_CLR_RESTART_DET_BITS   0x00000001
2575 #define I2C_IC_CLR_RESTART_DET_CLR_RESTART_DET_MSB    0
2576 #define I2C_IC_CLR_RESTART_DET_CLR_RESTART_DET_LSB    0
2577 #define I2C_IC_CLR_RESTART_DET_CLR_RESTART_DET_ACCESS "RO"
2578 // =============================================================================
2579 // Register    : I2C_IC_COMP_PARAM_1
2580 // Description : Component Parameter Register 1
2581 //
2582 //               Note This register is not implemented and therefore reads as 0.
2583 //               If it was implemented it would be a constant read-only register
2584 //               that contains encoded information about the component's
2585 //               parameter settings. Fields shown below are the settings for
2586 //               those parameters
2587 #define I2C_IC_COMP_PARAM_1_OFFSET 0x000000f4
2588 #define I2C_IC_COMP_PARAM_1_BITS   0x00ffffff
2589 #define I2C_IC_COMP_PARAM_1_RESET  0x00000000
2590 // -----------------------------------------------------------------------------
2591 // Field       : I2C_IC_COMP_PARAM_1_TX_BUFFER_DEPTH
2592 // Description : TX Buffer Depth = 16
2593 #define I2C_IC_COMP_PARAM_1_TX_BUFFER_DEPTH_RESET  0x00
2594 #define I2C_IC_COMP_PARAM_1_TX_BUFFER_DEPTH_BITS   0x00ff0000
2595 #define I2C_IC_COMP_PARAM_1_TX_BUFFER_DEPTH_MSB    23
2596 #define I2C_IC_COMP_PARAM_1_TX_BUFFER_DEPTH_LSB    16
2597 #define I2C_IC_COMP_PARAM_1_TX_BUFFER_DEPTH_ACCESS "RO"
2598 // -----------------------------------------------------------------------------
2599 // Field       : I2C_IC_COMP_PARAM_1_RX_BUFFER_DEPTH
2600 // Description : RX Buffer Depth = 16
2601 #define I2C_IC_COMP_PARAM_1_RX_BUFFER_DEPTH_RESET  0x00
2602 #define I2C_IC_COMP_PARAM_1_RX_BUFFER_DEPTH_BITS   0x0000ff00
2603 #define I2C_IC_COMP_PARAM_1_RX_BUFFER_DEPTH_MSB    15
2604 #define I2C_IC_COMP_PARAM_1_RX_BUFFER_DEPTH_LSB    8
2605 #define I2C_IC_COMP_PARAM_1_RX_BUFFER_DEPTH_ACCESS "RO"
2606 // -----------------------------------------------------------------------------
2607 // Field       : I2C_IC_COMP_PARAM_1_ADD_ENCODED_PARAMS
2608 // Description : Encoded parameters not visible
2609 #define I2C_IC_COMP_PARAM_1_ADD_ENCODED_PARAMS_RESET  0x0
2610 #define I2C_IC_COMP_PARAM_1_ADD_ENCODED_PARAMS_BITS   0x00000080
2611 #define I2C_IC_COMP_PARAM_1_ADD_ENCODED_PARAMS_MSB    7
2612 #define I2C_IC_COMP_PARAM_1_ADD_ENCODED_PARAMS_LSB    7
2613 #define I2C_IC_COMP_PARAM_1_ADD_ENCODED_PARAMS_ACCESS "RO"
2614 // -----------------------------------------------------------------------------
2615 // Field       : I2C_IC_COMP_PARAM_1_HAS_DMA
2616 // Description : DMA handshaking signals are enabled
2617 #define I2C_IC_COMP_PARAM_1_HAS_DMA_RESET  0x0
2618 #define I2C_IC_COMP_PARAM_1_HAS_DMA_BITS   0x00000040
2619 #define I2C_IC_COMP_PARAM_1_HAS_DMA_MSB    6
2620 #define I2C_IC_COMP_PARAM_1_HAS_DMA_LSB    6
2621 #define I2C_IC_COMP_PARAM_1_HAS_DMA_ACCESS "RO"
2622 // -----------------------------------------------------------------------------
2623 // Field       : I2C_IC_COMP_PARAM_1_INTR_IO
2624 // Description : COMBINED Interrupt outputs
2625 #define I2C_IC_COMP_PARAM_1_INTR_IO_RESET  0x0
2626 #define I2C_IC_COMP_PARAM_1_INTR_IO_BITS   0x00000020
2627 #define I2C_IC_COMP_PARAM_1_INTR_IO_MSB    5
2628 #define I2C_IC_COMP_PARAM_1_INTR_IO_LSB    5
2629 #define I2C_IC_COMP_PARAM_1_INTR_IO_ACCESS "RO"
2630 // -----------------------------------------------------------------------------
2631 // Field       : I2C_IC_COMP_PARAM_1_HC_COUNT_VALUES
2632 // Description : Programmable count values for each mode.
2633 #define I2C_IC_COMP_PARAM_1_HC_COUNT_VALUES_RESET  0x0
2634 #define I2C_IC_COMP_PARAM_1_HC_COUNT_VALUES_BITS   0x00000010
2635 #define I2C_IC_COMP_PARAM_1_HC_COUNT_VALUES_MSB    4
2636 #define I2C_IC_COMP_PARAM_1_HC_COUNT_VALUES_LSB    4
2637 #define I2C_IC_COMP_PARAM_1_HC_COUNT_VALUES_ACCESS "RO"
2638 // -----------------------------------------------------------------------------
2639 // Field       : I2C_IC_COMP_PARAM_1_MAX_SPEED_MODE
2640 // Description : MAX SPEED MODE = FAST MODE
2641 #define I2C_IC_COMP_PARAM_1_MAX_SPEED_MODE_RESET  0x0
2642 #define I2C_IC_COMP_PARAM_1_MAX_SPEED_MODE_BITS   0x0000000c
2643 #define I2C_IC_COMP_PARAM_1_MAX_SPEED_MODE_MSB    3
2644 #define I2C_IC_COMP_PARAM_1_MAX_SPEED_MODE_LSB    2
2645 #define I2C_IC_COMP_PARAM_1_MAX_SPEED_MODE_ACCESS "RO"
2646 // -----------------------------------------------------------------------------
2647 // Field       : I2C_IC_COMP_PARAM_1_APB_DATA_WIDTH
2648 // Description : APB data bus width is 32 bits
2649 #define I2C_IC_COMP_PARAM_1_APB_DATA_WIDTH_RESET  0x0
2650 #define I2C_IC_COMP_PARAM_1_APB_DATA_WIDTH_BITS   0x00000003
2651 #define I2C_IC_COMP_PARAM_1_APB_DATA_WIDTH_MSB    1
2652 #define I2C_IC_COMP_PARAM_1_APB_DATA_WIDTH_LSB    0
2653 #define I2C_IC_COMP_PARAM_1_APB_DATA_WIDTH_ACCESS "RO"
2654 // =============================================================================
2655 // Register    : I2C_IC_COMP_VERSION
2656 // Description : I2C Component Version Register
2657 #define I2C_IC_COMP_VERSION_OFFSET 0x000000f8
2658 #define I2C_IC_COMP_VERSION_BITS   0xffffffff
2659 #define I2C_IC_COMP_VERSION_RESET  0x3230312a
2660 // -----------------------------------------------------------------------------
2661 // Field       : I2C_IC_COMP_VERSION_IC_COMP_VERSION
2662 // Description : None
2663 #define I2C_IC_COMP_VERSION_IC_COMP_VERSION_RESET  0x3230312a
2664 #define I2C_IC_COMP_VERSION_IC_COMP_VERSION_BITS   0xffffffff
2665 #define I2C_IC_COMP_VERSION_IC_COMP_VERSION_MSB    31
2666 #define I2C_IC_COMP_VERSION_IC_COMP_VERSION_LSB    0
2667 #define I2C_IC_COMP_VERSION_IC_COMP_VERSION_ACCESS "RO"
2668 // =============================================================================
2669 // Register    : I2C_IC_COMP_TYPE
2670 // Description : I2C Component Type Register
2671 #define I2C_IC_COMP_TYPE_OFFSET 0x000000fc
2672 #define I2C_IC_COMP_TYPE_BITS   0xffffffff
2673 #define I2C_IC_COMP_TYPE_RESET  0x44570140
2674 // -----------------------------------------------------------------------------
2675 // Field       : I2C_IC_COMP_TYPE_IC_COMP_TYPE
2676 // Description : Designware Component Type number = 0x44_57_01_40. This assigned
2677 //               unique hex value is constant and is derived from the two ASCII
2678 //               letters 'DW' followed by a 16-bit unsigned number.
2679 #define I2C_IC_COMP_TYPE_IC_COMP_TYPE_RESET  0x44570140
2680 #define I2C_IC_COMP_TYPE_IC_COMP_TYPE_BITS   0xffffffff
2681 #define I2C_IC_COMP_TYPE_IC_COMP_TYPE_MSB    31
2682 #define I2C_IC_COMP_TYPE_IC_COMP_TYPE_LSB    0
2683 #define I2C_IC_COMP_TYPE_IC_COMP_TYPE_ACCESS "RO"
2684 // =============================================================================
2685 #endif // HARDWARE_REGS_I2C_DEFINED
2686