tm4c129x 0.9.2

Peripheral access API for TI TM4C129x microcontrollers
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
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
#[doc = "Reader of register DMARIS"]
pub type R = crate::R<u32, super::DMARIS>;
#[doc = "Writer for register DMARIS"]
pub type W = crate::W<u32, super::DMARIS>;
#[doc = "Register DMARIS `reset()`'s with value 0"]
impl crate::ResetValue for super::DMARIS {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Reader of field `TI`"]
pub type TI_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TI`"]
pub struct TI_W<'a> {
    w: &'a mut W,
}
impl<'a> TI_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
        self.w
    }
}
#[doc = "Reader of field `TPS`"]
pub type TPS_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TPS`"]
pub struct TPS_W<'a> {
    w: &'a mut W,
}
impl<'a> TPS_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
        self.w
    }
}
#[doc = "Reader of field `TU`"]
pub type TU_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TU`"]
pub struct TU_W<'a> {
    w: &'a mut W,
}
impl<'a> TU_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
        self.w
    }
}
#[doc = "Reader of field `TJT`"]
pub type TJT_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TJT`"]
pub struct TJT_W<'a> {
    w: &'a mut W,
}
impl<'a> TJT_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
        self.w
    }
}
#[doc = "Reader of field `OVF`"]
pub type OVF_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `OVF`"]
pub struct OVF_W<'a> {
    w: &'a mut W,
}
impl<'a> OVF_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
        self.w
    }
}
#[doc = "Reader of field `UNF`"]
pub type UNF_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `UNF`"]
pub struct UNF_W<'a> {
    w: &'a mut W,
}
impl<'a> UNF_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
        self.w
    }
}
#[doc = "Reader of field `RI`"]
pub type RI_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RI`"]
pub struct RI_W<'a> {
    w: &'a mut W,
}
impl<'a> RI_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
        self.w
    }
}
#[doc = "Reader of field `RU`"]
pub type RU_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RU`"]
pub struct RU_W<'a> {
    w: &'a mut W,
}
impl<'a> RU_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
        self.w
    }
}
#[doc = "Reader of field `RPS`"]
pub type RPS_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RPS`"]
pub struct RPS_W<'a> {
    w: &'a mut W,
}
impl<'a> RPS_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
        self.w
    }
}
#[doc = "Reader of field `RWT`"]
pub type RWT_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RWT`"]
pub struct RWT_W<'a> {
    w: &'a mut W,
}
impl<'a> RWT_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
        self.w
    }
}
#[doc = "Reader of field `ETI`"]
pub type ETI_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ETI`"]
pub struct ETI_W<'a> {
    w: &'a mut W,
}
impl<'a> ETI_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
        self.w
    }
}
#[doc = "Reader of field `FBI`"]
pub type FBI_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FBI`"]
pub struct FBI_W<'a> {
    w: &'a mut W,
}
impl<'a> FBI_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13);
        self.w
    }
}
#[doc = "Reader of field `ERI`"]
pub type ERI_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ERI`"]
pub struct ERI_W<'a> {
    w: &'a mut W,
}
impl<'a> ERI_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14);
        self.w
    }
}
#[doc = "Reader of field `AIS`"]
pub type AIS_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `AIS`"]
pub struct AIS_W<'a> {
    w: &'a mut W,
}
impl<'a> AIS_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
        self.w
    }
}
#[doc = "Reader of field `NIS`"]
pub type NIS_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `NIS`"]
pub struct NIS_W<'a> {
    w: &'a mut W,
}
impl<'a> NIS_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
        self.w
    }
}
#[doc = "Received Process State\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum RS_A {
    #[doc = "0: Stopped: Reset or stop receive command issued"]
    STOP = 0,
    #[doc = "1: Running: Fetching receive transfer descriptor"]
    RUNRXTD = 1,
    #[doc = "3: Running: Waiting for receive packet"]
    RUNRXD = 3,
    #[doc = "4: Suspended: Receive descriptor unavailable"]
    SUSPEND = 4,
    #[doc = "5: Running: Closing receive descriptor"]
    RUNCRD = 5,
    #[doc = "6: Writing Timestamp"]
    TSWS = 6,
    #[doc = "7: Running: Transferring the receive packet data from receive buffer to host memory"]
    RUNTXD = 7,
}
impl From<RS_A> for u8 {
    #[inline(always)]
    fn from(variant: RS_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `RS`"]
pub type RS_R = crate::R<u8, RS_A>;
impl RS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, RS_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(RS_A::STOP),
            1 => Val(RS_A::RUNRXTD),
            3 => Val(RS_A::RUNRXD),
            4 => Val(RS_A::SUSPEND),
            5 => Val(RS_A::RUNCRD),
            6 => Val(RS_A::TSWS),
            7 => Val(RS_A::RUNTXD),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `STOP`"]
    #[inline(always)]
    pub fn is_stop(&self) -> bool {
        *self == RS_A::STOP
    }
    #[doc = "Checks if the value of the field is `RUNRXTD`"]
    #[inline(always)]
    pub fn is_runrxtd(&self) -> bool {
        *self == RS_A::RUNRXTD
    }
    #[doc = "Checks if the value of the field is `RUNRXD`"]
    #[inline(always)]
    pub fn is_runrxd(&self) -> bool {
        *self == RS_A::RUNRXD
    }
    #[doc = "Checks if the value of the field is `SUSPEND`"]
    #[inline(always)]
    pub fn is_suspend(&self) -> bool {
        *self == RS_A::SUSPEND
    }
    #[doc = "Checks if the value of the field is `RUNCRD`"]
    #[inline(always)]
    pub fn is_runcrd(&self) -> bool {
        *self == RS_A::RUNCRD
    }
    #[doc = "Checks if the value of the field is `TSWS`"]
    #[inline(always)]
    pub fn is_tsws(&self) -> bool {
        *self == RS_A::TSWS
    }
    #[doc = "Checks if the value of the field is `RUNTXD`"]
    #[inline(always)]
    pub fn is_runtxd(&self) -> bool {
        *self == RS_A::RUNTXD
    }
}
#[doc = "Write proxy for field `RS`"]
pub struct RS_W<'a> {
    w: &'a mut W,
}
impl<'a> RS_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: RS_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "Stopped: Reset or stop receive command issued"]
    #[inline(always)]
    pub fn stop(self) -> &'a mut W {
        self.variant(RS_A::STOP)
    }
    #[doc = "Running: Fetching receive transfer descriptor"]
    #[inline(always)]
    pub fn runrxtd(self) -> &'a mut W {
        self.variant(RS_A::RUNRXTD)
    }
    #[doc = "Running: Waiting for receive packet"]
    #[inline(always)]
    pub fn runrxd(self) -> &'a mut W {
        self.variant(RS_A::RUNRXD)
    }
    #[doc = "Suspended: Receive descriptor unavailable"]
    #[inline(always)]
    pub fn suspend(self) -> &'a mut W {
        self.variant(RS_A::SUSPEND)
    }
    #[doc = "Running: Closing receive descriptor"]
    #[inline(always)]
    pub fn runcrd(self) -> &'a mut W {
        self.variant(RS_A::RUNCRD)
    }
    #[doc = "Writing Timestamp"]
    #[inline(always)]
    pub fn tsws(self) -> &'a mut W {
        self.variant(RS_A::TSWS)
    }
    #[doc = "Running: Transferring the receive packet data from receive buffer to host memory"]
    #[inline(always)]
    pub fn runtxd(self) -> &'a mut W {
        self.variant(RS_A::RUNTXD)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 17)) | (((value as u32) & 0x07) << 17);
        self.w
    }
}
#[doc = "Transmit Process State\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum TS_A {
    #[doc = "0: Stopped; Reset or Stop transmit command processed"]
    STOP = 0,
    #[doc = "1: Running; Fetching transmit transfer descriptor"]
    RUNTXTD = 1,
    #[doc = "2: Running; Waiting for status"]
    STATUS = 2,
    #[doc = "3: Running; Reading data from host memory buffer and queuing it to transmit buffer (TX FIFO)"]
    RUNTX = 3,
    #[doc = "4: Writing Timestamp"]
    TSTAMP = 4,
    #[doc = "6: Suspended; Transmit descriptor unavailable or transmit buffer underflow"]
    SUSPEND = 6,
    #[doc = "7: Running; Closing transmit descriptor"]
    RUNCTD = 7,
}
impl From<TS_A> for u8 {
    #[inline(always)]
    fn from(variant: TS_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `TS`"]
pub type TS_R = crate::R<u8, TS_A>;
impl TS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, TS_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(TS_A::STOP),
            1 => Val(TS_A::RUNTXTD),
            2 => Val(TS_A::STATUS),
            3 => Val(TS_A::RUNTX),
            4 => Val(TS_A::TSTAMP),
            6 => Val(TS_A::SUSPEND),
            7 => Val(TS_A::RUNCTD),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `STOP`"]
    #[inline(always)]
    pub fn is_stop(&self) -> bool {
        *self == TS_A::STOP
    }
    #[doc = "Checks if the value of the field is `RUNTXTD`"]
    #[inline(always)]
    pub fn is_runtxtd(&self) -> bool {
        *self == TS_A::RUNTXTD
    }
    #[doc = "Checks if the value of the field is `STATUS`"]
    #[inline(always)]
    pub fn is_status(&self) -> bool {
        *self == TS_A::STATUS
    }
    #[doc = "Checks if the value of the field is `RUNTX`"]
    #[inline(always)]
    pub fn is_runtx(&self) -> bool {
        *self == TS_A::RUNTX
    }
    #[doc = "Checks if the value of the field is `TSTAMP`"]
    #[inline(always)]
    pub fn is_tstamp(&self) -> bool {
        *self == TS_A::TSTAMP
    }
    #[doc = "Checks if the value of the field is `SUSPEND`"]
    #[inline(always)]
    pub fn is_suspend(&self) -> bool {
        *self == TS_A::SUSPEND
    }
    #[doc = "Checks if the value of the field is `RUNCTD`"]
    #[inline(always)]
    pub fn is_runctd(&self) -> bool {
        *self == TS_A::RUNCTD
    }
}
#[doc = "Write proxy for field `TS`"]
pub struct TS_W<'a> {
    w: &'a mut W,
}
impl<'a> TS_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: TS_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "Stopped; Reset or Stop transmit command processed"]
    #[inline(always)]
    pub fn stop(self) -> &'a mut W {
        self.variant(TS_A::STOP)
    }
    #[doc = "Running; Fetching transmit transfer descriptor"]
    #[inline(always)]
    pub fn runtxtd(self) -> &'a mut W {
        self.variant(TS_A::RUNTXTD)
    }
    #[doc = "Running; Waiting for status"]
    #[inline(always)]
    pub fn status(self) -> &'a mut W {
        self.variant(TS_A::STATUS)
    }
    #[doc = "Running; Reading data from host memory buffer and queuing it to transmit buffer (TX FIFO)"]
    #[inline(always)]
    pub fn runtx(self) -> &'a mut W {
        self.variant(TS_A::RUNTX)
    }
    #[doc = "Writing Timestamp"]
    #[inline(always)]
    pub fn tstamp(self) -> &'a mut W {
        self.variant(TS_A::TSTAMP)
    }
    #[doc = "Suspended; Transmit descriptor unavailable or transmit buffer underflow"]
    #[inline(always)]
    pub fn suspend(self) -> &'a mut W {
        self.variant(TS_A::SUSPEND)
    }
    #[doc = "Running; Closing transmit descriptor"]
    #[inline(always)]
    pub fn runctd(self) -> &'a mut W {
        self.variant(TS_A::RUNCTD)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 20)) | (((value as u32) & 0x07) << 20);
        self.w
    }
}
#[doc = "Access Error\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum AE_A {
    #[doc = "0: Error during RX DMA Write Data Transfer"]
    RXDMAWD = 0,
    #[doc = "3: Error during TX DMA Read Data Transfer"]
    TXDMARD = 3,
    #[doc = "4: Error during RX DMA Descriptor Write Access"]
    RXDMADW = 4,
    #[doc = "5: Error during TX DMA Descriptor Write Access"]
    TXDMADW = 5,
    #[doc = "6: Error during RX DMA Descriptor Read Access"]
    RXDMADR = 6,
    #[doc = "7: Error during TX DMA Descriptor Read Access"]
    TXDMADR = 7,
}
impl From<AE_A> for u8 {
    #[inline(always)]
    fn from(variant: AE_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `AE`"]
pub type AE_R = crate::R<u8, AE_A>;
impl AE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, AE_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(AE_A::RXDMAWD),
            3 => Val(AE_A::TXDMARD),
            4 => Val(AE_A::RXDMADW),
            5 => Val(AE_A::TXDMADW),
            6 => Val(AE_A::RXDMADR),
            7 => Val(AE_A::TXDMADR),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `RXDMAWD`"]
    #[inline(always)]
    pub fn is_rxdmawd(&self) -> bool {
        *self == AE_A::RXDMAWD
    }
    #[doc = "Checks if the value of the field is `TXDMARD`"]
    #[inline(always)]
    pub fn is_txdmard(&self) -> bool {
        *self == AE_A::TXDMARD
    }
    #[doc = "Checks if the value of the field is `RXDMADW`"]
    #[inline(always)]
    pub fn is_rxdmadw(&self) -> bool {
        *self == AE_A::RXDMADW
    }
    #[doc = "Checks if the value of the field is `TXDMADW`"]
    #[inline(always)]
    pub fn is_txdmadw(&self) -> bool {
        *self == AE_A::TXDMADW
    }
    #[doc = "Checks if the value of the field is `RXDMADR`"]
    #[inline(always)]
    pub fn is_rxdmadr(&self) -> bool {
        *self == AE_A::RXDMADR
    }
    #[doc = "Checks if the value of the field is `TXDMADR`"]
    #[inline(always)]
    pub fn is_txdmadr(&self) -> bool {
        *self == AE_A::TXDMADR
    }
}
#[doc = "Write proxy for field `AE`"]
pub struct AE_W<'a> {
    w: &'a mut W,
}
impl<'a> AE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: AE_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "Error during RX DMA Write Data Transfer"]
    #[inline(always)]
    pub fn rxdmawd(self) -> &'a mut W {
        self.variant(AE_A::RXDMAWD)
    }
    #[doc = "Error during TX DMA Read Data Transfer"]
    #[inline(always)]
    pub fn txdmard(self) -> &'a mut W {
        self.variant(AE_A::TXDMARD)
    }
    #[doc = "Error during RX DMA Descriptor Write Access"]
    #[inline(always)]
    pub fn rxdmadw(self) -> &'a mut W {
        self.variant(AE_A::RXDMADW)
    }
    #[doc = "Error during TX DMA Descriptor Write Access"]
    #[inline(always)]
    pub fn txdmadw(self) -> &'a mut W {
        self.variant(AE_A::TXDMADW)
    }
    #[doc = "Error during RX DMA Descriptor Read Access"]
    #[inline(always)]
    pub fn rxdmadr(self) -> &'a mut W {
        self.variant(AE_A::RXDMADR)
    }
    #[doc = "Error during TX DMA Descriptor Read Access"]
    #[inline(always)]
    pub fn txdmadr(self) -> &'a mut W {
        self.variant(AE_A::TXDMADR)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 23)) | (((value as u32) & 0x07) << 23);
        self.w
    }
}
#[doc = "Reader of field `MMC`"]
pub type MMC_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `MMC`"]
pub struct MMC_W<'a> {
    w: &'a mut W,
}
impl<'a> MMC_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27);
        self.w
    }
}
#[doc = "Reader of field `PMT`"]
pub type PMT_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `PMT`"]
pub struct PMT_W<'a> {
    w: &'a mut W,
}
impl<'a> PMT_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28);
        self.w
    }
}
#[doc = "Reader of field `TT`"]
pub type TT_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `TT`"]
pub struct TT_W<'a> {
    w: &'a mut W,
}
impl<'a> TT_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 29)) | (((value as u32) & 0x01) << 29);
        self.w
    }
}
impl R {
    #[doc = "Bit 0 - Transmit Interrupt"]
    #[inline(always)]
    pub fn ti(&self) -> TI_R {
        TI_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bit 1 - Transmit Process Stopped"]
    #[inline(always)]
    pub fn tps(&self) -> TPS_R {
        TPS_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bit 2 - Transmit Buffer Unavailable"]
    #[inline(always)]
    pub fn tu(&self) -> TU_R {
        TU_R::new(((self.bits >> 2) & 0x01) != 0)
    }
    #[doc = "Bit 3 - Transmit Jabber Timeout"]
    #[inline(always)]
    pub fn tjt(&self) -> TJT_R {
        TJT_R::new(((self.bits >> 3) & 0x01) != 0)
    }
    #[doc = "Bit 4 - Receive Overflow"]
    #[inline(always)]
    pub fn ovf(&self) -> OVF_R {
        OVF_R::new(((self.bits >> 4) & 0x01) != 0)
    }
    #[doc = "Bit 5 - Transmit Underflow"]
    #[inline(always)]
    pub fn unf(&self) -> UNF_R {
        UNF_R::new(((self.bits >> 5) & 0x01) != 0)
    }
    #[doc = "Bit 6 - Receive Interrupt"]
    #[inline(always)]
    pub fn ri(&self) -> RI_R {
        RI_R::new(((self.bits >> 6) & 0x01) != 0)
    }
    #[doc = "Bit 7 - Receive Buffer Unavailable"]
    #[inline(always)]
    pub fn ru(&self) -> RU_R {
        RU_R::new(((self.bits >> 7) & 0x01) != 0)
    }
    #[doc = "Bit 8 - Receive Process Stopped"]
    #[inline(always)]
    pub fn rps(&self) -> RPS_R {
        RPS_R::new(((self.bits >> 8) & 0x01) != 0)
    }
    #[doc = "Bit 9 - Receive Watchdog Timeout"]
    #[inline(always)]
    pub fn rwt(&self) -> RWT_R {
        RWT_R::new(((self.bits >> 9) & 0x01) != 0)
    }
    #[doc = "Bit 10 - Early Transmit Interrupt"]
    #[inline(always)]
    pub fn eti(&self) -> ETI_R {
        ETI_R::new(((self.bits >> 10) & 0x01) != 0)
    }
    #[doc = "Bit 13 - Fatal Bus Error Interrupt"]
    #[inline(always)]
    pub fn fbi(&self) -> FBI_R {
        FBI_R::new(((self.bits >> 13) & 0x01) != 0)
    }
    #[doc = "Bit 14 - Early Receive Interrupt"]
    #[inline(always)]
    pub fn eri(&self) -> ERI_R {
        ERI_R::new(((self.bits >> 14) & 0x01) != 0)
    }
    #[doc = "Bit 15 - Abnormal Interrupt Summary"]
    #[inline(always)]
    pub fn ais(&self) -> AIS_R {
        AIS_R::new(((self.bits >> 15) & 0x01) != 0)
    }
    #[doc = "Bit 16 - Normal Interrupt Summary"]
    #[inline(always)]
    pub fn nis(&self) -> NIS_R {
        NIS_R::new(((self.bits >> 16) & 0x01) != 0)
    }
    #[doc = "Bits 17:19 - Received Process State"]
    #[inline(always)]
    pub fn rs(&self) -> RS_R {
        RS_R::new(((self.bits >> 17) & 0x07) as u8)
    }
    #[doc = "Bits 20:22 - Transmit Process State"]
    #[inline(always)]
    pub fn ts(&self) -> TS_R {
        TS_R::new(((self.bits >> 20) & 0x07) as u8)
    }
    #[doc = "Bits 23:25 - Access Error"]
    #[inline(always)]
    pub fn ae(&self) -> AE_R {
        AE_R::new(((self.bits >> 23) & 0x07) as u8)
    }
    #[doc = "Bit 27 - MAC MMC Interrupt"]
    #[inline(always)]
    pub fn mmc(&self) -> MMC_R {
        MMC_R::new(((self.bits >> 27) & 0x01) != 0)
    }
    #[doc = "Bit 28 - MAC PMT Interrupt Status"]
    #[inline(always)]
    pub fn pmt(&self) -> PMT_R {
        PMT_R::new(((self.bits >> 28) & 0x01) != 0)
    }
    #[doc = "Bit 29 - Timestamp Trigger Interrupt Status"]
    #[inline(always)]
    pub fn tt(&self) -> TT_R {
        TT_R::new(((self.bits >> 29) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Transmit Interrupt"]
    #[inline(always)]
    pub fn ti(&mut self) -> TI_W {
        TI_W { w: self }
    }
    #[doc = "Bit 1 - Transmit Process Stopped"]
    #[inline(always)]
    pub fn tps(&mut self) -> TPS_W {
        TPS_W { w: self }
    }
    #[doc = "Bit 2 - Transmit Buffer Unavailable"]
    #[inline(always)]
    pub fn tu(&mut self) -> TU_W {
        TU_W { w: self }
    }
    #[doc = "Bit 3 - Transmit Jabber Timeout"]
    #[inline(always)]
    pub fn tjt(&mut self) -> TJT_W {
        TJT_W { w: self }
    }
    #[doc = "Bit 4 - Receive Overflow"]
    #[inline(always)]
    pub fn ovf(&mut self) -> OVF_W {
        OVF_W { w: self }
    }
    #[doc = "Bit 5 - Transmit Underflow"]
    #[inline(always)]
    pub fn unf(&mut self) -> UNF_W {
        UNF_W { w: self }
    }
    #[doc = "Bit 6 - Receive Interrupt"]
    #[inline(always)]
    pub fn ri(&mut self) -> RI_W {
        RI_W { w: self }
    }
    #[doc = "Bit 7 - Receive Buffer Unavailable"]
    #[inline(always)]
    pub fn ru(&mut self) -> RU_W {
        RU_W { w: self }
    }
    #[doc = "Bit 8 - Receive Process Stopped"]
    #[inline(always)]
    pub fn rps(&mut self) -> RPS_W {
        RPS_W { w: self }
    }
    #[doc = "Bit 9 - Receive Watchdog Timeout"]
    #[inline(always)]
    pub fn rwt(&mut self) -> RWT_W {
        RWT_W { w: self }
    }
    #[doc = "Bit 10 - Early Transmit Interrupt"]
    #[inline(always)]
    pub fn eti(&mut self) -> ETI_W {
        ETI_W { w: self }
    }
    #[doc = "Bit 13 - Fatal Bus Error Interrupt"]
    #[inline(always)]
    pub fn fbi(&mut self) -> FBI_W {
        FBI_W { w: self }
    }
    #[doc = "Bit 14 - Early Receive Interrupt"]
    #[inline(always)]
    pub fn eri(&mut self) -> ERI_W {
        ERI_W { w: self }
    }
    #[doc = "Bit 15 - Abnormal Interrupt Summary"]
    #[inline(always)]
    pub fn ais(&mut self) -> AIS_W {
        AIS_W { w: self }
    }
    #[doc = "Bit 16 - Normal Interrupt Summary"]
    #[inline(always)]
    pub fn nis(&mut self) -> NIS_W {
        NIS_W { w: self }
    }
    #[doc = "Bits 17:19 - Received Process State"]
    #[inline(always)]
    pub fn rs(&mut self) -> RS_W {
        RS_W { w: self }
    }
    #[doc = "Bits 20:22 - Transmit Process State"]
    #[inline(always)]
    pub fn ts(&mut self) -> TS_W {
        TS_W { w: self }
    }
    #[doc = "Bits 23:25 - Access Error"]
    #[inline(always)]
    pub fn ae(&mut self) -> AE_W {
        AE_W { w: self }
    }
    #[doc = "Bit 27 - MAC MMC Interrupt"]
    #[inline(always)]
    pub fn mmc(&mut self) -> MMC_W {
        MMC_W { w: self }
    }
    #[doc = "Bit 28 - MAC PMT Interrupt Status"]
    #[inline(always)]
    pub fn pmt(&mut self) -> PMT_W {
        PMT_W { w: self }
    }
    #[doc = "Bit 29 - Timestamp Trigger Interrupt Status"]
    #[inline(always)]
    pub fn tt(&mut self) -> TT_W {
        TT_W { w: self }
    }
}