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
#[doc = "Register `MR` reader"]
pub struct R(crate::R<MR_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<MR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<MR_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<MR_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `MR` writer"]
pub struct W(crate::W<MR_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<MR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<MR_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<MR_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `MODE` reader - Master/Slave/Controller Mode"]
pub type MODE_R = crate::BitReader<MODESELECT_A>;
#[doc = "Master/Slave/Controller Mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MODESELECT_A {
    #[doc = "0: Slave mode (only serial data handled, clocks received from external master or controller)"]
    SLAVE = 0,
    #[doc = "1: Master mode (clocks generated and output by IISC, serial data handled if CR.RXEN and/or CR.TXEN written to 1)"]
    MASTER = 1,
}
impl From<MODESELECT_A> for bool {
    #[inline(always)]
    fn from(variant: MODESELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl MODE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> MODESELECT_A {
        match self.bits {
            false => MODESELECT_A::SLAVE,
            true => MODESELECT_A::MASTER,
        }
    }
    #[doc = "Checks if the value of the field is `SLAVE`"]
    #[inline(always)]
    pub fn is_slave(&self) -> bool {
        *self == MODESELECT_A::SLAVE
    }
    #[doc = "Checks if the value of the field is `MASTER`"]
    #[inline(always)]
    pub fn is_master(&self) -> bool {
        *self == MODESELECT_A::MASTER
    }
}
#[doc = "Field `MODE` writer - Master/Slave/Controller Mode"]
pub type MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, MODESELECT_A, O>;
impl<'a, const O: u8> MODE_W<'a, O> {
    #[doc = "Slave mode (only serial data handled, clocks received from external master or controller)"]
    #[inline(always)]
    pub fn slave(self) -> &'a mut W {
        self.variant(MODESELECT_A::SLAVE)
    }
    #[doc = "Master mode (clocks generated and output by IISC, serial data handled if CR.RXEN and/or CR.TXEN written to 1)"]
    #[inline(always)]
    pub fn master(self) -> &'a mut W {
        self.variant(MODESELECT_A::MASTER)
    }
}
#[doc = "Field `DATALENGTH` reader - Data Word Length"]
pub type DATALENGTH_R = crate::FieldReader<u8, DATALENGTHSELECT_A>;
#[doc = "Data Word Length\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DATALENGTHSELECT_A {
    #[doc = "0: 32 bits"]
    _32 = 0,
    #[doc = "1: 24 bits"]
    _24 = 1,
    #[doc = "2: 20 bits"]
    _20 = 2,
    #[doc = "3: 18 bits"]
    _18 = 3,
    #[doc = "4: 16 bits"]
    _16 = 4,
    #[doc = "5: 16 bits compact stereo"]
    _16C = 5,
    #[doc = "6: 8 bits"]
    _8 = 6,
    #[doc = "7: 8 bits compact stereo"]
    _8C = 7,
}
impl From<DATALENGTHSELECT_A> for u8 {
    #[inline(always)]
    fn from(variant: DATALENGTHSELECT_A) -> Self {
        variant as _
    }
}
impl DATALENGTH_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DATALENGTHSELECT_A {
        match self.bits {
            0 => DATALENGTHSELECT_A::_32,
            1 => DATALENGTHSELECT_A::_24,
            2 => DATALENGTHSELECT_A::_20,
            3 => DATALENGTHSELECT_A::_18,
            4 => DATALENGTHSELECT_A::_16,
            5 => DATALENGTHSELECT_A::_16C,
            6 => DATALENGTHSELECT_A::_8,
            7 => DATALENGTHSELECT_A::_8C,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_32`"]
    #[inline(always)]
    pub fn is_32(&self) -> bool {
        *self == DATALENGTHSELECT_A::_32
    }
    #[doc = "Checks if the value of the field is `_24`"]
    #[inline(always)]
    pub fn is_24(&self) -> bool {
        *self == DATALENGTHSELECT_A::_24
    }
    #[doc = "Checks if the value of the field is `_20`"]
    #[inline(always)]
    pub fn is_20(&self) -> bool {
        *self == DATALENGTHSELECT_A::_20
    }
    #[doc = "Checks if the value of the field is `_18`"]
    #[inline(always)]
    pub fn is_18(&self) -> bool {
        *self == DATALENGTHSELECT_A::_18
    }
    #[doc = "Checks if the value of the field is `_16`"]
    #[inline(always)]
    pub fn is_16(&self) -> bool {
        *self == DATALENGTHSELECT_A::_16
    }
    #[doc = "Checks if the value of the field is `_16C`"]
    #[inline(always)]
    pub fn is_16c(&self) -> bool {
        *self == DATALENGTHSELECT_A::_16C
    }
    #[doc = "Checks if the value of the field is `_8`"]
    #[inline(always)]
    pub fn is_8(&self) -> bool {
        *self == DATALENGTHSELECT_A::_8
    }
    #[doc = "Checks if the value of the field is `_8C`"]
    #[inline(always)]
    pub fn is_8c(&self) -> bool {
        *self == DATALENGTHSELECT_A::_8C
    }
}
#[doc = "Field `DATALENGTH` writer - Data Word Length"]
pub type DATALENGTH_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, MR_SPEC, u8, DATALENGTHSELECT_A, 3, O>;
impl<'a, const O: u8> DATALENGTH_W<'a, O> {
    #[doc = "32 bits"]
    #[inline(always)]
    pub fn _32(self) -> &'a mut W {
        self.variant(DATALENGTHSELECT_A::_32)
    }
    #[doc = "24 bits"]
    #[inline(always)]
    pub fn _24(self) -> &'a mut W {
        self.variant(DATALENGTHSELECT_A::_24)
    }
    #[doc = "20 bits"]
    #[inline(always)]
    pub fn _20(self) -> &'a mut W {
        self.variant(DATALENGTHSELECT_A::_20)
    }
    #[doc = "18 bits"]
    #[inline(always)]
    pub fn _18(self) -> &'a mut W {
        self.variant(DATALENGTHSELECT_A::_18)
    }
    #[doc = "16 bits"]
    #[inline(always)]
    pub fn _16(self) -> &'a mut W {
        self.variant(DATALENGTHSELECT_A::_16)
    }
    #[doc = "16 bits compact stereo"]
    #[inline(always)]
    pub fn _16c(self) -> &'a mut W {
        self.variant(DATALENGTHSELECT_A::_16C)
    }
    #[doc = "8 bits"]
    #[inline(always)]
    pub fn _8(self) -> &'a mut W {
        self.variant(DATALENGTHSELECT_A::_8)
    }
    #[doc = "8 bits compact stereo"]
    #[inline(always)]
    pub fn _8c(self) -> &'a mut W {
        self.variant(DATALENGTHSELECT_A::_8C)
    }
}
#[doc = "Field `RXMONO` reader - Receiver Mono"]
pub type RXMONO_R = crate::BitReader<RXMONOSELECT_A>;
#[doc = "Receiver Mono\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXMONOSELECT_A {
    #[doc = "0: Normal mode"]
    STEREO = 0,
    #[doc = "1: Left channel data is duplicated to right channel"]
    MONO = 1,
}
impl From<RXMONOSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: RXMONOSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl RXMONO_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RXMONOSELECT_A {
        match self.bits {
            false => RXMONOSELECT_A::STEREO,
            true => RXMONOSELECT_A::MONO,
        }
    }
    #[doc = "Checks if the value of the field is `STEREO`"]
    #[inline(always)]
    pub fn is_stereo(&self) -> bool {
        *self == RXMONOSELECT_A::STEREO
    }
    #[doc = "Checks if the value of the field is `MONO`"]
    #[inline(always)]
    pub fn is_mono(&self) -> bool {
        *self == RXMONOSELECT_A::MONO
    }
}
#[doc = "Field `RXMONO` writer - Receiver Mono"]
pub type RXMONO_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, RXMONOSELECT_A, O>;
impl<'a, const O: u8> RXMONO_W<'a, O> {
    #[doc = "Normal mode"]
    #[inline(always)]
    pub fn stereo(self) -> &'a mut W {
        self.variant(RXMONOSELECT_A::STEREO)
    }
    #[doc = "Left channel data is duplicated to right channel"]
    #[inline(always)]
    pub fn mono(self) -> &'a mut W {
        self.variant(RXMONOSELECT_A::MONO)
    }
}
#[doc = "Field `RXDMA` reader - Single or Multiple DMA Channels for Receiver"]
pub type RXDMA_R = crate::BitReader<RXDMASELECT_A>;
#[doc = "Single or Multiple DMA Channels for Receiver\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXDMASELECT_A {
    #[doc = "0: Single DMA channel"]
    SINGLE = 0,
    #[doc = "1: One DMA channel per data channel"]
    MULTIPLE = 1,
}
impl From<RXDMASELECT_A> for bool {
    #[inline(always)]
    fn from(variant: RXDMASELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl RXDMA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RXDMASELECT_A {
        match self.bits {
            false => RXDMASELECT_A::SINGLE,
            true => RXDMASELECT_A::MULTIPLE,
        }
    }
    #[doc = "Checks if the value of the field is `SINGLE`"]
    #[inline(always)]
    pub fn is_single(&self) -> bool {
        *self == RXDMASELECT_A::SINGLE
    }
    #[doc = "Checks if the value of the field is `MULTIPLE`"]
    #[inline(always)]
    pub fn is_multiple(&self) -> bool {
        *self == RXDMASELECT_A::MULTIPLE
    }
}
#[doc = "Field `RXDMA` writer - Single or Multiple DMA Channels for Receiver"]
pub type RXDMA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, RXDMASELECT_A, O>;
impl<'a, const O: u8> RXDMA_W<'a, O> {
    #[doc = "Single DMA channel"]
    #[inline(always)]
    pub fn single(self) -> &'a mut W {
        self.variant(RXDMASELECT_A::SINGLE)
    }
    #[doc = "One DMA channel per data channel"]
    #[inline(always)]
    pub fn multiple(self) -> &'a mut W {
        self.variant(RXDMASELECT_A::MULTIPLE)
    }
}
#[doc = "Field `RXLOOP` reader - Loop-back Test Mode"]
pub type RXLOOP_R = crate::BitReader<RXLOOPSELECT_A>;
#[doc = "Loop-back Test Mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXLOOPSELECT_A {
    #[doc = "0: Normal mode"]
    OFF = 0,
    #[doc = "1: ISDO internally connected to ISDI"]
    ON = 1,
}
impl From<RXLOOPSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: RXLOOPSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl RXLOOP_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RXLOOPSELECT_A {
        match self.bits {
            false => RXLOOPSELECT_A::OFF,
            true => RXLOOPSELECT_A::ON,
        }
    }
    #[doc = "Checks if the value of the field is `OFF`"]
    #[inline(always)]
    pub fn is_off(&self) -> bool {
        *self == RXLOOPSELECT_A::OFF
    }
    #[doc = "Checks if the value of the field is `ON`"]
    #[inline(always)]
    pub fn is_on(&self) -> bool {
        *self == RXLOOPSELECT_A::ON
    }
}
#[doc = "Field `RXLOOP` writer - Loop-back Test Mode"]
pub type RXLOOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, RXLOOPSELECT_A, O>;
impl<'a, const O: u8> RXLOOP_W<'a, O> {
    #[doc = "Normal mode"]
    #[inline(always)]
    pub fn off(self) -> &'a mut W {
        self.variant(RXLOOPSELECT_A::OFF)
    }
    #[doc = "ISDO internally connected to ISDI"]
    #[inline(always)]
    pub fn on(self) -> &'a mut W {
        self.variant(RXLOOPSELECT_A::ON)
    }
}
#[doc = "Field `TXMONO` reader - Transmitter Mono"]
pub type TXMONO_R = crate::BitReader<TXMONOSELECT_A>;
#[doc = "Transmitter Mono\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXMONOSELECT_A {
    #[doc = "0: Normal mode"]
    STEREO = 0,
    #[doc = "1: Left channel data is duplicated to right channel"]
    MONO = 1,
}
impl From<TXMONOSELECT_A> for bool {
    #[inline(always)]
    fn from(variant: TXMONOSELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl TXMONO_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TXMONOSELECT_A {
        match self.bits {
            false => TXMONOSELECT_A::STEREO,
            true => TXMONOSELECT_A::MONO,
        }
    }
    #[doc = "Checks if the value of the field is `STEREO`"]
    #[inline(always)]
    pub fn is_stereo(&self) -> bool {
        *self == TXMONOSELECT_A::STEREO
    }
    #[doc = "Checks if the value of the field is `MONO`"]
    #[inline(always)]
    pub fn is_mono(&self) -> bool {
        *self == TXMONOSELECT_A::MONO
    }
}
#[doc = "Field `TXMONO` writer - Transmitter Mono"]
pub type TXMONO_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, TXMONOSELECT_A, O>;
impl<'a, const O: u8> TXMONO_W<'a, O> {
    #[doc = "Normal mode"]
    #[inline(always)]
    pub fn stereo(self) -> &'a mut W {
        self.variant(TXMONOSELECT_A::STEREO)
    }
    #[doc = "Left channel data is duplicated to right channel"]
    #[inline(always)]
    pub fn mono(self) -> &'a mut W {
        self.variant(TXMONOSELECT_A::MONO)
    }
}
#[doc = "Field `TXDMA` reader - Single or Multiple DMA Channels for Transmitter"]
pub type TXDMA_R = crate::BitReader<TXDMASELECT_A>;
#[doc = "Single or Multiple DMA Channels for Transmitter\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXDMASELECT_A {
    #[doc = "0: Single DMA channel"]
    SINGLE = 0,
    #[doc = "1: One DMA channel per data channel"]
    MULTIPLE = 1,
}
impl From<TXDMASELECT_A> for bool {
    #[inline(always)]
    fn from(variant: TXDMASELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl TXDMA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TXDMASELECT_A {
        match self.bits {
            false => TXDMASELECT_A::SINGLE,
            true => TXDMASELECT_A::MULTIPLE,
        }
    }
    #[doc = "Checks if the value of the field is `SINGLE`"]
    #[inline(always)]
    pub fn is_single(&self) -> bool {
        *self == TXDMASELECT_A::SINGLE
    }
    #[doc = "Checks if the value of the field is `MULTIPLE`"]
    #[inline(always)]
    pub fn is_multiple(&self) -> bool {
        *self == TXDMASELECT_A::MULTIPLE
    }
}
#[doc = "Field `TXDMA` writer - Single or Multiple DMA Channels for Transmitter"]
pub type TXDMA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, TXDMASELECT_A, O>;
impl<'a, const O: u8> TXDMA_W<'a, O> {
    #[doc = "Single DMA channel"]
    #[inline(always)]
    pub fn single(self) -> &'a mut W {
        self.variant(TXDMASELECT_A::SINGLE)
    }
    #[doc = "One DMA channel per data channel"]
    #[inline(always)]
    pub fn multiple(self) -> &'a mut W {
        self.variant(TXDMASELECT_A::MULTIPLE)
    }
}
#[doc = "Field `TXSAME` reader - Transmit Data when Underrun"]
pub type TXSAME_R = crate::BitReader<TXSAMESELECT_A>;
#[doc = "Transmit Data when Underrun\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TXSAMESELECT_A {
    #[doc = "0: Zero data transmitted in case of underrun"]
    ZERO = 0,
    #[doc = "1: Last data transmitted in case of underrun"]
    SAME = 1,
}
impl From<TXSAMESELECT_A> for bool {
    #[inline(always)]
    fn from(variant: TXSAMESELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl TXSAME_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TXSAMESELECT_A {
        match self.bits {
            false => TXSAMESELECT_A::ZERO,
            true => TXSAMESELECT_A::SAME,
        }
    }
    #[doc = "Checks if the value of the field is `ZERO`"]
    #[inline(always)]
    pub fn is_zero(&self) -> bool {
        *self == TXSAMESELECT_A::ZERO
    }
    #[doc = "Checks if the value of the field is `SAME`"]
    #[inline(always)]
    pub fn is_same(&self) -> bool {
        *self == TXSAMESELECT_A::SAME
    }
}
#[doc = "Field `TXSAME` writer - Transmit Data when Underrun"]
pub type TXSAME_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, TXSAMESELECT_A, O>;
impl<'a, const O: u8> TXSAME_W<'a, O> {
    #[doc = "Zero data transmitted in case of underrun"]
    #[inline(always)]
    pub fn zero(self) -> &'a mut W {
        self.variant(TXSAMESELECT_A::ZERO)
    }
    #[doc = "Last data transmitted in case of underrun"]
    #[inline(always)]
    pub fn same(self) -> &'a mut W {
        self.variant(TXSAMESELECT_A::SAME)
    }
}
#[doc = "Field `IMCKFS` reader - Master Clock to fs Ratio"]
pub type IMCKFS_R = crate::FieldReader<u8, IMCKFSSELECT_A>;
#[doc = "Master Clock to fs Ratio\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum IMCKFSSELECT_A {
    #[doc = "0: 16 fs"]
    _16 = 0,
    #[doc = "1: 32 fs"]
    _32 = 1,
    #[doc = "3: 64 fs"]
    _64 = 3,
    #[doc = "7: 128 fs"]
    _128 = 7,
    #[doc = "15: 256 fs"]
    _256 = 15,
    #[doc = "23: 384 fs"]
    _384 = 23,
    #[doc = "31: 512 fs"]
    _512 = 31,
    #[doc = "47: 768 fs"]
    _768 = 47,
    #[doc = "63: 1024 fs"]
    _1024 = 63,
}
impl From<IMCKFSSELECT_A> for u8 {
    #[inline(always)]
    fn from(variant: IMCKFSSELECT_A) -> Self {
        variant as _
    }
}
impl IMCKFS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<IMCKFSSELECT_A> {
        match self.bits {
            0 => Some(IMCKFSSELECT_A::_16),
            1 => Some(IMCKFSSELECT_A::_32),
            3 => Some(IMCKFSSELECT_A::_64),
            7 => Some(IMCKFSSELECT_A::_128),
            15 => Some(IMCKFSSELECT_A::_256),
            23 => Some(IMCKFSSELECT_A::_384),
            31 => Some(IMCKFSSELECT_A::_512),
            47 => Some(IMCKFSSELECT_A::_768),
            63 => Some(IMCKFSSELECT_A::_1024),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `_16`"]
    #[inline(always)]
    pub fn is_16(&self) -> bool {
        *self == IMCKFSSELECT_A::_16
    }
    #[doc = "Checks if the value of the field is `_32`"]
    #[inline(always)]
    pub fn is_32(&self) -> bool {
        *self == IMCKFSSELECT_A::_32
    }
    #[doc = "Checks if the value of the field is `_64`"]
    #[inline(always)]
    pub fn is_64(&self) -> bool {
        *self == IMCKFSSELECT_A::_64
    }
    #[doc = "Checks if the value of the field is `_128`"]
    #[inline(always)]
    pub fn is_128(&self) -> bool {
        *self == IMCKFSSELECT_A::_128
    }
    #[doc = "Checks if the value of the field is `_256`"]
    #[inline(always)]
    pub fn is_256(&self) -> bool {
        *self == IMCKFSSELECT_A::_256
    }
    #[doc = "Checks if the value of the field is `_384`"]
    #[inline(always)]
    pub fn is_384(&self) -> bool {
        *self == IMCKFSSELECT_A::_384
    }
    #[doc = "Checks if the value of the field is `_512`"]
    #[inline(always)]
    pub fn is_512(&self) -> bool {
        *self == IMCKFSSELECT_A::_512
    }
    #[doc = "Checks if the value of the field is `_768`"]
    #[inline(always)]
    pub fn is_768(&self) -> bool {
        *self == IMCKFSSELECT_A::_768
    }
    #[doc = "Checks if the value of the field is `_1024`"]
    #[inline(always)]
    pub fn is_1024(&self) -> bool {
        *self == IMCKFSSELECT_A::_1024
    }
}
#[doc = "Field `IMCKFS` writer - Master Clock to fs Ratio"]
pub type IMCKFS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MR_SPEC, u8, IMCKFSSELECT_A, 6, O>;
impl<'a, const O: u8> IMCKFS_W<'a, O> {
    #[doc = "16 fs"]
    #[inline(always)]
    pub fn _16(self) -> &'a mut W {
        self.variant(IMCKFSSELECT_A::_16)
    }
    #[doc = "32 fs"]
    #[inline(always)]
    pub fn _32(self) -> &'a mut W {
        self.variant(IMCKFSSELECT_A::_32)
    }
    #[doc = "64 fs"]
    #[inline(always)]
    pub fn _64(self) -> &'a mut W {
        self.variant(IMCKFSSELECT_A::_64)
    }
    #[doc = "128 fs"]
    #[inline(always)]
    pub fn _128(self) -> &'a mut W {
        self.variant(IMCKFSSELECT_A::_128)
    }
    #[doc = "256 fs"]
    #[inline(always)]
    pub fn _256(self) -> &'a mut W {
        self.variant(IMCKFSSELECT_A::_256)
    }
    #[doc = "384 fs"]
    #[inline(always)]
    pub fn _384(self) -> &'a mut W {
        self.variant(IMCKFSSELECT_A::_384)
    }
    #[doc = "512 fs"]
    #[inline(always)]
    pub fn _512(self) -> &'a mut W {
        self.variant(IMCKFSSELECT_A::_512)
    }
    #[doc = "768 fs"]
    #[inline(always)]
    pub fn _768(self) -> &'a mut W {
        self.variant(IMCKFSSELECT_A::_768)
    }
    #[doc = "1024 fs"]
    #[inline(always)]
    pub fn _1024(self) -> &'a mut W {
        self.variant(IMCKFSSELECT_A::_1024)
    }
}
#[doc = "Field `IMCKMODE` reader - Master Clock Mode"]
pub type IMCKMODE_R = crate::BitReader<IMCKMODESELECT_A>;
#[doc = "Master Clock Mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IMCKMODESELECT_A {
    #[doc = "0: No IMCK generated"]
    NO_IMCK = 0,
    #[doc = "1: IMCK generated"]
    IMCK = 1,
}
impl From<IMCKMODESELECT_A> for bool {
    #[inline(always)]
    fn from(variant: IMCKMODESELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl IMCKMODE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IMCKMODESELECT_A {
        match self.bits {
            false => IMCKMODESELECT_A::NO_IMCK,
            true => IMCKMODESELECT_A::IMCK,
        }
    }
    #[doc = "Checks if the value of the field is `NO_IMCK`"]
    #[inline(always)]
    pub fn is_no_imck(&self) -> bool {
        *self == IMCKMODESELECT_A::NO_IMCK
    }
    #[doc = "Checks if the value of the field is `IMCK`"]
    #[inline(always)]
    pub fn is_imck(&self) -> bool {
        *self == IMCKMODESELECT_A::IMCK
    }
}
#[doc = "Field `IMCKMODE` writer - Master Clock Mode"]
pub type IMCKMODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, IMCKMODESELECT_A, O>;
impl<'a, const O: u8> IMCKMODE_W<'a, O> {
    #[doc = "No IMCK generated"]
    #[inline(always)]
    pub fn no_imck(self) -> &'a mut W {
        self.variant(IMCKMODESELECT_A::NO_IMCK)
    }
    #[doc = "IMCK generated"]
    #[inline(always)]
    pub fn imck(self) -> &'a mut W {
        self.variant(IMCKMODESELECT_A::IMCK)
    }
}
#[doc = "Field `IWS24` reader - IWS Data Slot Width"]
pub type IWS24_R = crate::BitReader<IWS24SELECT_A>;
#[doc = "IWS Data Slot Width\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IWS24SELECT_A {
    #[doc = "0: IWS Data Slot is 32-bit wide for DATALENGTH=18/20/24-bit"]
    _32 = 0,
    #[doc = "1: IWS Data Slot is 24-bit wide for DATALENGTH=18/20/24-bit"]
    _24 = 1,
}
impl From<IWS24SELECT_A> for bool {
    #[inline(always)]
    fn from(variant: IWS24SELECT_A) -> Self {
        variant as u8 != 0
    }
}
impl IWS24_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IWS24SELECT_A {
        match self.bits {
            false => IWS24SELECT_A::_32,
            true => IWS24SELECT_A::_24,
        }
    }
    #[doc = "Checks if the value of the field is `_32`"]
    #[inline(always)]
    pub fn is_32(&self) -> bool {
        *self == IWS24SELECT_A::_32
    }
    #[doc = "Checks if the value of the field is `_24`"]
    #[inline(always)]
    pub fn is_24(&self) -> bool {
        *self == IWS24SELECT_A::_24
    }
}
#[doc = "Field `IWS24` writer - IWS Data Slot Width"]
pub type IWS24_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, IWS24SELECT_A, O>;
impl<'a, const O: u8> IWS24_W<'a, O> {
    #[doc = "IWS Data Slot is 32-bit wide for DATALENGTH=18/20/24-bit"]
    #[inline(always)]
    pub fn _32(self) -> &'a mut W {
        self.variant(IWS24SELECT_A::_32)
    }
    #[doc = "IWS Data Slot is 24-bit wide for DATALENGTH=18/20/24-bit"]
    #[inline(always)]
    pub fn _24(self) -> &'a mut W {
        self.variant(IWS24SELECT_A::_24)
    }
}
impl R {
    #[doc = "Bit 0 - Master/Slave/Controller Mode"]
    #[inline(always)]
    pub fn mode(&self) -> MODE_R {
        MODE_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bits 2:4 - Data Word Length"]
    #[inline(always)]
    pub fn datalength(&self) -> DATALENGTH_R {
        DATALENGTH_R::new(((self.bits >> 2) & 7) as u8)
    }
    #[doc = "Bit 8 - Receiver Mono"]
    #[inline(always)]
    pub fn rxmono(&self) -> RXMONO_R {
        RXMONO_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Single or Multiple DMA Channels for Receiver"]
    #[inline(always)]
    pub fn rxdma(&self) -> RXDMA_R {
        RXDMA_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Loop-back Test Mode"]
    #[inline(always)]
    pub fn rxloop(&self) -> RXLOOP_R {
        RXLOOP_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 12 - Transmitter Mono"]
    #[inline(always)]
    pub fn txmono(&self) -> TXMONO_R {
        TXMONO_R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - Single or Multiple DMA Channels for Transmitter"]
    #[inline(always)]
    pub fn txdma(&self) -> TXDMA_R {
        TXDMA_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - Transmit Data when Underrun"]
    #[inline(always)]
    pub fn txsame(&self) -> TXSAME_R {
        TXSAME_R::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bits 24:29 - Master Clock to fs Ratio"]
    #[inline(always)]
    pub fn imckfs(&self) -> IMCKFS_R {
        IMCKFS_R::new(((self.bits >> 24) & 0x3f) as u8)
    }
    #[doc = "Bit 30 - Master Clock Mode"]
    #[inline(always)]
    pub fn imckmode(&self) -> IMCKMODE_R {
        IMCKMODE_R::new(((self.bits >> 30) & 1) != 0)
    }
    #[doc = "Bit 31 - IWS Data Slot Width"]
    #[inline(always)]
    pub fn iws24(&self) -> IWS24_R {
        IWS24_R::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Master/Slave/Controller Mode"]
    #[inline(always)]
    #[must_use]
    pub fn mode(&mut self) -> MODE_W<0> {
        MODE_W::new(self)
    }
    #[doc = "Bits 2:4 - Data Word Length"]
    #[inline(always)]
    #[must_use]
    pub fn datalength(&mut self) -> DATALENGTH_W<2> {
        DATALENGTH_W::new(self)
    }
    #[doc = "Bit 8 - Receiver Mono"]
    #[inline(always)]
    #[must_use]
    pub fn rxmono(&mut self) -> RXMONO_W<8> {
        RXMONO_W::new(self)
    }
    #[doc = "Bit 9 - Single or Multiple DMA Channels for Receiver"]
    #[inline(always)]
    #[must_use]
    pub fn rxdma(&mut self) -> RXDMA_W<9> {
        RXDMA_W::new(self)
    }
    #[doc = "Bit 10 - Loop-back Test Mode"]
    #[inline(always)]
    #[must_use]
    pub fn rxloop(&mut self) -> RXLOOP_W<10> {
        RXLOOP_W::new(self)
    }
    #[doc = "Bit 12 - Transmitter Mono"]
    #[inline(always)]
    #[must_use]
    pub fn txmono(&mut self) -> TXMONO_W<12> {
        TXMONO_W::new(self)
    }
    #[doc = "Bit 13 - Single or Multiple DMA Channels for Transmitter"]
    #[inline(always)]
    #[must_use]
    pub fn txdma(&mut self) -> TXDMA_W<13> {
        TXDMA_W::new(self)
    }
    #[doc = "Bit 14 - Transmit Data when Underrun"]
    #[inline(always)]
    #[must_use]
    pub fn txsame(&mut self) -> TXSAME_W<14> {
        TXSAME_W::new(self)
    }
    #[doc = "Bits 24:29 - Master Clock to fs Ratio"]
    #[inline(always)]
    #[must_use]
    pub fn imckfs(&mut self) -> IMCKFS_W<24> {
        IMCKFS_W::new(self)
    }
    #[doc = "Bit 30 - Master Clock Mode"]
    #[inline(always)]
    #[must_use]
    pub fn imckmode(&mut self) -> IMCKMODE_W<30> {
        IMCKMODE_W::new(self)
    }
    #[doc = "Bit 31 - IWS Data Slot Width"]
    #[inline(always)]
    #[must_use]
    pub fn iws24(&mut self) -> IWS24_W<31> {
        IWS24_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Mode Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mr](index.html) module"]
pub struct MR_SPEC;
impl crate::RegisterSpec for MR_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [mr::R](R) reader structure"]
impl crate::Readable for MR_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [mr::W](W) writer structure"]
impl crate::Writable for MR_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets MR to value 0"]
impl crate::Resettable for MR_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}