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
#[doc = "Register `RBCTR` reader"]
pub type R = crate::R<RbctrSpec>;
#[doc = "Register `RBCTR` writer"]
pub type W = crate::W<RbctrSpec>;
#[doc = "Field `DPTR` writer - Data Pointer"]
pub type DptrW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
#[doc = "Field `LIMIT` reader - Limit For Interrupt Generation"]
pub type LimitR = crate::FieldReader;
#[doc = "Field `LIMIT` writer - Limit For Interrupt Generation"]
pub type LimitW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
#[doc = "Standard Receive Buffer Trigger Mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Srbtm {
    #[doc = "0: Trigger mode 0: While TRBSR.SRBT=1, a standard receive buffer event will be generated whenever there is a new data received or data read out (depending on RBCTR.LOF setting). SRBT is cleared when TRBSR.RBFLVL=RBCTR.LIMIT."]
    Value1 = 0,
    #[doc = "1: Trigger mode 1: While TRBSR.SRBT=1, a standard receive buffer event will be generated whenever there is a new data received or data read out (depending on RBCTR.LOF setting). SRBT is cleared when TRBSR.RBFLVL=0."]
    Value2 = 1,
}
impl From<Srbtm> for bool {
    #[inline(always)]
    fn from(variant: Srbtm) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SRBTM` reader - Standard Receive Buffer Trigger Mode"]
pub type SrbtmR = crate::BitReader<Srbtm>;
impl SrbtmR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Srbtm {
        match self.bits {
            false => Srbtm::Value1,
            true => Srbtm::Value2,
        }
    }
    #[doc = "Trigger mode 0: While TRBSR.SRBT=1, a standard receive buffer event will be generated whenever there is a new data received or data read out (depending on RBCTR.LOF setting). SRBT is cleared when TRBSR.RBFLVL=RBCTR.LIMIT."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Srbtm::Value1
    }
    #[doc = "Trigger mode 1: While TRBSR.SRBT=1, a standard receive buffer event will be generated whenever there is a new data received or data read out (depending on RBCTR.LOF setting). SRBT is cleared when TRBSR.RBFLVL=0."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Srbtm::Value2
    }
}
#[doc = "Field `SRBTM` writer - Standard Receive Buffer Trigger Mode"]
pub type SrbtmW<'a, REG> = crate::BitWriter<'a, REG, Srbtm>;
impl<'a, REG> SrbtmW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Trigger mode 0: While TRBSR.SRBT=1, a standard receive buffer event will be generated whenever there is a new data received or data read out (depending on RBCTR.LOF setting). SRBT is cleared when TRBSR.RBFLVL=RBCTR.LIMIT."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Srbtm::Value1)
    }
    #[doc = "Trigger mode 1: While TRBSR.SRBT=1, a standard receive buffer event will be generated whenever there is a new data received or data read out (depending on RBCTR.LOF setting). SRBT is cleared when TRBSR.RBFLVL=0."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Srbtm::Value2)
    }
}
#[doc = "Standard Receive Buffer Trigger Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Srbten {
    #[doc = "0: The standard receive buffer event trigger through bit TRBSR.SRBT is disabled."]
    Value1 = 0,
    #[doc = "1: The standard receive buffer event trigger through bit TRBSR.SRBT is enabled."]
    Value2 = 1,
}
impl From<Srbten> for bool {
    #[inline(always)]
    fn from(variant: Srbten) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SRBTEN` reader - Standard Receive Buffer Trigger Enable"]
pub type SrbtenR = crate::BitReader<Srbten>;
impl SrbtenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Srbten {
        match self.bits {
            false => Srbten::Value1,
            true => Srbten::Value2,
        }
    }
    #[doc = "The standard receive buffer event trigger through bit TRBSR.SRBT is disabled."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Srbten::Value1
    }
    #[doc = "The standard receive buffer event trigger through bit TRBSR.SRBT is enabled."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Srbten::Value2
    }
}
#[doc = "Field `SRBTEN` writer - Standard Receive Buffer Trigger Enable"]
pub type SrbtenW<'a, REG> = crate::BitWriter<'a, REG, Srbten>;
impl<'a, REG> SrbtenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "The standard receive buffer event trigger through bit TRBSR.SRBT is disabled."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Srbten::Value1)
    }
    #[doc = "The standard receive buffer event trigger through bit TRBSR.SRBT is enabled."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Srbten::Value2)
    }
}
#[doc = "Standard Receive Buffer Interrupt Node Pointer\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Srbinp {
    #[doc = "0: Output SR0 becomes activated."]
    Value1 = 0,
    #[doc = "1: Output SR1 becomes activated."]
    Value2 = 1,
    #[doc = "2: Output SR2 becomes activated."]
    Value3 = 2,
    #[doc = "3: Output SR3 becomes activated."]
    Value4 = 3,
    #[doc = "4: Output SR4 becomes activated."]
    Value5 = 4,
    #[doc = "5: Output SR5 becomes activated."]
    Value6 = 5,
}
impl From<Srbinp> for u8 {
    #[inline(always)]
    fn from(variant: Srbinp) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Srbinp {
    type Ux = u8;
}
#[doc = "Field `SRBINP` reader - Standard Receive Buffer Interrupt Node Pointer"]
pub type SrbinpR = crate::FieldReader<Srbinp>;
impl SrbinpR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Srbinp> {
        match self.bits {
            0 => Some(Srbinp::Value1),
            1 => Some(Srbinp::Value2),
            2 => Some(Srbinp::Value3),
            3 => Some(Srbinp::Value4),
            4 => Some(Srbinp::Value5),
            5 => Some(Srbinp::Value6),
            _ => None,
        }
    }
    #[doc = "Output SR0 becomes activated."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Srbinp::Value1
    }
    #[doc = "Output SR1 becomes activated."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Srbinp::Value2
    }
    #[doc = "Output SR2 becomes activated."]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Srbinp::Value3
    }
    #[doc = "Output SR3 becomes activated."]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Srbinp::Value4
    }
    #[doc = "Output SR4 becomes activated."]
    #[inline(always)]
    pub fn is_value5(&self) -> bool {
        *self == Srbinp::Value5
    }
    #[doc = "Output SR5 becomes activated."]
    #[inline(always)]
    pub fn is_value6(&self) -> bool {
        *self == Srbinp::Value6
    }
}
#[doc = "Field `SRBINP` writer - Standard Receive Buffer Interrupt Node Pointer"]
pub type SrbinpW<'a, REG> = crate::FieldWriter<'a, REG, 3, Srbinp>;
impl<'a, REG> SrbinpW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Output SR0 becomes activated."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Srbinp::Value1)
    }
    #[doc = "Output SR1 becomes activated."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Srbinp::Value2)
    }
    #[doc = "Output SR2 becomes activated."]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Srbinp::Value3)
    }
    #[doc = "Output SR3 becomes activated."]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Srbinp::Value4)
    }
    #[doc = "Output SR4 becomes activated."]
    #[inline(always)]
    pub fn value5(self) -> &'a mut crate::W<REG> {
        self.variant(Srbinp::Value5)
    }
    #[doc = "Output SR5 becomes activated."]
    #[inline(always)]
    pub fn value6(self) -> &'a mut crate::W<REG> {
        self.variant(Srbinp::Value6)
    }
}
#[doc = "Alternative Receive Buffer Interrupt Node Pointer\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Arbinp {
    #[doc = "0: Output SR0 becomes activated."]
    Value1 = 0,
    #[doc = "1: Output SR1 becomes activated."]
    Value2 = 1,
    #[doc = "2: Output SR2 becomes activated."]
    Value3 = 2,
    #[doc = "3: Output SR3 becomes activated."]
    Value4 = 3,
    #[doc = "4: Output SR4 becomes activated."]
    Value5 = 4,
    #[doc = "5: Output SR5 becomes activated."]
    Value6 = 5,
}
impl From<Arbinp> for u8 {
    #[inline(always)]
    fn from(variant: Arbinp) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Arbinp {
    type Ux = u8;
}
#[doc = "Field `ARBINP` reader - Alternative Receive Buffer Interrupt Node Pointer"]
pub type ArbinpR = crate::FieldReader<Arbinp>;
impl ArbinpR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Arbinp> {
        match self.bits {
            0 => Some(Arbinp::Value1),
            1 => Some(Arbinp::Value2),
            2 => Some(Arbinp::Value3),
            3 => Some(Arbinp::Value4),
            4 => Some(Arbinp::Value5),
            5 => Some(Arbinp::Value6),
            _ => None,
        }
    }
    #[doc = "Output SR0 becomes activated."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Arbinp::Value1
    }
    #[doc = "Output SR1 becomes activated."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Arbinp::Value2
    }
    #[doc = "Output SR2 becomes activated."]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Arbinp::Value3
    }
    #[doc = "Output SR3 becomes activated."]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Arbinp::Value4
    }
    #[doc = "Output SR4 becomes activated."]
    #[inline(always)]
    pub fn is_value5(&self) -> bool {
        *self == Arbinp::Value5
    }
    #[doc = "Output SR5 becomes activated."]
    #[inline(always)]
    pub fn is_value6(&self) -> bool {
        *self == Arbinp::Value6
    }
}
#[doc = "Field `ARBINP` writer - Alternative Receive Buffer Interrupt Node Pointer"]
pub type ArbinpW<'a, REG> = crate::FieldWriter<'a, REG, 3, Arbinp>;
impl<'a, REG> ArbinpW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Output SR0 becomes activated."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Arbinp::Value1)
    }
    #[doc = "Output SR1 becomes activated."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Arbinp::Value2)
    }
    #[doc = "Output SR2 becomes activated."]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Arbinp::Value3)
    }
    #[doc = "Output SR3 becomes activated."]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Arbinp::Value4)
    }
    #[doc = "Output SR4 becomes activated."]
    #[inline(always)]
    pub fn value5(self) -> &'a mut crate::W<REG> {
        self.variant(Arbinp::Value5)
    }
    #[doc = "Output SR5 becomes activated."]
    #[inline(always)]
    pub fn value6(self) -> &'a mut crate::W<REG> {
        self.variant(Arbinp::Value6)
    }
}
#[doc = "Receiver Control Information Mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Rcim {
    #[doc = "0: RCI\\[4\\]
