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
#[doc = "Register `FCON` reader"]
pub type R = crate::R<FCON_SPEC>;
#[doc = "Register `FCON` writer"]
pub type W = crate::W<FCON_SPEC>;
#[doc = "Wait States for read access to PFLASH\n\nValue on reset: 6"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum WSPFLASH_A {
    #[doc = "0: PFLASH access in one clock cycle"]
    VALUE1 = 0,
    #[doc = "1: PFLASH access in one clock cycle"]
    VALUE2 = 1,
    #[doc = "2: PFLASH access in two clock cycles"]
    VALUE3 = 2,
    #[doc = "3: PFLASH access in three clock cycles"]
    VALUE4 = 3,
    #[doc = "15: PFLASH access in fifteen clock cycles."]
    VALUE5 = 15,
}
impl From<WSPFLASH_A> for u8 {
    #[inline(always)]
    fn from(variant: WSPFLASH_A) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for WSPFLASH_A {
    type Ux = u8;
}
impl crate::IsEnum for WSPFLASH_A {}
#[doc = "Field `WSPFLASH` reader - Wait States for read access to PFLASH"]
pub type WSPFLASH_R = crate::FieldReader<WSPFLASH_A>;
impl WSPFLASH_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<WSPFLASH_A> {
        match self.bits {
            0 => Some(WSPFLASH_A::VALUE1),
            1 => Some(WSPFLASH_A::VALUE2),
            2 => Some(WSPFLASH_A::VALUE3),
            3 => Some(WSPFLASH_A::VALUE4),
            15 => Some(WSPFLASH_A::VALUE5),
            _ => None,
        }
    }
    #[doc = "PFLASH access in one clock cycle"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == WSPFLASH_A::VALUE1
    }
    #[doc = "PFLASH access in one clock cycle"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == WSPFLASH_A::VALUE2
    }
    #[doc = "PFLASH access in two clock cycles"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == WSPFLASH_A::VALUE3
    }
    #[doc = "PFLASH access in three clock cycles"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == WSPFLASH_A::VALUE4
    }
    #[doc = "PFLASH access in fifteen clock cycles."]
    #[inline(always)]
    pub fn is_value5(&self) -> bool {
        *self == WSPFLASH_A::VALUE5
    }
}
#[doc = "Field `WSPFLASH` writer - Wait States for read access to PFLASH"]
pub type WSPFLASH_W<'a, REG> = crate::FieldWriter<'a, REG, 4, WSPFLASH_A>;
impl<'a, REG> WSPFLASH_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "PFLASH access in one clock cycle"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(WSPFLASH_A::VALUE1)
    }
    #[doc = "PFLASH access in one clock cycle"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(WSPFLASH_A::VALUE2)
    }
    #[doc = "PFLASH access in two clock cycles"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(WSPFLASH_A::VALUE3)
    }
    #[doc = "PFLASH access in three clock cycles"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(WSPFLASH_A::VALUE4)
    }
    #[doc = "PFLASH access in fifteen clock cycles."]
    #[inline(always)]
    pub fn value5(self) -> &'a mut crate::W<REG> {
        self.variant(WSPFLASH_A::VALUE5)
    }
}
#[doc = "Wait State for Error Correction of PFLASH\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WSECPF_A {
    #[doc = "0: No additional wait state for error correction"]
    VALUE1 = 0,
    #[doc = "1: One additional wait state for error correction during read access to Program Flash. If enabled, this wait state is only used for the first transfer of a burst transfer."]
    VALUE2 = 1,
}
impl From<WSECPF_A> for bool {
    #[inline(always)]
    fn from(variant: WSECPF_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `WSECPF` reader - Wait State for Error Correction of PFLASH"]
pub type WSECPF_R = crate::BitReader<WSECPF_A>;
impl WSECPF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> WSECPF_A {
        match self.bits {
            false => WSECPF_A::VALUE1,
            true => WSECPF_A::VALUE2,
        }
    }
    #[doc = "No additional wait state for error correction"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == WSECPF_A::VALUE1
    }
    #[doc = "One additional wait state for error correction during read access to Program Flash. If enabled, this wait state is only used for the first transfer of a burst transfer."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == WSECPF_A::VALUE2
    }
}
#[doc = "Field `WSECPF` writer - Wait State for Error Correction of PFLASH"]
pub type WSECPF_W<'a, REG> = crate::BitWriter<'a, REG, WSECPF_A>;
impl<'a, REG> WSECPF_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No additional wait state for error correction"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(WSECPF_A::VALUE1)
    }
    #[doc = "One additional wait state for error correction during read access to Program Flash. If enabled, this wait state is only used for the first transfer of a burst transfer."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(WSECPF_A::VALUE2)
    }
}
#[doc = "Dynamic Flash Idle\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IDLE_A {
    #[doc = "0: Normal/standard Flash read operation"]
    VALUE1 = 0,
    #[doc = "1: Dynamic idle of Program Flash enabled for power saving; static prefetching disabled"]
    VALUE2 = 1,
}
impl From<IDLE_A> for bool {
    #[inline(always)]
    fn from(variant: IDLE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IDLE` reader - Dynamic Flash Idle"]
pub type IDLE_R = crate::BitReader<IDLE_A>;
impl IDLE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> IDLE_A {
        match self.bits {
            false => IDLE_A::VALUE1,
            true => IDLE_A::VALUE2,
        }
    }
    #[doc = "Normal/standard Flash read operation"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == IDLE_A::VALUE1
    }
    #[doc = "Dynamic idle of Program Flash enabled for power saving; static prefetching disabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == IDLE_A::VALUE2
    }
}
#[doc = "Field `IDLE` writer - Dynamic Flash Idle"]
pub type IDLE_W<'a, REG> = crate::BitWriter<'a, REG, IDLE_A>;
impl<'a, REG> IDLE_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Normal/standard Flash read operation"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(IDLE_A::VALUE1)
    }
    #[doc = "Dynamic idle of Program Flash enabled for power saving; static prefetching disabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(IDLE_A::VALUE2)
    }
}
#[doc = "External Sleep Request Disable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ESLDIS_A {
    #[doc = "0: External sleep request signal input is enabled"]
    VALUE1 = 0,
    #[doc = "1: Externally requested Flash sleep is disabled"]
    VALUE2 = 1,
}
impl From<ESLDIS_A> for bool {
    #[inline(always)]
    fn from(variant: ESLDIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ESLDIS` reader - External Sleep Request Disable"]
pub type ESLDIS_R = crate::BitReader<ESLDIS_A>;
impl ESLDIS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> ESLDIS_A {
        match self.bits {
            false => ESLDIS_A::VALUE1,
            true => ESLDIS_A::VALUE2,
        }
    }
    #[doc = "External sleep request signal input is enabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == ESLDIS_A::VALUE1
    }
    #[doc = "Externally requested Flash sleep is disabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == ESLDIS_A::VALUE2
    }
}
#[doc = "Field `ESLDIS` writer - External Sleep Request Disable"]
pub type ESLDIS_W<'a, REG> = crate::BitWriter<'a, REG, ESLDIS_A>;
impl<'a, REG> ESLDIS_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "External sleep request signal input is enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(ESLDIS_A::VALUE1)
    }
    #[doc = "Externally requested Flash sleep is disabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(ESLDIS_A::VALUE2)
    }
}
#[doc = "Flash SLEEP\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SLEEP_A {
    #[doc = "0: Normal state or wake-up"]
    VALUE1 = 0,
    #[doc = "1: Flash sleep mode is requested"]
    VALUE2 = 1,
}
impl From<SLEEP_A> for bool {
    #[inline(always)]
    fn from(variant: SLEEP_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SLEEP` reader - Flash SLEEP"]
pub type SLEEP_R = crate::BitReader<SLEEP_A>;
impl SLEEP_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SLEEP_A {
        match self.bits {
            false => SLEEP_A::VALUE1,
            true => SLEEP_A::VALUE2,
        }
    }
    #[doc = "Normal state or wake-up"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == SLEEP_A::VALUE1
    }
    #[doc = "Flash sleep mode is requested"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == SLEEP_A::VALUE2
    }
}
#[doc = "Field `SLEEP` writer - Flash SLEEP"]
pub type SLEEP_W<'a, REG> = crate::BitWriter<'a, REG, SLEEP_A>;
impl<'a, REG> SLEEP_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Normal state or wake-up"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(SLEEP_A::VALUE1)
    }
    #[doc = "Flash sleep mode is requested"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(SLEEP_A::VALUE2)
    }
}
#[doc = "Read Protection Activated\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RPA_A {
    #[doc = "0: The Flash-internal read protection is not activated. Bits DCF, DDF are not taken into account. Bits DCF, DDFx can be cleared"]
    VALUE1 = 0,
    #[doc = "1: The Flash-internal read protection is activated. Bits DCF, DDF are enabled and evaluated."]
    VALUE2 = 1,
}
impl From<RPA_A> for bool {
    #[inline(always)]
    fn from(variant: RPA_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RPA` reader - Read Protection Activated"]
pub type RPA_R = crate::BitReader<RPA_A>;
impl RPA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> RPA_A {
        match self.bits {
            false => RPA_A::VALUE1,
            true => RPA_A::VALUE2,
        }
    }
    #[doc = "The Flash-internal read protection is not activated. Bits DCF, DDF are not taken into account. Bits DCF, DDFx can be cleared"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == RPA_A::VALUE1
    }
    #[doc = "The Flash-internal read protection is activated. Bits DCF, DDF are enabled and evaluated."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == RPA_A::VALUE2
    }
}
#[doc = "Disable Code Fetch from Flash Memory\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DCF_A {
    #[doc = "0: Code fetching from the Flash memory area is allowed."]
    VALUE1 = 0,
    #[doc = "1: Code fetching from the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
    VALUE2 = 1,
}
impl From<DCF_A> for bool {
    #[inline(always)]
    fn from(variant: DCF_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DCF` reader - Disable Code Fetch from Flash Memory"]
pub type DCF_R = crate::BitReader<DCF_A>;
impl DCF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> DCF_A {
        match self.bits {
            false => DCF_A::VALUE1,
            true => DCF_A::VALUE2,
        }
    }
    #[doc = "Code fetching from the Flash memory area is allowed."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == DCF_A::VALUE1
    }
    #[doc = "Code fetching from the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == DCF_A::VALUE2
    }
}
#[doc = "Field `DCF` writer - Disable Code Fetch from Flash Memory"]
pub type DCF_W<'a, REG> = crate::BitWriter<'a, REG, DCF_A>;
impl<'a, REG> DCF_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Code fetching from the Flash memory area is allowed."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(DCF_A::VALUE1)
    }
    #[doc = "Code fetching from the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(DCF_A::VALUE2)
    }
}
#[doc = "Disable Any Data Fetch from Flash\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DDF_A {
    #[doc = "0: Data read access to the Flash memory area is allowed."]
    VALUE1 = 0,
    #[doc = "1: Data read access to the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
    VALUE2 = 1,
}
impl From<DDF_A> for bool {
    #[inline(always)]
    fn from(variant: DDF_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DDF` reader - Disable Any Data Fetch from Flash"]
pub type DDF_R = crate::BitReader<DDF_A>;
impl DDF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> DDF_A {
        match self.bits {
            false => DDF_A::VALUE1,
            true => DDF_A::VALUE2,
        }
    }
    #[doc = "Data read access to the Flash memory area is allowed."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == DDF_A::VALUE1
    }
    #[doc = "Data read access to the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == DDF_A::VALUE2
    }
}
#[doc = "Field `DDF` writer - Disable Any Data Fetch from Flash"]
pub type DDF_W<'a, REG> = crate::BitWriter<'a, REG, DDF_A>;
impl<'a, REG> DDF_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Data read access to the Flash memory area is allowed."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(DDF_A::VALUE1)
    }
    #[doc = "Data read access to the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(DDF_A::VALUE2)
    }
}
#[doc = "Verify and Operation Error Interrupt Mask\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VOPERM_A {
    #[doc = "0: Interrupt not enabled"]
    VALUE1 = 0,
    #[doc = "1: Flash interrupt because of Verify Error or Operation Error in Flash array (FSI) is enabled"]
    VALUE2 = 1,
}
impl From<VOPERM_A> for bool {
    #[inline(always)]
    fn from(variant: VOPERM_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `VOPERM` reader - Verify and Operation Error Interrupt Mask"]
pub type VOPERM_R = crate::BitReader<VOPERM_A>;
impl VOPERM_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> VOPERM_A {
        match self.bits {
            false => VOPERM_A::VALUE1,
            true => VOPERM_A::VALUE2,
        }
    }
    #[doc = "Interrupt not enabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == VOPERM_A::VALUE1
    }
    #[doc = "Flash interrupt because of Verify Error or Operation Error in Flash array (FSI) is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == VOPERM_A::VALUE2
    }
}
#[doc = "Field `VOPERM` writer - Verify and Operation Error Interrupt Mask"]
pub type VOPERM_W<'a, REG> = crate::BitWriter<'a, REG, VOPERM_A>;
impl<'a, REG> VOPERM_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Interrupt not enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(VOPERM_A::VALUE1)
    }
    #[doc = "Flash interrupt because of Verify Error or Operation Error in Flash array (FSI) is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(VOPERM_A::VALUE2)
    }
}
#[doc = "Command Sequence Error Interrupt Mask\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SQERM_A {
    #[doc = "0: Interrupt not enabled"]
    VALUE1 = 0,
    #[doc = "1: Flash interrupt because of Sequence Error is enabled"]
    VALUE2 = 1,
}
impl From<SQERM_A> for bool {
    #[inline(always)]
    fn from(variant: SQERM_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SQERM` reader - Command Sequence Error Interrupt Mask"]
pub type SQERM_R = crate::BitReader<SQERM_A>;
impl SQERM_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SQERM_A {
        match self.bits {
            false => SQERM_A::VALUE1,
            true => SQERM_A::VALUE2,
        }
    }
    #[doc = "Interrupt not enabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == SQERM_A::VALUE1
    }
    #[doc = "Flash interrupt because of Sequence Error is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == SQERM_A::VALUE2
    }
}
#[doc = "Field `SQERM` writer - Command Sequence Error Interrupt Mask"]
pub type SQERM_W<'a, REG> = crate::BitWriter<'a, REG, SQERM_A>;
impl<'a, REG> SQERM_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Interrupt not enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(SQERM_A::VALUE1)
    }
    #[doc = "Flash interrupt because of Sequence Error is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(SQERM_A::VALUE2)
    }
}
#[doc = "Protection Error Interrupt Mask\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PROERM_A {
    #[doc = "0: Interrupt not enabled"]
    VALUE1 = 0,
    #[doc = "1: Flash interrupt because of Protection Error is enabled"]
    VALUE2 = 1,
}
impl From<PROERM_A> for bool {
    #[inline(always)]
    fn from(variant: PROERM_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `PROERM` reader - Protection Error Interrupt Mask"]
pub type PROERM_R = crate::BitReader<PROERM_A>;
impl PROERM_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> PROERM_A {
        match self.bits {
            false => PROERM_A::VALUE1,
            true => PROERM_A::VALUE2,
        }
    }
    #[doc = "Interrupt not enabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == PROERM_A::VALUE1
    }
    #[doc = "Flash interrupt because of Protection Error is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == PROERM_A::VALUE2
    }
}
#[doc = "Field `PROERM` writer - Protection Error Interrupt Mask"]
pub type PROERM_W<'a, REG> = crate::BitWriter<'a, REG, PROERM_A>;
impl<'a, REG> PROERM_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Interrupt not enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(PROERM_A::VALUE1)
    }
    #[doc = "Flash interrupt because of Protection Error is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(PROERM_A::VALUE2)
    }
}
#[doc = "PFLASH Single-Bit Error Interrupt Mask\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PFSBERM_A {
    #[doc = "0: No Single-Bit Error interrupt enabled"]
    VALUE1 = 0,
    #[doc = "1: Single-Bit Error interrupt enabled for PFLASH"]
    VALUE2 = 1,
}
impl From<PFSBERM_A> for bool {
    #[inline(always)]
    fn from(variant: PFSBERM_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `PFSBERM` reader - PFLASH Single-Bit Error Interrupt Mask"]
pub type PFSBERM_R = crate::BitReader<PFSBERM_A>;
impl PFSBERM_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> PFSBERM_A {
        match self.bits {
            false => PFSBERM_A::VALUE1,
            true => PFSBERM_A::VALUE2,
        }
    }
    #[doc = "No Single-Bit Error interrupt enabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == PFSBERM_A::VALUE1
    }
    #[doc = "Single-Bit Error interrupt enabled for PFLASH"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == PFSBERM_A::VALUE2
    }
}
#[doc = "Field `PFSBERM` writer - PFLASH Single-Bit Error Interrupt Mask"]
pub type PFSBERM_W<'a, REG> = crate::BitWriter<'a, REG, PFSBERM_A>;
impl<'a, REG> PFSBERM_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No Single-Bit Error interrupt enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(PFSBERM_A::VALUE1)
    }
    #[doc = "Single-Bit Error interrupt enabled for PFLASH"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(PFSBERM_A::VALUE2)
    }
}
#[doc = "PFLASH Double-Bit Error Interrupt Mask\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PFDBERM_A {
    #[doc = "0: Double-Bit Error interrupt for PFLASH not enabled"]
    VALUE1 = 0,
    #[doc = "1: Double-Bit Error interrupt for PFLASH enabled. Especially intended for margin check"]
    VALUE2 = 1,
}
impl From<PFDBERM_A> for bool {
    #[inline(always)]
    fn from(variant: PFDBERM_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `PFDBERM` reader - PFLASH Double-Bit Error Interrupt Mask"]
pub type PFDBERM_R = crate::BitReader<PFDBERM_A>;
impl PFDBERM_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> PFDBERM_A {
        match self.bits {
            false => PFDBERM_A::VALUE1,
            true => PFDBERM_A::VALUE2,
        }
    }
    #[doc = "Double-Bit Error interrupt for PFLASH not enabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == PFDBERM_A::VALUE1
    }
    #[doc = "Double-Bit Error interrupt for PFLASH enabled. Especially intended for margin check"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == PFDBERM_A::VALUE2
    }
}
#[doc = "Field `PFDBERM` writer - PFLASH Double-Bit Error Interrupt Mask"]
pub type PFDBERM_W<'a, REG> = crate::BitWriter<'a, REG, PFDBERM_A>;
impl<'a, REG> PFDBERM_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Double-Bit Error interrupt for PFLASH not enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(PFDBERM_A::VALUE1)
    }
    #[doc = "Double-Bit Error interrupt for PFLASH enabled. Especially intended for margin check"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(PFDBERM_A::VALUE2)
    }
}
#[doc = "End of Busy Interrupt Mask\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EOBM_A {
    #[doc = "0: Interrupt not enabled"]
    VALUE1 = 0,
    #[doc = "1: EOB interrupt is enabled"]
    VALUE2 = 1,
}
impl From<EOBM_A> for bool {
    #[inline(always)]
    fn from(variant: EOBM_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `EOBM` reader - End of Busy Interrupt Mask"]
pub type EOBM_R = crate::BitReader<EOBM_A>;
impl EOBM_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> EOBM_A {
        match self.bits {
            false => EOBM_A::VALUE1,
            true => EOBM_A::VALUE2,
        }
    }
    #[doc = "Interrupt not enabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == EOBM_A::VALUE1
    }
    #[doc = "EOB interrupt is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == EOBM_A::VALUE2
    }
}
#[doc = "Field `EOBM` writer - End of Busy Interrupt Mask"]
pub type EOBM_W<'a, REG> = crate::BitWriter<'a, REG, EOBM_A>;
impl<'a, REG> EOBM_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Interrupt not enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(EOBM_A::VALUE1)
    }
    #[doc = "EOB interrupt is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(EOBM_A::VALUE2)
    }
}
impl R {
    #[doc = "Bits 0:3 - Wait States for read access to PFLASH"]
    #[inline(always)]
    pub fn wspflash(&self) -> WSPFLASH_R {
        WSPFLASH_R::new((self.bits & 0x0f) as u8)
    }
    #[doc = "Bit 4 - Wait State for Error Correction of PFLASH"]
    #[inline(always)]
    pub fn wsecpf(&self) -> WSECPF_R {
        WSECPF_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 13 - Dynamic Flash Idle"]
    #[inline(always)]
    pub fn idle(&self) -> IDLE_R {
        IDLE_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - External Sleep Request Disable"]
    #[inline(always)]
    pub fn esldis(&self) -> ESLDIS_R {
        ESLDIS_R::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 15 - Flash SLEEP"]
    #[inline(always)]
    pub fn sleep(&self) -> SLEEP_R {
        SLEEP_R::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bit 16 - Read Protection Activated"]
    #[inline(always)]
    pub fn rpa(&self) -> RPA_R {
        RPA_R::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bit 17 - Disable Code Fetch from Flash Memory"]
    #[inline(always)]
    pub fn dcf(&self) -> DCF_R {
        DCF_R::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bit 18 - Disable Any Data Fetch from Flash"]
    #[inline(always)]
    pub fn ddf(&self) -> DDF_R {
        DDF_R::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bit 24 - Verify and Operation Error Interrupt Mask"]
    #[inline(always)]
    pub fn voperm(&self) -> VOPERM_R {
        VOPERM_R::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 25 - Command Sequence Error Interrupt Mask"]
    #[inline(always)]
    pub fn sqerm(&self) -> SQERM_R {
        SQERM_R::new(((self.bits >> 25) & 1) != 0)
    }
    #[doc = "Bit 26 - Protection Error Interrupt Mask"]
    #[inline(always)]
    pub fn proerm(&self) -> PROERM_R {
        PROERM_R::new(((self.bits >> 26) & 1) != 0)
    }
    #[doc = "Bit 27 - PFLASH Single-Bit Error Interrupt Mask"]
    #[inline(always)]
    pub fn pfsberm(&self) -> PFSBERM_R {
        PFSBERM_R::new(((self.bits >> 27) & 1) != 0)
    }
    #[doc = "Bit 29 - PFLASH Double-Bit Error Interrupt Mask"]
    #[inline(always)]
    pub fn pfdberm(&self) -> PFDBERM_R {
        PFDBERM_R::new(((self.bits >> 29) & 1) != 0)
    }
    #[doc = "Bit 31 - End of Busy Interrupt Mask"]
    #[inline(always)]
    pub fn eobm(&self) -> EOBM_R {
        EOBM_R::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:3 - Wait States for read access to PFLASH"]
    #[inline(always)]
    #[must_use]
    pub fn wspflash(&mut self) -> WSPFLASH_W<FCON_SPEC> {
        WSPFLASH_W::new(self, 0)
    }
    #[doc = "Bit 4 - Wait State for Error Correction of PFLASH"]
    #[inline(always)]
    #[must_use]
    pub fn wsecpf(&mut self) -> WSECPF_W<FCON_SPEC> {
        WSECPF_W::new(self, 4)
    }
    #[doc = "Bit 13 - Dynamic Flash Idle"]
    #[inline(always)]
    #[must_use]
    pub fn idle(&mut self) -> IDLE_W<FCON_SPEC> {
        IDLE_W::new(self, 13)
    }
    #[doc = "Bit 14 - External Sleep Request Disable"]
    #[inline(always)]
    #[must_use]
    pub fn esldis(&mut self) -> ESLDIS_W<FCON_SPEC> {
        ESLDIS_W::new(self, 14)
    }
    #[doc = "Bit 15 - Flash SLEEP"]
    #[inline(always)]
    #[must_use]
    pub fn sleep(&mut self) -> SLEEP_W<FCON_SPEC> {
        SLEEP_W::new(self, 15)
    }
    #[doc = "Bit 17 - Disable Code Fetch from Flash Memory"]
    #[inline(always)]
    #[must_use]
    pub fn dcf(&mut self) -> DCF_W<FCON_SPEC> {
        DCF_W::new(self, 17)
    }
    #[doc = "Bit 18 - Disable Any Data Fetch from Flash"]
    #[inline(always)]
    #[must_use]
    pub fn ddf(&mut self) -> DDF_W<FCON_SPEC> {
        DDF_W::new(self, 18)
    }
    #[doc = "Bit 24 - Verify and Operation Error Interrupt Mask"]
    #[inline(always)]
    #[must_use]
    pub fn voperm(&mut self) -> VOPERM_W<FCON_SPEC> {
        VOPERM_W::new(self, 24)
    }
    #[doc = "Bit 25 - Command Sequence Error Interrupt Mask"]
    #[inline(always)]
    #[must_use]
    pub fn sqerm(&mut self) -> SQERM_W<FCON_SPEC> {
        SQERM_W::new(self, 25)
    }
    #[doc = "Bit 26 - Protection Error Interrupt Mask"]
    #[inline(always)]
    #[must_use]
    pub fn proerm(&mut self) -> PROERM_W<FCON_SPEC> {
        PROERM_W::new(self, 26)
    }
    #[doc = "Bit 27 - PFLASH Single-Bit Error Interrupt Mask"]
    #[inline(always)]
    #[must_use]
    pub fn pfsberm(&mut self) -> PFSBERM_W<FCON_SPEC> {
        PFSBERM_W::new(self, 27)
    }
    #[doc = "Bit 29 - PFLASH Double-Bit Error Interrupt Mask"]
    #[inline(always)]
    #[must_use]
    pub fn pfdberm(&mut self) -> PFDBERM_W<FCON_SPEC> {
        PFDBERM_W::new(self, 29)
    }
    #[doc = "Bit 31 - End of Busy Interrupt Mask"]
    #[inline(always)]
    #[must_use]
    pub fn eobm(&mut self) -> EOBM_W<FCON_SPEC> {
        EOBM_W::new(self, 31)
    }
}
#[doc = "Flash Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fcon::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fcon::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct FCON_SPEC;
impl crate::RegisterSpec for FCON_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [`fcon::R`](R) reader structure"]
impl crate::Readable for FCON_SPEC {}
#[doc = "`write(|w| ..)` method takes [`fcon::W`](W) writer structure"]
impl crate::Writable for FCON_SPEC {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets FCON to value 0x06"]
impl crate::Resettable for FCON_SPEC {
    const RESET_VALUE: u32 = 0x06;
}