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
#[doc = "Reader of register AUDIO_DMIC_CFG"]
pub type R = crate::R<u32, super::AUDIO_DMIC_CFG>;
#[doc = "Writer for register AUDIO_DMIC_CFG"]
pub type W = crate::W<u32, super::AUDIO_DMIC_CFG>;
#[doc = "Register AUDIO_DMIC_CFG `reset()`'s with value 0"]
impl crate::ResetValue for super::AUDIO_DMIC_CFG {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Reader of field `DMIC1_FRAC_DELAY`"]
pub type DMIC1_FRAC_DELAY_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `DMIC1_FRAC_DELAY`"]
pub struct DMIC1_FRAC_DELAY_W<'a> {
    w: &'a mut W,
}
impl<'a> DMIC1_FRAC_DELAY_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x1f << 24)) | (((value as u32) & 0x1f) << 24);
        self.w
    }
}
#[doc = "DMIC1 delay (0 to 1.875 samples in steps of 0.125 samples)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum DMIC1_DELAY_A {
    #[doc = "0: Delay disabled"]
    DMIC1_DELAY_DISABLE = 0,
    #[doc = "1: Delay of 0.125 samples"]
    DMIC1_DELAY_0P125 = 1,
    #[doc = "2: Delay of 0.25 samples"]
    DMIC1_DELAY_0P25 = 2,
    #[doc = "3: Delay of 0.375 samples"]
    DMIC1_DELAY_0P375 = 3,
    #[doc = "4: Delay of 0.5 samples"]
    DMIC1_DELAY_0P5 = 4,
    #[doc = "5: Delay of 0.625 samples"]
    DMIC1_DELAY_0P625 = 5,
    #[doc = "6: Delay of 0.75 samples"]
    DMIC1_DELAY_0P75 = 6,
    #[doc = "7: Delay of 0.875 samples"]
    DMIC1_DELAY_0P875 = 7,
    #[doc = "8: Delay of 1 sample"]
    DMIC1_DELAY_1P0 = 8,
    #[doc = "9: Delay of 1.125 samples"]
    DMIC1_DELAY_1P125 = 9,
    #[doc = "10: Delay of 1.25 samples"]
    DMIC1_DELAY_1P25 = 10,
    #[doc = "11: Delay of 1.375 samples"]
    DMIC1_DELAY_1P375 = 11,
    #[doc = "12: Delay of 1.5 samples"]
    DMIC1_DELAY_1P5 = 12,
    #[doc = "13: Delay of 1.625 samples"]
    DMIC1_DELAY_1P625 = 13,
    #[doc = "14: Delay of 1.75 samples"]
    DMIC1_DELAY_1P75 = 14,
    #[doc = "15: Delay of 1.875 samples"]
    DMIC1_DELAY_1P875 = 15,
}
impl From<DMIC1_DELAY_A> for u8 {
    #[inline(always)]
    fn from(variant: DMIC1_DELAY_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `DMIC1_DELAY`"]
pub type DMIC1_DELAY_R = crate::R<u8, DMIC1_DELAY_A>;
impl DMIC1_DELAY_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DMIC1_DELAY_A {
        match self.bits {
            0 => DMIC1_DELAY_A::DMIC1_DELAY_DISABLE,
            1 => DMIC1_DELAY_A::DMIC1_DELAY_0P125,
            2 => DMIC1_DELAY_A::DMIC1_DELAY_0P25,
            3 => DMIC1_DELAY_A::DMIC1_DELAY_0P375,
            4 => DMIC1_DELAY_A::DMIC1_DELAY_0P5,
            5 => DMIC1_DELAY_A::DMIC1_DELAY_0P625,
            6 => DMIC1_DELAY_A::DMIC1_DELAY_0P75,
            7 => DMIC1_DELAY_A::DMIC1_DELAY_0P875,
            8 => DMIC1_DELAY_A::DMIC1_DELAY_1P0,
            9 => DMIC1_DELAY_A::DMIC1_DELAY_1P125,
            10 => DMIC1_DELAY_A::DMIC1_DELAY_1P25,
            11 => DMIC1_DELAY_A::DMIC1_DELAY_1P375,
            12 => DMIC1_DELAY_A::DMIC1_DELAY_1P5,
            13 => DMIC1_DELAY_A::DMIC1_DELAY_1P625,
            14 => DMIC1_DELAY_A::DMIC1_DELAY_1P75,
            15 => DMIC1_DELAY_A::DMIC1_DELAY_1P875,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_DISABLE`"]
    #[inline(always)]
    pub fn is_dmic1_delay_disable(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_DISABLE
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_0P125`"]
    #[inline(always)]
    pub fn is_dmic1_delay_0p125(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_0P125
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_0P25`"]
    #[inline(always)]
    pub fn is_dmic1_delay_0p25(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_0P25
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_0P375`"]
    #[inline(always)]
    pub fn is_dmic1_delay_0p375(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_0P375
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_0P5`"]
    #[inline(always)]
    pub fn is_dmic1_delay_0p5(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_0P5
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_0P625`"]
    #[inline(always)]
    pub fn is_dmic1_delay_0p625(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_0P625
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_0P75`"]
    #[inline(always)]
    pub fn is_dmic1_delay_0p75(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_0P75
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_0P875`"]
    #[inline(always)]
    pub fn is_dmic1_delay_0p875(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_0P875
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_1P0`"]
    #[inline(always)]
    pub fn is_dmic1_delay_1p0(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_1P0
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_1P125`"]
    #[inline(always)]
    pub fn is_dmic1_delay_1p125(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_1P125
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_1P25`"]
    #[inline(always)]
    pub fn is_dmic1_delay_1p25(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_1P25
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_1P375`"]
    #[inline(always)]
    pub fn is_dmic1_delay_1p375(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_1P375
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_1P5`"]
    #[inline(always)]
    pub fn is_dmic1_delay_1p5(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_1P5
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_1P625`"]
    #[inline(always)]
    pub fn is_dmic1_delay_1p625(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_1P625
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_1P75`"]
    #[inline(always)]
    pub fn is_dmic1_delay_1p75(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_1P75
    }
    #[doc = "Checks if the value of the field is `DMIC1_DELAY_1P875`"]
    #[inline(always)]
    pub fn is_dmic1_delay_1p875(&self) -> bool {
        *self == DMIC1_DELAY_A::DMIC1_DELAY_1P875
    }
}
#[doc = "Write proxy for field `DMIC1_DELAY`"]
pub struct DMIC1_DELAY_W<'a> {
    w: &'a mut W,
}
impl<'a> DMIC1_DELAY_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DMIC1_DELAY_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "Delay disabled"]
    #[inline(always)]
    pub fn dmic1_delay_disable(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_DISABLE)
    }
    #[doc = "Delay of 0.125 samples"]
    #[inline(always)]
    pub fn dmic1_delay_0p125(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_0P125)
    }
    #[doc = "Delay of 0.25 samples"]
    #[inline(always)]
    pub fn dmic1_delay_0p25(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_0P25)
    }
    #[doc = "Delay of 0.375 samples"]
    #[inline(always)]
    pub fn dmic1_delay_0p375(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_0P375)
    }
    #[doc = "Delay of 0.5 samples"]
    #[inline(always)]
    pub fn dmic1_delay_0p5(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_0P5)
    }
    #[doc = "Delay of 0.625 samples"]
    #[inline(always)]
    pub fn dmic1_delay_0p625(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_0P625)
    }
    #[doc = "Delay of 0.75 samples"]
    #[inline(always)]
    pub fn dmic1_delay_0p75(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_0P75)
    }
    #[doc = "Delay of 0.875 samples"]
    #[inline(always)]
    pub fn dmic1_delay_0p875(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_0P875)
    }
    #[doc = "Delay of 1 sample"]
    #[inline(always)]
    pub fn dmic1_delay_1p0(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_1P0)
    }
    #[doc = "Delay of 1.125 samples"]
    #[inline(always)]
    pub fn dmic1_delay_1p125(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_1P125)
    }
    #[doc = "Delay of 1.25 samples"]
    #[inline(always)]
    pub fn dmic1_delay_1p25(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_1P25)
    }
    #[doc = "Delay of 1.375 samples"]
    #[inline(always)]
    pub fn dmic1_delay_1p375(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_1P375)
    }
    #[doc = "Delay of 1.5 samples"]
    #[inline(always)]
    pub fn dmic1_delay_1p5(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_1P5)
    }
    #[doc = "Delay of 1.625 samples"]
    #[inline(always)]
    pub fn dmic1_delay_1p625(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_1P625)
    }
    #[doc = "Delay of 1.75 samples"]
    #[inline(always)]
    pub fn dmic1_delay_1p75(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_1P75)
    }
    #[doc = "Delay of 1.875 samples"]
    #[inline(always)]
    pub fn dmic1_delay_1p875(self) -> &'a mut W {
        self.variant(DMIC1_DELAY_A::DMIC1_DELAY_1P875)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16);
        self.w
    }
}
#[doc = "DMIC1 DC removal filter enable and cut-off frequency\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum DMIC1_DCRM_A {
    #[doc = "0: Cut-off frequency is Fs/3200 (5 Hz at Fs=16 kHz)"]
    DMIC1_DCRM_CUTOFF_5HZ = 0,
    #[doc = "1: Cut-off frequency is Fs/1600 (10 Hz at Fs=16 kHz)"]
    DMIC1_DCRM_CUTOFF_10HZ = 1,
    #[doc = "2: Cut-off frequency is Fs/800 (20 Hz at Fs=16 kHz)"]
    DMIC1_DCRM_CUTOFF_20HZ = 2,
    #[doc = "3: Cut-off frequency is Fs/400 (40 Hz at Fs=16 kHz)"]
    DMIC1_DCRM_CUTOFF_40HZ = 3,
    #[doc = "4: Cut-off frequency is Fs/200 (80 Hz at Fs=16 kHz)"]
    DMIC1_DCRM_CUTOFF_80HZ = 4,
    #[doc = "5: Cut-off frequency is Fs/100 (160 Hz at Fs=16 kHz)"]
    DMIC1_DCRM_CUTOFF_160HZ = 5,
    #[doc = "6: Cut-off frequency is Fs/50 (320 Hz at Fs=16 kHz)"]
    DMIC1_DCRM_CUTOFF_320HZ = 6,
    #[doc = "7: DC removal filter disabled"]
    DMIC1_DCRM_DISABLE = 7,
}
impl From<DMIC1_DCRM_A> for u8 {
    #[inline(always)]
    fn from(variant: DMIC1_DCRM_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `DMIC1_DCRM`"]
pub type DMIC1_DCRM_R = crate::R<u8, DMIC1_DCRM_A>;
impl DMIC1_DCRM_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DMIC1_DCRM_A {
        match self.bits {
            0 => DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_5HZ,
            1 => DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_10HZ,
            2 => DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_20HZ,
            3 => DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_40HZ,
            4 => DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_80HZ,
            5 => DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_160HZ,
            6 => DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_320HZ,
            7 => DMIC1_DCRM_A::DMIC1_DCRM_DISABLE,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DMIC1_DCRM_CUTOFF_5HZ`"]
    #[inline(always)]
    pub fn is_dmic1_dcrm_cutoff_5hz(&self) -> bool {
        *self == DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_5HZ
    }
    #[doc = "Checks if the value of the field is `DMIC1_DCRM_CUTOFF_10HZ`"]
    #[inline(always)]
    pub fn is_dmic1_dcrm_cutoff_10hz(&self) -> bool {
        *self == DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_10HZ
    }
    #[doc = "Checks if the value of the field is `DMIC1_DCRM_CUTOFF_20HZ`"]
    #[inline(always)]
    pub fn is_dmic1_dcrm_cutoff_20hz(&self) -> bool {
        *self == DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_20HZ
    }
    #[doc = "Checks if the value of the field is `DMIC1_DCRM_CUTOFF_40HZ`"]
    #[inline(always)]
    pub fn is_dmic1_dcrm_cutoff_40hz(&self) -> bool {
        *self == DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_40HZ
    }
    #[doc = "Checks if the value of the field is `DMIC1_DCRM_CUTOFF_80HZ`"]
    #[inline(always)]
    pub fn is_dmic1_dcrm_cutoff_80hz(&self) -> bool {
        *self == DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_80HZ
    }
    #[doc = "Checks if the value of the field is `DMIC1_DCRM_CUTOFF_160HZ`"]
    #[inline(always)]
    pub fn is_dmic1_dcrm_cutoff_160hz(&self) -> bool {
        *self == DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_160HZ
    }
    #[doc = "Checks if the value of the field is `DMIC1_DCRM_CUTOFF_320HZ`"]
    #[inline(always)]
    pub fn is_dmic1_dcrm_cutoff_320hz(&self) -> bool {
        *self == DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_320HZ
    }
    #[doc = "Checks if the value of the field is `DMIC1_DCRM_DISABLE`"]
    #[inline(always)]
    pub fn is_dmic1_dcrm_disable(&self) -> bool {
        *self == DMIC1_DCRM_A::DMIC1_DCRM_DISABLE
    }
}
#[doc = "Write proxy for field `DMIC1_DCRM`"]
pub struct DMIC1_DCRM_W<'a> {
    w: &'a mut W,
}
impl<'a> DMIC1_DCRM_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DMIC1_DCRM_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "Cut-off frequency is Fs/3200 (5 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic1_dcrm_cutoff_5hz(self) -> &'a mut W {
        self.variant(DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_5HZ)
    }
    #[doc = "Cut-off frequency is Fs/1600 (10 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic1_dcrm_cutoff_10hz(self) -> &'a mut W {
        self.variant(DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_10HZ)
    }
    #[doc = "Cut-off frequency is Fs/800 (20 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic1_dcrm_cutoff_20hz(self) -> &'a mut W {
        self.variant(DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_20HZ)
    }
    #[doc = "Cut-off frequency is Fs/400 (40 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic1_dcrm_cutoff_40hz(self) -> &'a mut W {
        self.variant(DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_40HZ)
    }
    #[doc = "Cut-off frequency is Fs/200 (80 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic1_dcrm_cutoff_80hz(self) -> &'a mut W {
        self.variant(DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_80HZ)
    }
    #[doc = "Cut-off frequency is Fs/100 (160 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic1_dcrm_cutoff_160hz(self) -> &'a mut W {
        self.variant(DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_160HZ)
    }
    #[doc = "Cut-off frequency is Fs/50 (320 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic1_dcrm_cutoff_320hz(self) -> &'a mut W {
        self.variant(DMIC1_DCRM_A::DMIC1_DCRM_CUTOFF_320HZ)
    }
    #[doc = "DC removal filter disabled"]
    #[inline(always)]
    pub fn dmic1_dcrm_disable(self) -> &'a mut W {
        self.variant(DMIC1_DCRM_A::DMIC1_DCRM_DISABLE)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12);
        self.w
    }
}
#[doc = "DMIC0 DC removal filter enable and cut-off frequency\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum DMIC0_DCRM_A {
    #[doc = "0: Cut-off frequency is Fs/3200 (5 Hz at Fs=16 kHz)"]
    DMIC0_DCRM_CUTOFF_5HZ = 0,
    #[doc = "1: Cut-off frequency is Fs/1600 (10 Hz at Fs=16 kHz)"]
    DMIC0_DCRM_CUTOFF_10HZ = 1,
    #[doc = "2: Cut-off frequency is Fs/800 (20 Hz at Fs=16 kHz)"]
    DMIC0_DCRM_CUTOFF_20HZ = 2,
    #[doc = "3: Cut-off frequency is Fs/400 (40 Hz at Fs=16 kHz)"]
    DMIC0_DCRM_CUTOFF_40HZ = 3,
    #[doc = "4: Cut-off frequency is Fs/200 (80 Hz at Fs=16 kHz)"]
    DMIC0_DCRM_CUTOFF_80HZ = 4,
    #[doc = "5: Cut-off frequency is Fs/100 (160 Hz at Fs=16 kHz)"]
    DMIC0_DCRM_CUTOFF_160HZ = 5,
    #[doc = "6: Cut-off frequency is Fs/50 (320 Hz at Fs=16 kHz)"]
    DMIC0_DCRM_CUTOFF_320HZ = 6,
    #[doc = "7: DC removal filter disabled"]
    DMIC0_DCRM_DISABLE = 7,
}
impl From<DMIC0_DCRM_A> for u8 {
    #[inline(always)]
    fn from(variant: DMIC0_DCRM_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `DMIC0_DCRM`"]
pub type DMIC0_DCRM_R = crate::R<u8, DMIC0_DCRM_A>;
impl DMIC0_DCRM_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DMIC0_DCRM_A {
        match self.bits {
            0 => DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_5HZ,
            1 => DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_10HZ,
            2 => DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_20HZ,
            3 => DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_40HZ,
            4 => DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_80HZ,
            5 => DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_160HZ,
            6 => DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_320HZ,
            7 => DMIC0_DCRM_A::DMIC0_DCRM_DISABLE,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DMIC0_DCRM_CUTOFF_5HZ`"]
    #[inline(always)]
    pub fn is_dmic0_dcrm_cutoff_5hz(&self) -> bool {
        *self == DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_5HZ
    }
    #[doc = "Checks if the value of the field is `DMIC0_DCRM_CUTOFF_10HZ`"]
    #[inline(always)]
    pub fn is_dmic0_dcrm_cutoff_10hz(&self) -> bool {
        *self == DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_10HZ
    }
    #[doc = "Checks if the value of the field is `DMIC0_DCRM_CUTOFF_20HZ`"]
    #[inline(always)]
    pub fn is_dmic0_dcrm_cutoff_20hz(&self) -> bool {
        *self == DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_20HZ
    }
    #[doc = "Checks if the value of the field is `DMIC0_DCRM_CUTOFF_40HZ`"]
    #[inline(always)]
    pub fn is_dmic0_dcrm_cutoff_40hz(&self) -> bool {
        *self == DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_40HZ
    }
    #[doc = "Checks if the value of the field is `DMIC0_DCRM_CUTOFF_80HZ`"]
    #[inline(always)]
    pub fn is_dmic0_dcrm_cutoff_80hz(&self) -> bool {
        *self == DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_80HZ
    }
    #[doc = "Checks if the value of the field is `DMIC0_DCRM_CUTOFF_160HZ`"]
    #[inline(always)]
    pub fn is_dmic0_dcrm_cutoff_160hz(&self) -> bool {
        *self == DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_160HZ
    }
    #[doc = "Checks if the value of the field is `DMIC0_DCRM_CUTOFF_320HZ`"]
    #[inline(always)]
    pub fn is_dmic0_dcrm_cutoff_320hz(&self) -> bool {
        *self == DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_320HZ
    }
    #[doc = "Checks if the value of the field is `DMIC0_DCRM_DISABLE`"]
    #[inline(always)]
    pub fn is_dmic0_dcrm_disable(&self) -> bool {
        *self == DMIC0_DCRM_A::DMIC0_DCRM_DISABLE
    }
}
#[doc = "Write proxy for field `DMIC0_DCRM`"]
pub struct DMIC0_DCRM_W<'a> {
    w: &'a mut W,
}
impl<'a> DMIC0_DCRM_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DMIC0_DCRM_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "Cut-off frequency is Fs/3200 (5 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic0_dcrm_cutoff_5hz(self) -> &'a mut W {
        self.variant(DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_5HZ)
    }
    #[doc = "Cut-off frequency is Fs/1600 (10 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic0_dcrm_cutoff_10hz(self) -> &'a mut W {
        self.variant(DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_10HZ)
    }
    #[doc = "Cut-off frequency is Fs/800 (20 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic0_dcrm_cutoff_20hz(self) -> &'a mut W {
        self.variant(DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_20HZ)
    }
    #[doc = "Cut-off frequency is Fs/400 (40 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic0_dcrm_cutoff_40hz(self) -> &'a mut W {
        self.variant(DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_40HZ)
    }
    #[doc = "Cut-off frequency is Fs/200 (80 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic0_dcrm_cutoff_80hz(self) -> &'a mut W {
        self.variant(DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_80HZ)
    }
    #[doc = "Cut-off frequency is Fs/100 (160 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic0_dcrm_cutoff_160hz(self) -> &'a mut W {
        self.variant(DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_160HZ)
    }
    #[doc = "Cut-off frequency is Fs/50 (320 Hz at Fs=16 kHz)"]
    #[inline(always)]
    pub fn dmic0_dcrm_cutoff_320hz(self) -> &'a mut W {
        self.variant(DMIC0_DCRM_A::DMIC0_DCRM_CUTOFF_320HZ)
    }
    #[doc = "DC removal filter disabled"]
    #[inline(always)]
    pub fn dmic0_dcrm_disable(self) -> &'a mut W {
        self.variant(DMIC0_DCRM_A::DMIC0_DCRM_DISABLE)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8);
        self.w
    }
}
#[doc = "DMIC1 input clock edge\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DMIC1_CLK_EDGE_A {
    #[doc = "0: Sample the DMIC1 input data on the falling DMIC clock"]
    DMIC1_FALLING_EDGE = 0,
    #[doc = "1: Sample the DMIC1 input data on the rising DMIC clock"]
    DMIC1_RISING_EDGE = 1,
}
impl From<DMIC1_CLK_EDGE_A> for bool {
    #[inline(always)]
    fn from(variant: DMIC1_CLK_EDGE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `DMIC1_CLK_EDGE`"]
pub type DMIC1_CLK_EDGE_R = crate::R<bool, DMIC1_CLK_EDGE_A>;
impl DMIC1_CLK_EDGE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DMIC1_CLK_EDGE_A {
        match self.bits {
            false => DMIC1_CLK_EDGE_A::DMIC1_FALLING_EDGE,
            true => DMIC1_CLK_EDGE_A::DMIC1_RISING_EDGE,
        }
    }
    #[doc = "Checks if the value of the field is `DMIC1_FALLING_EDGE`"]
    #[inline(always)]
    pub fn is_dmic1_falling_edge(&self) -> bool {
        *self == DMIC1_CLK_EDGE_A::DMIC1_FALLING_EDGE
    }
    #[doc = "Checks if the value of the field is `DMIC1_RISING_EDGE`"]
    #[inline(always)]
    pub fn is_dmic1_rising_edge(&self) -> bool {
        *self == DMIC1_CLK_EDGE_A::DMIC1_RISING_EDGE
    }
}
#[doc = "Write proxy for field `DMIC1_CLK_EDGE`"]
pub struct DMIC1_CLK_EDGE_W<'a> {
    w: &'a mut W,
}
impl<'a> DMIC1_CLK_EDGE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DMIC1_CLK_EDGE_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Sample the DMIC1 input data on the falling DMIC clock"]
    #[inline(always)]
    pub fn dmic1_falling_edge(self) -> &'a mut W {
        self.variant(DMIC1_CLK_EDGE_A::DMIC1_FALLING_EDGE)
    }
    #[doc = "Sample the DMIC1 input data on the rising DMIC clock"]
    #[inline(always)]
    pub fn dmic1_rising_edge(self) -> &'a mut W {
        self.variant(DMIC1_CLK_EDGE_A::DMIC1_RISING_EDGE)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
        self.w
    }
}
#[doc = "DMIC0 input clock edge\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DMIC0_CLK_EDGE_A {
    #[doc = "0: Sample the DMIC0 input data on the falling DMIC clock"]
    DMIC0_FALLING_EDGE = 0,
    #[doc = "1: Sample the DMIC0 input data on the rising DMIC clock"]
    DMIC0_RISING_EDGE = 1,
}
impl From<DMIC0_CLK_EDGE_A> for bool {
    #[inline(always)]
    fn from(variant: DMIC0_CLK_EDGE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `DMIC0_CLK_EDGE`"]
pub type DMIC0_CLK_EDGE_R = crate::R<bool, DMIC0_CLK_EDGE_A>;
impl DMIC0_CLK_EDGE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DMIC0_CLK_EDGE_A {
        match self.bits {
            false => DMIC0_CLK_EDGE_A::DMIC0_FALLING_EDGE,
            true => DMIC0_CLK_EDGE_A::DMIC0_RISING_EDGE,
        }
    }
    #[doc = "Checks if the value of the field is `DMIC0_FALLING_EDGE`"]
    #[inline(always)]
    pub fn is_dmic0_falling_edge(&self) -> bool {
        *self == DMIC0_CLK_EDGE_A::DMIC0_FALLING_EDGE
    }
    #[doc = "Checks if the value of the field is `DMIC0_RISING_EDGE`"]
    #[inline(always)]
    pub fn is_dmic0_rising_edge(&self) -> bool {
        *self == DMIC0_CLK_EDGE_A::DMIC0_RISING_EDGE
    }
}
#[doc = "Write proxy for field `DMIC0_CLK_EDGE`"]
pub struct DMIC0_CLK_EDGE_W<'a> {
    w: &'a mut W,
}
impl<'a> DMIC0_CLK_EDGE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DMIC0_CLK_EDGE_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Sample the DMIC0 input data on the falling DMIC clock"]
    #[inline(always)]
    pub fn dmic0_falling_edge(self) -> &'a mut W {
        self.variant(DMIC0_CLK_EDGE_A::DMIC0_FALLING_EDGE)
    }
    #[doc = "Sample the DMIC0 input data on the rising DMIC clock"]
    #[inline(always)]
    pub fn dmic0_rising_edge(self) -> &'a mut W {
        self.variant(DMIC0_CLK_EDGE_A::DMIC0_RISING_EDGE)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
        self.w
    }
}
impl R {
    #[doc = "Bits 24:28 - DMIC1 fractional delay (each step represents a DMIC clock cycle)"]
    #[inline(always)]
    pub fn dmic1_frac_delay(&self) -> DMIC1_FRAC_DELAY_R {
        DMIC1_FRAC_DELAY_R::new(((self.bits >> 24) & 0x1f) as u8)
    }
    #[doc = "Bits 16:19 - DMIC1 delay (0 to 1.875 samples in steps of 0.125 samples)"]
    #[inline(always)]
    pub fn dmic1_delay(&self) -> DMIC1_DELAY_R {
        DMIC1_DELAY_R::new(((self.bits >> 16) & 0x0f) as u8)
    }
    #[doc = "Bits 12:14 - DMIC1 DC removal filter enable and cut-off frequency"]
    #[inline(always)]
    pub fn dmic1_dcrm(&self) -> DMIC1_DCRM_R {
        DMIC1_DCRM_R::new(((self.bits >> 12) & 0x07) as u8)
    }
    #[doc = "Bits 8:10 - DMIC0 DC removal filter enable and cut-off frequency"]
    #[inline(always)]
    pub fn dmic0_dcrm(&self) -> DMIC0_DCRM_R {
        DMIC0_DCRM_R::new(((self.bits >> 8) & 0x07) as u8)
    }
    #[doc = "Bit 1 - DMIC1 input clock edge"]
    #[inline(always)]
    pub fn dmic1_clk_edge(&self) -> DMIC1_CLK_EDGE_R {
        DMIC1_CLK_EDGE_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bit 0 - DMIC0 input clock edge"]
    #[inline(always)]
    pub fn dmic0_clk_edge(&self) -> DMIC0_CLK_EDGE_R {
        DMIC0_CLK_EDGE_R::new((self.bits & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bits 24:28 - DMIC1 fractional delay (each step represents a DMIC clock cycle)"]
    #[inline(always)]
    pub fn dmic1_frac_delay(&mut self) -> DMIC1_FRAC_DELAY_W {
        DMIC1_FRAC_DELAY_W { w: self }
    }
    #[doc = "Bits 16:19 - DMIC1 delay (0 to 1.875 samples in steps of 0.125 samples)"]
    #[inline(always)]
    pub fn dmic1_delay(&mut self) -> DMIC1_DELAY_W {
        DMIC1_DELAY_W { w: self }
    }
    #[doc = "Bits 12:14 - DMIC1 DC removal filter enable and cut-off frequency"]
    #[inline(always)]
    pub fn dmic1_dcrm(&mut self) -> DMIC1_DCRM_W {
        DMIC1_DCRM_W { w: self }
    }
    #[doc = "Bits 8:10 - DMIC0 DC removal filter enable and cut-off frequency"]
    #[inline(always)]
    pub fn dmic0_dcrm(&mut self) -> DMIC0_DCRM_W {
        DMIC0_DCRM_W { w: self }
    }
    #[doc = "Bit 1 - DMIC1 input clock edge"]
    #[inline(always)]
    pub fn dmic1_clk_edge(&mut self) -> DMIC1_CLK_EDGE_W {
        DMIC1_CLK_EDGE_W { w: self }
    }
    #[doc = "Bit 0 - DMIC0 input clock edge"]
    #[inline(always)]
    pub fn dmic0_clk_edge(&mut self) -> DMIC0_CLK_EDGE_W {
        DMIC0_CLK_EDGE_W { w: self }
    }
}