= PERR, RCI\\[3:0\\]
= WLEN"]
    Value1 = 0,
    #[doc = "1: RCI\\[4\\]
= SOF, RCI\\[3:0\\]
= WLEN"]
    Value2 = 1,
    #[doc = "2: RCI\\[4\\]
= 0, RCI\\[3:0\\]
= WLEN"]
    Value3 = 2,
    #[doc = "3: RCI\\[4\\]
= PERR, RCI\\[3\\]
= PAR, RCI\\[2:1\\]
= 00B, RCI\\[0\\]
= SOF"]
    Value4 = 3,
}
impl From<Rcim> for u8 {
    #[inline(always)]
    fn from(variant: Rcim) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Rcim {
    type Ux = u8;
}
#[doc = "Field `RCIM` reader - Receiver Control Information Mode"]
pub type RcimR = crate::FieldReader<Rcim>;
impl RcimR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rcim {
        match self.bits {
            0 => Rcim::Value1,
            1 => Rcim::Value2,
            2 => Rcim::Value3,
            3 => Rcim::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "RCI\\[4\\]
= PERR, RCI\\[3:0\\]
= WLEN"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Rcim::Value1
    }
    #[doc = "RCI\\[4\\]
= SOF, RCI\\[3:0\\]
= WLEN"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Rcim::Value2
    }
    #[doc = "RCI\\[4\\]
= 0, RCI\\[3:0\\]
= WLEN"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Rcim::Value3
    }
    #[doc = "RCI\\[4\\]
