rp2040 0.1.0

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