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
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::identity_op)]
#![allow(clippy::unnecessary_cast)]
#![allow(clippy::erasing_op)]

#[doc = "Ethernet MAC-10M+PHY"]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Eth {
    ptr: *mut u8,
}
unsafe impl Send for Eth {}
unsafe impl Sync for Eth {}
impl Eth {
    #[inline(always)]
    pub const unsafe fn from_ptr(ptr: *mut ()) -> Self {
        Self { ptr: ptr as _ }
    }
    #[inline(always)]
    pub const fn as_ptr(&self) -> *mut () {
        self.ptr as _
    }
    #[doc = "Interrupt enable register"]
    #[inline(always)]
    pub const fn eie(self) -> crate::common::Reg<regs::Eie, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x03usize) as _) }
    }
    #[doc = "Interrupt flag register"]
    #[inline(always)]
    pub const fn eir(self) -> crate::common::Reg<regs::Eir, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x04usize) as _) }
    }
    #[doc = "Status register"]
    #[inline(always)]
    pub const fn estat(self) -> crate::common::Reg<regs::Estat, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x05usize) as _) }
    }
    #[doc = "PHY analog parameter setting register"]
    #[inline(always)]
    pub const fn econ2(self) -> crate::common::Reg<regs::Econ2, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x06usize) as _) }
    }
    #[doc = "Receive/transmit control register"]
    #[inline(always)]
    pub const fn econ1(self) -> crate::common::Reg<regs::Econ1, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x07usize) as _) }
    }
    #[doc = "Transmit DMA buffer start address register"]
    #[inline(always)]
    pub const fn etxst(self) -> crate::common::Reg<regs::Etxst, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x08usize) as _) }
    }
    #[doc = "Transmission length register"]
    #[inline(always)]
    pub const fn etxln(self) -> crate::common::Reg<regs::Etxln, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0ausize) as _) }
    }
    #[doc = "Receive DMA buffer start address register"]
    #[inline(always)]
    pub const fn erxst(self) -> crate::common::Reg<regs::Erxst, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0cusize) as _) }
    }
    #[doc = "Reception length register"]
    #[inline(always)]
    pub const fn erxln(self) -> crate::common::Reg<regs::Erxln, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0eusize) as _) }
    }
    #[doc = "Hash table low register"]
    #[inline(always)]
    pub const fn htl(self) -> crate::common::Reg<regs::Htl, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x10usize) as _) }
    }
    #[doc = "Hash table high register"]
    #[inline(always)]
    pub const fn hth(self) -> crate::common::Reg<regs::Hth, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x14usize) as _) }
    }
    #[doc = "Receive packet filter control register"]
    #[inline(always)]
    pub const fn erxfcon(self) -> crate::common::Reg<regs::Erxfcon, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x18usize) as _) }
    }
    #[doc = "Mac layer flow control register"]
    #[inline(always)]
    pub const fn macon1(self) -> crate::common::Reg<regs::Macon1, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x19usize) as _) }
    }
    #[doc = "Mac layer packet control register"]
    #[inline(always)]
    pub const fn macon2(self) -> crate::common::Reg<regs::Macon2, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x1ausize) as _) }
    }
    #[doc = "Minimum packet interval register"]
    #[inline(always)]
    pub const fn mabbipg(self) -> crate::common::Reg<regs::Mabbipg, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x1busize) as _) }
    }
    #[doc = "Flow control pause frame time register"]
    #[inline(always)]
    pub const fn epaus(self) -> crate::common::Reg<regs::Epaus, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x1cusize) as _) }
    }
    #[doc = "Maximum receive packet length register"]
    #[inline(always)]
    pub const fn mamxfl(self) -> crate::common::Reg<regs::Mamxfl, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x1eusize) as _) }
    }
    #[doc = "MII read register"]
    #[inline(always)]
    pub const fn mird(self) -> crate::common::Reg<regs::Mird, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x20usize) as _) }
    }
    #[doc = "MII read register address"]
    #[inline(always)]
    pub const fn miregadr(self) -> crate::common::Reg<regs::Miregadr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x24usize) as _) }
    }
    #[doc = "MII write register"]
    #[inline(always)]
    pub const fn miwr(self) -> crate::common::Reg<regs::Miwr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x24usize) as _) }
    }
    #[doc = "MAC address low register"]
    #[inline(always)]
    pub const fn maadr0(self) -> crate::common::Reg<regs::Maadr0, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x28usize) as _) }
    }
    #[doc = "MAC address byte 1"]
    #[inline(always)]
    pub const fn maadr1(self) -> crate::common::Reg<regs::Maadr1, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x29usize) as _) }
    }
    #[doc = "MAC address byte 2"]
    #[inline(always)]
    pub const fn maadr2(self) -> crate::common::Reg<regs::Maadr2, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x2ausize) as _) }
    }
    #[doc = "MAC address byte 3"]
    #[inline(always)]
    pub const fn maadr3(self) -> crate::common::Reg<regs::Maadr3, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x2busize) as _) }
    }
    #[doc = "MAC address byte 4"]
    #[inline(always)]
    pub const fn maadr4(self) -> crate::common::Reg<regs::Maadr4, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x2cusize) as _) }
    }
    #[doc = "MAC address high register"]
    #[inline(always)]
    pub const fn maadr5(self) -> crate::common::Reg<regs::Maadr5, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x2dusize) as _) }
    }
}
pub mod regs {
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Econ1(pub u8);
    impl Econ1 {
        #[doc = "Receive enable"]
        #[inline(always)]
        pub const fn rx_en(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Receive enable"]
        #[inline(always)]
        pub fn set_rx_en(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u8) & 0x01) << 2usize);
        }
        #[doc = "Transmit start. Cleared automatically after the transmission is completed"]
        #[inline(always)]
        pub const fn tx_rts(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Transmit start. Cleared automatically after the transmission is completed"]
        #[inline(always)]
        pub fn set_tx_rts(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u8) & 0x01) << 3usize);
        }
        #[doc = "Receive module reset"]
        #[inline(always)]
        pub const fn rx_rst(&self) -> bool {
            let val = (self.0 >> 6usize) & 0x01;
            val != 0
        }
        #[doc = "Receive module reset"]
        #[inline(always)]
        pub fn set_rx_rst(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u8) & 0x01) << 6usize);
        }
        #[doc = "Transmit module reset"]
        #[inline(always)]
        pub const fn tx_rst(&self) -> bool {
            let val = (self.0 >> 7usize) & 0x01;
            val != 0
        }
        #[doc = "Transmit module reset"]
        #[inline(always)]
        pub fn set_tx_rst(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u8) & 0x01) << 7usize);
        }
    }
    impl Default for Econ1 {
        #[inline(always)]
        fn default() -> Econ1 {
            Econ1(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Econ2(pub u8);
    impl Econ2 {
        #[doc = "Transmitter energy-saving driver control"]
        #[inline(always)]
        pub const fn tx(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Transmitter energy-saving driver control"]
        #[inline(always)]
        pub fn set_tx(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u8) & 0x01) << 0usize);
        }
        #[doc = "Reserved. Must write 110b."]
        #[inline(always)]
        pub const fn rx_must(&self) -> u8 {
            let val = (self.0 >> 1usize) & 0x07;
            val as u8
        }
        #[doc = "Reserved. Must write 110b."]
        #[inline(always)]
        pub fn set_rx_must(&mut self, val: u8) {
            self.0 = (self.0 & !(0x07 << 1usize)) | (((val as u8) & 0x07) << 1usize);
        }
    }
    impl Default for Econ2 {
        #[inline(always)]
        fn default() -> Econ2 {
            Econ2(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Eie(pub u8);
    impl Eie {
        #[doc = "Receive error interrupt enable"]
        #[inline(always)]
        pub const fn rxerie(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Receive error interrupt enable"]
        #[inline(always)]
        pub fn set_rxerie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u8) & 0x01) << 0usize);
        }
        #[doc = "Transmit error interrupt enable"]
        #[inline(always)]
        pub const fn txerie(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Transmit error interrupt enable"]
        #[inline(always)]
        pub fn set_txerie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u8) & 0x01) << 1usize);
        }
        #[doc = "Built-in 50ohm impedance matching resistor enable"]
        #[inline(always)]
        pub const fn r_en50(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Built-in 50ohm impedance matching resistor enable"]
        #[inline(always)]
        pub fn set_r_en50(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u8) & 0x01) << 2usize);
        }
        #[doc = "Transmit completed interrupt enable"]
        #[inline(always)]
        pub const fn txie(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Transmit completed interrupt enable"]
        #[inline(always)]
        pub fn set_txie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u8) & 0x01) << 3usize);
        }
        #[doc = "Link change interrupt enable"]
        #[inline(always)]
        pub const fn linkie(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Link change interrupt enable"]
        #[inline(always)]
        pub fn set_linkie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u8) & 0x01) << 4usize);
        }
        #[doc = "Receive completed interrupt enable"]
        #[inline(always)]
        pub const fn rxie(&self) -> bool {
            let val = (self.0 >> 6usize) & 0x01;
            val != 0
        }
        #[doc = "Receive completed interrupt enable"]
        #[inline(always)]
        pub fn set_rxie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u8) & 0x01) << 6usize);
        }
        #[doc = "Ethernet interrupt enable"]
        #[inline(always)]
        pub const fn intie(&self) -> bool {
            let val = (self.0 >> 7usize) & 0x01;
            val != 0
        }
        #[doc = "Ethernet interrupt enable"]
        #[inline(always)]
        pub fn set_intie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u8) & 0x01) << 7usize);
        }
    }
    impl Default for Eie {
        #[inline(always)]
        fn default() -> Eie {
            Eie(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Eir(pub u8);
    impl Eir {
        #[doc = "Receive error flag"]
        #[inline(always)]
        pub const fn rxerif(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Receive error flag"]
        #[inline(always)]
        pub fn set_rxerif(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u8) & 0x01) << 0usize);
        }
        #[doc = "Transmit error flag"]
        #[inline(always)]
        pub const fn txerif(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Transmit error flag"]
        #[inline(always)]
        pub fn set_txerif(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u8) & 0x01) << 1usize);
        }
        #[doc = "Transmit completed flag"]
        #[inline(always)]
        pub const fn txif(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Transmit completed flag"]
        #[inline(always)]
        pub fn set_txif(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u8) & 0x01) << 3usize);
        }
        #[doc = "Link change flag"]
        #[inline(always)]
        pub const fn linkif(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Link change flag"]
        #[inline(always)]
        pub fn set_linkif(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u8) & 0x01) << 4usize);
        }
        #[doc = "Receive completed flag"]
        #[inline(always)]
        pub const fn rxif(&self) -> bool {
            let val = (self.0 >> 6usize) & 0x01;
            val != 0
        }
        #[doc = "Receive completed flag"]
        #[inline(always)]
        pub fn set_rxif(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u8) & 0x01) << 6usize);
        }
    }
    impl Default for Eir {
        #[inline(always)]
        fn default() -> Eir {
            Eir(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Epaus(pub u16);
    impl Epaus {
        #[doc = "Flow control pause frame time"]
        #[inline(always)]
        pub const fn epaus(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Flow control pause frame time"]
        #[inline(always)]
        pub fn set_epaus(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for Epaus {
        #[inline(always)]
        fn default() -> Epaus {
            Epaus(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Erxfcon(pub u8);
    impl Erxfcon {
        #[doc = "Broadcast packet matching filter settings"]
        #[inline(always)]
        pub const fn bcen(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Broadcast packet matching filter settings"]
        #[inline(always)]
        pub fn set_bcen(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u8) & 0x01) << 0usize);
        }
        #[doc = "Multicast packet matching filter settings"]
        #[inline(always)]
        pub const fn mcen(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Multicast packet matching filter settings"]
        #[inline(always)]
        pub fn set_mcen(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u8) & 0x01) << 1usize);
        }
        #[doc = "Hash table matching filter settings"]
        #[inline(always)]
        pub const fn hten(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Hash table matching filter settings"]
        #[inline(always)]
        pub fn set_hten(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u8) & 0x01) << 2usize);
        }
        #[doc = "Magic packet filter settings"]
        #[inline(always)]
        pub const fn mpen(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Magic packet filter settings"]
        #[inline(always)]
        pub fn set_mpen(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u8) & 0x01) << 3usize);
        }
        #[doc = "Receive filtering enable"]
        #[inline(always)]
        pub const fn en(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Receive filtering enable"]
        #[inline(always)]
        pub fn set_en(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u8) & 0x01) << 4usize);
        }
        #[doc = "CRC checksum filter settings"]
        #[inline(always)]
        pub const fn crcen(&self) -> bool {
            let val = (self.0 >> 5usize) & 0x01;
            val != 0
        }
        #[doc = "CRC checksum filter settings"]
        #[inline(always)]
        pub fn set_crcen(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u8) & 0x01) << 5usize);
        }
        #[doc = "Unicast match filter settings"]
        #[inline(always)]
        pub const fn ucen(&self) -> bool {
            let val = (self.0 >> 7usize) & 0x01;
            val != 0
        }
        #[doc = "Unicast match filter settings"]
        #[inline(always)]
        pub fn set_ucen(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u8) & 0x01) << 7usize);
        }
    }
    impl Default for Erxfcon {
        #[inline(always)]
        fn default() -> Erxfcon {
            Erxfcon(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Erxln(pub u16);
    impl Erxln {
        #[doc = "Reception length"]
        #[inline(always)]
        pub const fn erxln(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Reception length"]
        #[inline(always)]
        pub fn set_erxln(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for Erxln {
        #[inline(always)]
        fn default() -> Erxln {
            Erxln(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Erxst(pub u16);
    impl Erxst {
        #[doc = "Receive DMA buffer start address"]
        #[inline(always)]
        pub const fn erxst(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Receive DMA buffer start address"]
        #[inline(always)]
        pub fn set_erxst(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for Erxst {
        #[inline(always)]
        fn default() -> Erxst {
            Erxst(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Estat(pub u8);
    impl Estat {
        #[doc = "Transmission interrupted by MCU"]
        #[inline(always)]
        pub const fn txabrt(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Transmission interrupted by MCU"]
        #[inline(always)]
        pub fn set_txabrt(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u8) & 0x01) << 1usize);
        }
        #[doc = "Packets receive in progress"]
        #[inline(always)]
        pub const fn rxbusy(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Packets receive in progress"]
        #[inline(always)]
        pub fn set_rxbusy(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u8) & 0x01) << 2usize);
        }
        #[doc = "Receive more than the set maximum packets"]
        #[inline(always)]
        pub const fn rxmore(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Receive more than the set maximum packets"]
        #[inline(always)]
        pub fn set_rxmore(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u8) & 0x01) << 3usize);
        }
        #[doc = "Receive nibble error / Receive more than the set maximum"]
        #[inline(always)]
        pub const fn rxnibble(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Receive nibble error / Receive more than the set maximum"]
        #[inline(always)]
        pub fn set_rxnibble(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u8) & 0x01) << 4usize);
        }
        #[doc = "Receive CRC error"]
        #[inline(always)]
        pub const fn rxcrcer(&self) -> bool {
            let val = (self.0 >> 5usize) & 0x01;
            val != 0
        }
        #[doc = "Receive CRC error"]
        #[inline(always)]
        pub fn set_rxcrcer(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u8) & 0x01) << 5usize);
        }
        #[doc = "Buffer error"]
        #[inline(always)]
        pub const fn bufer(&self) -> bool {
            let val = (self.0 >> 6usize) & 0x01;
            val != 0
        }
        #[doc = "Buffer error"]
        #[inline(always)]
        pub fn set_bufer(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u8) & 0x01) << 6usize);
        }
        #[doc = "Interrupt"]
        #[inline(always)]
        pub const fn int(&self) -> bool {
            let val = (self.0 >> 7usize) & 0x01;
            val != 0
        }
        #[doc = "Interrupt"]
        #[inline(always)]
        pub fn set_int(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u8) & 0x01) << 7usize);
        }
    }
    impl Default for Estat {
        #[inline(always)]
        fn default() -> Estat {
            Estat(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Etxln(pub u16);
    impl Etxln {
        #[doc = "Transmission length"]
        #[inline(always)]
        pub const fn etxln(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Transmission length"]
        #[inline(always)]
        pub fn set_etxln(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for Etxln {
        #[inline(always)]
        fn default() -> Etxln {
            Etxln(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Etxst(pub u16);
    impl Etxst {
        #[doc = "Transmit DMA buffer start address"]
        #[inline(always)]
        pub const fn etxst(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Transmit DMA buffer start address"]
        #[inline(always)]
        pub fn set_etxst(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for Etxst {
        #[inline(always)]
        fn default() -> Etxst {
            Etxst(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Hth(pub u32);
    impl Hth {
        #[doc = "Hash Table byte 4"]
        #[inline(always)]
        pub const fn b4(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "Hash Table byte 4"]
        #[inline(always)]
        pub fn set_b4(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
        }
        #[doc = "Hash Table byte 5"]
        #[inline(always)]
        pub const fn b5(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0xff;
            val as u8
        }
        #[doc = "Hash Table byte 5"]
        #[inline(always)]
        pub fn set_b5(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
        }
        #[doc = "Hash Table byte 6"]
        #[inline(always)]
        pub const fn b6(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0xff;
            val as u8
        }
        #[doc = "Hash Table byte 6"]
        #[inline(always)]
        pub fn set_b6(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
        }
        #[doc = "Hash Table byte 7"]
        #[inline(always)]
        pub const fn b7(&self) -> u8 {
            let val = (self.0 >> 24usize) & 0xff;
            val as u8
        }
        #[doc = "Hash Table byte 7"]
        #[inline(always)]
        pub fn set_b7(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
        }
    }
    impl Default for Hth {
        #[inline(always)]
        fn default() -> Hth {
            Hth(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Htl(pub u32);
    impl Htl {
        #[doc = "Hash Table byte 0"]
        #[inline(always)]
        pub const fn b0(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "Hash Table byte 0"]
        #[inline(always)]
        pub fn set_b0(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
        }
        #[doc = "Hash Table byte 1"]
        #[inline(always)]
        pub const fn b1(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0xff;
            val as u8
        }
        #[doc = "Hash Table byte 1"]
        #[inline(always)]
        pub fn set_b1(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
        }
        #[doc = "Hash Table byte 2"]
        #[inline(always)]
        pub const fn b2(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0xff;
            val as u8
        }
        #[doc = "Hash Table byte 2"]
        #[inline(always)]
        pub fn set_b2(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
        }
        #[doc = "Hash Table byte 3"]
        #[inline(always)]
        pub const fn b3(&self) -> u8 {
            let val = (self.0 >> 24usize) & 0xff;
            val as u8
        }
        #[doc = "Hash Table byte 3"]
        #[inline(always)]
        pub fn set_b3(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
        }
    }
    impl Default for Htl {
        #[inline(always)]
        fn default() -> Htl {
            Htl(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Maadr0(pub u8);
    impl Maadr0 {
        #[doc = "MAC Address byte 0"]
        #[inline(always)]
        pub const fn maadr(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "MAC Address byte 0"]
        #[inline(always)]
        pub fn set_maadr(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u8) & 0xff) << 0usize);
        }
    }
    impl Default for Maadr0 {
        #[inline(always)]
        fn default() -> Maadr0 {
            Maadr0(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Maadr1(pub u8);
    impl Maadr1 {
        #[doc = "MAC Address byte 1"]
        #[inline(always)]
        pub const fn maadr(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "MAC Address byte 1"]
        #[inline(always)]
        pub fn set_maadr(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u8) & 0xff) << 0usize);
        }
    }
    impl Default for Maadr1 {
        #[inline(always)]
        fn default() -> Maadr1 {
            Maadr1(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Maadr2(pub u8);
    impl Maadr2 {
        #[doc = "MAC Address byte 2"]
        #[inline(always)]
        pub const fn maadr(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "MAC Address byte 2"]
        #[inline(always)]
        pub fn set_maadr(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u8) & 0xff) << 0usize);
        }
    }
    impl Default for Maadr2 {
        #[inline(always)]
        fn default() -> Maadr2 {
            Maadr2(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Maadr3(pub u8);
    impl Maadr3 {
        #[doc = "MAC Address byte 3"]
        #[inline(always)]
        pub const fn maadr(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "MAC Address byte 3"]
        #[inline(always)]
        pub fn set_maadr(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u8) & 0xff) << 0usize);
        }
    }
    impl Default for Maadr3 {
        #[inline(always)]
        fn default() -> Maadr3 {
            Maadr3(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Maadr4(pub u8);
    impl Maadr4 {
        #[doc = "MAC Address byte 4"]
        #[inline(always)]
        pub const fn maadr(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "MAC Address byte 4"]
        #[inline(always)]
        pub fn set_maadr(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u8) & 0xff) << 0usize);
        }
    }
    impl Default for Maadr4 {
        #[inline(always)]
        fn default() -> Maadr4 {
            Maadr4(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Maadr5(pub u8);
    impl Maadr5 {
        #[doc = "MAC Address byte 5"]
        #[inline(always)]
        pub const fn maadr(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "MAC Address byte 5"]
        #[inline(always)]
        pub fn set_maadr(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u8) & 0xff) << 0usize);
        }
    }
    impl Default for Maadr5 {
        #[inline(always)]
        fn default() -> Maadr5 {
            Maadr5(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Mabbipg(pub u8);
    impl Mabbipg {
        #[doc = "Minimum number of packet interval bytes"]
        #[inline(always)]
        pub const fn mabbipg(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0x7f;
            val as u8
        }
        #[doc = "Minimum number of packet interval bytes"]
        #[inline(always)]
        pub fn set_mabbipg(&mut self, val: u8) {
            self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u8) & 0x7f) << 0usize);
        }
    }
    impl Default for Mabbipg {
        #[inline(always)]
        fn default() -> Mabbipg {
            Mabbipg(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Macon1(pub u8);
    impl Macon1 {
        #[doc = "MAC layer receive enable"]
        #[inline(always)]
        pub const fn marxen(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "MAC layer receive enable"]
        #[inline(always)]
        pub fn set_marxen(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u8) & 0x01) << 0usize);
        }
        #[doc = "Control frame setting"]
        #[inline(always)]
        pub const fn passall(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Control frame setting"]
        #[inline(always)]
        pub fn set_passall(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u8) & 0x01) << 1usize);
        }
        #[doc = "Receive pause frame enable"]
        #[inline(always)]
        pub const fn rxpaus(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Receive pause frame enable"]
        #[inline(always)]
        pub fn set_rxpaus(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u8) & 0x01) << 2usize);
        }
        #[doc = "Transmit pause frame enable control"]
        #[inline(always)]
        pub const fn txpaus(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Transmit pause frame enable control"]
        #[inline(always)]
        pub fn set_txpaus(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u8) & 0x01) << 3usize);
        }
        #[doc = "Pause frame setting. Active at full-duplex"]
        #[inline(always)]
        pub const fn fcen(&self) -> u8 {
            let val = (self.0 >> 4usize) & 0x03;
            val as u8
        }
        #[doc = "Pause frame setting. Active at full-duplex"]
        #[inline(always)]
        pub fn set_fcen(&mut self, val: u8) {
            self.0 = (self.0 & !(0x03 << 4usize)) | (((val as u8) & 0x03) << 4usize);
        }
    }
    impl Default for Macon1 {
        #[inline(always)]
        fn default() -> Macon1 {
            Macon1(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Macon2(pub u8);
    impl Macon2 {
        #[doc = "Ethernet communication mode"]
        #[inline(always)]
        pub const fn fuldpx(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Ethernet communication mode"]
        #[inline(always)]
        pub fn set_fuldpx(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u8) & 0x01) << 0usize);
        }
        #[doc = "Jumbo frame received enable"]
        #[inline(always)]
        pub const fn hfrmen(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Jumbo frame received enable"]
        #[inline(always)]
        pub fn set_hfrmen(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u8) & 0x01) << 2usize);
        }
        #[doc = "Special 4 bytes are not involved in CRC."]
        #[inline(always)]
        pub const fn phdren(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Special 4 bytes are not involved in CRC."]
        #[inline(always)]
        pub fn set_phdren(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u8) & 0x01) << 3usize);
        }
        #[doc = "Transmit add CRC control"]
        #[inline(always)]
        pub const fn txcrcen(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Transmit add CRC control"]
        #[inline(always)]
        pub fn set_txcrcen(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u8) & 0x01) << 4usize);
        }
        #[doc = "Short packet fill setting"]
        #[inline(always)]
        pub const fn padcfg(&self) -> u8 {
            let val = (self.0 >> 5usize) & 0x07;
            val as u8
        }
        #[doc = "Short packet fill setting"]
        #[inline(always)]
        pub fn set_padcfg(&mut self, val: u8) {
            self.0 = (self.0 & !(0x07 << 5usize)) | (((val as u8) & 0x07) << 5usize);
        }
    }
    impl Default for Macon2 {
        #[inline(always)]
        fn default() -> Macon2 {
            Macon2(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Mamxfl(pub u16);
    impl Mamxfl {
        #[doc = "Maximum receive packet length"]
        #[inline(always)]
        pub const fn mamxfl(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Maximum receive packet length"]
        #[inline(always)]
        pub fn set_mamxfl(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for Mamxfl {
        #[inline(always)]
        fn default() -> Mamxfl {
            Mamxfl(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Mird(pub u16);
    impl Mird {
        #[doc = "MII Read register"]
        #[inline(always)]
        pub const fn rd(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "MII Read register"]
        #[inline(always)]
        pub fn set_rd(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for Mird {
        #[inline(always)]
        fn default() -> Mird {
            Mird(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Miregadr(pub u8);
    impl Miregadr {
        #[doc = "MII Read register address"]
        #[inline(always)]
        pub const fn miregadr(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "MII Read register address"]
        #[inline(always)]
        pub fn set_miregadr(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u8) & 0xff) << 0usize);
        }
    }
    impl Default for Miregadr {
        #[inline(always)]
        fn default() -> Miregadr {
            Miregadr(0)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Miwr(pub u32);
    impl Miwr {
        #[doc = "PHY register address"]
        #[inline(always)]
        pub const fn mirdl(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0x1f;
            val as u8
        }
        #[doc = "PHY register address"]
        #[inline(always)]
        pub fn set_mirdl(&mut self, val: u8) {
            self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize);
        }
        #[doc = "Write to MII register"]
        #[inline(always)]
        pub const fn write(&self) -> bool {
            let val = (self.0 >> 8usize) & 0x01;
            val != 0
        }
        #[doc = "Write to MII register"]
        #[inline(always)]
        pub fn set_write(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
        }
        #[doc = "MII write register"]
        #[inline(always)]
        pub const fn wr(&self) -> u16 {
            let val = (self.0 >> 16usize) & 0xffff;
            val as u16
        }
        #[doc = "MII write register"]
        #[inline(always)]
        pub fn set_wr(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
        }
    }
    impl Default for Miwr {
        #[inline(always)]
        fn default() -> Miwr {
            Miwr(0)
        }
    }
}