= PERR, RCI\\[3\\]
= PAR, RCI\\[2:1\\]
= 00B, RCI\\[0\\]
= SOF"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Rcim::Value4
    }
}
#[doc = "Field `RCIM` writer - Receiver Control Information Mode"]
pub type RcimW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Rcim>;
impl<'a, REG> RcimW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "RCI\\[4\\]
= PERR, RCI\\[3:0\\]
= WLEN"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Rcim::Value1)
    }
    #[doc = "RCI\\[4\\]
= SOF, RCI\\[3:0\\]
= WLEN"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Rcim::Value2)
    }
    #[doc = "RCI\\[4\\]
= 0, RCI\\[3:0\\]
= WLEN"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Rcim::Value3)
    }
    #[doc = "RCI\\[4\\]
= PERR, RCI\\[3\\]
= PAR, RCI\\[2:1\\]
= 00B, RCI\\[0\\]
= SOF"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Rcim::Value4)
    }
}
#[doc = "Buffer Size\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Size {
    #[doc = "0: The FIFO mechanism is disabled. The buffer does not accept any request for data."]
    Value1 = 0,
    #[doc = "1: The FIFO buffer contains 2 entries."]
    Value2 = 1,
    #[doc = "2: The FIFO buffer contains 4 entries."]
    Value3 = 2,
    #[doc = "3: The FIFO buffer contains 8 entries."]
    Value4 = 3,
    #[doc = "4: The FIFO buffer contains 16 entries."]
    Value5 = 4,
    #[doc = "5: The FIFO buffer contains 32 entries."]
    Value6 = 5,
    #[doc = "6: The FIFO buffer contains 64 entries."]
    Value7 = 6,
}
impl From<Size> for u8 {
    #[inline(always)]
    fn from(variant: Size) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Size {
    type Ux = u8;
}
#[doc = "Field `SIZE` reader - Buffer Size"]
pub type SizeR = crate::FieldReader<Size>;
impl SizeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Size> {
        match self.bits {
            0 => Some(Size::Value1),
            1 => Some(Size::Value2),
            2 => Some(Size::Value3),
            3 => Some(Size::Value4),
            4 => Some(Size::Value5),
            5 => Some(Size::Value6),
            6 => Some(Size::Value7),
            _ => None,
        }
    }
    #[doc = "The FIFO mechanism is disabled. The buffer does not accept any request for data."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Size::Value1
    }
    #[doc = "The FIFO buffer contains 2 entries."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Size::Value2
    }
    #[doc = "The FIFO buffer contains 4 entries."]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Size::Value3
    }
    #[doc = "The FIFO buffer contains 8 entries."]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Size::Value4
    }
    #[doc = "The FIFO buffer contains 16 entries."]
    #[inline(always)]
    pub fn is_value5(&self) -> bool {
        *self == Size::Value5
    }
    #[doc = "The FIFO buffer contains 32 entries."]
    #[inline(always)]
    pub fn is_value6(&self) -> bool {
        *self == Size::Value6
    }
    #[doc = "The FIFO buffer contains 64 entries."]
    #[inline(always)]
    pub fn is_value7(&self) -> bool {
        *self == Size::Value7
    }
}
#[doc = "Field `SIZE` writer - Buffer Size"]
pub type SizeW<'a, REG> = crate::FieldWriter<'a, REG, 3, Size>;
impl<'a, REG> SizeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "The FIFO mechanism is disabled. The buffer does not accept any request for data."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Size::Value1)
    }
    #[doc = "The FIFO buffer contains 2 entries."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Size::Value2)
    }
    #[doc = "The FIFO buffer contains 4 entries."]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Size::Value3)
    }
    #[doc = "The FIFO buffer contains 8 entries."]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Size::Value4)
    }
    #[doc = "The FIFO buffer contains 16 entries."]
    #[inline(always)]
    pub fn value5(self) -> &'a mut crate::W<REG> {
        self.variant(Size::Value5)
    }
    #[doc = "The FIFO buffer contains 32 entries."]
    #[inline(always)]
    pub fn value6(self) -> &'a mut crate::W<REG> {
        self.variant(Size::Value6)
    }
    #[doc = "The FIFO buffer contains 64 entries."]
    #[inline(always)]
    pub fn value7(self) -> &'a mut crate::W<REG> {
        self.variant(Size::Value7)
    }
}
#[doc = "Receiver Notification Mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Rnm {
    #[doc = "0: Filling level mode: A standard receive buffer event occurs when the filling level equals the limit value and changes, either due to a read access from OUTR (LOF = 0) or due to a new received data word (LOF = 1)."]
    Value1 = 0,
    #[doc = "1: RCI mode: A standard receive buffer event occurs when register OUTR is updated with a new value if the corresponding value in OUTR.RCI\\[4\\]
