1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
#[doc = "Register `OPTR` reader"]
pub struct R(crate::R<OPTR_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<OPTR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<OPTR_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<OPTR_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `OPTR` writer"]
pub struct W(crate::W<OPTR_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<OPTR_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<OPTR_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<OPTR_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Read protection level\n\nValue on reset: 170"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum RDP_A {
    #[doc = "136: Level 1, memories readout protection active (writes 0x88)"]
    Level1 = 136,
    #[doc = "170: Level 0, readout protection not active"]
    Level0 = 170,
    #[doc = "204: Level 2, chip readout protection active"]
    Level2 = 204,
}
impl From<RDP_A> for u8 {
    #[inline(always)]
    fn from(variant: RDP_A) -> Self {
        variant as _
    }
}
#[doc = "Field `RDP` reader - Read protection level"]
pub type RDP_R = crate::FieldReader<u8, RDP_A>;
impl RDP_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<RDP_A> {
        match self.bits {
            136 => Some(RDP_A::Level1),
            170 => Some(RDP_A::Level0),
            204 => Some(RDP_A::Level2),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `Level1`"]
    #[inline(always)]
    pub fn is_level1(&self) -> bool {
        *self == RDP_A::Level1
    }
    #[doc = "Checks if the value of the field is `Level0`"]
    #[inline(always)]
    pub fn is_level0(&self) -> bool {
        *self == RDP_A::Level0
    }
    #[doc = "Checks if the value of the field is `Level2`"]
    #[inline(always)]
    pub fn is_level2(&self) -> bool {
        *self == RDP_A::Level2
    }
}
#[doc = "Field `RDP` writer - Read protection level"]
pub type RDP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, OPTR_SPEC, u8, RDP_A, 8, O>;
impl<'a, const O: u8> RDP_W<'a, O> {
    #[doc = "Level 1, memories readout protection active (writes 0x88)"]
    #[inline(always)]
    pub fn level1(self) -> &'a mut W {
        self.variant(RDP_A::Level1)
    }
    #[doc = "Level 0, readout protection not active"]
    #[inline(always)]
    pub fn level0(self) -> &'a mut W {
        self.variant(RDP_A::Level0)
    }
    #[doc = "Level 2, chip readout protection active"]
    #[inline(always)]
    pub fn level2(self) -> &'a mut W {
        self.variant(RDP_A::Level2)
    }
}
#[doc = "System security enabled flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ESE_A {
    #[doc = "0: Security disabled"]
    Disabled = 0,
    #[doc = "1: Security enabled"]
    Enabled = 1,
}
impl From<ESE_A> for bool {
    #[inline(always)]
    fn from(variant: ESE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ESE` reader - System security enabled flag"]
pub type ESE_R = crate::BitReader<ESE_A>;
impl ESE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> ESE_A {
        match self.bits {
            false => ESE_A::Disabled,
            true => ESE_A::Enabled,
        }
    }
    #[doc = "Checks if the value of the field is `Disabled`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == ESE_A::Disabled
    }
    #[doc = "Checks if the value of the field is `Enabled`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == ESE_A::Enabled
    }
}
#[doc = "Field `ESE` writer - System security enabled flag"]
pub type ESE_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, ESE_A, O>;
impl<'a, const O: u8> ESE_W<'a, O> {
    #[doc = "Security disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(ESE_A::Disabled)
    }
    #[doc = "Security enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(ESE_A::Enabled)
    }
}
#[doc = "BOR reset Level\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum BOR_LEV_A {
    #[doc = "0: BOR level 0. Reset level threshold is around 1.7 V"]
    Level0 = 0,
    #[doc = "1: BOR level 1. Reset level threshold is around 2.0 V"]
    Level1 = 1,
    #[doc = "2: BOR level 2. Reset level threshold is around 2.2 V"]
    Level2 = 2,
    #[doc = "3: BOR level 3. Reset level threshold is around 2.5 V"]
    Level3 = 3,
    #[doc = "4: BOR level 4. Reset level threshold is around 2.8 V"]
    Level4 = 4,
}
impl From<BOR_LEV_A> for u8 {
    #[inline(always)]
    fn from(variant: BOR_LEV_A) -> Self {
        variant as _
    }
}
#[doc = "Field `BOR_LEV` reader - BOR reset Level"]
pub type BOR_LEV_R = crate::FieldReader<u8, BOR_LEV_A>;
impl BOR_LEV_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<BOR_LEV_A> {
        match self.bits {
            0 => Some(BOR_LEV_A::Level0),
            1 => Some(BOR_LEV_A::Level1),
            2 => Some(BOR_LEV_A::Level2),
            3 => Some(BOR_LEV_A::Level3),
            4 => Some(BOR_LEV_A::Level4),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `Level0`"]
    #[inline(always)]
    pub fn is_level0(&self) -> bool {
        *self == BOR_LEV_A::Level0
    }
    #[doc = "Checks if the value of the field is `Level1`"]
    #[inline(always)]
    pub fn is_level1(&self) -> bool {
        *self == BOR_LEV_A::Level1
    }
    #[doc = "Checks if the value of the field is `Level2`"]
    #[inline(always)]
    pub fn is_level2(&self) -> bool {
        *self == BOR_LEV_A::Level2
    }
    #[doc = "Checks if the value of the field is `Level3`"]
    #[inline(always)]
    pub fn is_level3(&self) -> bool {
        *self == BOR_LEV_A::Level3
    }
    #[doc = "Checks if the value of the field is `Level4`"]
    #[inline(always)]
    pub fn is_level4(&self) -> bool {
        *self == BOR_LEV_A::Level4
    }
}
#[doc = "Field `BOR_LEV` writer - BOR reset Level"]
pub type BOR_LEV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, OPTR_SPEC, u8, BOR_LEV_A, 3, O>;
impl<'a, const O: u8> BOR_LEV_W<'a, O> {
    #[doc = "BOR level 0. Reset level threshold is around 1.7 V"]
    #[inline(always)]
    pub fn level0(self) -> &'a mut W {
        self.variant(BOR_LEV_A::Level0)
    }
    #[doc = "BOR level 1. Reset level threshold is around 2.0 V"]
    #[inline(always)]
    pub fn level1(self) -> &'a mut W {
        self.variant(BOR_LEV_A::Level1)
    }
    #[doc = "BOR level 2. Reset level threshold is around 2.2 V"]
    #[inline(always)]
    pub fn level2(self) -> &'a mut W {
        self.variant(BOR_LEV_A::Level2)
    }
    #[doc = "BOR level 3. Reset level threshold is around 2.5 V"]
    #[inline(always)]
    pub fn level3(self) -> &'a mut W {
        self.variant(BOR_LEV_A::Level3)
    }
    #[doc = "BOR level 4. Reset level threshold is around 2.8 V"]
    #[inline(always)]
    pub fn level4(self) -> &'a mut W {
        self.variant(BOR_LEV_A::Level4)
    }
}
#[doc = "nRST_STOP\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NRST_STOP_A {
    #[doc = "0: Reset generated when entering the Standby mode"]
    Enabled = 0,
    #[doc = "1: No reset generated when entering the Standby mode"]
    Disabled = 1,
}
impl From<NRST_STOP_A> for bool {
    #[inline(always)]
    fn from(variant: NRST_STOP_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `nRST_STOP` reader - nRST_STOP"]
pub type NRST_STOP_R = crate::BitReader<NRST_STOP_A>;
impl NRST_STOP_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NRST_STOP_A {
        match self.bits {
            false => NRST_STOP_A::Enabled,
            true => NRST_STOP_A::Disabled,
        }
    }
    #[doc = "Checks if the value of the field is `Enabled`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == NRST_STOP_A::Enabled
    }
    #[doc = "Checks if the value of the field is `Disabled`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == NRST_STOP_A::Disabled
    }
}
#[doc = "Field `nRST_STOP` writer - nRST_STOP"]
pub type NRST_STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, NRST_STOP_A, O>;
impl<'a, const O: u8> NRST_STOP_W<'a, O> {
    #[doc = "Reset generated when entering the Standby mode"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(NRST_STOP_A::Enabled)
    }
    #[doc = "No reset generated when entering the Standby mode"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(NRST_STOP_A::Disabled)
    }
}
#[doc = "nRST_STDBY\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NRST_STDBY_A {
    #[doc = "0: Reset generated when entering the Standby mode"]
    Enabled = 0,
    #[doc = "1: No reset generated when entering the Standby mode"]
    Disabled = 1,
}
impl From<NRST_STDBY_A> for bool {
    #[inline(always)]
    fn from(variant: NRST_STDBY_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `nRST_STDBY` reader - nRST_STDBY"]
pub type NRST_STDBY_R = crate::BitReader<NRST_STDBY_A>;
impl NRST_STDBY_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NRST_STDBY_A {
        match self.bits {
            false => NRST_STDBY_A::Enabled,
            true => NRST_STDBY_A::Disabled,
        }
    }
    #[doc = "Checks if the value of the field is `Enabled`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == NRST_STDBY_A::Enabled
    }
    #[doc = "Checks if the value of the field is `Disabled`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == NRST_STDBY_A::Disabled
    }
}
#[doc = "Field `nRST_STDBY` writer - nRST_STDBY"]
pub type NRST_STDBY_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, NRST_STDBY_A, O>;
impl<'a, const O: u8> NRST_STDBY_W<'a, O> {
    #[doc = "Reset generated when entering the Standby mode"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(NRST_STDBY_A::Enabled)
    }
    #[doc = "No reset generated when entering the Standby mode"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(NRST_STDBY_A::Disabled)
    }
}
#[doc = "nRSTSHDW\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NRST_SHDW_A {
    #[doc = "0: Reset generated when entering the Shutdown mode"]
    Enabled = 0,
    #[doc = "1: No reset generated when entering the Shutdown mode"]
    Disabled = 1,
}
impl From<NRST_SHDW_A> for bool {
    #[inline(always)]
    fn from(variant: NRST_SHDW_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `nRST_SHDW` reader - nRSTSHDW"]
pub type NRST_SHDW_R = crate::BitReader<NRST_SHDW_A>;
impl NRST_SHDW_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NRST_SHDW_A {
        match self.bits {
            false => NRST_SHDW_A::Enabled,
            true => NRST_SHDW_A::Disabled,
        }
    }
    #[doc = "Checks if the value of the field is `Enabled`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == NRST_SHDW_A::Enabled
    }
    #[doc = "Checks if the value of the field is `Disabled`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == NRST_SHDW_A::Disabled
    }
}
#[doc = "Field `nRST_SHDW` writer - nRSTSHDW"]
pub type NRST_SHDW_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, NRST_SHDW_A, O>;
impl<'a, const O: u8> NRST_SHDW_W<'a, O> {
    #[doc = "Reset generated when entering the Shutdown mode"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(NRST_SHDW_A::Enabled)
    }
    #[doc = "No reset generated when entering the Shutdown mode"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(NRST_SHDW_A::Disabled)
    }
}
#[doc = "Independent watchdog selection\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum IWDG_SW_A {
    #[doc = "0: Hardware independent watchdog"]
    Hardware = 0,
    #[doc = "1: Software independent watchdog"]
    Software = 1,
}
impl From<IWDG_SW_A> for bool {
    #[inline(always)]
    fn from(variant: IWDG_SW_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IWDG_SW` reader - Independent watchdog selection"]
pub type IWDG_SW_R = crate::BitReader<IWDG_SW_A>;
impl IWDG_SW_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IWDG_SW_A {
        match self.bits {
            false => IWDG_SW_A::Hardware,
            true => IWDG_SW_A::Software,
        }
    }
    #[doc = "Checks if the value of the field is `Hardware`"]
    #[inline(always)]
    pub fn is_hardware(&self) -> bool {
        *self == IWDG_SW_A::Hardware
    }
    #[doc = "Checks if the value of the field is `Software`"]
    #[inline(always)]
    pub fn is_software(&self) -> bool {
        *self == IWDG_SW_A::Software
    }
}
#[doc = "Field `IWDG_SW` writer - Independent watchdog selection"]
pub type IWDG_SW_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, IWDG_SW_A, O>;
impl<'a, const O: u8> IWDG_SW_W<'a, O> {
    #[doc = "Hardware independent watchdog"]
    #[inline(always)]
    pub fn hardware(self) -> &'a mut W {
        self.variant(IWDG_SW_A::Hardware)
    }
    #[doc = "Software independent watchdog"]
    #[inline(always)]
    pub fn software(self) -> &'a mut W {
        self.variant(IWDG_SW_A::Software)
    }
}
#[doc = "Independent watchdog counter freeze in Stop mode\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum IWDG_STOP_A {
    #[doc = "0: Independent watchdog counter frozen in Stop mode"]
    Frozen = 0,
    #[doc = "1: Independent watchdog counter running in Stop mode"]
    Running = 1,
}
impl From<IWDG_STOP_A> for bool {
    #[inline(always)]
    fn from(variant: IWDG_STOP_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IWDG_STOP` reader - Independent watchdog counter freeze in Stop mode"]
pub type IWDG_STOP_R = crate::BitReader<IWDG_STOP_A>;
impl IWDG_STOP_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IWDG_STOP_A {
        match self.bits {
            false => IWDG_STOP_A::Frozen,
            true => IWDG_STOP_A::Running,
        }
    }
    #[doc = "Checks if the value of the field is `Frozen`"]
    #[inline(always)]
    pub fn is_frozen(&self) -> bool {
        *self == IWDG_STOP_A::Frozen
    }
    #[doc = "Checks if the value of the field is `Running`"]
    #[inline(always)]
    pub fn is_running(&self) -> bool {
        *self == IWDG_STOP_A::Running
    }
}
#[doc = "Field `IWDG_STOP` writer - Independent watchdog counter freeze in Stop mode"]
pub type IWDG_STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, IWDG_STOP_A, O>;
impl<'a, const O: u8> IWDG_STOP_W<'a, O> {
    #[doc = "Independent watchdog counter frozen in Stop mode"]
    #[inline(always)]
    pub fn frozen(self) -> &'a mut W {
        self.variant(IWDG_STOP_A::Frozen)
    }
    #[doc = "Independent watchdog counter running in Stop mode"]
    #[inline(always)]
    pub fn running(self) -> &'a mut W {
        self.variant(IWDG_STOP_A::Running)
    }
}
#[doc = "Independent watchdog counter freeze in Standby mode\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum IWDG_STDBY_A {
    #[doc = "0: Independent watchdog counter frozen in Standby mode"]
    Frozen = 0,
    #[doc = "1: Independent watchdog counter running in Standby mode"]
    Running = 1,
}
impl From<IWDG_STDBY_A> for bool {
    #[inline(always)]
    fn from(variant: IWDG_STDBY_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IWDG_STDBY` reader - Independent watchdog counter freeze in Standby mode"]
pub type IWDG_STDBY_R = crate::BitReader<IWDG_STDBY_A>;
impl IWDG_STDBY_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IWDG_STDBY_A {
        match self.bits {
            false => IWDG_STDBY_A::Frozen,
            true => IWDG_STDBY_A::Running,
        }
    }
    #[doc = "Checks if the value of the field is `Frozen`"]
    #[inline(always)]
    pub fn is_frozen(&self) -> bool {
        *self == IWDG_STDBY_A::Frozen
    }
    #[doc = "Checks if the value of the field is `Running`"]
    #[inline(always)]
    pub fn is_running(&self) -> bool {
        *self == IWDG_STDBY_A::Running
    }
}
#[doc = "Field `IWDG_STDBY` writer - Independent watchdog counter freeze in Standby mode"]
pub type IWDG_STDBY_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, IWDG_STDBY_A, O>;
impl<'a, const O: u8> IWDG_STDBY_W<'a, O> {
    #[doc = "Independent watchdog counter frozen in Standby mode"]
    #[inline(always)]
    pub fn frozen(self) -> &'a mut W {
        self.variant(IWDG_STDBY_A::Frozen)
    }
    #[doc = "Independent watchdog counter running in Standby mode"]
    #[inline(always)]
    pub fn running(self) -> &'a mut W {
        self.variant(IWDG_STDBY_A::Running)
    }
}
#[doc = "Window watchdog selection\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum WWDG_SW_A {
    #[doc = "0: Hardware window watchdog"]
    Hardware = 0,
    #[doc = "1: Software window watchdog"]
    Software = 1,
}
impl From<WWDG_SW_A> for bool {
    #[inline(always)]
    fn from(variant: WWDG_SW_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `WWDG_SW` reader - Window watchdog selection"]
pub type WWDG_SW_R = crate::BitReader<WWDG_SW_A>;
impl WWDG_SW_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> WWDG_SW_A {
        match self.bits {
            false => WWDG_SW_A::Hardware,
            true => WWDG_SW_A::Software,
        }
    }
    #[doc = "Checks if the value of the field is `Hardware`"]
    #[inline(always)]
    pub fn is_hardware(&self) -> bool {
        *self == WWDG_SW_A::Hardware
    }
    #[doc = "Checks if the value of the field is `Software`"]
    #[inline(always)]
    pub fn is_software(&self) -> bool {
        *self == WWDG_SW_A::Software
    }
}
#[doc = "Field `WWDG_SW` writer - Window watchdog selection"]
pub type WWDG_SW_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, WWDG_SW_A, O>;
impl<'a, const O: u8> WWDG_SW_W<'a, O> {
    #[doc = "Hardware window watchdog"]
    #[inline(always)]
    pub fn hardware(self) -> &'a mut W {
        self.variant(WWDG_SW_A::Hardware)
    }
    #[doc = "Software window watchdog"]
    #[inline(always)]
    pub fn software(self) -> &'a mut W {
        self.variant(WWDG_SW_A::Software)
    }
}
#[doc = "Boot configuration\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NBOOT1_A {
    #[doc = "0: When nSWBOOT0 is cleared, select boot mode together with nBOOT0"]
    Clear = 0,
    #[doc = "1: When nSWBOOT0 is cleared, select boot mode together with nBOOT0"]
    Set = 1,
}
impl From<NBOOT1_A> for bool {
    #[inline(always)]
    fn from(variant: NBOOT1_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `nBOOT1` reader - Boot configuration"]
pub type NBOOT1_R = crate::BitReader<NBOOT1_A>;
impl NBOOT1_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NBOOT1_A {
        match self.bits {
            false => NBOOT1_A::Clear,
            true => NBOOT1_A::Set,
        }
    }
    #[doc = "Checks if the value of the field is `Clear`"]
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        *self == NBOOT1_A::Clear
    }
    #[doc = "Checks if the value of the field is `Set`"]
    #[inline(always)]
    pub fn is_set(&self) -> bool {
        *self == NBOOT1_A::Set
    }
}
#[doc = "Field `nBOOT1` writer - Boot configuration"]
pub type NBOOT1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, NBOOT1_A, O>;
impl<'a, const O: u8> NBOOT1_W<'a, O> {
    #[doc = "When nSWBOOT0 is cleared, select boot mode together with nBOOT0"]
    #[inline(always)]
    pub fn clear(self) -> &'a mut W {
        self.variant(NBOOT1_A::Clear)
    }
    #[doc = "When nSWBOOT0 is cleared, select boot mode together with nBOOT0"]
    #[inline(always)]
    pub fn set(self) -> &'a mut W {
        self.variant(NBOOT1_A::Set)
    }
}
#[doc = "SRAM2 parity check enable\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SRAM2_PE_A {
    #[doc = "0: SRAM2 Parity check enabled"]
    Enabled = 0,
    #[doc = "1: SRAM2 Parity check disabled"]
    Disabled = 1,
}
impl From<SRAM2_PE_A> for bool {
    #[inline(always)]
    fn from(variant: SRAM2_PE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SRAM2_PE` reader - SRAM2 parity check enable"]
pub type SRAM2_PE_R = crate::BitReader<SRAM2_PE_A>;
impl SRAM2_PE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SRAM2_PE_A {
        match self.bits {
            false => SRAM2_PE_A::Enabled,
            true => SRAM2_PE_A::Disabled,
        }
    }
    #[doc = "Checks if the value of the field is `Enabled`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == SRAM2_PE_A::Enabled
    }
    #[doc = "Checks if the value of the field is `Disabled`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == SRAM2_PE_A::Disabled
    }
}
#[doc = "Field `SRAM2_PE` writer - SRAM2 parity check enable"]
pub type SRAM2_PE_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, SRAM2_PE_A, O>;
impl<'a, const O: u8> SRAM2_PE_W<'a, O> {
    #[doc = "SRAM2 Parity check enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(SRAM2_PE_A::Enabled)
    }
    #[doc = "SRAM2 Parity check disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(SRAM2_PE_A::Disabled)
    }
}
#[doc = "SRAM2 Erase when system reset\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SRAM_RST_A {
    #[doc = "0: SRAM1 and SRAM2 erased when a system reset occurs"]
    Reset = 0,
    #[doc = "1: SRAM1 and SRAM2 not erased when a system reset occurs"]
    NotReset = 1,
}
impl From<SRAM_RST_A> for bool {
    #[inline(always)]
    fn from(variant: SRAM_RST_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SRAM_RST` reader - SRAM2 Erase when system reset"]
pub type SRAM_RST_R = crate::BitReader<SRAM_RST_A>;
impl SRAM_RST_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SRAM_RST_A {
        match self.bits {
            false => SRAM_RST_A::Reset,
            true => SRAM_RST_A::NotReset,
        }
    }
    #[doc = "Checks if the value of the field is `Reset`"]
    #[inline(always)]
    pub fn is_reset(&self) -> bool {
        *self == SRAM_RST_A::Reset
    }
    #[doc = "Checks if the value of the field is `NotReset`"]
    #[inline(always)]
    pub fn is_not_reset(&self) -> bool {
        *self == SRAM_RST_A::NotReset
    }
}
#[doc = "Field `SRAM_RST` writer - SRAM2 Erase when system reset"]
pub type SRAM_RST_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, SRAM_RST_A, O>;
impl<'a, const O: u8> SRAM_RST_W<'a, O> {
    #[doc = "SRAM1 and SRAM2 erased when a system reset occurs"]
    #[inline(always)]
    pub fn reset(self) -> &'a mut W {
        self.variant(SRAM_RST_A::Reset)
    }
    #[doc = "SRAM1 and SRAM2 not erased when a system reset occurs"]
    #[inline(always)]
    pub fn not_reset(self) -> &'a mut W {
        self.variant(SRAM_RST_A::NotReset)
    }
}
#[doc = "Software BOOT0 selection\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSWBOOT0_A {
    #[doc = "0: BOOT0 taken from nBOOT0 in this register"]
    Bit = 0,
    #[doc = "1: BOOT0 taken from GPIO PH3/BOOT0"]
    Pin = 1,
}
impl From<NSWBOOT0_A> for bool {
    #[inline(always)]
    fn from(variant: NSWBOOT0_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `nSWBOOT0` reader - Software BOOT0 selection"]
pub type NSWBOOT0_R = crate::BitReader<NSWBOOT0_A>;
impl NSWBOOT0_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NSWBOOT0_A {
        match self.bits {
            false => NSWBOOT0_A::Bit,
            true => NSWBOOT0_A::Pin,
        }
    }
    #[doc = "Checks if the value of the field is `Bit`"]
    #[inline(always)]
    pub fn is_bit_(&self) -> bool {
        *self == NSWBOOT0_A::Bit
    }
    #[doc = "Checks if the value of the field is `Pin`"]
    #[inline(always)]
    pub fn is_pin(&self) -> bool {
        *self == NSWBOOT0_A::Pin
    }
}
#[doc = "Field `nSWBOOT0` writer - Software BOOT0 selection"]
pub type NSWBOOT0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, NSWBOOT0_A, O>;
impl<'a, const O: u8> NSWBOOT0_W<'a, O> {
    #[doc = "BOOT0 taken from nBOOT0 in this register"]
    #[inline(always)]
    pub fn bit_(self) -> &'a mut W {
        self.variant(NSWBOOT0_A::Bit)
    }
    #[doc = "BOOT0 taken from GPIO PH3/BOOT0"]
    #[inline(always)]
    pub fn pin(self) -> &'a mut W {
        self.variant(NSWBOOT0_A::Pin)
    }
}
#[doc = "nBOOT0 option bit\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NBOOT0_A {
    #[doc = "0: When nSWBOOT0 is cleared, select boot mode together with nBOOT1"]
    Clear = 0,
    #[doc = "1: When nSWBOOT0 is cleared, select boot mode together with nBOOT1"]
    Set = 1,
}
impl From<NBOOT0_A> for bool {
    #[inline(always)]
    fn from(variant: NBOOT0_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `nBOOT0` reader - nBOOT0 option bit"]
pub type NBOOT0_R = crate::BitReader<NBOOT0_A>;
impl NBOOT0_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NBOOT0_A {
        match self.bits {
            false => NBOOT0_A::Clear,
            true => NBOOT0_A::Set,
        }
    }
    #[doc = "Checks if the value of the field is `Clear`"]
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        *self == NBOOT0_A::Clear
    }
    #[doc = "Checks if the value of the field is `Set`"]
    #[inline(always)]
    pub fn is_set(&self) -> bool {
        *self == NBOOT0_A::Set
    }
}
#[doc = "Field `nBOOT0` writer - nBOOT0 option bit"]
pub type NBOOT0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, NBOOT0_A, O>;
impl<'a, const O: u8> NBOOT0_W<'a, O> {
    #[doc = "When nSWBOOT0 is cleared, select boot mode together with nBOOT1"]
    #[inline(always)]
    pub fn clear(self) -> &'a mut W {
        self.variant(NBOOT0_A::Clear)
    }
    #[doc = "When nSWBOOT0 is cleared, select boot mode together with nBOOT1"]
    #[inline(always)]
    pub fn set(self) -> &'a mut W {
        self.variant(NBOOT0_A::Set)
    }
}
#[doc = "CPU1 CM4 Unique Boot entry enable option bit\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BOOT_LOCK_A {
    #[doc = "0: Boot lock is disabled"]
    Disabled = 0,
    #[doc = "1: Boot lock is enabled"]
    Enabled = 1,
}
impl From<BOOT_LOCK_A> for bool {
    #[inline(always)]
    fn from(variant: BOOT_LOCK_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `BOOT_LOCK` reader - CPU1 CM4 Unique Boot entry enable option bit"]
pub type BOOT_LOCK_R = crate::BitReader<BOOT_LOCK_A>;
impl BOOT_LOCK_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BOOT_LOCK_A {
        match self.bits {
            false => BOOT_LOCK_A::Disabled,
            true => BOOT_LOCK_A::Enabled,
        }
    }
    #[doc = "Checks if the value of the field is `Disabled`"]
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == BOOT_LOCK_A::Disabled
    }
    #[doc = "Checks if the value of the field is `Enabled`"]
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == BOOT_LOCK_A::Enabled
    }
}
#[doc = "Field `BOOT_LOCK` writer - CPU1 CM4 Unique Boot entry enable option bit"]
pub type BOOT_LOCK_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, BOOT_LOCK_A, O>;
impl<'a, const O: u8> BOOT_LOCK_W<'a, O> {
    #[doc = "Boot lock is disabled"]
    #[inline(always)]
    pub fn disabled(self) -> &'a mut W {
        self.variant(BOOT_LOCK_A::Disabled)
    }
    #[doc = "Boot lock is enabled"]
    #[inline(always)]
    pub fn enabled(self) -> &'a mut W {
        self.variant(BOOT_LOCK_A::Enabled)
    }
}
#[doc = "Field `C2BOOT_LOCK` reader - CPU2 CM0+ Unique Boot entry enable option bit"]
pub type C2BOOT_LOCK_R = crate::BitReader<bool>;
#[doc = "Field `C2BOOT_LOCK` writer - CPU2 CM0+ Unique Boot entry enable option bit"]
pub type C2BOOT_LOCK_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPTR_SPEC, bool, O>;
impl R {
    #[doc = "Bits 0:7 - Read protection level"]
    #[inline(always)]
    pub fn rdp(&self) -> RDP_R {
        RDP_R::new((self.bits & 0xff) as u8)
    }
    #[doc = "Bit 8 - System security enabled flag"]
    #[inline(always)]
    pub fn ese(&self) -> ESE_R {
        ESE_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bits 9:11 - BOR reset Level"]
    #[inline(always)]
    pub fn bor_lev(&self) -> BOR_LEV_R {
        BOR_LEV_R::new(((self.bits >> 9) & 7) as u8)
    }
    #[doc = "Bit 12 - nRST_STOP"]
    #[inline(always)]
    pub fn n_rst_stop(&self) -> NRST_STOP_R {
        NRST_STOP_R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - nRST_STDBY"]
    #[inline(always)]
    pub fn n_rst_stdby(&self) -> NRST_STDBY_R {
        NRST_STDBY_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - nRSTSHDW"]
    #[inline(always)]
    pub fn n_rst_shdw(&self) -> NRST_SHDW_R {
        NRST_SHDW_R::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 16 - Independent watchdog selection"]
    #[inline(always)]
    pub fn iwdg_sw(&self) -> IWDG_SW_R {
        IWDG_SW_R::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bit 17 - Independent watchdog counter freeze in Stop mode"]
    #[inline(always)]
    pub fn iwdg_stop(&self) -> IWDG_STOP_R {
        IWDG_STOP_R::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bit 18 - Independent watchdog counter freeze in Standby mode"]
    #[inline(always)]
    pub fn iwdg_stdby(&self) -> IWDG_STDBY_R {
        IWDG_STDBY_R::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bit 19 - Window watchdog selection"]
    #[inline(always)]
    pub fn wwdg_sw(&self) -> WWDG_SW_R {
        WWDG_SW_R::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bit 23 - Boot configuration"]
    #[inline(always)]
    pub fn n_boot1(&self) -> NBOOT1_R {
        NBOOT1_R::new(((self.bits >> 23) & 1) != 0)
    }
    #[doc = "Bit 24 - SRAM2 parity check enable"]
    #[inline(always)]
    pub fn sram2_pe(&self) -> SRAM2_PE_R {
        SRAM2_PE_R::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 25 - SRAM2 Erase when system reset"]
    #[inline(always)]
    pub fn sram_rst(&self) -> SRAM_RST_R {
        SRAM_RST_R::new(((self.bits >> 25) & 1) != 0)
    }
    #[doc = "Bit 26 - Software BOOT0 selection"]
    #[inline(always)]
    pub fn n_swboot0(&self) -> NSWBOOT0_R {
        NSWBOOT0_R::new(((self.bits >> 26) & 1) != 0)
    }
    #[doc = "Bit 27 - nBOOT0 option bit"]
    #[inline(always)]
    pub fn n_boot0(&self) -> NBOOT0_R {
        NBOOT0_R::new(((self.bits >> 27) & 1) != 0)
    }
    #[doc = "Bit 30 - CPU1 CM4 Unique Boot entry enable option bit"]
    #[inline(always)]
    pub fn boot_lock(&self) -> BOOT_LOCK_R {
        BOOT_LOCK_R::new(((self.bits >> 30) & 1) != 0)
    }
    #[doc = "Bit 31 - CPU2 CM0+ Unique Boot entry enable option bit"]
    #[inline(always)]
    pub fn c2boot_lock(&self) -> C2BOOT_LOCK_R {
        C2BOOT_LOCK_R::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:7 - Read protection level"]
    #[inline(always)]
    pub fn rdp(&mut self) -> RDP_W<0> {
        RDP_W::new(self)
    }
    #[doc = "Bit 8 - System security enabled flag"]
    #[inline(always)]
    pub fn ese(&mut self) -> ESE_W<8> {
        ESE_W::new(self)
    }
    #[doc = "Bits 9:11 - BOR reset Level"]
    #[inline(always)]
    pub fn bor_lev(&mut self) -> BOR_LEV_W<9> {
        BOR_LEV_W::new(self)
    }
    #[doc = "Bit 12 - nRST_STOP"]
    #[inline(always)]
    pub fn n_rst_stop(&mut self) -> NRST_STOP_W<12> {
        NRST_STOP_W::new(self)
    }
    #[doc = "Bit 13 - nRST_STDBY"]
    #[inline(always)]
    pub fn n_rst_stdby(&mut self) -> NRST_STDBY_W<13> {
        NRST_STDBY_W::new(self)
    }
    #[doc = "Bit 14 - nRSTSHDW"]
    #[inline(always)]
    pub fn n_rst_shdw(&mut self) -> NRST_SHDW_W<14> {
        NRST_SHDW_W::new(self)
    }
    #[doc = "Bit 16 - Independent watchdog selection"]
    #[inline(always)]
    pub fn iwdg_sw(&mut self) -> IWDG_SW_W<16> {
        IWDG_SW_W::new(self)
    }
    #[doc = "Bit 17 - Independent watchdog counter freeze in Stop mode"]
    #[inline(always)]
    pub fn iwdg_stop(&mut self) -> IWDG_STOP_W<17> {
        IWDG_STOP_W::new(self)
    }
    #[doc = "Bit 18 - Independent watchdog counter freeze in Standby mode"]
    #[inline(always)]
    pub fn iwdg_stdby(&mut self) -> IWDG_STDBY_W<18> {
        IWDG_STDBY_W::new(self)
    }
    #[doc = "Bit 19 - Window watchdog selection"]
    #[inline(always)]
    pub fn wwdg_sw(&mut self) -> WWDG_SW_W<19> {
        WWDG_SW_W::new(self)
    }
    #[doc = "Bit 23 - Boot configuration"]
    #[inline(always)]
    pub fn n_boot1(&mut self) -> NBOOT1_W<23> {
        NBOOT1_W::new(self)
    }
    #[doc = "Bit 24 - SRAM2 parity check enable"]
    #[inline(always)]
    pub fn sram2_pe(&mut self) -> SRAM2_PE_W<24> {
        SRAM2_PE_W::new(self)
    }
    #[doc = "Bit 25 - SRAM2 Erase when system reset"]
    #[inline(always)]
    pub fn sram_rst(&mut self) -> SRAM_RST_W<25> {
        SRAM_RST_W::new(self)
    }
    #[doc = "Bit 26 - Software BOOT0 selection"]
    #[inline(always)]
    pub fn n_swboot0(&mut self) -> NSWBOOT0_W<26> {
        NSWBOOT0_W::new(self)
    }
    #[doc = "Bit 27 - nBOOT0 option bit"]
    #[inline(always)]
    pub fn n_boot0(&mut self) -> NBOOT0_W<27> {
        NBOOT0_W::new(self)
    }
    #[doc = "Bit 30 - CPU1 CM4 Unique Boot entry enable option bit"]
    #[inline(always)]
    pub fn boot_lock(&mut self) -> BOOT_LOCK_W<30> {
        BOOT_LOCK_W::new(self)
    }
    #[doc = "Bit 31 - CPU2 CM0+ Unique Boot entry enable option bit"]
    #[inline(always)]
    pub fn c2boot_lock(&mut self) -> C2BOOT_LOCK_W<31> {
        C2BOOT_LOCK_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 = "Flash option register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [optr](index.html) module"]
pub struct OPTR_SPEC;
impl crate::RegisterSpec for OPTR_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [optr::R](R) reader structure"]
impl crate::Readable for OPTR_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [optr::W](W) writer structure"]
impl crate::Writable for OPTR_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets OPTR to value 0x3fff_f0aa"]
impl crate::Resettable for OPTR_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0x3fff_f0aa
    }
}