rp2040/i2c0/
ic_tx_abrt_source.rs

1#[doc = "Reader of register IC_TX_ABRT_SOURCE"]
2pub type R = crate::R<u32, super::IC_TX_ABRT_SOURCE>;
3#[doc = "Reader of field `TX_FLUSH_CNT`"]
4pub type TX_FLUSH_CNT_R = crate::R<u16, u16>;
5#[doc = "This is a master-mode-only bit. Master has detected the transfer abort (IC_ENABLE\\[1\\])\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq)]
7pub enum ABRT_USER_ABRT_A {
8    #[doc = "0: Transfer abort detected by master- scenario not present"]
9    ABRT_USER_ABRT_VOID = 0,
10    #[doc = "1: Transfer abort detected by master"]
11    ABRT_USER_ABRT_GENERATED = 1,
12}
13impl From<ABRT_USER_ABRT_A> for bool {
14    #[inline(always)]
15    fn from(variant: ABRT_USER_ABRT_A) -> Self {
16        variant as u8 != 0
17    }
18}
19#[doc = "Reader of field `ABRT_USER_ABRT`"]
20pub type ABRT_USER_ABRT_R = crate::R<bool, ABRT_USER_ABRT_A>;
21impl ABRT_USER_ABRT_R {
22    #[doc = r"Get enumerated values variant"]
23    #[inline(always)]
24    pub fn variant(&self) -> ABRT_USER_ABRT_A {
25        match self.bits {
26            false => ABRT_USER_ABRT_A::ABRT_USER_ABRT_VOID,
27            true => ABRT_USER_ABRT_A::ABRT_USER_ABRT_GENERATED,
28        }
29    }
30    #[doc = "Checks if the value of the field is `ABRT_USER_ABRT_VOID`"]
31    #[inline(always)]
32    pub fn is_abrt_user_abrt_void(&self) -> bool {
33        *self == ABRT_USER_ABRT_A::ABRT_USER_ABRT_VOID
34    }
35    #[doc = "Checks if the value of the field is `ABRT_USER_ABRT_GENERATED`"]
36    #[inline(always)]
37    pub fn is_abrt_user_abrt_generated(&self) -> bool {
38        *self == ABRT_USER_ABRT_A::ABRT_USER_ABRT_GENERATED
39    }
40}
41#[doc = "1: When the processor side responds to a slave mode request for data to be transmitted to a remote master and user writes a 1 in CMD (bit 8) of IC_DATA_CMD register.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Slave-Transmitter\n\nValue on reset: 0"]
42#[derive(Clone, Copy, Debug, PartialEq)]
43pub enum ABRT_SLVRD_INTX_A {
44    #[doc = "0: Slave trying to transmit to remote master in read mode- scenario not present"]
45    ABRT_SLVRD_INTX_VOID = 0,
46    #[doc = "1: Slave trying to transmit to remote master in read mode"]
47    ABRT_SLVRD_INTX_GENERATED = 1,
48}
49impl From<ABRT_SLVRD_INTX_A> for bool {
50    #[inline(always)]
51    fn from(variant: ABRT_SLVRD_INTX_A) -> Self {
52        variant as u8 != 0
53    }
54}
55#[doc = "Reader of field `ABRT_SLVRD_INTX`"]
56pub type ABRT_SLVRD_INTX_R = crate::R<bool, ABRT_SLVRD_INTX_A>;
57impl ABRT_SLVRD_INTX_R {
58    #[doc = r"Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> ABRT_SLVRD_INTX_A {
61        match self.bits {
62            false => ABRT_SLVRD_INTX_A::ABRT_SLVRD_INTX_VOID,
63            true => ABRT_SLVRD_INTX_A::ABRT_SLVRD_INTX_GENERATED,
64        }
65    }
66    #[doc = "Checks if the value of the field is `ABRT_SLVRD_INTX_VOID`"]
67    #[inline(always)]
68    pub fn is_abrt_slvrd_intx_void(&self) -> bool {
69        *self == ABRT_SLVRD_INTX_A::ABRT_SLVRD_INTX_VOID
70    }
71    #[doc = "Checks if the value of the field is `ABRT_SLVRD_INTX_GENERATED`"]
72    #[inline(always)]
73    pub fn is_abrt_slvrd_intx_generated(&self) -> bool {
74        *self == ABRT_SLVRD_INTX_A::ABRT_SLVRD_INTX_GENERATED
75    }
76}
77#[doc = "This field indicates that a Slave has lost the bus while transmitting data to a remote master. IC_TX_ABRT_SOURCE\\[12\\]
78is set at the same time. Note: Even though the slave never 'owns' the bus, something could go wrong on the bus. This is a fail safe check. For instance, during a data transmission at the low-to-high transition of SCL, if what is on the data bus is not what is supposed to be transmitted, then DW_apb_i2c no longer own the bus.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Slave-Transmitter\n\nValue on reset: 0"]
79#[derive(Clone, Copy, Debug, PartialEq)]
80pub enum ABRT_SLV_ARBLOST_A {
81    #[doc = "0: Slave lost arbitration to remote master- scenario not present"]
82    ABRT_SLV_ARBLOST_VOID = 0,
83    #[doc = "1: Slave lost arbitration to remote master"]
84    ABRT_SLV_ARBLOST_GENERATED = 1,
85}
86impl From<ABRT_SLV_ARBLOST_A> for bool {
87    #[inline(always)]
88    fn from(variant: ABRT_SLV_ARBLOST_A) -> Self {
89        variant as u8 != 0
90    }
91}
92#[doc = "Reader of field `ABRT_SLV_ARBLOST`"]
93pub type ABRT_SLV_ARBLOST_R = crate::R<bool, ABRT_SLV_ARBLOST_A>;
94impl ABRT_SLV_ARBLOST_R {
95    #[doc = r"Get enumerated values variant"]
96    #[inline(always)]
97    pub fn variant(&self) -> ABRT_SLV_ARBLOST_A {
98        match self.bits {
99            false => ABRT_SLV_ARBLOST_A::ABRT_SLV_ARBLOST_VOID,
100            true => ABRT_SLV_ARBLOST_A::ABRT_SLV_ARBLOST_GENERATED,
101        }
102    }
103    #[doc = "Checks if the value of the field is `ABRT_SLV_ARBLOST_VOID`"]
104    #[inline(always)]
105    pub fn is_abrt_slv_arblost_void(&self) -> bool {
106        *self == ABRT_SLV_ARBLOST_A::ABRT_SLV_ARBLOST_VOID
107    }
108    #[doc = "Checks if the value of the field is `ABRT_SLV_ARBLOST_GENERATED`"]
109    #[inline(always)]
110    pub fn is_abrt_slv_arblost_generated(&self) -> bool {
111        *self == ABRT_SLV_ARBLOST_A::ABRT_SLV_ARBLOST_GENERATED
112    }
113}
114#[doc = "This field specifies that the Slave has received a read command and some data exists in the TX FIFO, so the slave issues a TX_ABRT interrupt to flush old data in TX FIFO.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Slave-Transmitter\n\nValue on reset: 0"]
115#[derive(Clone, Copy, Debug, PartialEq)]
116pub enum ABRT_SLVFLUSH_TXFIFO_A {
117    #[doc = "0: Slave flushes existing data in TX-FIFO upon getting read command- scenario not present"]
118    ABRT_SLVFLUSH_TXFIFO_VOID = 0,
119    #[doc = "1: Slave flushes existing data in TX-FIFO upon getting read command"]
120    ABRT_SLVFLUSH_TXFIFO_GENERATED = 1,
121}
122impl From<ABRT_SLVFLUSH_TXFIFO_A> for bool {
123    #[inline(always)]
124    fn from(variant: ABRT_SLVFLUSH_TXFIFO_A) -> Self {
125        variant as u8 != 0
126    }
127}
128#[doc = "Reader of field `ABRT_SLVFLUSH_TXFIFO`"]
129pub type ABRT_SLVFLUSH_TXFIFO_R = crate::R<bool, ABRT_SLVFLUSH_TXFIFO_A>;
130impl ABRT_SLVFLUSH_TXFIFO_R {
131    #[doc = r"Get enumerated values variant"]
132    #[inline(always)]
133    pub fn variant(&self) -> ABRT_SLVFLUSH_TXFIFO_A {
134        match self.bits {
135            false => ABRT_SLVFLUSH_TXFIFO_A::ABRT_SLVFLUSH_TXFIFO_VOID,
136            true => ABRT_SLVFLUSH_TXFIFO_A::ABRT_SLVFLUSH_TXFIFO_GENERATED,
137        }
138    }
139    #[doc = "Checks if the value of the field is `ABRT_SLVFLUSH_TXFIFO_VOID`"]
140    #[inline(always)]
141    pub fn is_abrt_slvflush_txfifo_void(&self) -> bool {
142        *self == ABRT_SLVFLUSH_TXFIFO_A::ABRT_SLVFLUSH_TXFIFO_VOID
143    }
144    #[doc = "Checks if the value of the field is `ABRT_SLVFLUSH_TXFIFO_GENERATED`"]
145    #[inline(always)]
146    pub fn is_abrt_slvflush_txfifo_generated(&self) -> bool {
147        *self == ABRT_SLVFLUSH_TXFIFO_A::ABRT_SLVFLUSH_TXFIFO_GENERATED
148    }
149}
150#[doc = "This field specifies that the Master has lost arbitration, or if IC_TX_ABRT_SOURCE\\[14\\]
151is also set, then the slave transmitter has lost arbitration.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Slave-Transmitter\n\nValue on reset: 0"]
152#[derive(Clone, Copy, Debug, PartialEq)]
153pub enum ARB_LOST_A {
154    #[doc = "0: Master or Slave-Transmitter lost arbitration- scenario not present"]
155    ABRT_LOST_VOID = 0,
156    #[doc = "1: Master or Slave-Transmitter lost arbitration"]
157    ABRT_LOST_GENERATED = 1,
158}
159impl From<ARB_LOST_A> for bool {
160    #[inline(always)]
161    fn from(variant: ARB_LOST_A) -> Self {
162        variant as u8 != 0
163    }
164}
165#[doc = "Reader of field `ARB_LOST`"]
166pub type ARB_LOST_R = crate::R<bool, ARB_LOST_A>;
167impl ARB_LOST_R {
168    #[doc = r"Get enumerated values variant"]
169    #[inline(always)]
170    pub fn variant(&self) -> ARB_LOST_A {
171        match self.bits {
172            false => ARB_LOST_A::ABRT_LOST_VOID,
173            true => ARB_LOST_A::ABRT_LOST_GENERATED,
174        }
175    }
176    #[doc = "Checks if the value of the field is `ABRT_LOST_VOID`"]
177    #[inline(always)]
178    pub fn is_abrt_lost_void(&self) -> bool {
179        *self == ARB_LOST_A::ABRT_LOST_VOID
180    }
181    #[doc = "Checks if the value of the field is `ABRT_LOST_GENERATED`"]
182    #[inline(always)]
183    pub fn is_abrt_lost_generated(&self) -> bool {
184        *self == ARB_LOST_A::ABRT_LOST_GENERATED
185    }
186}
187#[doc = "This field indicates that the User tries to initiate a Master operation with the Master mode disabled.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Master-Receiver\n\nValue on reset: 0"]
188#[derive(Clone, Copy, Debug, PartialEq)]
189pub enum ABRT_MASTER_DIS_A {
190    #[doc = "0: User initiating master operation when MASTER disabled- scenario not present"]
191    ABRT_MASTER_DIS_VOID = 0,
192    #[doc = "1: User initiating master operation when MASTER disabled"]
193    ABRT_MASTER_DIS_GENERATED = 1,
194}
195impl From<ABRT_MASTER_DIS_A> for bool {
196    #[inline(always)]
197    fn from(variant: ABRT_MASTER_DIS_A) -> Self {
198        variant as u8 != 0
199    }
200}
201#[doc = "Reader of field `ABRT_MASTER_DIS`"]
202pub type ABRT_MASTER_DIS_R = crate::R<bool, ABRT_MASTER_DIS_A>;
203impl ABRT_MASTER_DIS_R {
204    #[doc = r"Get enumerated values variant"]
205    #[inline(always)]
206    pub fn variant(&self) -> ABRT_MASTER_DIS_A {
207        match self.bits {
208            false => ABRT_MASTER_DIS_A::ABRT_MASTER_DIS_VOID,
209            true => ABRT_MASTER_DIS_A::ABRT_MASTER_DIS_GENERATED,
210        }
211    }
212    #[doc = "Checks if the value of the field is `ABRT_MASTER_DIS_VOID`"]
213    #[inline(always)]
214    pub fn is_abrt_master_dis_void(&self) -> bool {
215        *self == ABRT_MASTER_DIS_A::ABRT_MASTER_DIS_VOID
216    }
217    #[doc = "Checks if the value of the field is `ABRT_MASTER_DIS_GENERATED`"]
218    #[inline(always)]
219    pub fn is_abrt_master_dis_generated(&self) -> bool {
220        *self == ABRT_MASTER_DIS_A::ABRT_MASTER_DIS_GENERATED
221    }
222}
223#[doc = "This field indicates that the restart is disabled (IC_RESTART_EN bit (IC_CON\\[5\\]) =0) and the master sends a read command in 10-bit addressing mode.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Receiver\n\nValue on reset: 0"]
224#[derive(Clone, Copy, Debug, PartialEq)]
225pub enum ABRT_10B_RD_NORSTRT_A {
226    #[doc = "0: Master not trying to read in 10Bit addressing mode when RESTART disabled"]
227    ABRT_10B_RD_VOID = 0,
228    #[doc = "1: Master trying to read in 10Bit addressing mode when RESTART disabled"]
229    ABRT_10B_RD_GENERATED = 1,
230}
231impl From<ABRT_10B_RD_NORSTRT_A> for bool {
232    #[inline(always)]
233    fn from(variant: ABRT_10B_RD_NORSTRT_A) -> Self {
234        variant as u8 != 0
235    }
236}
237#[doc = "Reader of field `ABRT_10B_RD_NORSTRT`"]
238pub type ABRT_10B_RD_NORSTRT_R = crate::R<bool, ABRT_10B_RD_NORSTRT_A>;
239impl ABRT_10B_RD_NORSTRT_R {
240    #[doc = r"Get enumerated values variant"]
241    #[inline(always)]
242    pub fn variant(&self) -> ABRT_10B_RD_NORSTRT_A {
243        match self.bits {
244            false => ABRT_10B_RD_NORSTRT_A::ABRT_10B_RD_VOID,
245            true => ABRT_10B_RD_NORSTRT_A::ABRT_10B_RD_GENERATED,
246        }
247    }
248    #[doc = "Checks if the value of the field is `ABRT_10B_RD_VOID`"]
249    #[inline(always)]
250    pub fn is_abrt_10b_rd_void(&self) -> bool {
251        *self == ABRT_10B_RD_NORSTRT_A::ABRT_10B_RD_VOID
252    }
253    #[doc = "Checks if the value of the field is `ABRT_10B_RD_GENERATED`"]
254    #[inline(always)]
255    pub fn is_abrt_10b_rd_generated(&self) -> bool {
256        *self == ABRT_10B_RD_NORSTRT_A::ABRT_10B_RD_GENERATED
257    }
258}
259#[doc = "To clear Bit 9, the source of the ABRT_SBYTE_NORSTRT must be fixed first; restart must be enabled (IC_CON\\[5\\]=1), the SPECIAL bit must be cleared (IC_TAR\\[11\\]), or the GC_OR_START bit must be cleared (IC_TAR\\[10\\]). Once the source of the ABRT_SBYTE_NORSTRT is fixed, then this bit can be cleared in the same manner as other bits in this register. If the source of the ABRT_SBYTE_NORSTRT is not fixed before attempting to clear this bit, bit 9 clears for one cycle and then gets reasserted. When this field is set to 1, the restart is disabled (IC_RESTART_EN bit (IC_CON\\[5\\]) =0) and the user is trying to send a START Byte.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master\n\nValue on reset: 0"]
260#[derive(Clone, Copy, Debug, PartialEq)]
261pub enum ABRT_SBYTE_NORSTRT_A {
262    #[doc = "0: User trying to send START byte when RESTART disabled- scenario not present"]
263    ABRT_SBYTE_NORSTRT_VOID = 0,
264    #[doc = "1: User trying to send START byte when RESTART disabled"]
265    ABRT_SBYTE_NORSTRT_GENERATED = 1,
266}
267impl From<ABRT_SBYTE_NORSTRT_A> for bool {
268    #[inline(always)]
269    fn from(variant: ABRT_SBYTE_NORSTRT_A) -> Self {
270        variant as u8 != 0
271    }
272}
273#[doc = "Reader of field `ABRT_SBYTE_NORSTRT`"]
274pub type ABRT_SBYTE_NORSTRT_R = crate::R<bool, ABRT_SBYTE_NORSTRT_A>;
275impl ABRT_SBYTE_NORSTRT_R {
276    #[doc = r"Get enumerated values variant"]
277    #[inline(always)]
278    pub fn variant(&self) -> ABRT_SBYTE_NORSTRT_A {
279        match self.bits {
280            false => ABRT_SBYTE_NORSTRT_A::ABRT_SBYTE_NORSTRT_VOID,
281            true => ABRT_SBYTE_NORSTRT_A::ABRT_SBYTE_NORSTRT_GENERATED,
282        }
283    }
284    #[doc = "Checks if the value of the field is `ABRT_SBYTE_NORSTRT_VOID`"]
285    #[inline(always)]
286    pub fn is_abrt_sbyte_norstrt_void(&self) -> bool {
287        *self == ABRT_SBYTE_NORSTRT_A::ABRT_SBYTE_NORSTRT_VOID
288    }
289    #[doc = "Checks if the value of the field is `ABRT_SBYTE_NORSTRT_GENERATED`"]
290    #[inline(always)]
291    pub fn is_abrt_sbyte_norstrt_generated(&self) -> bool {
292        *self == ABRT_SBYTE_NORSTRT_A::ABRT_SBYTE_NORSTRT_GENERATED
293    }
294}
295#[doc = "This field indicates that the restart is disabled (IC_RESTART_EN bit (IC_CON\\[5\\]) =0) and the user is trying to use the master to transfer data in High Speed mode.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Master-Receiver\n\nValue on reset: 0"]
296#[derive(Clone, Copy, Debug, PartialEq)]
297pub enum ABRT_HS_NORSTRT_A {
298    #[doc = "0: User trying to switch Master to HS mode when RESTART disabled- scenario not present"]
299    ABRT_HS_NORSTRT_VOID = 0,
300    #[doc = "1: User trying to switch Master to HS mode when RESTART disabled"]
301    ABRT_HS_NORSTRT_GENERATED = 1,
302}
303impl From<ABRT_HS_NORSTRT_A> for bool {
304    #[inline(always)]
305    fn from(variant: ABRT_HS_NORSTRT_A) -> Self {
306        variant as u8 != 0
307    }
308}
309#[doc = "Reader of field `ABRT_HS_NORSTRT`"]
310pub type ABRT_HS_NORSTRT_R = crate::R<bool, ABRT_HS_NORSTRT_A>;
311impl ABRT_HS_NORSTRT_R {
312    #[doc = r"Get enumerated values variant"]
313    #[inline(always)]
314    pub fn variant(&self) -> ABRT_HS_NORSTRT_A {
315        match self.bits {
316            false => ABRT_HS_NORSTRT_A::ABRT_HS_NORSTRT_VOID,
317            true => ABRT_HS_NORSTRT_A::ABRT_HS_NORSTRT_GENERATED,
318        }
319    }
320    #[doc = "Checks if the value of the field is `ABRT_HS_NORSTRT_VOID`"]
321    #[inline(always)]
322    pub fn is_abrt_hs_norstrt_void(&self) -> bool {
323        *self == ABRT_HS_NORSTRT_A::ABRT_HS_NORSTRT_VOID
324    }
325    #[doc = "Checks if the value of the field is `ABRT_HS_NORSTRT_GENERATED`"]
326    #[inline(always)]
327    pub fn is_abrt_hs_norstrt_generated(&self) -> bool {
328        *self == ABRT_HS_NORSTRT_A::ABRT_HS_NORSTRT_GENERATED
329    }
330}
331#[doc = "This field indicates that the Master has sent a START Byte and the START Byte was acknowledged (wrong behavior).\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master\n\nValue on reset: 0"]
332#[derive(Clone, Copy, Debug, PartialEq)]
333pub enum ABRT_SBYTE_ACKDET_A {
334    #[doc = "0: ACK detected for START byte- scenario not present"]
335    ABRT_SBYTE_ACKDET_VOID = 0,
336    #[doc = "1: ACK detected for START byte"]
337    ABRT_SBYTE_ACKDET_GENERATED = 1,
338}
339impl From<ABRT_SBYTE_ACKDET_A> for bool {
340    #[inline(always)]
341    fn from(variant: ABRT_SBYTE_ACKDET_A) -> Self {
342        variant as u8 != 0
343    }
344}
345#[doc = "Reader of field `ABRT_SBYTE_ACKDET`"]
346pub type ABRT_SBYTE_ACKDET_R = crate::R<bool, ABRT_SBYTE_ACKDET_A>;
347impl ABRT_SBYTE_ACKDET_R {
348    #[doc = r"Get enumerated values variant"]
349    #[inline(always)]
350    pub fn variant(&self) -> ABRT_SBYTE_ACKDET_A {
351        match self.bits {
352            false => ABRT_SBYTE_ACKDET_A::ABRT_SBYTE_ACKDET_VOID,
353            true => ABRT_SBYTE_ACKDET_A::ABRT_SBYTE_ACKDET_GENERATED,
354        }
355    }
356    #[doc = "Checks if the value of the field is `ABRT_SBYTE_ACKDET_VOID`"]
357    #[inline(always)]
358    pub fn is_abrt_sbyte_ackdet_void(&self) -> bool {
359        *self == ABRT_SBYTE_ACKDET_A::ABRT_SBYTE_ACKDET_VOID
360    }
361    #[doc = "Checks if the value of the field is `ABRT_SBYTE_ACKDET_GENERATED`"]
362    #[inline(always)]
363    pub fn is_abrt_sbyte_ackdet_generated(&self) -> bool {
364        *self == ABRT_SBYTE_ACKDET_A::ABRT_SBYTE_ACKDET_GENERATED
365    }
366}
367#[doc = "This field indicates that the Master is in High Speed mode and the High Speed Master code was acknowledged (wrong behavior).\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master\n\nValue on reset: 0"]
368#[derive(Clone, Copy, Debug, PartialEq)]
369pub enum ABRT_HS_ACKDET_A {
370    #[doc = "0: HS Master code ACKed in HS Mode- scenario not present"]
371    ABRT_HS_ACK_VOID = 0,
372    #[doc = "1: HS Master code ACKed in HS Mode"]
373    ABRT_HS_ACK_GENERATED = 1,
374}
375impl From<ABRT_HS_ACKDET_A> for bool {
376    #[inline(always)]
377    fn from(variant: ABRT_HS_ACKDET_A) -> Self {
378        variant as u8 != 0
379    }
380}
381#[doc = "Reader of field `ABRT_HS_ACKDET`"]
382pub type ABRT_HS_ACKDET_R = crate::R<bool, ABRT_HS_ACKDET_A>;
383impl ABRT_HS_ACKDET_R {
384    #[doc = r"Get enumerated values variant"]
385    #[inline(always)]
386    pub fn variant(&self) -> ABRT_HS_ACKDET_A {
387        match self.bits {
388            false => ABRT_HS_ACKDET_A::ABRT_HS_ACK_VOID,
389            true => ABRT_HS_ACKDET_A::ABRT_HS_ACK_GENERATED,
390        }
391    }
392    #[doc = "Checks if the value of the field is `ABRT_HS_ACK_VOID`"]
393    #[inline(always)]
394    pub fn is_abrt_hs_ack_void(&self) -> bool {
395        *self == ABRT_HS_ACKDET_A::ABRT_HS_ACK_VOID
396    }
397    #[doc = "Checks if the value of the field is `ABRT_HS_ACK_GENERATED`"]
398    #[inline(always)]
399    pub fn is_abrt_hs_ack_generated(&self) -> bool {
400        *self == ABRT_HS_ACKDET_A::ABRT_HS_ACK_GENERATED
401    }
402}
403#[doc = "This field indicates that DW_apb_i2c in the master mode has sent a General Call but the user programmed the byte following the General Call to be a read from the bus (IC_DATA_CMD\\[9\\]
404is set to 1).\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter\n\nValue on reset: 0"]
405#[derive(Clone, Copy, Debug, PartialEq)]
406pub enum ABRT_GCALL_READ_A {
407    #[doc = "0: GCALL is followed by read from bus-scenario not present"]
408    ABRT_GCALL_READ_VOID = 0,
409    #[doc = "1: GCALL is followed by read from bus"]
410    ABRT_GCALL_READ_GENERATED = 1,
411}
412impl From<ABRT_GCALL_READ_A> for bool {
413    #[inline(always)]
414    fn from(variant: ABRT_GCALL_READ_A) -> Self {
415        variant as u8 != 0
416    }
417}
418#[doc = "Reader of field `ABRT_GCALL_READ`"]
419pub type ABRT_GCALL_READ_R = crate::R<bool, ABRT_GCALL_READ_A>;
420impl ABRT_GCALL_READ_R {
421    #[doc = r"Get enumerated values variant"]
422    #[inline(always)]
423    pub fn variant(&self) -> ABRT_GCALL_READ_A {
424        match self.bits {
425            false => ABRT_GCALL_READ_A::ABRT_GCALL_READ_VOID,
426            true => ABRT_GCALL_READ_A::ABRT_GCALL_READ_GENERATED,
427        }
428    }
429    #[doc = "Checks if the value of the field is `ABRT_GCALL_READ_VOID`"]
430    #[inline(always)]
431    pub fn is_abrt_gcall_read_void(&self) -> bool {
432        *self == ABRT_GCALL_READ_A::ABRT_GCALL_READ_VOID
433    }
434    #[doc = "Checks if the value of the field is `ABRT_GCALL_READ_GENERATED`"]
435    #[inline(always)]
436    pub fn is_abrt_gcall_read_generated(&self) -> bool {
437        *self == ABRT_GCALL_READ_A::ABRT_GCALL_READ_GENERATED
438    }
439}
440#[doc = "This field indicates that DW_apb_i2c in master mode has sent a General Call and no slave on the bus acknowledged the General Call.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter\n\nValue on reset: 0"]
441#[derive(Clone, Copy, Debug, PartialEq)]
442pub enum ABRT_GCALL_NOACK_A {
443    #[doc = "0: GCALL not ACKed by any slave-scenario not present"]
444    ABRT_GCALL_NOACK_VOID = 0,
445    #[doc = "1: GCALL not ACKed by any slave"]
446    ABRT_GCALL_NOACK_GENERATED = 1,
447}
448impl From<ABRT_GCALL_NOACK_A> for bool {
449    #[inline(always)]
450    fn from(variant: ABRT_GCALL_NOACK_A) -> Self {
451        variant as u8 != 0
452    }
453}
454#[doc = "Reader of field `ABRT_GCALL_NOACK`"]
455pub type ABRT_GCALL_NOACK_R = crate::R<bool, ABRT_GCALL_NOACK_A>;
456impl ABRT_GCALL_NOACK_R {
457    #[doc = r"Get enumerated values variant"]
458    #[inline(always)]
459    pub fn variant(&self) -> ABRT_GCALL_NOACK_A {
460        match self.bits {
461            false => ABRT_GCALL_NOACK_A::ABRT_GCALL_NOACK_VOID,
462            true => ABRT_GCALL_NOACK_A::ABRT_GCALL_NOACK_GENERATED,
463        }
464    }
465    #[doc = "Checks if the value of the field is `ABRT_GCALL_NOACK_VOID`"]
466    #[inline(always)]
467    pub fn is_abrt_gcall_noack_void(&self) -> bool {
468        *self == ABRT_GCALL_NOACK_A::ABRT_GCALL_NOACK_VOID
469    }
470    #[doc = "Checks if the value of the field is `ABRT_GCALL_NOACK_GENERATED`"]
471    #[inline(always)]
472    pub fn is_abrt_gcall_noack_generated(&self) -> bool {
473        *self == ABRT_GCALL_NOACK_A::ABRT_GCALL_NOACK_GENERATED
474    }
475}
476#[doc = "This field indicates the master-mode only bit. When the master receives an acknowledgement for the address, but when it sends data byte(s) following the address, it did not receive an acknowledge from the remote slave(s).\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter\n\nValue on reset: 0"]
477#[derive(Clone, Copy, Debug, PartialEq)]
478pub enum ABRT_TXDATA_NOACK_A {
479    #[doc = "0: Transmitted data non-ACKed by addressed slave-scenario not present"]
480    ABRT_TXDATA_NOACK_VOID = 0,
481    #[doc = "1: Transmitted data not ACKed by addressed slave"]
482    ABRT_TXDATA_NOACK_GENERATED = 1,
483}
484impl From<ABRT_TXDATA_NOACK_A> for bool {
485    #[inline(always)]
486    fn from(variant: ABRT_TXDATA_NOACK_A) -> Self {
487        variant as u8 != 0
488    }
489}
490#[doc = "Reader of field `ABRT_TXDATA_NOACK`"]
491pub type ABRT_TXDATA_NOACK_R = crate::R<bool, ABRT_TXDATA_NOACK_A>;
492impl ABRT_TXDATA_NOACK_R {
493    #[doc = r"Get enumerated values variant"]
494    #[inline(always)]
495    pub fn variant(&self) -> ABRT_TXDATA_NOACK_A {
496        match self.bits {
497            false => ABRT_TXDATA_NOACK_A::ABRT_TXDATA_NOACK_VOID,
498            true => ABRT_TXDATA_NOACK_A::ABRT_TXDATA_NOACK_GENERATED,
499        }
500    }
501    #[doc = "Checks if the value of the field is `ABRT_TXDATA_NOACK_VOID`"]
502    #[inline(always)]
503    pub fn is_abrt_txdata_noack_void(&self) -> bool {
504        *self == ABRT_TXDATA_NOACK_A::ABRT_TXDATA_NOACK_VOID
505    }
506    #[doc = "Checks if the value of the field is `ABRT_TXDATA_NOACK_GENERATED`"]
507    #[inline(always)]
508    pub fn is_abrt_txdata_noack_generated(&self) -> bool {
509        *self == ABRT_TXDATA_NOACK_A::ABRT_TXDATA_NOACK_GENERATED
510    }
511}
512#[doc = "This field indicates that the Master is in 10-bit address mode and that the second address byte of the 10-bit address was not acknowledged by any slave.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Master-Receiver\n\nValue on reset: 0"]
513#[derive(Clone, Copy, Debug, PartialEq)]
514pub enum ABRT_10ADDR2_NOACK_A {
515    #[doc = "0: This abort is not generated"]
516    INACTIVE = 0,
517    #[doc = "1: Byte 2 of 10Bit Address not ACKed by any slave"]
518    ACTIVE = 1,
519}
520impl From<ABRT_10ADDR2_NOACK_A> for bool {
521    #[inline(always)]
522    fn from(variant: ABRT_10ADDR2_NOACK_A) -> Self {
523        variant as u8 != 0
524    }
525}
526#[doc = "Reader of field `ABRT_10ADDR2_NOACK`"]
527pub type ABRT_10ADDR2_NOACK_R = crate::R<bool, ABRT_10ADDR2_NOACK_A>;
528impl ABRT_10ADDR2_NOACK_R {
529    #[doc = r"Get enumerated values variant"]
530    #[inline(always)]
531    pub fn variant(&self) -> ABRT_10ADDR2_NOACK_A {
532        match self.bits {
533            false => ABRT_10ADDR2_NOACK_A::INACTIVE,
534            true => ABRT_10ADDR2_NOACK_A::ACTIVE,
535        }
536    }
537    #[doc = "Checks if the value of the field is `INACTIVE`"]
538    #[inline(always)]
539    pub fn is_inactive(&self) -> bool {
540        *self == ABRT_10ADDR2_NOACK_A::INACTIVE
541    }
542    #[doc = "Checks if the value of the field is `ACTIVE`"]
543    #[inline(always)]
544    pub fn is_active(&self) -> bool {
545        *self == ABRT_10ADDR2_NOACK_A::ACTIVE
546    }
547}
548#[doc = "This field indicates that the Master is in 10-bit address mode and the first 10-bit address byte was not acknowledged by any slave.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Master-Receiver\n\nValue on reset: 0"]
549#[derive(Clone, Copy, Debug, PartialEq)]
550pub enum ABRT_10ADDR1_NOACK_A {
551    #[doc = "0: This abort is not generated"]
552    INACTIVE = 0,
553    #[doc = "1: Byte 1 of 10Bit Address not ACKed by any slave"]
554    ACTIVE = 1,
555}
556impl From<ABRT_10ADDR1_NOACK_A> for bool {
557    #[inline(always)]
558    fn from(variant: ABRT_10ADDR1_NOACK_A) -> Self {
559        variant as u8 != 0
560    }
561}
562#[doc = "Reader of field `ABRT_10ADDR1_NOACK`"]
563pub type ABRT_10ADDR1_NOACK_R = crate::R<bool, ABRT_10ADDR1_NOACK_A>;
564impl ABRT_10ADDR1_NOACK_R {
565    #[doc = r"Get enumerated values variant"]
566    #[inline(always)]
567    pub fn variant(&self) -> ABRT_10ADDR1_NOACK_A {
568        match self.bits {
569            false => ABRT_10ADDR1_NOACK_A::INACTIVE,
570            true => ABRT_10ADDR1_NOACK_A::ACTIVE,
571        }
572    }
573    #[doc = "Checks if the value of the field is `INACTIVE`"]
574    #[inline(always)]
575    pub fn is_inactive(&self) -> bool {
576        *self == ABRT_10ADDR1_NOACK_A::INACTIVE
577    }
578    #[doc = "Checks if the value of the field is `ACTIVE`"]
579    #[inline(always)]
580    pub fn is_active(&self) -> bool {
581        *self == ABRT_10ADDR1_NOACK_A::ACTIVE
582    }
583}
584#[doc = "This field indicates that the Master is in 7-bit addressing mode and the address sent was not acknowledged by any slave.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Master-Receiver\n\nValue on reset: 0"]
585#[derive(Clone, Copy, Debug, PartialEq)]
586pub enum ABRT_7B_ADDR_NOACK_A {
587    #[doc = "0: This abort is not generated"]
588    INACTIVE = 0,
589    #[doc = "1: This abort is generated because of NOACK for 7-bit address"]
590    ACTIVE = 1,
591}
592impl From<ABRT_7B_ADDR_NOACK_A> for bool {
593    #[inline(always)]
594    fn from(variant: ABRT_7B_ADDR_NOACK_A) -> Self {
595        variant as u8 != 0
596    }
597}
598#[doc = "Reader of field `ABRT_7B_ADDR_NOACK`"]
599pub type ABRT_7B_ADDR_NOACK_R = crate::R<bool, ABRT_7B_ADDR_NOACK_A>;
600impl ABRT_7B_ADDR_NOACK_R {
601    #[doc = r"Get enumerated values variant"]
602    #[inline(always)]
603    pub fn variant(&self) -> ABRT_7B_ADDR_NOACK_A {
604        match self.bits {
605            false => ABRT_7B_ADDR_NOACK_A::INACTIVE,
606            true => ABRT_7B_ADDR_NOACK_A::ACTIVE,
607        }
608    }
609    #[doc = "Checks if the value of the field is `INACTIVE`"]
610    #[inline(always)]
611    pub fn is_inactive(&self) -> bool {
612        *self == ABRT_7B_ADDR_NOACK_A::INACTIVE
613    }
614    #[doc = "Checks if the value of the field is `ACTIVE`"]
615    #[inline(always)]
616    pub fn is_active(&self) -> bool {
617        *self == ABRT_7B_ADDR_NOACK_A::ACTIVE
618    }
619}
620impl R {
621    #[doc = "Bits 23:31 - This field indicates the number of Tx FIFO Data Commands which are flushed due to TX_ABRT interrupt. It is cleared whenever I2C is disabled.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Slave-Transmitter"]
622    #[inline(always)]
623    pub fn tx_flush_cnt(&self) -> TX_FLUSH_CNT_R {
624        TX_FLUSH_CNT_R::new(((self.bits >> 23) & 0x01ff) as u16)
625    }
626    #[doc = "Bit 16 - This is a master-mode-only bit. Master has detected the transfer abort (IC_ENABLE\\[1\\])\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter"]
627    #[inline(always)]
628    pub fn abrt_user_abrt(&self) -> ABRT_USER_ABRT_R {
629        ABRT_USER_ABRT_R::new(((self.bits >> 16) & 0x01) != 0)
630    }
631    #[doc = "Bit 15 - 1: When the processor side responds to a slave mode request for data to be transmitted to a remote master and user writes a 1 in CMD (bit 8) of IC_DATA_CMD register.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Slave-Transmitter"]
632    #[inline(always)]
633    pub fn abrt_slvrd_intx(&self) -> ABRT_SLVRD_INTX_R {
634        ABRT_SLVRD_INTX_R::new(((self.bits >> 15) & 0x01) != 0)
635    }
636    #[doc = "Bit 14 - This field indicates that a Slave has lost the bus while transmitting data to a remote master. IC_TX_ABRT_SOURCE\\[12\\]
637is set at the same time. Note: Even though the slave never 'owns' the bus, something could go wrong on the bus. This is a fail safe check. For instance, during a data transmission at the low-to-high transition of SCL, if what is on the data bus is not what is supposed to be transmitted, then DW_apb_i2c no longer own the bus.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Slave-Transmitter"]
638    #[inline(always)]
639    pub fn abrt_slv_arblost(&self) -> ABRT_SLV_ARBLOST_R {
640        ABRT_SLV_ARBLOST_R::new(((self.bits >> 14) & 0x01) != 0)
641    }
642    #[doc = "Bit 13 - This field specifies that the Slave has received a read command and some data exists in the TX FIFO, so the slave issues a TX_ABRT interrupt to flush old data in TX FIFO.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Slave-Transmitter"]
643    #[inline(always)]
644    pub fn abrt_slvflush_txfifo(&self) -> ABRT_SLVFLUSH_TXFIFO_R {
645        ABRT_SLVFLUSH_TXFIFO_R::new(((self.bits >> 13) & 0x01) != 0)
646    }
647    #[doc = "Bit 12 - This field specifies that the Master has lost arbitration, or if IC_TX_ABRT_SOURCE\\[14\\]
648is also set, then the slave transmitter has lost arbitration.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Slave-Transmitter"]
649    #[inline(always)]
650    pub fn arb_lost(&self) -> ARB_LOST_R {
651        ARB_LOST_R::new(((self.bits >> 12) & 0x01) != 0)
652    }
653    #[doc = "Bit 11 - This field indicates that the User tries to initiate a Master operation with the Master mode disabled.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Master-Receiver"]
654    #[inline(always)]
655    pub fn abrt_master_dis(&self) -> ABRT_MASTER_DIS_R {
656        ABRT_MASTER_DIS_R::new(((self.bits >> 11) & 0x01) != 0)
657    }
658    #[doc = "Bit 10 - This field indicates that the restart is disabled (IC_RESTART_EN bit (IC_CON\\[5\\]) =0) and the master sends a read command in 10-bit addressing mode.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Receiver"]
659    #[inline(always)]
660    pub fn abrt_10b_rd_norstrt(&self) -> ABRT_10B_RD_NORSTRT_R {
661        ABRT_10B_RD_NORSTRT_R::new(((self.bits >> 10) & 0x01) != 0)
662    }
663    #[doc = "Bit 9 - To clear Bit 9, the source of the ABRT_SBYTE_NORSTRT must be fixed first; restart must be enabled (IC_CON\\[5\\]=1), the SPECIAL bit must be cleared (IC_TAR\\[11\\]), or the GC_OR_START bit must be cleared (IC_TAR\\[10\\]). Once the source of the ABRT_SBYTE_NORSTRT is fixed, then this bit can be cleared in the same manner as other bits in this register. If the source of the ABRT_SBYTE_NORSTRT is not fixed before attempting to clear this bit, bit 9 clears for one cycle and then gets reasserted. When this field is set to 1, the restart is disabled (IC_RESTART_EN bit (IC_CON\\[5\\]) =0) and the user is trying to send a START Byte.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master"]
664    #[inline(always)]
665    pub fn abrt_sbyte_norstrt(&self) -> ABRT_SBYTE_NORSTRT_R {
666        ABRT_SBYTE_NORSTRT_R::new(((self.bits >> 9) & 0x01) != 0)
667    }
668    #[doc = "Bit 8 - This field indicates that the restart is disabled (IC_RESTART_EN bit (IC_CON\\[5\\]) =0) and the user is trying to use the master to transfer data in High Speed mode.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Master-Receiver"]
669    #[inline(always)]
670    pub fn abrt_hs_norstrt(&self) -> ABRT_HS_NORSTRT_R {
671        ABRT_HS_NORSTRT_R::new(((self.bits >> 8) & 0x01) != 0)
672    }
673    #[doc = "Bit 7 - This field indicates that the Master has sent a START Byte and the START Byte was acknowledged (wrong behavior).\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master"]
674    #[inline(always)]
675    pub fn abrt_sbyte_ackdet(&self) -> ABRT_SBYTE_ACKDET_R {
676        ABRT_SBYTE_ACKDET_R::new(((self.bits >> 7) & 0x01) != 0)
677    }
678    #[doc = "Bit 6 - This field indicates that the Master is in High Speed mode and the High Speed Master code was acknowledged (wrong behavior).\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master"]
679    #[inline(always)]
680    pub fn abrt_hs_ackdet(&self) -> ABRT_HS_ACKDET_R {
681        ABRT_HS_ACKDET_R::new(((self.bits >> 6) & 0x01) != 0)
682    }
683    #[doc = "Bit 5 - This field indicates that DW_apb_i2c in the master mode has sent a General Call but the user programmed the byte following the General Call to be a read from the bus (IC_DATA_CMD\\[9\\]
684is set to 1).\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter"]
685    #[inline(always)]
686    pub fn abrt_gcall_read(&self) -> ABRT_GCALL_READ_R {
687        ABRT_GCALL_READ_R::new(((self.bits >> 5) & 0x01) != 0)
688    }
689    #[doc = "Bit 4 - This field indicates that DW_apb_i2c in master mode has sent a General Call and no slave on the bus acknowledged the General Call.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter"]
690    #[inline(always)]
691    pub fn abrt_gcall_noack(&self) -> ABRT_GCALL_NOACK_R {
692        ABRT_GCALL_NOACK_R::new(((self.bits >> 4) & 0x01) != 0)
693    }
694    #[doc = "Bit 3 - This field indicates the master-mode only bit. When the master receives an acknowledgement for the address, but when it sends data byte(s) following the address, it did not receive an acknowledge from the remote slave(s).\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter"]
695    #[inline(always)]
696    pub fn abrt_txdata_noack(&self) -> ABRT_TXDATA_NOACK_R {
697        ABRT_TXDATA_NOACK_R::new(((self.bits >> 3) & 0x01) != 0)
698    }
699    #[doc = "Bit 2 - This field indicates that the Master is in 10-bit address mode and that the second address byte of the 10-bit address was not acknowledged by any slave.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Master-Receiver"]
700    #[inline(always)]
701    pub fn abrt_10addr2_noack(&self) -> ABRT_10ADDR2_NOACK_R {
702        ABRT_10ADDR2_NOACK_R::new(((self.bits >> 2) & 0x01) != 0)
703    }
704    #[doc = "Bit 1 - This field indicates that the Master is in 10-bit address mode and the first 10-bit address byte was not acknowledged by any slave.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Master-Receiver"]
705    #[inline(always)]
706    pub fn abrt_10addr1_noack(&self) -> ABRT_10ADDR1_NOACK_R {
707        ABRT_10ADDR1_NOACK_R::new(((self.bits >> 1) & 0x01) != 0)
708    }
709    #[doc = "Bit 0 - This field indicates that the Master is in 7-bit addressing mode and the address sent was not acknowledged by any slave.\\n\\n Reset value: 0x0\\n\\n Role of DW_apb_i2c: Master-Transmitter or Master-Receiver"]
710    #[inline(always)]
711    pub fn abrt_7b_addr_noack(&self) -> ABRT_7B_ADDR_NOACK_R {
712        ABRT_7B_ADDR_NOACK_R::new((self.bits & 0x01) != 0)
713    }
714}