efm32pg22-pac 0.1.3

Peripheral access API for EFM32PG22 MCU (generated using svd2rust)
Documentation
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
#[doc = "Register `RNGCTRL` reader"]
pub struct R(crate::R<RNGCTRL_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<RNGCTRL_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<RNGCTRL_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<RNGCTRL_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `RNGCTRL` writer"]
pub struct W(crate::W<RNGCTRL_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<RNGCTRL_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<RNGCTRL_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<RNGCTRL_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `ENABLE` reader - TRNG Module Enable"]
pub type ENABLE_R = crate::BitReader<ENABLE_A>;
#[doc = "TRNG Module Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ENABLE_A {
    #[doc = "0: Module disabled"]
    DISABLED = 0,
    #[doc = "1: Module enabled"]
    ENABLED = 1,
}
impl From<ENABLE_A> for bool {
    #[inline(always)]
    fn from(variant: ENABLE_A) -> Self {
        variant as u8 != 0
    }
}
impl ENABLE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> ENABLE_A {
        match self.bits {
            false => ENABLE_A::DISABLED,
            true => ENABLE_A::ENABLED,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLED`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == ENABLE_A::DISABLED
    }
    #[doc = "Checks if the value of the field is `ENABLED`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == ENABLE_A::ENABLED
    }
}
#[doc = "Field `ENABLE` writer - TRNG Module Enable"]
pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, ENABLE_A, O>;
impl<'a, const O: u8> ENABLE_W<'a, O> {
    #[doc = "Module disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(ENABLE_A::DISABLED)
    }
    #[doc = "Module enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(ENABLE_A::ENABLED)
    }
}
#[doc = "Field `TESTEN` reader - Test Enable"]
pub type TESTEN_R = crate::BitReader<TESTEN_A>;
#[doc = "Test Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TESTEN_A {
    #[doc = "0: Non-determinsitc random number generation"]
    NOISE = 0,
    #[doc = "1: Pseudo-random number generation"]
    TESTDATA = 1,
}
impl From<TESTEN_A> for bool {
    #[inline(always)]
    fn from(variant: TESTEN_A) -> Self {
        variant as u8 != 0
    }
}
impl TESTEN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TESTEN_A {
        match self.bits {
            false => TESTEN_A::NOISE,
            true => TESTEN_A::TESTDATA,
        }
    }
    #[doc = "Checks if the value of the field is `NOISE`"]
    #[inline(always)]
    pub fn is_noise(&self) -> bool {
        *self == TESTEN_A::NOISE
    }
    #[doc = "Checks if the value of the field is `TESTDATA`"]
    #[inline(always)]
    pub fn is_testdata(&self) -> bool {
        *self == TESTEN_A::TESTDATA
    }
}
#[doc = "Field `TESTEN` writer - Test Enable"]
pub type TESTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, TESTEN_A, O>;
impl<'a, const O: u8> TESTEN_W<'a, O> {
    #[doc = "Non-determinsitc random number generation"]
    #[inline(always)]
    pub fn noise(self) -> &'a mut W {
        self.variant(TESTEN_A::NOISE)
    }
    #[doc = "Pseudo-random number generation"]
    #[inline(always)]
    pub fn testdata(self) -> &'a mut W {
        self.variant(TESTEN_A::TESTDATA)
    }
}
#[doc = "Field `CONDBYPASS` reader - Conditioning Bypass"]
pub type CONDBYPASS_R = crate::BitReader<CONDBYPASS_A>;
#[doc = "Conditioning Bypass\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CONDBYPASS_A {
    #[doc = "0: The conditionig function is used"]
    NORMAL = 0,
    #[doc = "1: The conditioning function is bypassed"]
    BYPASS = 1,
}
impl From<CONDBYPASS_A> for bool {
    #[inline(always)]
    fn from(variant: CONDBYPASS_A) -> Self {
        variant as u8 != 0
    }
}
impl CONDBYPASS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CONDBYPASS_A {
        match self.bits {
            false => CONDBYPASS_A::NORMAL,
            true => CONDBYPASS_A::BYPASS,
        }
    }
    #[doc = "Checks if the value of the field is `NORMAL`"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        *self == CONDBYPASS_A::NORMAL
    }
    #[doc = "Checks if the value of the field is `BYPASS`"]
    #[inline(always)]
    pub fn is_bypass(&self) -> bool {
        *self == CONDBYPASS_A::BYPASS
    }
}
#[doc = "Field `CONDBYPASS` writer - Conditioning Bypass"]
pub type CONDBYPASS_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, CONDBYPASS_A, O>;
impl<'a, const O: u8> CONDBYPASS_W<'a, O> {
    #[doc = "The conditionig function is used"]
    #[inline(always)]
    pub fn normal(self) -> &'a mut W {
        self.variant(CONDBYPASS_A::NORMAL)
    }
    #[doc = "The conditioning function is bypassed"]
    #[inline(always)]
    pub fn bypass(self) -> &'a mut W {
        self.variant(CONDBYPASS_A::BYPASS)
    }
}
#[doc = "Field `REPCOUNTIEN` reader - IRQ enable for Repetition Count Test"]
pub type REPCOUNTIEN_R = crate::BitReader<bool>;
#[doc = "Field `REPCOUNTIEN` writer - IRQ enable for Repetition Count Test"]
pub type REPCOUNTIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
#[doc = "Field `APT64IEN` reader - IRQ enable for APT64IF"]
pub type APT64IEN_R = crate::BitReader<bool>;
#[doc = "Field `APT64IEN` writer - IRQ enable for APT64IF"]
pub type APT64IEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
#[doc = "Field `APT4096IEN` reader - IRQ enable for APT4096IF"]
pub type APT4096IEN_R = crate::BitReader<bool>;
#[doc = "Field `APT4096IEN` writer - IRQ enable for APT4096IF"]
pub type APT4096IEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
#[doc = "Field `FULLIEN` reader - IRQ enable for FIFO full"]
pub type FULLIEN_R = crate::BitReader<bool>;
#[doc = "Field `FULLIEN` writer - IRQ enable for FIFO full"]
pub type FULLIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
#[doc = "Field `SOFTRESET` reader - Software Reset"]
pub type SOFTRESET_R = crate::BitReader<SOFTRESET_A>;
#[doc = "Software Reset\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SOFTRESET_A {
    #[doc = "0: Module not in reset"]
    NORMAL = 0,
    #[doc = "1: The continuous test, the conditioning function and the FIFO are reset"]
    RESET = 1,
}
impl From<SOFTRESET_A> for bool {
    #[inline(always)]
    fn from(variant: SOFTRESET_A) -> Self {
        variant as u8 != 0
    }
}
impl SOFTRESET_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SOFTRESET_A {
        match self.bits {
            false => SOFTRESET_A::NORMAL,
            true => SOFTRESET_A::RESET,
        }
    }
    #[doc = "Checks if the value of the field is `NORMAL`"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        *self == SOFTRESET_A::NORMAL
    }
    #[doc = "Checks if the value of the field is `RESET`"]
    #[inline(always)]
    pub fn is_reset(&self) -> bool {
        *self == SOFTRESET_A::RESET
    }
}
#[doc = "Field `SOFTRESET` writer - Software Reset"]
pub type SOFTRESET_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, SOFTRESET_A, O>;
impl<'a, const O: u8> SOFTRESET_W<'a, O> {
    #[doc = "Module not in reset"]
    #[inline(always)]
    pub fn normal(self) -> &'a mut W {
        self.variant(SOFTRESET_A::NORMAL)
    }
    #[doc = "The continuous test, the conditioning function and the FIFO are reset"]
    #[inline(always)]
    pub fn reset(self) -> &'a mut W {
        self.variant(SOFTRESET_A::RESET)
    }
}
#[doc = "Field `PREIEN` reader - IRQ enable for AIS31 prelim. noise alarm"]
pub type PREIEN_R = crate::BitReader<bool>;
#[doc = "Field `PREIEN` writer - IRQ enable for AIS31 prelim. noise alarm"]
pub type PREIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
#[doc = "Field `ALMIEN` reader - IRQ enable for AIS31 noise alarm"]
pub type ALMIEN_R = crate::BitReader<bool>;
#[doc = "Field `ALMIEN` writer - IRQ enable for AIS31 noise alarm"]
pub type ALMIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
#[doc = "Field `FORCERUN` reader - Oscillator Force Run"]
pub type FORCERUN_R = crate::BitReader<FORCERUN_A>;
#[doc = "Oscillator Force Run\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FORCERUN_A {
    #[doc = "0: Oscillators will shut down when FIFO is full"]
    NORMAL = 0,
    #[doc = "1: Oscillators will continue to run even after FIFO is full"]
    RUN = 1,
}
impl From<FORCERUN_A> for bool {
    #[inline(always)]
    fn from(variant: FORCERUN_A) -> Self {
        variant as u8 != 0
    }
}
impl FORCERUN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FORCERUN_A {
        match self.bits {
            false => FORCERUN_A::NORMAL,
            true => FORCERUN_A::RUN,
        }
    }
    #[doc = "Checks if the value of the field is `NORMAL`"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        *self == FORCERUN_A::NORMAL
    }
    #[doc = "Checks if the value of the field is `RUN`"]
    #[inline(always)]
    pub fn is_run(&self) -> bool {
        *self == FORCERUN_A::RUN
    }
}
#[doc = "Field `FORCERUN` writer - Oscillator Force Run"]
pub type FORCERUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, FORCERUN_A, O>;
impl<'a, const O: u8> FORCERUN_W<'a, O> {
    #[doc = "Oscillators will shut down when FIFO is full"]
    #[inline(always)]
    pub fn normal(self) -> &'a mut W {
        self.variant(FORCERUN_A::NORMAL)
    }
    #[doc = "Oscillators will continue to run even after FIFO is full"]
    #[inline(always)]
    pub fn run(self) -> &'a mut W {
        self.variant(FORCERUN_A::RUN)
    }
}
#[doc = "Field `BYPNIST` reader - NIST Start-up Test Bypass."]
pub type BYPNIST_R = crate::BitReader<BYPNIST_A>;
#[doc = "NIST Start-up Test Bypass.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BYPNIST_A {
    #[doc = "0: NIST-800-90B startup test is applied. No data will be written to the FIFO until the test passes."]
    NORMAL = 0,
    #[doc = "1: NIST-800-90B startup test is bypassed."]
    BYPASS = 1,
}
impl From<BYPNIST_A> for bool {
    #[inline(always)]
    fn from(variant: BYPNIST_A) -> Self {
        variant as u8 != 0
    }
}
impl BYPNIST_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BYPNIST_A {
        match self.bits {
            false => BYPNIST_A::NORMAL,
            true => BYPNIST_A::BYPASS,
        }
    }
    #[doc = "Checks if the value of the field is `NORMAL`"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        *self == BYPNIST_A::NORMAL
    }
    #[doc = "Checks if the value of the field is `BYPASS`"]
    #[inline(always)]
    pub fn is_bypass(&self) -> bool {
        *self == BYPNIST_A::BYPASS
    }
}
#[doc = "Field `BYPNIST` writer - NIST Start-up Test Bypass."]
pub type BYPNIST_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, BYPNIST_A, O>;
impl<'a, const O: u8> BYPNIST_W<'a, O> {
    #[doc = "NIST-800-90B startup test is applied. No data will be written to the FIFO until the test passes."]
    #[inline(always)]
    pub fn normal(self) -> &'a mut W {
        self.variant(BYPNIST_A::NORMAL)
    }
    #[doc = "NIST-800-90B startup test is bypassed."]
    #[inline(always)]
    pub fn bypass(self) -> &'a mut W {
        self.variant(BYPNIST_A::BYPASS)
    }
}
#[doc = "Field `BYPAIS31` reader - AIS31 Start-up Test Bypass."]
pub type BYPAIS31_R = crate::BitReader<BYPAIS31_A>;
#[doc = "AIS31 Start-up Test Bypass.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BYPAIS31_A {
    #[doc = "0: AIS31 startup test is applied. No data will be written to the FIFO until the test passes."]
    NORMAL = 0,
    #[doc = "1: AIS31 startup test is bypassed."]
    BYPASS = 1,
}
impl From<BYPAIS31_A> for bool {
    #[inline(always)]
    fn from(variant: BYPAIS31_A) -> Self {
        variant as u8 != 0
    }
}
impl BYPAIS31_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BYPAIS31_A {
        match self.bits {
            false => BYPAIS31_A::NORMAL,
            true => BYPAIS31_A::BYPASS,
        }
    }
    #[doc = "Checks if the value of the field is `NORMAL`"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        *self == BYPAIS31_A::NORMAL
    }
    #[doc = "Checks if the value of the field is `BYPASS`"]
    #[inline(always)]
    pub fn is_bypass(&self) -> bool {
        *self == BYPAIS31_A::BYPASS
    }
}
#[doc = "Field `BYPAIS31` writer - AIS31 Start-up Test Bypass."]
pub type BYPAIS31_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, BYPAIS31_A, O>;
impl<'a, const O: u8> BYPAIS31_W<'a, O> {
    #[doc = "AIS31 startup test is applied. No data will be written to the FIFO until the test passes."]
    #[inline(always)]
    pub fn normal(self) -> &'a mut W {
        self.variant(BYPAIS31_A::NORMAL)
    }
    #[doc = "AIS31 startup test is bypassed."]
    #[inline(always)]
    pub fn bypass(self) -> &'a mut W {
        self.variant(BYPAIS31_A::BYPASS)
    }
}
#[doc = "Field `HEALTHTESTSEL` reader - Health test input select"]
pub type HEALTHTESTSEL_R = crate::BitReader<HEALTHTESTSEL_A>;
#[doc = "Health test input select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HEALTHTESTSEL_A {
    #[doc = "0: Before conditioning"]
    BEFORE = 0,
    #[doc = "1: After conditioning"]
    AFTER = 1,
}
impl From<HEALTHTESTSEL_A> for bool {
    #[inline(always)]
    fn from(variant: HEALTHTESTSEL_A) -> Self {
        variant as u8 != 0
    }
}
impl HEALTHTESTSEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HEALTHTESTSEL_A {
        match self.bits {
            false => HEALTHTESTSEL_A::BEFORE,
            true => HEALTHTESTSEL_A::AFTER,
        }
    }
    #[doc = "Checks if the value of the field is `BEFORE`"]
    #[inline(always)]
    pub fn is_before(&self) -> bool {
        *self == HEALTHTESTSEL_A::BEFORE
    }
    #[doc = "Checks if the value of the field is `AFTER`"]
    #[inline(always)]
    pub fn is_after(&self) -> bool {
        *self == HEALTHTESTSEL_A::AFTER
    }
}
#[doc = "Field `HEALTHTESTSEL` writer - Health test input select"]
pub type HEALTHTESTSEL_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, RNGCTRL_SPEC, HEALTHTESTSEL_A, O>;
impl<'a, const O: u8> HEALTHTESTSEL_W<'a, O> {
    #[doc = "Before conditioning"]
    #[inline(always)]
    pub fn before(self) -> &'a mut W {
        self.variant(HEALTHTESTSEL_A::BEFORE)
    }
    #[doc = "After conditioning"]
    #[inline(always)]
    pub fn after(self) -> &'a mut W {
        self.variant(HEALTHTESTSEL_A::AFTER)
    }
}
#[doc = "Field `AIS31TESTSEL` reader - AIS31 test input select"]
pub type AIS31TESTSEL_R = crate::BitReader<AIS31TESTSEL_A>;
#[doc = "AIS31 test input select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AIS31TESTSEL_A {
    #[doc = "0: Before conditioning"]
    BEFORE = 0,
    #[doc = "1: After conditioning"]
    AFTER = 1,
}
impl From<AIS31TESTSEL_A> for bool {
    #[inline(always)]
    fn from(variant: AIS31TESTSEL_A) -> Self {
        variant as u8 != 0
    }
}
impl AIS31TESTSEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AIS31TESTSEL_A {
        match self.bits {
            false => AIS31TESTSEL_A::BEFORE,
            true => AIS31TESTSEL_A::AFTER,
        }
    }
    #[doc = "Checks if the value of the field is `BEFORE`"]
    #[inline(always)]
    pub fn is_before(&self) -> bool {
        *self == AIS31TESTSEL_A::BEFORE
    }
    #[doc = "Checks if the value of the field is `AFTER`"]
    #[inline(always)]
    pub fn is_after(&self) -> bool {
        *self == AIS31TESTSEL_A::AFTER
    }
}
#[doc = "Field `AIS31TESTSEL` writer - AIS31 test input select"]
pub type AIS31TESTSEL_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, RNGCTRL_SPEC, AIS31TESTSEL_A, O>;
impl<'a, const O: u8> AIS31TESTSEL_W<'a, O> {
    #[doc = "Before conditioning"]
    #[inline(always)]
    pub fn before(self) -> &'a mut W {
        self.variant(AIS31TESTSEL_A::BEFORE)
    }
    #[doc = "After conditioning"]
    #[inline(always)]
    pub fn after(self) -> &'a mut W {
        self.variant(AIS31TESTSEL_A::AFTER)
    }
}
#[doc = "Field `NB128BITBLOCKS` reader - Number of 128b blocks in AES-CBCMAC"]
pub type NB128BITBLOCKS_R = crate::FieldReader<u8, u8>;
#[doc = "Field `NB128BITBLOCKS` writer - Number of 128b blocks in AES-CBCMAC"]
pub type NB128BITBLOCKS_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, RNGCTRL_SPEC, u8, u8, 4, O>;
#[doc = "Field `FIFOWRSTARTUP` reader - Fifo Write Start Up"]
pub type FIFOWRSTARTUP_R = crate::BitReader<bool>;
#[doc = "Field `FIFOWRSTARTUP` writer - Fifo Write Start Up"]
pub type FIFOWRSTARTUP_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
impl R {
    #[doc = "Bit 0 - TRNG Module Enable"]
    #[inline(always)]
    pub fn enable(&self) -> ENABLE_R {
        ENABLE_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 2 - Test Enable"]
    #[inline(always)]
    pub fn testen(&self) -> TESTEN_R {
        TESTEN_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Conditioning Bypass"]
    #[inline(always)]
    pub fn condbypass(&self) -> CONDBYPASS_R {
        CONDBYPASS_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - IRQ enable for Repetition Count Test"]
    #[inline(always)]
    pub fn repcountien(&self) -> REPCOUNTIEN_R {
        REPCOUNTIEN_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - IRQ enable for APT64IF"]
    #[inline(always)]
    pub fn apt64ien(&self) -> APT64IEN_R {
        APT64IEN_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - IRQ enable for APT4096IF"]
    #[inline(always)]
    pub fn apt4096ien(&self) -> APT4096IEN_R {
        APT4096IEN_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - IRQ enable for FIFO full"]
    #[inline(always)]
    pub fn fullien(&self) -> FULLIEN_R {
        FULLIEN_R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - Software Reset"]
    #[inline(always)]
    pub fn softreset(&self) -> SOFTRESET_R {
        SOFTRESET_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - IRQ enable for AIS31 prelim. noise alarm"]
    #[inline(always)]
    pub fn preien(&self) -> PREIEN_R {
        PREIEN_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - IRQ enable for AIS31 noise alarm"]
    #[inline(always)]
    pub fn almien(&self) -> ALMIEN_R {
        ALMIEN_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Oscillator Force Run"]
    #[inline(always)]
    pub fn forcerun(&self) -> FORCERUN_R {
        FORCERUN_R::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 12 - NIST Start-up Test Bypass."]
    #[inline(always)]
    pub fn bypnist(&self) -> BYPNIST_R {
        BYPNIST_R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - AIS31 Start-up Test Bypass."]
    #[inline(always)]
    pub fn bypais31(&self) -> BYPAIS31_R {
        BYPAIS31_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - Health test input select"]
    #[inline(always)]
    pub fn healthtestsel(&self) -> HEALTHTESTSEL_R {
        HEALTHTESTSEL_R::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 15 - AIS31 test input select"]
    #[inline(always)]
    pub fn ais31testsel(&self) -> AIS31TESTSEL_R {
        AIS31TESTSEL_R::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bits 16:19 - Number of 128b blocks in AES-CBCMAC"]
    #[inline(always)]
    pub fn nb128bitblocks(&self) -> NB128BITBLOCKS_R {
        NB128BITBLOCKS_R::new(((self.bits >> 16) & 0x0f) as u8)
    }
    #[doc = "Bit 20 - Fifo Write Start Up"]
    #[inline(always)]
    pub fn fifowrstartup(&self) -> FIFOWRSTARTUP_R {
        FIFOWRSTARTUP_R::new(((self.bits >> 20) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - TRNG Module Enable"]
    #[inline(always)]
    #[must_use]
    pub fn enable(&mut self) -> ENABLE_W<0> {
        ENABLE_W::new(self)
    }
    #[doc = "Bit 2 - Test Enable"]
    #[inline(always)]
    #[must_use]
    pub fn testen(&mut self) -> TESTEN_W<2> {
        TESTEN_W::new(self)
    }
    #[doc = "Bit 3 - Conditioning Bypass"]
    #[inline(always)]
    #[must_use]
    pub fn condbypass(&mut self) -> CONDBYPASS_W<3> {
        CONDBYPASS_W::new(self)
    }
    #[doc = "Bit 4 - IRQ enable for Repetition Count Test"]
    #[inline(always)]
    #[must_use]
    pub fn repcountien(&mut self) -> REPCOUNTIEN_W<4> {
        REPCOUNTIEN_W::new(self)
    }
    #[doc = "Bit 5 - IRQ enable for APT64IF"]
    #[inline(always)]
    #[must_use]
    pub fn apt64ien(&mut self) -> APT64IEN_W<5> {
        APT64IEN_W::new(self)
    }
    #[doc = "Bit 6 - IRQ enable for APT4096IF"]
    #[inline(always)]
    #[must_use]
    pub fn apt4096ien(&mut self) -> APT4096IEN_W<6> {
        APT4096IEN_W::new(self)
    }
    #[doc = "Bit 7 - IRQ enable for FIFO full"]
    #[inline(always)]
    #[must_use]
    pub fn fullien(&mut self) -> FULLIEN_W<7> {
        FULLIEN_W::new(self)
    }
    #[doc = "Bit 8 - Software Reset"]
    #[inline(always)]
    #[must_use]
    pub fn softreset(&mut self) -> SOFTRESET_W<8> {
        SOFTRESET_W::new(self)
    }
    #[doc = "Bit 9 - IRQ enable for AIS31 prelim. noise alarm"]
    #[inline(always)]
    #[must_use]
    pub fn preien(&mut self) -> PREIEN_W<9> {
        PREIEN_W::new(self)
    }
    #[doc = "Bit 10 - IRQ enable for AIS31 noise alarm"]
    #[inline(always)]
    #[must_use]
    pub fn almien(&mut self) -> ALMIEN_W<10> {
        ALMIEN_W::new(self)
    }
    #[doc = "Bit 11 - Oscillator Force Run"]
    #[inline(always)]
    #[must_use]
    pub fn forcerun(&mut self) -> FORCERUN_W<11> {
        FORCERUN_W::new(self)
    }
    #[doc = "Bit 12 - NIST Start-up Test Bypass."]
    #[inline(always)]
    #[must_use]
    pub fn bypnist(&mut self) -> BYPNIST_W<12> {
        BYPNIST_W::new(self)
    }
    #[doc = "Bit 13 - AIS31 Start-up Test Bypass."]
    #[inline(always)]
    #[must_use]
    pub fn bypais31(&mut self) -> BYPAIS31_W<13> {
        BYPAIS31_W::new(self)
    }
    #[doc = "Bit 14 - Health test input select"]
    #[inline(always)]
    #[must_use]
    pub fn healthtestsel(&mut self) -> HEALTHTESTSEL_W<14> {
        HEALTHTESTSEL_W::new(self)
    }
    #[doc = "Bit 15 - AIS31 test input select"]
    #[inline(always)]
    #[must_use]
    pub fn ais31testsel(&mut self) -> AIS31TESTSEL_W<15> {
        AIS31TESTSEL_W::new(self)
    }
    #[doc = "Bits 16:19 - Number of 128b blocks in AES-CBCMAC"]
    #[inline(always)]
    #[must_use]
    pub fn nb128bitblocks(&mut self) -> NB128BITBLOCKS_W<16> {
        NB128BITBLOCKS_W::new(self)
    }
    #[doc = "Bit 20 - Fifo Write Start Up"]
    #[inline(always)]
    #[must_use]
    pub fn fifowrstartup(&mut self) -> FIFOWRSTARTUP_W<20> {
        FIFOWRSTARTUP_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 = "No Description\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 [rngctrl](index.html) module"]
pub struct RNGCTRL_SPEC;
impl crate::RegisterSpec for RNGCTRL_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [rngctrl::R](R) reader structure"]
impl crate::Readable for RNGCTRL_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [rngctrl::W](W) writer structure"]
impl crate::Writable for RNGCTRL_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 RNGCTRL to value 0x0004_0000"]
impl crate::Resettable for RNGCTRL_SPEC {
    const RESET_VALUE: Self::Ux = 0x0004_0000;
}