1#[doc = "Register `RNGCTRL` reader"]
2pub struct R(crate::R<RNGCTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<RNGCTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<RNGCTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<RNGCTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `RNGCTRL` writer"]
17pub struct W(crate::W<RNGCTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<RNGCTRL_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<RNGCTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<RNGCTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `ENABLE` reader - TRNG Module Enable"]
38pub type ENABLE_R = crate::BitReader<ENABLE_A>;
39#[doc = "TRNG Module Enable\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum ENABLE_A {
42 #[doc = "0: Module disabled"]
43 DISABLED = 0,
44 #[doc = "1: Module enabled"]
45 ENABLED = 1,
46}
47impl From<ENABLE_A> for bool {
48 #[inline(always)]
49 fn from(variant: ENABLE_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl ENABLE_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> ENABLE_A {
57 match self.bits {
58 false => ENABLE_A::DISABLED,
59 true => ENABLE_A::ENABLED,
60 }
61 }
62 #[doc = "Checks if the value of the field is `DISABLED`"]
63 #[inline(always)]
64 pub fn is_disabled(&self) -> bool {
65 *self == ENABLE_A::DISABLED
66 }
67 #[doc = "Checks if the value of the field is `ENABLED`"]
68 #[inline(always)]
69 pub fn is_enabled(&self) -> bool {
70 *self == ENABLE_A::ENABLED
71 }
72}
73#[doc = "Field `ENABLE` writer - TRNG Module Enable"]
74pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, ENABLE_A, O>;
75impl<'a, const O: u8> ENABLE_W<'a, O> {
76 #[doc = "Module disabled"]
77 #[inline(always)]
78 pub fn disabled(self) -> &'a mut W {
79 self.variant(ENABLE_A::DISABLED)
80 }
81 #[doc = "Module enabled"]
82 #[inline(always)]
83 pub fn enabled(self) -> &'a mut W {
84 self.variant(ENABLE_A::ENABLED)
85 }
86}
87#[doc = "Field `TESTEN` reader - Test Enable"]
88pub type TESTEN_R = crate::BitReader<TESTEN_A>;
89#[doc = "Test Enable\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum TESTEN_A {
92 #[doc = "0: Non-determinsitc random number generation"]
93 NOISE = 0,
94 #[doc = "1: Pseudo-random number generation"]
95 TESTDATA = 1,
96}
97impl From<TESTEN_A> for bool {
98 #[inline(always)]
99 fn from(variant: TESTEN_A) -> Self {
100 variant as u8 != 0
101 }
102}
103impl TESTEN_R {
104 #[doc = "Get enumerated values variant"]
105 #[inline(always)]
106 pub fn variant(&self) -> TESTEN_A {
107 match self.bits {
108 false => TESTEN_A::NOISE,
109 true => TESTEN_A::TESTDATA,
110 }
111 }
112 #[doc = "Checks if the value of the field is `NOISE`"]
113 #[inline(always)]
114 pub fn is_noise(&self) -> bool {
115 *self == TESTEN_A::NOISE
116 }
117 #[doc = "Checks if the value of the field is `TESTDATA`"]
118 #[inline(always)]
119 pub fn is_testdata(&self) -> bool {
120 *self == TESTEN_A::TESTDATA
121 }
122}
123#[doc = "Field `TESTEN` writer - Test Enable"]
124pub type TESTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, TESTEN_A, O>;
125impl<'a, const O: u8> TESTEN_W<'a, O> {
126 #[doc = "Non-determinsitc random number generation"]
127 #[inline(always)]
128 pub fn noise(self) -> &'a mut W {
129 self.variant(TESTEN_A::NOISE)
130 }
131 #[doc = "Pseudo-random number generation"]
132 #[inline(always)]
133 pub fn testdata(self) -> &'a mut W {
134 self.variant(TESTEN_A::TESTDATA)
135 }
136}
137#[doc = "Field `CONDBYPASS` reader - Conditioning Bypass"]
138pub type CONDBYPASS_R = crate::BitReader<CONDBYPASS_A>;
139#[doc = "Conditioning Bypass\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq, Eq)]
141pub enum CONDBYPASS_A {
142 #[doc = "0: The conditionig function is used"]
143 NORMAL = 0,
144 #[doc = "1: The conditioning function is bypassed"]
145 BYPASS = 1,
146}
147impl From<CONDBYPASS_A> for bool {
148 #[inline(always)]
149 fn from(variant: CONDBYPASS_A) -> Self {
150 variant as u8 != 0
151 }
152}
153impl CONDBYPASS_R {
154 #[doc = "Get enumerated values variant"]
155 #[inline(always)]
156 pub fn variant(&self) -> CONDBYPASS_A {
157 match self.bits {
158 false => CONDBYPASS_A::NORMAL,
159 true => CONDBYPASS_A::BYPASS,
160 }
161 }
162 #[doc = "Checks if the value of the field is `NORMAL`"]
163 #[inline(always)]
164 pub fn is_normal(&self) -> bool {
165 *self == CONDBYPASS_A::NORMAL
166 }
167 #[doc = "Checks if the value of the field is `BYPASS`"]
168 #[inline(always)]
169 pub fn is_bypass(&self) -> bool {
170 *self == CONDBYPASS_A::BYPASS
171 }
172}
173#[doc = "Field `CONDBYPASS` writer - Conditioning Bypass"]
174pub type CONDBYPASS_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, CONDBYPASS_A, O>;
175impl<'a, const O: u8> CONDBYPASS_W<'a, O> {
176 #[doc = "The conditionig function is used"]
177 #[inline(always)]
178 pub fn normal(self) -> &'a mut W {
179 self.variant(CONDBYPASS_A::NORMAL)
180 }
181 #[doc = "The conditioning function is bypassed"]
182 #[inline(always)]
183 pub fn bypass(self) -> &'a mut W {
184 self.variant(CONDBYPASS_A::BYPASS)
185 }
186}
187#[doc = "Field `REPCOUNTIEN` reader - IRQ enable for Repetition Count Test"]
188pub type REPCOUNTIEN_R = crate::BitReader<bool>;
189#[doc = "Field `REPCOUNTIEN` writer - IRQ enable for Repetition Count Test"]
190pub type REPCOUNTIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
191#[doc = "Field `APT64IEN` reader - IRQ enable for APT64IF"]
192pub type APT64IEN_R = crate::BitReader<bool>;
193#[doc = "Field `APT64IEN` writer - IRQ enable for APT64IF"]
194pub type APT64IEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
195#[doc = "Field `APT4096IEN` reader - IRQ enable for APT4096IF"]
196pub type APT4096IEN_R = crate::BitReader<bool>;
197#[doc = "Field `APT4096IEN` writer - IRQ enable for APT4096IF"]
198pub type APT4096IEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
199#[doc = "Field `FULLIEN` reader - IRQ enable for FIFO full"]
200pub type FULLIEN_R = crate::BitReader<bool>;
201#[doc = "Field `FULLIEN` writer - IRQ enable for FIFO full"]
202pub type FULLIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
203#[doc = "Field `SOFTRESET` reader - Software Reset"]
204pub type SOFTRESET_R = crate::BitReader<SOFTRESET_A>;
205#[doc = "Software Reset\n\nValue on reset: 0"]
206#[derive(Clone, Copy, Debug, PartialEq, Eq)]
207pub enum SOFTRESET_A {
208 #[doc = "0: Module not in reset"]
209 NORMAL = 0,
210 #[doc = "1: The continuous test, the conditioning function and the FIFO are reset"]
211 RESET = 1,
212}
213impl From<SOFTRESET_A> for bool {
214 #[inline(always)]
215 fn from(variant: SOFTRESET_A) -> Self {
216 variant as u8 != 0
217 }
218}
219impl SOFTRESET_R {
220 #[doc = "Get enumerated values variant"]
221 #[inline(always)]
222 pub fn variant(&self) -> SOFTRESET_A {
223 match self.bits {
224 false => SOFTRESET_A::NORMAL,
225 true => SOFTRESET_A::RESET,
226 }
227 }
228 #[doc = "Checks if the value of the field is `NORMAL`"]
229 #[inline(always)]
230 pub fn is_normal(&self) -> bool {
231 *self == SOFTRESET_A::NORMAL
232 }
233 #[doc = "Checks if the value of the field is `RESET`"]
234 #[inline(always)]
235 pub fn is_reset(&self) -> bool {
236 *self == SOFTRESET_A::RESET
237 }
238}
239#[doc = "Field `SOFTRESET` writer - Software Reset"]
240pub type SOFTRESET_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, SOFTRESET_A, O>;
241impl<'a, const O: u8> SOFTRESET_W<'a, O> {
242 #[doc = "Module not in reset"]
243 #[inline(always)]
244 pub fn normal(self) -> &'a mut W {
245 self.variant(SOFTRESET_A::NORMAL)
246 }
247 #[doc = "The continuous test, the conditioning function and the FIFO are reset"]
248 #[inline(always)]
249 pub fn reset(self) -> &'a mut W {
250 self.variant(SOFTRESET_A::RESET)
251 }
252}
253#[doc = "Field `PREIEN` reader - IRQ enable for AIS31 prelim. noise alarm"]
254pub type PREIEN_R = crate::BitReader<bool>;
255#[doc = "Field `PREIEN` writer - IRQ enable for AIS31 prelim. noise alarm"]
256pub type PREIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
257#[doc = "Field `ALMIEN` reader - IRQ enable for AIS31 noise alarm"]
258pub type ALMIEN_R = crate::BitReader<bool>;
259#[doc = "Field `ALMIEN` writer - IRQ enable for AIS31 noise alarm"]
260pub type ALMIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
261#[doc = "Field `FORCERUN` reader - Oscillator Force Run"]
262pub type FORCERUN_R = crate::BitReader<FORCERUN_A>;
263#[doc = "Oscillator Force Run\n\nValue on reset: 0"]
264#[derive(Clone, Copy, Debug, PartialEq, Eq)]
265pub enum FORCERUN_A {
266 #[doc = "0: Oscillators will shut down when FIFO is full"]
267 NORMAL = 0,
268 #[doc = "1: Oscillators will continue to run even after FIFO is full"]
269 RUN = 1,
270}
271impl From<FORCERUN_A> for bool {
272 #[inline(always)]
273 fn from(variant: FORCERUN_A) -> Self {
274 variant as u8 != 0
275 }
276}
277impl FORCERUN_R {
278 #[doc = "Get enumerated values variant"]
279 #[inline(always)]
280 pub fn variant(&self) -> FORCERUN_A {
281 match self.bits {
282 false => FORCERUN_A::NORMAL,
283 true => FORCERUN_A::RUN,
284 }
285 }
286 #[doc = "Checks if the value of the field is `NORMAL`"]
287 #[inline(always)]
288 pub fn is_normal(&self) -> bool {
289 *self == FORCERUN_A::NORMAL
290 }
291 #[doc = "Checks if the value of the field is `RUN`"]
292 #[inline(always)]
293 pub fn is_run(&self) -> bool {
294 *self == FORCERUN_A::RUN
295 }
296}
297#[doc = "Field `FORCERUN` writer - Oscillator Force Run"]
298pub type FORCERUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, FORCERUN_A, O>;
299impl<'a, const O: u8> FORCERUN_W<'a, O> {
300 #[doc = "Oscillators will shut down when FIFO is full"]
301 #[inline(always)]
302 pub fn normal(self) -> &'a mut W {
303 self.variant(FORCERUN_A::NORMAL)
304 }
305 #[doc = "Oscillators will continue to run even after FIFO is full"]
306 #[inline(always)]
307 pub fn run(self) -> &'a mut W {
308 self.variant(FORCERUN_A::RUN)
309 }
310}
311#[doc = "Field `BYPNIST` reader - NIST Start-up Test Bypass."]
312pub type BYPNIST_R = crate::BitReader<BYPNIST_A>;
313#[doc = "NIST Start-up Test Bypass.\n\nValue on reset: 0"]
314#[derive(Clone, Copy, Debug, PartialEq, Eq)]
315pub enum BYPNIST_A {
316 #[doc = "0: NIST-800-90B startup test is applied. No data will be written to the FIFO until the test passes."]
317 NORMAL = 0,
318 #[doc = "1: NIST-800-90B startup test is bypassed."]
319 BYPASS = 1,
320}
321impl From<BYPNIST_A> for bool {
322 #[inline(always)]
323 fn from(variant: BYPNIST_A) -> Self {
324 variant as u8 != 0
325 }
326}
327impl BYPNIST_R {
328 #[doc = "Get enumerated values variant"]
329 #[inline(always)]
330 pub fn variant(&self) -> BYPNIST_A {
331 match self.bits {
332 false => BYPNIST_A::NORMAL,
333 true => BYPNIST_A::BYPASS,
334 }
335 }
336 #[doc = "Checks if the value of the field is `NORMAL`"]
337 #[inline(always)]
338 pub fn is_normal(&self) -> bool {
339 *self == BYPNIST_A::NORMAL
340 }
341 #[doc = "Checks if the value of the field is `BYPASS`"]
342 #[inline(always)]
343 pub fn is_bypass(&self) -> bool {
344 *self == BYPNIST_A::BYPASS
345 }
346}
347#[doc = "Field `BYPNIST` writer - NIST Start-up Test Bypass."]
348pub type BYPNIST_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, BYPNIST_A, O>;
349impl<'a, const O: u8> BYPNIST_W<'a, O> {
350 #[doc = "NIST-800-90B startup test is applied. No data will be written to the FIFO until the test passes."]
351 #[inline(always)]
352 pub fn normal(self) -> &'a mut W {
353 self.variant(BYPNIST_A::NORMAL)
354 }
355 #[doc = "NIST-800-90B startup test is bypassed."]
356 #[inline(always)]
357 pub fn bypass(self) -> &'a mut W {
358 self.variant(BYPNIST_A::BYPASS)
359 }
360}
361#[doc = "Field `BYPAIS31` reader - AIS31 Start-up Test Bypass."]
362pub type BYPAIS31_R = crate::BitReader<BYPAIS31_A>;
363#[doc = "AIS31 Start-up Test Bypass.\n\nValue on reset: 0"]
364#[derive(Clone, Copy, Debug, PartialEq, Eq)]
365pub enum BYPAIS31_A {
366 #[doc = "0: AIS31 startup test is applied. No data will be written to the FIFO until the test passes."]
367 NORMAL = 0,
368 #[doc = "1: AIS31 startup test is bypassed."]
369 BYPASS = 1,
370}
371impl From<BYPAIS31_A> for bool {
372 #[inline(always)]
373 fn from(variant: BYPAIS31_A) -> Self {
374 variant as u8 != 0
375 }
376}
377impl BYPAIS31_R {
378 #[doc = "Get enumerated values variant"]
379 #[inline(always)]
380 pub fn variant(&self) -> BYPAIS31_A {
381 match self.bits {
382 false => BYPAIS31_A::NORMAL,
383 true => BYPAIS31_A::BYPASS,
384 }
385 }
386 #[doc = "Checks if the value of the field is `NORMAL`"]
387 #[inline(always)]
388 pub fn is_normal(&self) -> bool {
389 *self == BYPAIS31_A::NORMAL
390 }
391 #[doc = "Checks if the value of the field is `BYPASS`"]
392 #[inline(always)]
393 pub fn is_bypass(&self) -> bool {
394 *self == BYPAIS31_A::BYPASS
395 }
396}
397#[doc = "Field `BYPAIS31` writer - AIS31 Start-up Test Bypass."]
398pub type BYPAIS31_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, BYPAIS31_A, O>;
399impl<'a, const O: u8> BYPAIS31_W<'a, O> {
400 #[doc = "AIS31 startup test is applied. No data will be written to the FIFO until the test passes."]
401 #[inline(always)]
402 pub fn normal(self) -> &'a mut W {
403 self.variant(BYPAIS31_A::NORMAL)
404 }
405 #[doc = "AIS31 startup test is bypassed."]
406 #[inline(always)]
407 pub fn bypass(self) -> &'a mut W {
408 self.variant(BYPAIS31_A::BYPASS)
409 }
410}
411#[doc = "Field `HEALTHTESTSEL` reader - Health test input select"]
412pub type HEALTHTESTSEL_R = crate::BitReader<HEALTHTESTSEL_A>;
413#[doc = "Health test input select\n\nValue on reset: 0"]
414#[derive(Clone, Copy, Debug, PartialEq, Eq)]
415pub enum HEALTHTESTSEL_A {
416 #[doc = "0: Before conditioning"]
417 BEFORE = 0,
418 #[doc = "1: After conditioning"]
419 AFTER = 1,
420}
421impl From<HEALTHTESTSEL_A> for bool {
422 #[inline(always)]
423 fn from(variant: HEALTHTESTSEL_A) -> Self {
424 variant as u8 != 0
425 }
426}
427impl HEALTHTESTSEL_R {
428 #[doc = "Get enumerated values variant"]
429 #[inline(always)]
430 pub fn variant(&self) -> HEALTHTESTSEL_A {
431 match self.bits {
432 false => HEALTHTESTSEL_A::BEFORE,
433 true => HEALTHTESTSEL_A::AFTER,
434 }
435 }
436 #[doc = "Checks if the value of the field is `BEFORE`"]
437 #[inline(always)]
438 pub fn is_before(&self) -> bool {
439 *self == HEALTHTESTSEL_A::BEFORE
440 }
441 #[doc = "Checks if the value of the field is `AFTER`"]
442 #[inline(always)]
443 pub fn is_after(&self) -> bool {
444 *self == HEALTHTESTSEL_A::AFTER
445 }
446}
447#[doc = "Field `HEALTHTESTSEL` writer - Health test input select"]
448pub type HEALTHTESTSEL_W<'a, const O: u8> =
449 crate::BitWriter<'a, u32, RNGCTRL_SPEC, HEALTHTESTSEL_A, O>;
450impl<'a, const O: u8> HEALTHTESTSEL_W<'a, O> {
451 #[doc = "Before conditioning"]
452 #[inline(always)]
453 pub fn before(self) -> &'a mut W {
454 self.variant(HEALTHTESTSEL_A::BEFORE)
455 }
456 #[doc = "After conditioning"]
457 #[inline(always)]
458 pub fn after(self) -> &'a mut W {
459 self.variant(HEALTHTESTSEL_A::AFTER)
460 }
461}
462#[doc = "Field `AIS31TESTSEL` reader - AIS31 test input select"]
463pub type AIS31TESTSEL_R = crate::BitReader<AIS31TESTSEL_A>;
464#[doc = "AIS31 test input select\n\nValue on reset: 0"]
465#[derive(Clone, Copy, Debug, PartialEq, Eq)]
466pub enum AIS31TESTSEL_A {
467 #[doc = "0: Before conditioning"]
468 BEFORE = 0,
469 #[doc = "1: After conditioning"]
470 AFTER = 1,
471}
472impl From<AIS31TESTSEL_A> for bool {
473 #[inline(always)]
474 fn from(variant: AIS31TESTSEL_A) -> Self {
475 variant as u8 != 0
476 }
477}
478impl AIS31TESTSEL_R {
479 #[doc = "Get enumerated values variant"]
480 #[inline(always)]
481 pub fn variant(&self) -> AIS31TESTSEL_A {
482 match self.bits {
483 false => AIS31TESTSEL_A::BEFORE,
484 true => AIS31TESTSEL_A::AFTER,
485 }
486 }
487 #[doc = "Checks if the value of the field is `BEFORE`"]
488 #[inline(always)]
489 pub fn is_before(&self) -> bool {
490 *self == AIS31TESTSEL_A::BEFORE
491 }
492 #[doc = "Checks if the value of the field is `AFTER`"]
493 #[inline(always)]
494 pub fn is_after(&self) -> bool {
495 *self == AIS31TESTSEL_A::AFTER
496 }
497}
498#[doc = "Field `AIS31TESTSEL` writer - AIS31 test input select"]
499pub type AIS31TESTSEL_W<'a, const O: u8> =
500 crate::BitWriter<'a, u32, RNGCTRL_SPEC, AIS31TESTSEL_A, O>;
501impl<'a, const O: u8> AIS31TESTSEL_W<'a, O> {
502 #[doc = "Before conditioning"]
503 #[inline(always)]
504 pub fn before(self) -> &'a mut W {
505 self.variant(AIS31TESTSEL_A::BEFORE)
506 }
507 #[doc = "After conditioning"]
508 #[inline(always)]
509 pub fn after(self) -> &'a mut W {
510 self.variant(AIS31TESTSEL_A::AFTER)
511 }
512}
513#[doc = "Field `NB128BITBLOCKS` reader - Number of 128b blocks in AES-CBCMAC"]
514pub type NB128BITBLOCKS_R = crate::FieldReader<u8, u8>;
515#[doc = "Field `NB128BITBLOCKS` writer - Number of 128b blocks in AES-CBCMAC"]
516pub type NB128BITBLOCKS_W<'a, const O: u8> =
517 crate::FieldWriter<'a, u32, RNGCTRL_SPEC, u8, u8, 4, O>;
518#[doc = "Field `FIFOWRSTARTUP` reader - Fifo Write Start Up"]
519pub type FIFOWRSTARTUP_R = crate::BitReader<bool>;
520#[doc = "Field `FIFOWRSTARTUP` writer - Fifo Write Start Up"]
521pub type FIFOWRSTARTUP_W<'a, const O: u8> = crate::BitWriter<'a, u32, RNGCTRL_SPEC, bool, O>;
522impl R {
523 #[doc = "Bit 0 - TRNG Module Enable"]
524 #[inline(always)]
525 pub fn enable(&self) -> ENABLE_R {
526 ENABLE_R::new((self.bits & 1) != 0)
527 }
528 #[doc = "Bit 2 - Test Enable"]
529 #[inline(always)]
530 pub fn testen(&self) -> TESTEN_R {
531 TESTEN_R::new(((self.bits >> 2) & 1) != 0)
532 }
533 #[doc = "Bit 3 - Conditioning Bypass"]
534 #[inline(always)]
535 pub fn condbypass(&self) -> CONDBYPASS_R {
536 CONDBYPASS_R::new(((self.bits >> 3) & 1) != 0)
537 }
538 #[doc = "Bit 4 - IRQ enable for Repetition Count Test"]
539 #[inline(always)]
540 pub fn repcountien(&self) -> REPCOUNTIEN_R {
541 REPCOUNTIEN_R::new(((self.bits >> 4) & 1) != 0)
542 }
543 #[doc = "Bit 5 - IRQ enable for APT64IF"]
544 #[inline(always)]
545 pub fn apt64ien(&self) -> APT64IEN_R {
546 APT64IEN_R::new(((self.bits >> 5) & 1) != 0)
547 }
548 #[doc = "Bit 6 - IRQ enable for APT4096IF"]
549 #[inline(always)]
550 pub fn apt4096ien(&self) -> APT4096IEN_R {
551 APT4096IEN_R::new(((self.bits >> 6) & 1) != 0)
552 }
553 #[doc = "Bit 7 - IRQ enable for FIFO full"]
554 #[inline(always)]
555 pub fn fullien(&self) -> FULLIEN_R {
556 FULLIEN_R::new(((self.bits >> 7) & 1) != 0)
557 }
558 #[doc = "Bit 8 - Software Reset"]
559 #[inline(always)]
560 pub fn softreset(&self) -> SOFTRESET_R {
561 SOFTRESET_R::new(((self.bits >> 8) & 1) != 0)
562 }
563 #[doc = "Bit 9 - IRQ enable for AIS31 prelim. noise alarm"]
564 #[inline(always)]
565 pub fn preien(&self) -> PREIEN_R {
566 PREIEN_R::new(((self.bits >> 9) & 1) != 0)
567 }
568 #[doc = "Bit 10 - IRQ enable for AIS31 noise alarm"]
569 #[inline(always)]
570 pub fn almien(&self) -> ALMIEN_R {
571 ALMIEN_R::new(((self.bits >> 10) & 1) != 0)
572 }
573 #[doc = "Bit 11 - Oscillator Force Run"]
574 #[inline(always)]
575 pub fn forcerun(&self) -> FORCERUN_R {
576 FORCERUN_R::new(((self.bits >> 11) & 1) != 0)
577 }
578 #[doc = "Bit 12 - NIST Start-up Test Bypass."]
579 #[inline(always)]
580 pub fn bypnist(&self) -> BYPNIST_R {
581 BYPNIST_R::new(((self.bits >> 12) & 1) != 0)
582 }
583 #[doc = "Bit 13 - AIS31 Start-up Test Bypass."]
584 #[inline(always)]
585 pub fn bypais31(&self) -> BYPAIS31_R {
586 BYPAIS31_R::new(((self.bits >> 13) & 1) != 0)
587 }
588 #[doc = "Bit 14 - Health test input select"]
589 #[inline(always)]
590 pub fn healthtestsel(&self) -> HEALTHTESTSEL_R {
591 HEALTHTESTSEL_R::new(((self.bits >> 14) & 1) != 0)
592 }
593 #[doc = "Bit 15 - AIS31 test input select"]
594 #[inline(always)]
595 pub fn ais31testsel(&self) -> AIS31TESTSEL_R {
596 AIS31TESTSEL_R::new(((self.bits >> 15) & 1) != 0)
597 }
598 #[doc = "Bits 16:19 - Number of 128b blocks in AES-CBCMAC"]
599 #[inline(always)]
600 pub fn nb128bitblocks(&self) -> NB128BITBLOCKS_R {
601 NB128BITBLOCKS_R::new(((self.bits >> 16) & 0x0f) as u8)
602 }
603 #[doc = "Bit 20 - Fifo Write Start Up"]
604 #[inline(always)]
605 pub fn fifowrstartup(&self) -> FIFOWRSTARTUP_R {
606 FIFOWRSTARTUP_R::new(((self.bits >> 20) & 1) != 0)
607 }
608}
609impl W {
610 #[doc = "Bit 0 - TRNG Module Enable"]
611 #[inline(always)]
612 #[must_use]
613 pub fn enable(&mut self) -> ENABLE_W<0> {
614 ENABLE_W::new(self)
615 }
616 #[doc = "Bit 2 - Test Enable"]
617 #[inline(always)]
618 #[must_use]
619 pub fn testen(&mut self) -> TESTEN_W<2> {
620 TESTEN_W::new(self)
621 }
622 #[doc = "Bit 3 - Conditioning Bypass"]
623 #[inline(always)]
624 #[must_use]
625 pub fn condbypass(&mut self) -> CONDBYPASS_W<3> {
626 CONDBYPASS_W::new(self)
627 }
628 #[doc = "Bit 4 - IRQ enable for Repetition Count Test"]
629 #[inline(always)]
630 #[must_use]
631 pub fn repcountien(&mut self) -> REPCOUNTIEN_W<4> {
632 REPCOUNTIEN_W::new(self)
633 }
634 #[doc = "Bit 5 - IRQ enable for APT64IF"]
635 #[inline(always)]
636 #[must_use]
637 pub fn apt64ien(&mut self) -> APT64IEN_W<5> {
638 APT64IEN_W::new(self)
639 }
640 #[doc = "Bit 6 - IRQ enable for APT4096IF"]
641 #[inline(always)]
642 #[must_use]
643 pub fn apt4096ien(&mut self) -> APT4096IEN_W<6> {
644 APT4096IEN_W::new(self)
645 }
646 #[doc = "Bit 7 - IRQ enable for FIFO full"]
647 #[inline(always)]
648 #[must_use]
649 pub fn fullien(&mut self) -> FULLIEN_W<7> {
650 FULLIEN_W::new(self)
651 }
652 #[doc = "Bit 8 - Software Reset"]
653 #[inline(always)]
654 #[must_use]
655 pub fn softreset(&mut self) -> SOFTRESET_W<8> {
656 SOFTRESET_W::new(self)
657 }
658 #[doc = "Bit 9 - IRQ enable for AIS31 prelim. noise alarm"]
659 #[inline(always)]
660 #[must_use]
661 pub fn preien(&mut self) -> PREIEN_W<9> {
662 PREIEN_W::new(self)
663 }
664 #[doc = "Bit 10 - IRQ enable for AIS31 noise alarm"]
665 #[inline(always)]
666 #[must_use]
667 pub fn almien(&mut self) -> ALMIEN_W<10> {
668 ALMIEN_W::new(self)
669 }
670 #[doc = "Bit 11 - Oscillator Force Run"]
671 #[inline(always)]
672 #[must_use]
673 pub fn forcerun(&mut self) -> FORCERUN_W<11> {
674 FORCERUN_W::new(self)
675 }
676 #[doc = "Bit 12 - NIST Start-up Test Bypass."]
677 #[inline(always)]
678 #[must_use]
679 pub fn bypnist(&mut self) -> BYPNIST_W<12> {
680 BYPNIST_W::new(self)
681 }
682 #[doc = "Bit 13 - AIS31 Start-up Test Bypass."]
683 #[inline(always)]
684 #[must_use]
685 pub fn bypais31(&mut self) -> BYPAIS31_W<13> {
686 BYPAIS31_W::new(self)
687 }
688 #[doc = "Bit 14 - Health test input select"]
689 #[inline(always)]
690 #[must_use]
691 pub fn healthtestsel(&mut self) -> HEALTHTESTSEL_W<14> {
692 HEALTHTESTSEL_W::new(self)
693 }
694 #[doc = "Bit 15 - AIS31 test input select"]
695 #[inline(always)]
696 #[must_use]
697 pub fn ais31testsel(&mut self) -> AIS31TESTSEL_W<15> {
698 AIS31TESTSEL_W::new(self)
699 }
700 #[doc = "Bits 16:19 - Number of 128b blocks in AES-CBCMAC"]
701 #[inline(always)]
702 #[must_use]
703 pub fn nb128bitblocks(&mut self) -> NB128BITBLOCKS_W<16> {
704 NB128BITBLOCKS_W::new(self)
705 }
706 #[doc = "Bit 20 - Fifo Write Start Up"]
707 #[inline(always)]
708 #[must_use]
709 pub fn fifowrstartup(&mut self) -> FIFOWRSTARTUP_W<20> {
710 FIFOWRSTARTUP_W::new(self)
711 }
712 #[doc = "Writes raw bits to the register."]
713 #[inline(always)]
714 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
715 self.0.bits(bits);
716 self
717 }
718}
719#[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"]
720pub struct RNGCTRL_SPEC;
721impl crate::RegisterSpec for RNGCTRL_SPEC {
722 type Ux = u32;
723}
724#[doc = "`read()` method returns [rngctrl::R](R) reader structure"]
725impl crate::Readable for RNGCTRL_SPEC {
726 type Reader = R;
727}
728#[doc = "`write(|w| ..)` method takes [rngctrl::W](W) writer structure"]
729impl crate::Writable for RNGCTRL_SPEC {
730 type Writer = W;
731 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
732 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
733}
734#[doc = "`reset()` method sets RNGCTRL to value 0x0004_0000"]
735impl crate::Resettable for RNGCTRL_SPEC {
736 const RESET_VALUE: Self::Ux = 0x0004_0000;
737}