ADuCM302x 0.1.0

A Peripheral Access Crate for the Analog Devices ADuCM302x series of MCUs
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
#[doc = "Reader of register CFG"]
pub type R = crate::R<u32, super::CFG>;
#[doc = "Writer for register CFG"]
pub type W = crate::W<u32, super::CFG>;
#[doc = "Register CFG `reset()`'s with value 0x1000_0000"]
impl crate::ResetValue for super::CFG {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0x1000_0000
    }
}
#[doc = "Enable Bit for Crypto Block\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BLKEN_A {
    #[doc = "0: Enable Crypto Block"]
    ENABLE = 0,
    #[doc = "1: Disable Crypto Block"]
    DISABLE = 1,
}
impl From<BLKEN_A> for bool {
    #[inline(always)]
    fn from(variant: BLKEN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `BLKEN`"]
pub type BLKEN_R = crate::R<bool, BLKEN_A>;
impl BLKEN_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BLKEN_A {
        match self.bits {
            false => BLKEN_A::ENABLE,
            true => BLKEN_A::DISABLE,
        }
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == BLKEN_A::ENABLE
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == BLKEN_A::DISABLE
    }
}
#[doc = "Write proxy for field `BLKEN`"]
pub struct BLKEN_W<'a> {
    w: &'a mut W,
}
impl<'a> BLKEN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: BLKEN_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Enable Crypto Block"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(BLKEN_A::ENABLE)
    }
    #[doc = "Disable Crypto Block"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(BLKEN_A::DISABLE)
    }
    #[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
    }
}
#[doc = "Reader of field `ENCR`"]
pub type ENCR_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ENCR`"]
pub struct ENCR_W<'a> {
    w: &'a mut W,
}
impl<'a> ENCR_W<'a> {
    #[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 = "Enable DMA Channel Request for Input Buffer\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum INDMAEN_A {
    #[doc = "0: Disable DMA Requesting for Input Buffer"]
    DMA_DISABLE_INBUF = 0,
    #[doc = "1: Enable DMA Requesting for Input Buffer"]
    DMA_ENABLE_INBUF = 1,
}
impl From<INDMAEN_A> for bool {
    #[inline(always)]
    fn from(variant: INDMAEN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `INDMAEN`"]
pub type INDMAEN_R = crate::R<bool, INDMAEN_A>;
impl INDMAEN_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> INDMAEN_A {
        match self.bits {
            false => INDMAEN_A::DMA_DISABLE_INBUF,
            true => INDMAEN_A::DMA_ENABLE_INBUF,
        }
    }
    #[doc = "Checks if the value of the field is `DMA_DISABLE_INBUF`"]
    #[inline(always)]
    pub fn is_dma_disable_inbuf(&self) -> bool {
        *self == INDMAEN_A::DMA_DISABLE_INBUF
    }
    #[doc = "Checks if the value of the field is `DMA_ENABLE_INBUF`"]
    #[inline(always)]
    pub fn is_dma_enable_inbuf(&self) -> bool {
        *self == INDMAEN_A::DMA_ENABLE_INBUF
    }
}
#[doc = "Write proxy for field `INDMAEN`"]
pub struct INDMAEN_W<'a> {
    w: &'a mut W,
}
impl<'a> INDMAEN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: INDMAEN_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Disable DMA Requesting for Input Buffer"]
    #[inline(always)]
    pub fn dma_disable_inbuf(self) -> &'a mut W {
        self.variant(INDMAEN_A::DMA_DISABLE_INBUF)
    }
    #[doc = "Enable DMA Requesting for Input Buffer"]
    #[inline(always)]
    pub fn dma_enable_inbuf(self) -> &'a mut W {
        self.variant(INDMAEN_A::DMA_ENABLE_INBUF)
    }
    #[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 << 2)) | (((value as u32) & 0x01) << 2);
        self.w
    }
}
#[doc = "Enable DMA Channel Request for Output Buffer\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OUTDMAEN_A {
    #[doc = "0: Disable DMA Requesting for Output Buffer"]
    DMA_DISABLE_OUTBUF = 0,
    #[doc = "1: Enable DMA Requesting for Output Buffer"]
    DMA_ENABLE_OUTBUF = 1,
}
impl From<OUTDMAEN_A> for bool {
    #[inline(always)]
    fn from(variant: OUTDMAEN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `OUTDMAEN`"]
pub type OUTDMAEN_R = crate::R<bool, OUTDMAEN_A>;
impl OUTDMAEN_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OUTDMAEN_A {
        match self.bits {
            false => OUTDMAEN_A::DMA_DISABLE_OUTBUF,
            true => OUTDMAEN_A::DMA_ENABLE_OUTBUF,
        }
    }
    #[doc = "Checks if the value of the field is `DMA_DISABLE_OUTBUF`"]
    #[inline(always)]
    pub fn is_dma_disable_outbuf(&self) -> bool {
        *self == OUTDMAEN_A::DMA_DISABLE_OUTBUF
    }
    #[doc = "Checks if the value of the field is `DMA_ENABLE_OUTBUF`"]
    #[inline(always)]
    pub fn is_dma_enable_outbuf(&self) -> bool {
        *self == OUTDMAEN_A::DMA_ENABLE_OUTBUF
    }
}
#[doc = "Write proxy for field `OUTDMAEN`"]
pub struct OUTDMAEN_W<'a> {
    w: &'a mut W,
}
impl<'a> OUTDMAEN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: OUTDMAEN_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Disable DMA Requesting for Output Buffer"]
    #[inline(always)]
    pub fn dma_disable_outbuf(self) -> &'a mut W {
        self.variant(OUTDMAEN_A::DMA_DISABLE_OUTBUF)
    }
    #[doc = "Enable DMA Requesting for Output Buffer"]
    #[inline(always)]
    pub fn dma_enable_outbuf(self) -> &'a mut W {
        self.variant(OUTDMAEN_A::DMA_ENABLE_OUTBUF)
    }
    #[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 << 3)) | (((value as u32) & 0x01) << 3);
        self.w
    }
}
#[doc = "Write proxy for field `INFLUSH`"]
pub struct INFLUSH_W<'a> {
    w: &'a mut W,
}
impl<'a> INFLUSH_W<'a> {
    #[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 << 4)) | (((value as u32) & 0x01) << 4);
        self.w
    }
}
#[doc = "Write proxy for field `OUTFLUSH`"]
pub struct OUTFLUSH_W<'a> {
    w: &'a mut W,
}
impl<'a> OUTFLUSH_W<'a> {
    #[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 << 5)) | (((value as u32) & 0x01) << 5);
        self.w
    }
}
#[doc = "Reader of field `AES_BYTESWAP`"]
pub type AES_BYTESWAP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `AES_BYTESWAP`"]
pub struct AES_BYTESWAP_W<'a> {
    w: &'a mut W,
}
impl<'a> AES_BYTESWAP_W<'a> {
    #[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 << 6)) | (((value as u32) & 0x01) << 6);
        self.w
    }
}
#[doc = "Select Key Length for AES Cipher\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum AESKEYLEN_A {
    #[doc = "0: Uses 128-bit long key"]
    AESKEYLEN128 = 0,
    #[doc = "2: Uses 256-bit long key"]
    AESKEYLEN256 = 2,
}
impl From<AESKEYLEN_A> for u8 {
    #[inline(always)]
    fn from(variant: AESKEYLEN_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `AESKEYLEN`"]
pub type AESKEYLEN_R = crate::R<u8, AESKEYLEN_A>;
impl AESKEYLEN_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, AESKEYLEN_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(AESKEYLEN_A::AESKEYLEN128),
            2 => Val(AESKEYLEN_A::AESKEYLEN256),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `AESKEYLEN128`"]
    #[inline(always)]
    pub fn is_aeskeylen128(&self) -> bool {
        *self == AESKEYLEN_A::AESKEYLEN128
    }
    #[doc = "Checks if the value of the field is `AESKEYLEN256`"]
    #[inline(always)]
    pub fn is_aeskeylen256(&self) -> bool {
        *self == AESKEYLEN_A::AESKEYLEN256
    }
}
#[doc = "Write proxy for field `AESKEYLEN`"]
pub struct AESKEYLEN_W<'a> {
    w: &'a mut W,
}
impl<'a> AESKEYLEN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: AESKEYLEN_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "Uses 128-bit long key"]
    #[inline(always)]
    pub fn aeskeylen128(self) -> &'a mut W {
        self.variant(AESKEYLEN_A::AESKEYLEN128)
    }
    #[doc = "Uses 256-bit long key"]
    #[inline(always)]
    pub fn aeskeylen256(self) -> &'a mut W {
        self.variant(AESKEYLEN_A::AESKEYLEN256)
    }
    #[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 & !(0x03 << 8)) | (((value as u32) & 0x03) << 8);
        self.w
    }
}
#[doc = "Reader of field `ECBEN`"]
pub type ECBEN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ECBEN`"]
pub struct ECBEN_W<'a> {
    w: &'a mut W,
}
impl<'a> ECBEN_W<'a> {
    #[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 << 16)) | (((value as u32) & 0x01) << 16);
        self.w
    }
}
#[doc = "Reader of field `CTREN`"]
pub type CTREN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `CTREN`"]
pub struct CTREN_W<'a> {
    w: &'a mut W,
}
impl<'a> CTREN_W<'a> {
    #[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 << 17)) | (((value as u32) & 0x01) << 17);
        self.w
    }
}
#[doc = "Reader of field `CBCEN`"]
pub type CBCEN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `CBCEN`"]
pub struct CBCEN_W<'a> {
    w: &'a mut W,
}
impl<'a> CBCEN_W<'a> {
    #[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 << 18)) | (((value as u32) & 0x01) << 18);
        self.w
    }
}
#[doc = "Reader of field `CCMEN`"]
pub type CCMEN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `CCMEN`"]
pub struct CCMEN_W<'a> {
    w: &'a mut W,
}
impl<'a> CCMEN_W<'a> {
    #[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 << 19)) | (((value as u32) & 0x01) << 19);
        self.w
    }
}
#[doc = "Reader of field `CMACEN`"]
pub type CMACEN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `CMACEN`"]
pub struct CMACEN_W<'a> {
    w: &'a mut W,
}
impl<'a> CMACEN_W<'a> {
    #[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 << 20)) | (((value as u32) & 0x01) << 20);
        self.w
    }
}
#[doc = "Reader of field `SHA256EN`"]
pub type SHA256EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `SHA256EN`"]
pub struct SHA256EN_W<'a> {
    w: &'a mut W,
}
impl<'a> SHA256EN_W<'a> {
    #[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 << 25)) | (((value as u32) & 0x01) << 25);
        self.w
    }
}
#[doc = "Reader of field `SHAINIT`"]
pub type SHAINIT_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `SHAINIT`"]
pub struct SHAINIT_W<'a> {
    w: &'a mut W,
}
impl<'a> SHAINIT_W<'a> {
    #[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 << 26)) | (((value as u32) & 0x01) << 26);
        self.w
    }
}
#[doc = "Reader of field `RevID`"]
pub type REVID_R = crate::R<u8, u8>;
impl R {
    #[doc = "Bit 0 - Enable Bit for Crypto Block"]
    #[inline(always)]
    pub fn blken(&self) -> BLKEN_R {
        BLKEN_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bit 1 - Encrypt or Decrypt"]
    #[inline(always)]
    pub fn encr(&self) -> ENCR_R {
        ENCR_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bit 2 - Enable DMA Channel Request for Input Buffer"]
    #[inline(always)]
    pub fn indmaen(&self) -> INDMAEN_R {
        INDMAEN_R::new(((self.bits >> 2) & 0x01) != 0)
    }
    #[doc = "Bit 3 - Enable DMA Channel Request for Output Buffer"]
    #[inline(always)]
    pub fn outdmaen(&self) -> OUTDMAEN_R {
        OUTDMAEN_R::new(((self.bits >> 3) & 0x01) != 0)
    }
    #[doc = "Bit 6 - Byte Swap 32 Bit AES Input Data"]
    #[inline(always)]
    pub fn aes_byteswap(&self) -> AES_BYTESWAP_R {
        AES_BYTESWAP_R::new(((self.bits >> 6) & 0x01) != 0)
    }
    #[doc = "Bits 8:9 - Select Key Length for AES Cipher"]
    #[inline(always)]
    pub fn aeskeylen(&self) -> AESKEYLEN_R {
        AESKEYLEN_R::new(((self.bits >> 8) & 0x03) as u8)
    }
    #[doc = "Bit 16 - Enable ECB Mode Operation"]
    #[inline(always)]
    pub fn ecben(&self) -> ECBEN_R {
        ECBEN_R::new(((self.bits >> 16) & 0x01) != 0)
    }
    #[doc = "Bit 17 - Enable CTR Mode Operation"]
    #[inline(always)]
    pub fn ctren(&self) -> CTREN_R {
        CTREN_R::new(((self.bits >> 17) & 0x01) != 0)
    }
    #[doc = "Bit 18 - Enable CBC Mode Operation"]
    #[inline(always)]
    pub fn cbcen(&self) -> CBCEN_R {
        CBCEN_R::new(((self.bits >> 18) & 0x01) != 0)
    }
    #[doc = "Bit 19 - Enable CCM/CCM* Mode Operation"]
    #[inline(always)]
    pub fn ccmen(&self) -> CCMEN_R {
        CCMEN_R::new(((self.bits >> 19) & 0x01) != 0)
    }
    #[doc = "Bit 20 - Enable CMAC Mode Operation"]
    #[inline(always)]
    pub fn cmacen(&self) -> CMACEN_R {
        CMACEN_R::new(((self.bits >> 20) & 0x01) != 0)
    }
    #[doc = "Bit 25 - Enable SHA-256 Operation"]
    #[inline(always)]
    pub fn sha256en(&self) -> SHA256EN_R {
        SHA256EN_R::new(((self.bits >> 25) & 0x01) != 0)
    }
    #[doc = "Bit 26 - Restarts SHA Computation"]
    #[inline(always)]
    pub fn shainit(&self) -> SHAINIT_R {
        SHAINIT_R::new(((self.bits >> 26) & 0x01) != 0)
    }
    #[doc = "Bits 28:31 - Rev ID for Crypto"]
    #[inline(always)]
    pub fn rev_id(&self) -> REVID_R {
        REVID_R::new(((self.bits >> 28) & 0x0f) as u8)
    }
}
impl W {
    #[doc = "Bit 0 - Enable Bit for Crypto Block"]
    #[inline(always)]
    pub fn blken(&mut self) -> BLKEN_W {
        BLKEN_W { w: self }
    }
    #[doc = "Bit 1 - Encrypt or Decrypt"]
    #[inline(always)]
    pub fn encr(&mut self) -> ENCR_W {
        ENCR_W { w: self }
    }
    #[doc = "Bit 2 - Enable DMA Channel Request for Input Buffer"]
    #[inline(always)]
    pub fn indmaen(&mut self) -> INDMAEN_W {
        INDMAEN_W { w: self }
    }
    #[doc = "Bit 3 - Enable DMA Channel Request for Output Buffer"]
    #[inline(always)]
    pub fn outdmaen(&mut self) -> OUTDMAEN_W {
        OUTDMAEN_W { w: self }
    }
    #[doc = "Bit 4 - Input Buffer Flush"]
    #[inline(always)]
    pub fn inflush(&mut self) -> INFLUSH_W {
        INFLUSH_W { w: self }
    }
    #[doc = "Bit 5 - Output Buffer Flush"]
    #[inline(always)]
    pub fn outflush(&mut self) -> OUTFLUSH_W {
        OUTFLUSH_W { w: self }
    }
    #[doc = "Bit 6 - Byte Swap 32 Bit AES Input Data"]
    #[inline(always)]
    pub fn aes_byteswap(&mut self) -> AES_BYTESWAP_W {
        AES_BYTESWAP_W { w: self }
    }
    #[doc = "Bits 8:9 - Select Key Length for AES Cipher"]
    #[inline(always)]
    pub fn aeskeylen(&mut self) -> AESKEYLEN_W {
        AESKEYLEN_W { w: self }
    }
    #[doc = "Bit 16 - Enable ECB Mode Operation"]
    #[inline(always)]
    pub fn ecben(&mut self) -> ECBEN_W {
        ECBEN_W { w: self }
    }
    #[doc = "Bit 17 - Enable CTR Mode Operation"]
    #[inline(always)]
    pub fn ctren(&mut self) -> CTREN_W {
        CTREN_W { w: self }
    }
    #[doc = "Bit 18 - Enable CBC Mode Operation"]
    #[inline(always)]
    pub fn cbcen(&mut self) -> CBCEN_W {
        CBCEN_W { w: self }
    }
    #[doc = "Bit 19 - Enable CCM/CCM* Mode Operation"]
    #[inline(always)]
    pub fn ccmen(&mut self) -> CCMEN_W {
        CCMEN_W { w: self }
    }
    #[doc = "Bit 20 - Enable CMAC Mode Operation"]
    #[inline(always)]
    pub fn cmacen(&mut self) -> CMACEN_W {
        CMACEN_W { w: self }
    }
    #[doc = "Bit 25 - Enable SHA-256 Operation"]
    #[inline(always)]
    pub fn sha256en(&mut self) -> SHA256EN_W {
        SHA256EN_W { w: self }
    }
    #[doc = "Bit 26 - Restarts SHA Computation"]
    #[inline(always)]
    pub fn shainit(&mut self) -> SHAINIT_W {
        SHAINIT_W { w: self }
    }
}