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
#[doc = "Register `CONP0` reader"]
pub type R = crate::R<Conp0Spec>;
#[doc = "Register `CONP0` writer"]
pub type W = crate::W<Conp0Spec>;
#[doc = "PORT0 Receive Input 0 Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Rxd0 {
    #[doc = "0: Data input RXD0A is selected"]
    Value1 = 0,
    #[doc = "1: Data input RXD0B is selected"]
    Value2 = 1,
    #[doc = "2: Data input RXD0C is selected"]
    Value3 = 2,
    #[doc = "3: Data input RXD0D is selected"]
    Value4 = 3,
}
impl From<Rxd0> for u8 {
    #[inline(always)]
    fn from(variant: Rxd0) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Rxd0 {
    type Ux = u8;
}
#[doc = "Field `RXD0` reader - PORT0 Receive Input 0 Select"]
pub type Rxd0R = crate::FieldReader<Rxd0>;
impl Rxd0R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rxd0 {
        match self.bits {
            0 => Rxd0::Value1,
            1 => Rxd0::Value2,
            2 => Rxd0::Value3,
            3 => Rxd0::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Data input RXD0A is selected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Rxd0::Value1
    }
    #[doc = "Data input RXD0B is selected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Rxd0::Value2
    }
    #[doc = "Data input RXD0C is selected"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Rxd0::Value3
    }
    #[doc = "Data input RXD0D is selected"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Rxd0::Value4
    }
}
#[doc = "Field `RXD0` writer - PORT0 Receive Input 0 Select"]
pub type Rxd0W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Rxd0>;
impl<'a, REG> Rxd0W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Data input RXD0A is selected"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd0::Value1)
    }
    #[doc = "Data input RXD0B is selected"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd0::Value2)
    }
    #[doc = "Data input RXD0C is selected"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd0::Value3)
    }
    #[doc = "Data input RXD0D is selected"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd0::Value4)
    }
}
#[doc = "Port0 Receive Input 1 Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Rxd1 {
    #[doc = "0: Data input RXD1A is selected"]
    Value1 = 0,
    #[doc = "1: Data input RXD1B is selected"]
    Value2 = 1,
    #[doc = "2: Data input RXD1C is selected"]
    Value3 = 2,
    #[doc = "3: Data input RXD1D is selected"]
    Value4 = 3,
}
impl From<Rxd1> for u8 {
    #[inline(always)]
    fn from(variant: Rxd1) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Rxd1 {
    type Ux = u8;
}
#[doc = "Field `RXD1` reader - Port0 Receive Input 1 Select"]
pub type Rxd1R = crate::FieldReader<Rxd1>;
impl Rxd1R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rxd1 {
        match self.bits {
            0 => Rxd1::Value1,
            1 => Rxd1::Value2,
            2 => Rxd1::Value3,
            3 => Rxd1::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Data input RXD1A is selected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Rxd1::Value1
    }
    #[doc = "Data input RXD1B is selected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Rxd1::Value2
    }
    #[doc = "Data input RXD1C is selected"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Rxd1::Value3
    }
    #[doc = "Data input RXD1D is selected"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Rxd1::Value4
    }
}
#[doc = "Field `RXD1` writer - Port0 Receive Input 1 Select"]
pub type Rxd1W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Rxd1>;
impl<'a, REG> Rxd1W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Data input RXD1A is selected"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd1::Value1)
    }
    #[doc = "Data input RXD1B is selected"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd1::Value2)
    }
    #[doc = "Data input RXD1C is selected"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd1::Value3)
    }
    #[doc = "Data input RXD1D is selected"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd1::Value4)
    }
}
#[doc = "Port0 Receive Input 2 Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Rxd2 {
    #[doc = "0: Data input RXD2A is selected"]
    Value1 = 0,
    #[doc = "1: Data input RXD2B is selected"]
    Value2 = 1,
    #[doc = "2: Data input RXD2C is selected"]
    Value3 = 2,
    #[doc = "3: Data input RXD2D is selected"]
    Value4 = 3,
}
impl From<Rxd2> for u8 {
    #[inline(always)]
    fn from(variant: Rxd2) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Rxd2 {
    type Ux = u8;
}
#[doc = "Field `RXD2` reader - Port0 Receive Input 2 Select"]
pub type Rxd2R = crate::FieldReader<Rxd2>;
impl Rxd2R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rxd2 {
        match self.bits {
            0 => Rxd2::Value1,
            1 => Rxd2::Value2,
            2 => Rxd2::Value3,
            3 => Rxd2::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Data input RXD2A is selected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Rxd2::Value1
    }
    #[doc = "Data input RXD2B is selected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Rxd2::Value2
    }
    #[doc = "Data input RXD2C is selected"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Rxd2::Value3
    }
    #[doc = "Data input RXD2D is selected"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Rxd2::Value4
    }
}
#[doc = "Field `RXD2` writer - Port0 Receive Input 2 Select"]
pub type Rxd2W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Rxd2>;
impl<'a, REG> Rxd2W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Data input RXD2A is selected"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd2::Value1)
    }
    #[doc = "Data input RXD2B is selected"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd2::Value2)
    }
    #[doc = "Data input RXD2C is selected"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd2::Value3)
    }
    #[doc = "Data input RXD2D is selected"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd2::Value4)
    }
}
#[doc = "Port0 Receive Input 3 Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Rxd3 {
    #[doc = "0: Data input RXD3A is selected"]
    Value1 = 0,
    #[doc = "1: Data input RXD3B is selected"]
    Value2 = 1,
    #[doc = "2: Data input RXD3C is selected"]
    Value3 = 2,
    #[doc = "3: Data input RXD3D is selected"]
    Value4 = 3,
}
impl From<Rxd3> for u8 {
    #[inline(always)]
    fn from(variant: Rxd3) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Rxd3 {
    type Ux = u8;
}
#[doc = "Field `RXD3` reader - Port0 Receive Input 3 Select"]
pub type Rxd3R = crate::FieldReader<Rxd3>;
impl Rxd3R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rxd3 {
        match self.bits {
            0 => Rxd3::Value1,
            1 => Rxd3::Value2,
            2 => Rxd3::Value3,
            3 => Rxd3::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Data input RXD3A is selected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Rxd3::Value1
    }
    #[doc = "Data input RXD3B is selected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Rxd3::Value2
    }
    #[doc = "Data input RXD3C is selected"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Rxd3::Value3
    }
    #[doc = "Data input RXD3D is selected"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Rxd3::Value4
    }
}
#[doc = "Field `RXD3` writer - Port0 Receive Input 3 Select"]
pub type Rxd3W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Rxd3>;
impl<'a, REG> Rxd3W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Data input RXD3A is selected"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd3::Value1)
    }
    #[doc = "Data input RXD3B is selected"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd3::Value2)
    }
    #[doc = "Data input RXD3C is selected"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd3::Value3)
    }
    #[doc = "Data input RXD3D is selected"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Rxd3::Value4)
    }
}
#[doc = "Port0 MII RX ERROR Input Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RxErr {
    #[doc = "0: Data input RX_ERRA is selected"]
    Value1 = 0,
    #[doc = "1: Data input RX_ERRB is selected"]
    Value2 = 1,
    #[doc = "2: Data input RX_ERRC is selected"]
    Value3 = 2,
    #[doc = "3: Data input RX_ERRD is selected"]
    Value4 = 3,
}
impl From<RxErr> for u8 {
    #[inline(always)]
    fn from(variant: RxErr) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for RxErr {
    type Ux = u8;
}
#[doc = "Field `RX_ERR` reader - Port0 MII RX ERROR Input Select"]
pub type RxErrR = crate::FieldReader<RxErr>;
impl RxErrR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> RxErr {
        match self.bits {
            0 => RxErr::Value1,
            1 => RxErr::Value2,
            2 => RxErr::Value3,
            3 => RxErr::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Data input RX_ERRA is selected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == RxErr::Value1
    }
    #[doc = "Data input RX_ERRB is selected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == RxErr::Value2
    }
    #[doc = "Data input RX_ERRC is selected"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == RxErr::Value3
    }
    #[doc = "Data input RX_ERRD is selected"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == RxErr::Value4
    }
}
#[doc = "Field `RX_ERR` writer - Port0 MII RX ERROR Input Select"]
pub type RxErrW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, RxErr>;
impl<'a, REG> RxErrW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Data input RX_ERRA is selected"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(RxErr::Value1)
    }
    #[doc = "Data input RX_ERRB is selected"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(RxErr::Value2)
    }
    #[doc = "Data input RX_ERRC is selected"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(RxErr::Value3)
    }
    #[doc = "Data input RX_ERRD is selected"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(RxErr::Value4)
    }
}
#[doc = "Port0 MII RX DV Input Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RxDv {
    #[doc = "0: Data input RX_DVA is selected"]
    Value1 = 0,
    #[doc = "1: Data input RX_DVB is selected"]
    Value2 = 1,
    #[doc = "2: Data input RX_DVC is selected"]
    Value3 = 2,
    #[doc = "3: Data input RX_DVD is selected"]
    Value4 = 3,
}
impl From<RxDv> for u8 {
    #[inline(always)]
    fn from(variant: RxDv) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for RxDv {
    type Ux = u8;
}
#[doc = "Field `RX_DV` reader - Port0 MII RX DV Input Select"]
pub type RxDvR = crate::FieldReader<RxDv>;
impl RxDvR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> RxDv {
        match self.bits {
            0 => RxDv::Value1,
            1 => RxDv::Value2,
            2 => RxDv::Value3,
            3 => RxDv::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Data input RX_DVA is selected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == RxDv::Value1
    }
    #[doc = "Data input RX_DVB is selected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == RxDv::Value2
    }
    #[doc = "Data input RX_DVC is selected"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == RxDv::Value3
    }
    #[doc = "Data input RX_DVD is selected"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == RxDv::Value4
    }
}
#[doc = "Field `RX_DV` writer - Port0 MII RX DV Input Select"]
pub type RxDvW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, RxDv>;
impl<'a, REG> RxDvW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Data input RX_DVA is selected"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(RxDv::Value1)
    }
    #[doc = "Data input RX_DVB is selected"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(RxDv::Value2)
    }
    #[doc = "Data input RX_DVC is selected"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(RxDv::Value3)
    }
    #[doc = "Data input RX_DVD is selected"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(RxDv::Value4)
    }
}
#[doc = "Port0 MII RX Clock Input Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RxClk {
    #[doc = "0: Clock input RX_CLKA"]
    Value1 = 0,
    #[doc = "1: Clock input RX_CLKB"]
    Value2 = 1,
    #[doc = "2: Clock input RX_CLKC"]
    Value3 = 2,
    #[doc = "3: Clock input RX_CLKD"]
    Value4 = 3,
}
impl From<RxClk> for u8 {
    #[inline(always)]
    fn from(variant: RxClk) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for RxClk {
    type Ux = u8;
}
#[doc = "Field `RX_CLK` reader - Port0 MII RX Clock Input Select"]
pub type RxClkR = crate::FieldReader<RxClk>;
impl RxClkR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> RxClk {
        match self.bits {
            0 => RxClk::Value1,
            1 => RxClk::Value2,
            2 => RxClk::Value3,
            3 => RxClk::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Clock input RX_CLKA"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == RxClk::Value1
    }
    #[doc = "Clock input RX_CLKB"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == RxClk::Value2
    }
    #[doc = "Clock input RX_CLKC"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == RxClk::Value3
    }
    #[doc = "Clock input RX_CLKD"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == RxClk::Value4
    }
}
#[doc = "Field `RX_CLK` writer - Port0 MII RX Clock Input Select"]
pub type RxClkW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, RxClk>;
impl<'a, REG> RxClkW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Clock input RX_CLKA"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(RxClk::Value1)
    }
    #[doc = "Clock input RX_CLKB"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(RxClk::Value2)
    }
    #[doc = "Clock input RX_CLKC"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(RxClk::Value3)
    }
    #[doc = "Clock input RX_CLKD"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(RxClk::Value4)
    }
}
#[doc = "Port0 PHY Link Input Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Link {
    #[doc = "0: PHY LINKA"]
    Value1 = 0,
    #[doc = "1: PHY LINKB"]
    Value2 = 1,
    #[doc = "2: PHY LINKC"]
    Value3 = 2,
    #[doc = "3: PHY LINKD"]
    Value4 = 3,
}
impl From<Link> for u8 {
    #[inline(always)]
    fn from(variant: Link) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Link {
    type Ux = u8;
}
#[doc = "Field `LINK` reader - Port0 PHY Link Input Select"]
pub type LinkR = crate::FieldReader<Link>;
impl LinkR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Link {
        match self.bits {
            0 => Link::Value1,
            1 => Link::Value2,
            2 => Link::Value3,
            3 => Link::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "PHY LINKA"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Link::Value1
    }
    #[doc = "PHY LINKB"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Link::Value2
    }
    #[doc = "PHY LINKC"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Link::Value3
    }
    #[doc = "PHY LINKD"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Link::Value4
    }
}
#[doc = "Field `LINK` writer - Port0 PHY Link Input Select"]
pub type LinkW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Link>;
impl<'a, REG> LinkW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "PHY LINKA"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Link::Value1)
    }
    #[doc = "PHY LINKB"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Link::Value2)
    }
    #[doc = "PHY LINKC"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Link::Value3)
    }
    #[doc = "PHY LINKD"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Link::Value4)
    }
}
#[doc = "Port0 MII TX Clock Input Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TxClk {
    #[doc = "0: Clock input TX_CLKA"]
    Value1 = 0,
    #[doc = "1: Clock input TX_CLKB"]
    Value2 = 1,
    #[doc = "2: Clock input TX_CLKC"]
    Value3 = 2,
    #[doc = "3: Clock input TX_CLKD"]
    Value4 = 3,
}
impl From<TxClk> for u8 {
    #[inline(always)]
    fn from(variant: TxClk) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for TxClk {
    type Ux = u8;
}
#[doc = "Field `TX_CLK` reader - Port0 MII TX Clock Input Select"]
pub type TxClkR = crate::FieldReader<TxClk>;
impl TxClkR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> TxClk {
        match self.bits {
            0 => TxClk::Value1,
            1 => TxClk::Value2,
            2 => TxClk::Value3,
            3 => TxClk::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Clock input TX_CLKA"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == TxClk::Value1
    }
    #[doc = "Clock input TX_CLKB"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == TxClk::Value2
    }
    #[doc = "Clock input TX_CLKC"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == TxClk::Value3
    }
    #[doc = "Clock input TX_CLKD"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == TxClk::Value4
    }
}
#[doc = "Field `TX_CLK` writer - Port0 MII TX Clock Input Select"]
pub type TxClkW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, TxClk>;
impl<'a, REG> TxClkW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Clock input TX_CLKA"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(TxClk::Value1)
    }
    #[doc = "Clock input TX_CLKB"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(TxClk::Value2)
    }
    #[doc = "Clock input TX_CLKC"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(TxClk::Value3)
    }
    #[doc = "Clock input TX_CLKD"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(TxClk::Value4)
    }
}
#[doc = "Port0 Manual TX Shift configuration\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum TxShift {
    #[doc = "0: 0 ns"]
    Value1 = 0,
    #[doc = "1: 10 ns"]
    Value2 = 1,
    #[doc = "2: 20 ns"]
    Value3 = 2,
    #[doc = "3: 30 ns"]
    Value4 = 3,
}
impl From<TxShift> for u8 {
    #[inline(always)]
    fn from(variant: TxShift) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for TxShift {
    type Ux = u8;
}
#[doc = "Field `TX_SHIFT` reader - Port0 Manual TX Shift configuration"]
pub type TxShiftR = crate::FieldReader<TxShift>;
impl TxShiftR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> TxShift {
        match self.bits {
            0 => TxShift::Value1,
            1 => TxShift::Value2,
            2 => TxShift::Value3,
            3 => TxShift::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "0 ns"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == TxShift::Value1
    }
    #[doc = "10 ns"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == TxShift::Value2
    }
    #[doc = "20 ns"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == TxShift::Value3
    }
    #[doc = "30 ns"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == TxShift::Value4
    }
}
#[doc = "Field `TX_SHIFT` writer - Port0 Manual TX Shift configuration"]
pub type TxShiftW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, TxShift>;
impl<'a, REG> TxShiftW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "0 ns"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(TxShift::Value1)
    }
    #[doc = "10 ns"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(TxShift::Value2)
    }
    #[doc = "20 ns"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(TxShift::Value3)
    }
    #[doc = "30 ns"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(TxShift::Value4)
    }
}
impl R {
    #[doc = "Bits 0:1 - PORT0 Receive Input 0 Select"]
    #[inline(always)]
    pub fn rxd0(&self) -> Rxd0R {
        Rxd0R::new((self.bits & 3) as u8)
    }
    #[doc = "Bits 2:3 - Port0 Receive Input 1 Select"]
    #[inline(always)]
    pub fn rxd1(&self) -> Rxd1R {
        Rxd1R::new(((self.bits >> 2) & 3) as u8)
    }
    #[doc = "Bits 4:5 - Port0 Receive Input 2 Select"]
    #[inline(always)]
    pub fn rxd2(&self) -> Rxd2R {
        Rxd2R::new(((self.bits >> 4) & 3) as u8)
    }
    #[doc = "Bits 6:7 - Port0 Receive Input 3 Select"]
    #[inline(always)]
    pub fn rxd3(&self) -> Rxd3R {
        Rxd3R::new(((self.bits >> 6) & 3) as u8)
    }
    #[doc = "Bits 8:9 - Port0 MII RX ERROR Input Select"]
    #[inline(always)]
    pub fn rx_err(&self) -> RxErrR {
        RxErrR::new(((self.bits >> 8) & 3) as u8)
    }
    #[doc = "Bits 10:11 - Port0 MII RX DV Input Select"]
    #[inline(always)]
    pub fn rx_dv(&self) -> RxDvR {
        RxDvR::new(((self.bits >> 10) & 3) as u8)
    }
    #[doc = "Bits 12:13 - Port0 MII RX Clock Input Select"]
    #[inline(always)]
    pub fn rx_clk(&self) -> RxClkR {
        RxClkR::new(((self.bits >> 12) & 3) as u8)
    }
    #[doc = "Bits 16:17 - Port0 PHY Link Input Select"]
    #[inline(always)]
    pub fn link(&self) -> LinkR {
        LinkR::new(((self.bits >> 16) & 3) as u8)
    }
    #[doc = "Bits 28:29 - Port0 MII TX Clock Input Select"]
    #[inline(always)]
    pub fn tx_clk(&self) -> TxClkR {
        TxClkR::new(((self.bits >> 28) & 3) as u8)
    }
    #[doc = "Bits 30:31 - Port0 Manual TX Shift configuration"]
    #[inline(always)]
    pub fn tx_shift(&self) -> TxShiftR {
        TxShiftR::new(((self.bits >> 30) & 3) as u8)
    }
}
impl W {
    #[doc = "Bits 0:1 - PORT0 Receive Input 0 Select"]
    #[inline(always)]
    #[must_use]
    pub fn rxd0(&mut self) -> Rxd0W<Conp0Spec> {
        Rxd0W::new(self, 0)
    }
    #[doc = "Bits 2:3 - Port0 Receive Input 1 Select"]
    #[inline(always)]
    #[must_use]
    pub fn rxd1(&mut self) -> Rxd1W<Conp0Spec> {
        Rxd1W::new(self, 2)
    }
    #[doc = "Bits 4:5 - Port0 Receive Input 2 Select"]
    #[inline(always)]
    #[must_use]
    pub fn rxd2(&mut self) -> Rxd2W<Conp0Spec> {
        Rxd2W::new(self, 4)
    }
    #[doc = "Bits 6:7 - Port0 Receive Input 3 Select"]
    #[inline(always)]
    #[must_use]
    pub fn rxd3(&mut self) -> Rxd3W<Conp0Spec> {
        Rxd3W::new(self, 6)
    }
    #[doc = "Bits 8:9 - Port0 MII RX ERROR Input Select"]
    #[inline(always)]
    #[must_use]
    pub fn rx_err(&mut self) -> RxErrW<Conp0Spec> {
        RxErrW::new(self, 8)
    }
    #[doc = "Bits 10:11 - Port0 MII RX DV Input Select"]
    #[inline(always)]
    #[must_use]
    pub fn rx_dv(&mut self) -> RxDvW<Conp0Spec> {
        RxDvW::new(self, 10)
    }
    #[doc = "Bits 12:13 - Port0 MII RX Clock Input Select"]
    #[inline(always)]
    #[must_use]
    pub fn rx_clk(&mut self) -> RxClkW<Conp0Spec> {
        RxClkW::new(self, 12)
    }
    #[doc = "Bits 16:17 - Port0 PHY Link Input Select"]
    #[inline(always)]
    #[must_use]
    pub fn link(&mut self) -> LinkW<Conp0Spec> {
        LinkW::new(self, 16)
    }
    #[doc = "Bits 28:29 - Port0 MII TX Clock Input Select"]
    #[inline(always)]
    #[must_use]
    pub fn tx_clk(&mut self) -> TxClkW<Conp0Spec> {
        TxClkW::new(self, 28)
    }
    #[doc = "Bits 30:31 - Port0 Manual TX Shift configuration"]
    #[inline(always)]
    #[must_use]
    pub fn tx_shift(&mut self) -> TxShiftW<Conp0Spec> {
        TxShiftW::new(self, 30)
    }
}
#[doc = "EtherCAT 0 Port 1 Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`conp0::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`conp0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Conp0Spec;
impl crate::RegisterSpec for Conp0Spec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`conp0::R`](R) reader structure"]
impl crate::Readable for Conp0Spec {}
#[doc = "`write(|w| ..)` method takes [`conp0::W`](W) writer structure"]
impl crate::Writable for Conp0Spec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets CONP0 to value 0"]
impl crate::Resettable for Conp0Spec {
    const RESET_VALUE: u32 = 0;
}