= 0. If OUTR.RCI\\[4\\]
= 1, an alternative receive buffer event occurs instead of the standard receive buffer event."]
    Value2 = 1,
}
impl From<Rnm> for bool {
    #[inline(always)]
    fn from(variant: Rnm) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RNM` reader - Receiver Notification Mode"]
pub type RnmR = crate::BitReader<Rnm>;
impl RnmR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rnm {
        match self.bits {
            false => Rnm::Value1,
            true => Rnm::Value2,
        }
    }
    #[doc = "Filling level mode: A standard receive buffer event occurs when the filling level equals the limit value and changes, either due to a read access from OUTR (LOF = 0) or due to a new received data word (LOF = 1)."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Rnm::Value1
    }
    #[doc = "RCI mode: A standard receive buffer event occurs when register OUTR is updated with a new value if the corresponding value in OUTR.RCI\\[4\\]
= 0. If OUTR.RCI\\[4\\]
= 1, an alternative receive buffer event occurs instead of the standard receive buffer event."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Rnm::Value2
    }
}
#[doc = "Field `RNM` writer - Receiver Notification Mode"]
pub type RnmW<'a, REG> = crate::BitWriter<'a, REG, Rnm>;
impl<'a, REG> RnmW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Filling level mode: A standard receive buffer event occurs when the filling level equals the limit value and changes, either due to a read access from OUTR (LOF = 0) or due to a new received data word (LOF = 1)."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Rnm::Value1)
    }
    #[doc = "RCI mode: A standard receive buffer event occurs when register OUTR is updated with a new value if the corresponding value in OUTR.RCI\\[4\\]
= 0. If OUTR.RCI\\[4\\]
= 1, an alternative receive buffer event occurs instead of the standard receive buffer event."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Rnm::Value2)
    }
}
#[doc = "Buffer Event on Limit Overflow\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lof {
    #[doc = "0: A standard receive buffer event occurs when the filling level equals the limit value and gets lower due to a read access from OUTR."]
    Value1 = 0,
    #[doc = "1: A standard receive buffer event occurs when the filling level equals the limit value and gets bigger due to the reception of a new data word."]
    Value2 = 1,
}
impl From<Lof> for bool {
    #[inline(always)]
    fn from(variant: Lof) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LOF` reader - Buffer Event on Limit Overflow"]
pub type LofR = crate::BitReader<Lof>;
impl LofR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lof {
        match self.bits {
            false => Lof::Value1,
            true => Lof::Value2,
        }
    }
    #[doc = "A standard receive buffer event occurs when the filling level equals the limit value and gets lower due to a read access from OUTR."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Lof::Value1
    }
    #[doc = "A standard receive buffer event occurs when the filling level equals the limit value and gets bigger due to the reception of a new data word."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Lof::Value2
    }
}
#[doc = "Field `LOF` writer - Buffer Event on Limit Overflow"]
pub type LofW<'a, REG> = crate::BitWriter<'a, REG, Lof>;
impl<'a, REG> LofW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "A standard receive buffer event occurs when the filling level equals the limit value and gets lower due to a read access from OUTR."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Lof::Value1)
    }
    #[doc = "A standard receive buffer event occurs when the filling level equals the limit value and gets bigger due to the reception of a new data word."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Lof::Value2)
    }
}
#[doc = "Alternative Receive Buffer Interrupt Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Arbien {
    #[doc = "0: The alternative receive buffer interrupt generation is disabled."]
    Value1 = 0,
    #[doc = "1: The alternative receive buffer interrupt generation is enabled."]
    Value2 = 1,
}
impl From<Arbien> for bool {
    #[inline(always)]
    fn from(variant: Arbien) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ARBIEN` reader - Alternative Receive Buffer Interrupt Enable"]
pub type ArbienR = crate::BitReader<Arbien>;
impl ArbienR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Arbien {
        match self.bits {
            false => Arbien::Value1,
            true => Arbien::Value2,
        }
    }
    #[doc = "The alternative receive buffer interrupt generation is disabled."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Arbien::Value1
    }
    #[doc = "The alternative receive buffer interrupt generation is enabled."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Arbien::Value2
    }
}
#[doc = "Field `ARBIEN` writer - Alternative Receive Buffer Interrupt Enable"]
pub type ArbienW<'a, REG> = crate::BitWriter<'a, REG, Arbien>;
impl<'a, REG> ArbienW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "The alternative receive buffer interrupt generation is disabled."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Arbien::Value1)
    }
    #[doc = "The alternative receive buffer interrupt generation is enabled."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Arbien::Value2)
    }
}
#[doc = "Standard Receive Buffer Interrupt Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Srbien {
    #[doc = "0: The standard receive buffer interrupt generation is disabled."]
    Value1 = 0,
    #[doc = "1: The standard receive buffer interrupt generation is enabled."]
    Value2 = 1,
}
impl From<Srbien> for bool {
    #[inline(always)]
    fn from(variant: Srbien) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SRBIEN` reader - Standard Receive Buffer Interrupt Enable"]
pub type SrbienR = crate::BitReader<Srbien>;
impl SrbienR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Srbien {
        match self.bits {
            false => Srbien::Value1,
            true => Srbien::Value2,
        }
    }
    #[doc = "The standard receive buffer interrupt generation is disabled."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Srbien::Value1
    }
    #[doc = "The standard receive buffer interrupt generation is enabled."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Srbien::Value2
    }
}
#[doc = "Field `SRBIEN` writer - Standard Receive Buffer Interrupt Enable"]
pub type SrbienW<'a, REG> = crate::BitWriter<'a, REG, Srbien>;
impl<'a, REG> SrbienW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "The standard receive buffer interrupt generation is disabled."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Srbien::Value1)
    }
    #[doc = "The standard receive buffer interrupt generation is enabled."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Srbien::Value2)
    }
}
#[doc = "Receive Buffer Error Interrupt Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Rberien {
    #[doc = "0: The receive buffer error interrupt generation is disabled."]
    Value1 = 0,
    #[doc = "1: The receive buffer error interrupt generation is enabled."]
    Value2 = 1,
}
impl From<Rberien> for bool {
    #[inline(always)]
    fn from(variant: Rberien) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RBERIEN` reader - Receive Buffer Error Interrupt Enable"]
pub type RberienR = crate::BitReader<Rberien>;
impl RberienR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rberien {
        match self.bits {
            false => Rberien::Value1,
            true => Rberien::Value2,
        }
    }
    #[doc = "The receive buffer error interrupt generation is disabled."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Rberien::Value1
    }
    #[doc = "The receive buffer error interrupt generation is enabled."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Rberien::Value2
    }
}
#[doc = "Field `RBERIEN` writer - Receive Buffer Error Interrupt Enable"]
pub type RberienW<'a, REG> = crate::BitWriter<'a, REG, Rberien>;
impl<'a, REG> RberienW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "The receive buffer error interrupt generation is disabled."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Rberien::Value1)
    }
    #[doc = "The receive buffer error interrupt generation is enabled."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Rberien::Value2)
    }
}
impl R {
    #[doc = "Bits 8:13 - Limit For Interrupt Generation"]
    #[inline(always)]
    pub fn limit(&self) -> LimitR {
        LimitR::new(((self.bits >> 8) & 0x3f) as u8)
    }
    #[doc = "Bit 14 - Standard Receive Buffer Trigger Mode"]
    #[inline(always)]
    pub fn srbtm(&self) -> SrbtmR {
        SrbtmR::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 15 - Standard Receive Buffer Trigger Enable"]
    #[inline(always)]
    pub fn srbten(&self) -> SrbtenR {
        SrbtenR::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bits 16:18 - Standard Receive Buffer Interrupt Node Pointer"]
    #[inline(always)]
    pub fn srbinp(&self) -> SrbinpR {
        SrbinpR::new(((self.bits >> 16) & 7) as u8)
    }
    #[doc = "Bits 19:21 - Alternative Receive Buffer Interrupt Node Pointer"]
    #[inline(always)]
    pub fn arbinp(&self) -> ArbinpR {
        ArbinpR::new(((self.bits >> 19) & 7) as u8)
    }
    #[doc = "Bits 22:23 - Receiver Control Information Mode"]
    #[inline(always)]
    pub fn rcim(&self) -> RcimR {
        RcimR::new(((self.bits >> 22) & 3) as u8)
    }
    #[doc = "Bits 24:26 - Buffer Size"]
    #[inline(always)]
    pub fn size(&self) -> SizeR {
        SizeR::new(((self.bits >> 24) & 7) as u8)
    }
    #[doc = "Bit 27 - Receiver Notification Mode"]
    #[inline(always)]
    pub fn rnm(&self) -> RnmR {
        RnmR::new(((self.bits >> 27) & 1) != 0)
    }
    #[doc = "Bit 28 - Buffer Event on Limit Overflow"]
    #[inline(always)]
    pub fn lof(&self) -> LofR {
        LofR::new(((self.bits >> 28) & 1) != 0)
    }
    #[doc = "Bit 29 - Alternative Receive Buffer Interrupt Enable"]
    #[inline(always)]
    pub fn arbien(&self) -> ArbienR {
        ArbienR::new(((self.bits >> 29) & 1) != 0)
    }
    #[doc = "Bit 30 - Standard Receive Buffer Interrupt Enable"]
    #[inline(always)]
    pub fn srbien(&self) -> SrbienR {
        SrbienR::new(((self.bits >> 30) & 1) != 0)
    }
    #[doc = "Bit 31 - Receive Buffer Error Interrupt Enable"]
    #[inline(always)]
    pub fn rberien(&self) -> RberienR {
        RberienR::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:5 - Data Pointer"]
    #[inline(always)]
    #[must_use]
    pub fn dptr(&mut self) -> DptrW<RbctrSpec> {
        DptrW::new(self, 0)
    }
    #[doc = "Bits 8:13 - Limit For Interrupt Generation"]
    #[inline(always)]
    #[must_use]
    pub fn limit(&mut self) -> LimitW<RbctrSpec> {
        LimitW::new(self, 8)
    }
    #[doc = "Bit 14 - Standard Receive Buffer Trigger Mode"]
    #[inline(always)]
    #[must_use]
    pub fn srbtm(&mut self) -> SrbtmW<RbctrSpec> {
        SrbtmW::new(self, 14)
    }
    #[doc = "Bit 15 - Standard Receive Buffer Trigger Enable"]
    #[inline(always)]
    #[must_use]
    pub fn srbten(&mut self) -> SrbtenW<RbctrSpec> {
        SrbtenW::new(self, 15)
    }
    #[doc = "Bits 16:18 - Standard Receive Buffer Interrupt Node Pointer"]
    #[inline(always)]
    #[must_use]
    pub fn srbinp(&mut self) -> SrbinpW<RbctrSpec> {
        SrbinpW::new(self, 16)
    }
    #[doc = "Bits 19:21 - Alternative Receive Buffer Interrupt Node Pointer"]
    #[inline(always)]
    #[must_use]
    pub fn arbinp(&mut self) -> ArbinpW<RbctrSpec> {
        ArbinpW::new(self, 19)
    }
    #[doc = "Bits 22:23 - Receiver Control Information Mode"]
    #[inline(always)]
    #[must_use]
    pub fn rcim(&mut self) -> RcimW<RbctrSpec> {
        RcimW::new(self, 22)
    }
    #[doc = "Bits 24:26 - Buffer Size"]
    #[inline(always)]
    #[must_use]
    pub fn size(&mut self) -> SizeW<RbctrSpec> {
        SizeW::new(self, 24)
    }
    #[doc = "Bit 27 - Receiver Notification Mode"]
    #[inline(always)]
    #[must_use]
    pub fn rnm(&mut self) -> RnmW<RbctrSpec> {
        RnmW::new(self, 27)
    }
    #[doc = "Bit 28 - Buffer Event on Limit Overflow"]
    #[inline(always)]
    #[must_use]
    pub fn lof(&mut self) -> LofW<RbctrSpec> {
        LofW::new(self, 28)
    }
    #[doc = "Bit 29 - Alternative Receive Buffer Interrupt Enable"]
    #[inline(always)]
    #[must_use]
    pub fn arbien(&mut self) -> ArbienW<RbctrSpec> {
        ArbienW::new(self, 29)
    }
    #[doc = "Bit 30 - Standard Receive Buffer Interrupt Enable"]
    #[inline(always)]
    #[must_use]
    pub fn srbien(&mut self) -> SrbienW<RbctrSpec> {
        SrbienW::new(self, 30)
    }
    #[doc = "Bit 31 - Receive Buffer Error Interrupt Enable"]
    #[inline(always)]
    #[must_use]
    pub fn rberien(&mut self) -> RberienW<RbctrSpec> {
        RberienW::new(self, 31)
    }
}
#[doc = "Receiver Buffer Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbctr::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 [`rbctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct RbctrSpec;
impl crate::RegisterSpec for RbctrSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`rbctr::R`](R) reader structure"]
impl crate::Readable for RbctrSpec {}
#[doc = "`write(|w| ..)` method takes [`rbctr::W`](W) writer structure"]
impl crate::Writable for RbctrSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets RBCTR to value 0"]
impl crate::Resettable for RbctrSpec {
    const RESET_VALUE: u32 = 0;
}