xmc4400/flash0/
fcon.rs

1#[doc = "Register `FCON` reader"]
2pub type R = crate::R<FCON_SPEC>;
3#[doc = "Register `FCON` writer"]
4pub type W = crate::W<FCON_SPEC>;
5#[doc = "Wait States for read access to PFLASH\n\nValue on reset: 6"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7#[repr(u8)]
8pub enum WSPFLASH_A {
9    #[doc = "0: PFLASH access in one clock cycle"]
10    VALUE1 = 0,
11    #[doc = "1: PFLASH access in one clock cycle"]
12    VALUE2 = 1,
13    #[doc = "2: PFLASH access in two clock cycles"]
14    VALUE3 = 2,
15    #[doc = "3: PFLASH access in three clock cycles"]
16    VALUE4 = 3,
17    #[doc = "15: PFLASH access in fifteen clock cycles."]
18    VALUE5 = 15,
19}
20impl From<WSPFLASH_A> for u8 {
21    #[inline(always)]
22    fn from(variant: WSPFLASH_A) -> Self {
23        variant as _
24    }
25}
26impl crate::FieldSpec for WSPFLASH_A {
27    type Ux = u8;
28}
29impl crate::IsEnum for WSPFLASH_A {}
30#[doc = "Field `WSPFLASH` reader - Wait States for read access to PFLASH"]
31pub type WSPFLASH_R = crate::FieldReader<WSPFLASH_A>;
32impl WSPFLASH_R {
33    #[doc = "Get enumerated values variant"]
34    #[inline(always)]
35    pub const fn variant(&self) -> Option<WSPFLASH_A> {
36        match self.bits {
37            0 => Some(WSPFLASH_A::VALUE1),
38            1 => Some(WSPFLASH_A::VALUE2),
39            2 => Some(WSPFLASH_A::VALUE3),
40            3 => Some(WSPFLASH_A::VALUE4),
41            15 => Some(WSPFLASH_A::VALUE5),
42            _ => None,
43        }
44    }
45    #[doc = "PFLASH access in one clock cycle"]
46    #[inline(always)]
47    pub fn is_value1(&self) -> bool {
48        *self == WSPFLASH_A::VALUE1
49    }
50    #[doc = "PFLASH access in one clock cycle"]
51    #[inline(always)]
52    pub fn is_value2(&self) -> bool {
53        *self == WSPFLASH_A::VALUE2
54    }
55    #[doc = "PFLASH access in two clock cycles"]
56    #[inline(always)]
57    pub fn is_value3(&self) -> bool {
58        *self == WSPFLASH_A::VALUE3
59    }
60    #[doc = "PFLASH access in three clock cycles"]
61    #[inline(always)]
62    pub fn is_value4(&self) -> bool {
63        *self == WSPFLASH_A::VALUE4
64    }
65    #[doc = "PFLASH access in fifteen clock cycles."]
66    #[inline(always)]
67    pub fn is_value5(&self) -> bool {
68        *self == WSPFLASH_A::VALUE5
69    }
70}
71#[doc = "Field `WSPFLASH` writer - Wait States for read access to PFLASH"]
72pub type WSPFLASH_W<'a, REG> = crate::FieldWriter<'a, REG, 4, WSPFLASH_A>;
73impl<'a, REG> WSPFLASH_W<'a, REG>
74where
75    REG: crate::Writable + crate::RegisterSpec,
76    REG::Ux: From<u8>,
77{
78    #[doc = "PFLASH access in one clock cycle"]
79    #[inline(always)]
80    pub fn value1(self) -> &'a mut crate::W<REG> {
81        self.variant(WSPFLASH_A::VALUE1)
82    }
83    #[doc = "PFLASH access in one clock cycle"]
84    #[inline(always)]
85    pub fn value2(self) -> &'a mut crate::W<REG> {
86        self.variant(WSPFLASH_A::VALUE2)
87    }
88    #[doc = "PFLASH access in two clock cycles"]
89    #[inline(always)]
90    pub fn value3(self) -> &'a mut crate::W<REG> {
91        self.variant(WSPFLASH_A::VALUE3)
92    }
93    #[doc = "PFLASH access in three clock cycles"]
94    #[inline(always)]
95    pub fn value4(self) -> &'a mut crate::W<REG> {
96        self.variant(WSPFLASH_A::VALUE4)
97    }
98    #[doc = "PFLASH access in fifteen clock cycles."]
99    #[inline(always)]
100    pub fn value5(self) -> &'a mut crate::W<REG> {
101        self.variant(WSPFLASH_A::VALUE5)
102    }
103}
104#[doc = "Wait State for Error Correction of PFLASH\n\nValue on reset: 0"]
105#[derive(Clone, Copy, Debug, PartialEq, Eq)]
106pub enum WSECPF_A {
107    #[doc = "0: No additional wait state for error correction"]
108    VALUE1 = 0,
109    #[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."]
110    VALUE2 = 1,
111}
112impl From<WSECPF_A> for bool {
113    #[inline(always)]
114    fn from(variant: WSECPF_A) -> Self {
115        variant as u8 != 0
116    }
117}
118#[doc = "Field `WSECPF` reader - Wait State for Error Correction of PFLASH"]
119pub type WSECPF_R = crate::BitReader<WSECPF_A>;
120impl WSECPF_R {
121    #[doc = "Get enumerated values variant"]
122    #[inline(always)]
123    pub const fn variant(&self) -> WSECPF_A {
124        match self.bits {
125            false => WSECPF_A::VALUE1,
126            true => WSECPF_A::VALUE2,
127        }
128    }
129    #[doc = "No additional wait state for error correction"]
130    #[inline(always)]
131    pub fn is_value1(&self) -> bool {
132        *self == WSECPF_A::VALUE1
133    }
134    #[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."]
135    #[inline(always)]
136    pub fn is_value2(&self) -> bool {
137        *self == WSECPF_A::VALUE2
138    }
139}
140#[doc = "Field `WSECPF` writer - Wait State for Error Correction of PFLASH"]
141pub type WSECPF_W<'a, REG> = crate::BitWriter<'a, REG, WSECPF_A>;
142impl<'a, REG> WSECPF_W<'a, REG>
143where
144    REG: crate::Writable + crate::RegisterSpec,
145{
146    #[doc = "No additional wait state for error correction"]
147    #[inline(always)]
148    pub fn value1(self) -> &'a mut crate::W<REG> {
149        self.variant(WSECPF_A::VALUE1)
150    }
151    #[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."]
152    #[inline(always)]
153    pub fn value2(self) -> &'a mut crate::W<REG> {
154        self.variant(WSECPF_A::VALUE2)
155    }
156}
157#[doc = "Dynamic Flash Idle\n\nValue on reset: 0"]
158#[derive(Clone, Copy, Debug, PartialEq, Eq)]
159pub enum IDLE_A {
160    #[doc = "0: Normal/standard Flash read operation"]
161    VALUE1 = 0,
162    #[doc = "1: Dynamic idle of Program Flash enabled for power saving; static prefetching disabled"]
163    VALUE2 = 1,
164}
165impl From<IDLE_A> for bool {
166    #[inline(always)]
167    fn from(variant: IDLE_A) -> Self {
168        variant as u8 != 0
169    }
170}
171#[doc = "Field `IDLE` reader - Dynamic Flash Idle"]
172pub type IDLE_R = crate::BitReader<IDLE_A>;
173impl IDLE_R {
174    #[doc = "Get enumerated values variant"]
175    #[inline(always)]
176    pub const fn variant(&self) -> IDLE_A {
177        match self.bits {
178            false => IDLE_A::VALUE1,
179            true => IDLE_A::VALUE2,
180        }
181    }
182    #[doc = "Normal/standard Flash read operation"]
183    #[inline(always)]
184    pub fn is_value1(&self) -> bool {
185        *self == IDLE_A::VALUE1
186    }
187    #[doc = "Dynamic idle of Program Flash enabled for power saving; static prefetching disabled"]
188    #[inline(always)]
189    pub fn is_value2(&self) -> bool {
190        *self == IDLE_A::VALUE2
191    }
192}
193#[doc = "Field `IDLE` writer - Dynamic Flash Idle"]
194pub type IDLE_W<'a, REG> = crate::BitWriter<'a, REG, IDLE_A>;
195impl<'a, REG> IDLE_W<'a, REG>
196where
197    REG: crate::Writable + crate::RegisterSpec,
198{
199    #[doc = "Normal/standard Flash read operation"]
200    #[inline(always)]
201    pub fn value1(self) -> &'a mut crate::W<REG> {
202        self.variant(IDLE_A::VALUE1)
203    }
204    #[doc = "Dynamic idle of Program Flash enabled for power saving; static prefetching disabled"]
205    #[inline(always)]
206    pub fn value2(self) -> &'a mut crate::W<REG> {
207        self.variant(IDLE_A::VALUE2)
208    }
209}
210#[doc = "External Sleep Request Disable\n\nValue on reset: 0"]
211#[derive(Clone, Copy, Debug, PartialEq, Eq)]
212pub enum ESLDIS_A {
213    #[doc = "0: External sleep request signal input is enabled"]
214    VALUE1 = 0,
215    #[doc = "1: Externally requested Flash sleep is disabled"]
216    VALUE2 = 1,
217}
218impl From<ESLDIS_A> for bool {
219    #[inline(always)]
220    fn from(variant: ESLDIS_A) -> Self {
221        variant as u8 != 0
222    }
223}
224#[doc = "Field `ESLDIS` reader - External Sleep Request Disable"]
225pub type ESLDIS_R = crate::BitReader<ESLDIS_A>;
226impl ESLDIS_R {
227    #[doc = "Get enumerated values variant"]
228    #[inline(always)]
229    pub const fn variant(&self) -> ESLDIS_A {
230        match self.bits {
231            false => ESLDIS_A::VALUE1,
232            true => ESLDIS_A::VALUE2,
233        }
234    }
235    #[doc = "External sleep request signal input is enabled"]
236    #[inline(always)]
237    pub fn is_value1(&self) -> bool {
238        *self == ESLDIS_A::VALUE1
239    }
240    #[doc = "Externally requested Flash sleep is disabled"]
241    #[inline(always)]
242    pub fn is_value2(&self) -> bool {
243        *self == ESLDIS_A::VALUE2
244    }
245}
246#[doc = "Field `ESLDIS` writer - External Sleep Request Disable"]
247pub type ESLDIS_W<'a, REG> = crate::BitWriter<'a, REG, ESLDIS_A>;
248impl<'a, REG> ESLDIS_W<'a, REG>
249where
250    REG: crate::Writable + crate::RegisterSpec,
251{
252    #[doc = "External sleep request signal input is enabled"]
253    #[inline(always)]
254    pub fn value1(self) -> &'a mut crate::W<REG> {
255        self.variant(ESLDIS_A::VALUE1)
256    }
257    #[doc = "Externally requested Flash sleep is disabled"]
258    #[inline(always)]
259    pub fn value2(self) -> &'a mut crate::W<REG> {
260        self.variant(ESLDIS_A::VALUE2)
261    }
262}
263#[doc = "Flash SLEEP\n\nValue on reset: 0"]
264#[derive(Clone, Copy, Debug, PartialEq, Eq)]
265pub enum SLEEP_A {
266    #[doc = "0: Normal state or wake-up"]
267    VALUE1 = 0,
268    #[doc = "1: Flash sleep mode is requested"]
269    VALUE2 = 1,
270}
271impl From<SLEEP_A> for bool {
272    #[inline(always)]
273    fn from(variant: SLEEP_A) -> Self {
274        variant as u8 != 0
275    }
276}
277#[doc = "Field `SLEEP` reader - Flash SLEEP"]
278pub type SLEEP_R = crate::BitReader<SLEEP_A>;
279impl SLEEP_R {
280    #[doc = "Get enumerated values variant"]
281    #[inline(always)]
282    pub const fn variant(&self) -> SLEEP_A {
283        match self.bits {
284            false => SLEEP_A::VALUE1,
285            true => SLEEP_A::VALUE2,
286        }
287    }
288    #[doc = "Normal state or wake-up"]
289    #[inline(always)]
290    pub fn is_value1(&self) -> bool {
291        *self == SLEEP_A::VALUE1
292    }
293    #[doc = "Flash sleep mode is requested"]
294    #[inline(always)]
295    pub fn is_value2(&self) -> bool {
296        *self == SLEEP_A::VALUE2
297    }
298}
299#[doc = "Field `SLEEP` writer - Flash SLEEP"]
300pub type SLEEP_W<'a, REG> = crate::BitWriter<'a, REG, SLEEP_A>;
301impl<'a, REG> SLEEP_W<'a, REG>
302where
303    REG: crate::Writable + crate::RegisterSpec,
304{
305    #[doc = "Normal state or wake-up"]
306    #[inline(always)]
307    pub fn value1(self) -> &'a mut crate::W<REG> {
308        self.variant(SLEEP_A::VALUE1)
309    }
310    #[doc = "Flash sleep mode is requested"]
311    #[inline(always)]
312    pub fn value2(self) -> &'a mut crate::W<REG> {
313        self.variant(SLEEP_A::VALUE2)
314    }
315}
316#[doc = "Read Protection Activated\n\nValue on reset: 0"]
317#[derive(Clone, Copy, Debug, PartialEq, Eq)]
318pub enum RPA_A {
319    #[doc = "0: The Flash-internal read protection is not activated. Bits DCF, DDF are not taken into account. Bits DCF, DDFx can be cleared"]
320    VALUE1 = 0,
321    #[doc = "1: The Flash-internal read protection is activated. Bits DCF, DDF are enabled and evaluated."]
322    VALUE2 = 1,
323}
324impl From<RPA_A> for bool {
325    #[inline(always)]
326    fn from(variant: RPA_A) -> Self {
327        variant as u8 != 0
328    }
329}
330#[doc = "Field `RPA` reader - Read Protection Activated"]
331pub type RPA_R = crate::BitReader<RPA_A>;
332impl RPA_R {
333    #[doc = "Get enumerated values variant"]
334    #[inline(always)]
335    pub const fn variant(&self) -> RPA_A {
336        match self.bits {
337            false => RPA_A::VALUE1,
338            true => RPA_A::VALUE2,
339        }
340    }
341    #[doc = "The Flash-internal read protection is not activated. Bits DCF, DDF are not taken into account. Bits DCF, DDFx can be cleared"]
342    #[inline(always)]
343    pub fn is_value1(&self) -> bool {
344        *self == RPA_A::VALUE1
345    }
346    #[doc = "The Flash-internal read protection is activated. Bits DCF, DDF are enabled and evaluated."]
347    #[inline(always)]
348    pub fn is_value2(&self) -> bool {
349        *self == RPA_A::VALUE2
350    }
351}
352#[doc = "Disable Code Fetch from Flash Memory\n\nValue on reset: 0"]
353#[derive(Clone, Copy, Debug, PartialEq, Eq)]
354pub enum DCF_A {
355    #[doc = "0: Code fetching from the Flash memory area is allowed."]
356    VALUE1 = 0,
357    #[doc = "1: Code fetching from the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
358    VALUE2 = 1,
359}
360impl From<DCF_A> for bool {
361    #[inline(always)]
362    fn from(variant: DCF_A) -> Self {
363        variant as u8 != 0
364    }
365}
366#[doc = "Field `DCF` reader - Disable Code Fetch from Flash Memory"]
367pub type DCF_R = crate::BitReader<DCF_A>;
368impl DCF_R {
369    #[doc = "Get enumerated values variant"]
370    #[inline(always)]
371    pub const fn variant(&self) -> DCF_A {
372        match self.bits {
373            false => DCF_A::VALUE1,
374            true => DCF_A::VALUE2,
375        }
376    }
377    #[doc = "Code fetching from the Flash memory area is allowed."]
378    #[inline(always)]
379    pub fn is_value1(&self) -> bool {
380        *self == DCF_A::VALUE1
381    }
382    #[doc = "Code fetching from the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
383    #[inline(always)]
384    pub fn is_value2(&self) -> bool {
385        *self == DCF_A::VALUE2
386    }
387}
388#[doc = "Field `DCF` writer - Disable Code Fetch from Flash Memory"]
389pub type DCF_W<'a, REG> = crate::BitWriter<'a, REG, DCF_A>;
390impl<'a, REG> DCF_W<'a, REG>
391where
392    REG: crate::Writable + crate::RegisterSpec,
393{
394    #[doc = "Code fetching from the Flash memory area is allowed."]
395    #[inline(always)]
396    pub fn value1(self) -> &'a mut crate::W<REG> {
397        self.variant(DCF_A::VALUE1)
398    }
399    #[doc = "Code fetching from the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
400    #[inline(always)]
401    pub fn value2(self) -> &'a mut crate::W<REG> {
402        self.variant(DCF_A::VALUE2)
403    }
404}
405#[doc = "Disable Any Data Fetch from Flash\n\nValue on reset: 0"]
406#[derive(Clone, Copy, Debug, PartialEq, Eq)]
407pub enum DDF_A {
408    #[doc = "0: Data read access to the Flash memory area is allowed."]
409    VALUE1 = 0,
410    #[doc = "1: Data read access to the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
411    VALUE2 = 1,
412}
413impl From<DDF_A> for bool {
414    #[inline(always)]
415    fn from(variant: DDF_A) -> Self {
416        variant as u8 != 0
417    }
418}
419#[doc = "Field `DDF` reader - Disable Any Data Fetch from Flash"]
420pub type DDF_R = crate::BitReader<DDF_A>;
421impl DDF_R {
422    #[doc = "Get enumerated values variant"]
423    #[inline(always)]
424    pub const fn variant(&self) -> DDF_A {
425        match self.bits {
426            false => DDF_A::VALUE1,
427            true => DDF_A::VALUE2,
428        }
429    }
430    #[doc = "Data read access to the Flash memory area is allowed."]
431    #[inline(always)]
432    pub fn is_value1(&self) -> bool {
433        *self == DDF_A::VALUE1
434    }
435    #[doc = "Data read access to the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
436    #[inline(always)]
437    pub fn is_value2(&self) -> bool {
438        *self == DDF_A::VALUE2
439    }
440}
441#[doc = "Field `DDF` writer - Disable Any Data Fetch from Flash"]
442pub type DDF_W<'a, REG> = crate::BitWriter<'a, REG, DDF_A>;
443impl<'a, REG> DDF_W<'a, REG>
444where
445    REG: crate::Writable + crate::RegisterSpec,
446{
447    #[doc = "Data read access to the Flash memory area is allowed."]
448    #[inline(always)]
449    pub fn value1(self) -> &'a mut crate::W<REG> {
450        self.variant(DDF_A::VALUE1)
451    }
452    #[doc = "Data read access to the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."]
453    #[inline(always)]
454    pub fn value2(self) -> &'a mut crate::W<REG> {
455        self.variant(DDF_A::VALUE2)
456    }
457}
458#[doc = "Verify and Operation Error Interrupt Mask\n\nValue on reset: 0"]
459#[derive(Clone, Copy, Debug, PartialEq, Eq)]
460pub enum VOPERM_A {
461    #[doc = "0: Interrupt not enabled"]
462    VALUE1 = 0,
463    #[doc = "1: Flash interrupt because of Verify Error or Operation Error in Flash array (FSI) is enabled"]
464    VALUE2 = 1,
465}
466impl From<VOPERM_A> for bool {
467    #[inline(always)]
468    fn from(variant: VOPERM_A) -> Self {
469        variant as u8 != 0
470    }
471}
472#[doc = "Field `VOPERM` reader - Verify and Operation Error Interrupt Mask"]
473pub type VOPERM_R = crate::BitReader<VOPERM_A>;
474impl VOPERM_R {
475    #[doc = "Get enumerated values variant"]
476    #[inline(always)]
477    pub const fn variant(&self) -> VOPERM_A {
478        match self.bits {
479            false => VOPERM_A::VALUE1,
480            true => VOPERM_A::VALUE2,
481        }
482    }
483    #[doc = "Interrupt not enabled"]
484    #[inline(always)]
485    pub fn is_value1(&self) -> bool {
486        *self == VOPERM_A::VALUE1
487    }
488    #[doc = "Flash interrupt because of Verify Error or Operation Error in Flash array (FSI) is enabled"]
489    #[inline(always)]
490    pub fn is_value2(&self) -> bool {
491        *self == VOPERM_A::VALUE2
492    }
493}
494#[doc = "Field `VOPERM` writer - Verify and Operation Error Interrupt Mask"]
495pub type VOPERM_W<'a, REG> = crate::BitWriter<'a, REG, VOPERM_A>;
496impl<'a, REG> VOPERM_W<'a, REG>
497where
498    REG: crate::Writable + crate::RegisterSpec,
499{
500    #[doc = "Interrupt not enabled"]
501    #[inline(always)]
502    pub fn value1(self) -> &'a mut crate::W<REG> {
503        self.variant(VOPERM_A::VALUE1)
504    }
505    #[doc = "Flash interrupt because of Verify Error or Operation Error in Flash array (FSI) is enabled"]
506    #[inline(always)]
507    pub fn value2(self) -> &'a mut crate::W<REG> {
508        self.variant(VOPERM_A::VALUE2)
509    }
510}
511#[doc = "Command Sequence Error Interrupt Mask\n\nValue on reset: 0"]
512#[derive(Clone, Copy, Debug, PartialEq, Eq)]
513pub enum SQERM_A {
514    #[doc = "0: Interrupt not enabled"]
515    VALUE1 = 0,
516    #[doc = "1: Flash interrupt because of Sequence Error is enabled"]
517    VALUE2 = 1,
518}
519impl From<SQERM_A> for bool {
520    #[inline(always)]
521    fn from(variant: SQERM_A) -> Self {
522        variant as u8 != 0
523    }
524}
525#[doc = "Field `SQERM` reader - Command Sequence Error Interrupt Mask"]
526pub type SQERM_R = crate::BitReader<SQERM_A>;
527impl SQERM_R {
528    #[doc = "Get enumerated values variant"]
529    #[inline(always)]
530    pub const fn variant(&self) -> SQERM_A {
531        match self.bits {
532            false => SQERM_A::VALUE1,
533            true => SQERM_A::VALUE2,
534        }
535    }
536    #[doc = "Interrupt not enabled"]
537    #[inline(always)]
538    pub fn is_value1(&self) -> bool {
539        *self == SQERM_A::VALUE1
540    }
541    #[doc = "Flash interrupt because of Sequence Error is enabled"]
542    #[inline(always)]
543    pub fn is_value2(&self) -> bool {
544        *self == SQERM_A::VALUE2
545    }
546}
547#[doc = "Field `SQERM` writer - Command Sequence Error Interrupt Mask"]
548pub type SQERM_W<'a, REG> = crate::BitWriter<'a, REG, SQERM_A>;
549impl<'a, REG> SQERM_W<'a, REG>
550where
551    REG: crate::Writable + crate::RegisterSpec,
552{
553    #[doc = "Interrupt not enabled"]
554    #[inline(always)]
555    pub fn value1(self) -> &'a mut crate::W<REG> {
556        self.variant(SQERM_A::VALUE1)
557    }
558    #[doc = "Flash interrupt because of Sequence Error is enabled"]
559    #[inline(always)]
560    pub fn value2(self) -> &'a mut crate::W<REG> {
561        self.variant(SQERM_A::VALUE2)
562    }
563}
564#[doc = "Protection Error Interrupt Mask\n\nValue on reset: 0"]
565#[derive(Clone, Copy, Debug, PartialEq, Eq)]
566pub enum PROERM_A {
567    #[doc = "0: Interrupt not enabled"]
568    VALUE1 = 0,
569    #[doc = "1: Flash interrupt because of Protection Error is enabled"]
570    VALUE2 = 1,
571}
572impl From<PROERM_A> for bool {
573    #[inline(always)]
574    fn from(variant: PROERM_A) -> Self {
575        variant as u8 != 0
576    }
577}
578#[doc = "Field `PROERM` reader - Protection Error Interrupt Mask"]
579pub type PROERM_R = crate::BitReader<PROERM_A>;
580impl PROERM_R {
581    #[doc = "Get enumerated values variant"]
582    #[inline(always)]
583    pub const fn variant(&self) -> PROERM_A {
584        match self.bits {
585            false => PROERM_A::VALUE1,
586            true => PROERM_A::VALUE2,
587        }
588    }
589    #[doc = "Interrupt not enabled"]
590    #[inline(always)]
591    pub fn is_value1(&self) -> bool {
592        *self == PROERM_A::VALUE1
593    }
594    #[doc = "Flash interrupt because of Protection Error is enabled"]
595    #[inline(always)]
596    pub fn is_value2(&self) -> bool {
597        *self == PROERM_A::VALUE2
598    }
599}
600#[doc = "Field `PROERM` writer - Protection Error Interrupt Mask"]
601pub type PROERM_W<'a, REG> = crate::BitWriter<'a, REG, PROERM_A>;
602impl<'a, REG> PROERM_W<'a, REG>
603where
604    REG: crate::Writable + crate::RegisterSpec,
605{
606    #[doc = "Interrupt not enabled"]
607    #[inline(always)]
608    pub fn value1(self) -> &'a mut crate::W<REG> {
609        self.variant(PROERM_A::VALUE1)
610    }
611    #[doc = "Flash interrupt because of Protection Error is enabled"]
612    #[inline(always)]
613    pub fn value2(self) -> &'a mut crate::W<REG> {
614        self.variant(PROERM_A::VALUE2)
615    }
616}
617#[doc = "PFLASH Single-Bit Error Interrupt Mask\n\nValue on reset: 0"]
618#[derive(Clone, Copy, Debug, PartialEq, Eq)]
619pub enum PFSBERM_A {
620    #[doc = "0: No Single-Bit Error interrupt enabled"]
621    VALUE1 = 0,
622    #[doc = "1: Single-Bit Error interrupt enabled for PFLASH"]
623    VALUE2 = 1,
624}
625impl From<PFSBERM_A> for bool {
626    #[inline(always)]
627    fn from(variant: PFSBERM_A) -> Self {
628        variant as u8 != 0
629    }
630}
631#[doc = "Field `PFSBERM` reader - PFLASH Single-Bit Error Interrupt Mask"]
632pub type PFSBERM_R = crate::BitReader<PFSBERM_A>;
633impl PFSBERM_R {
634    #[doc = "Get enumerated values variant"]
635    #[inline(always)]
636    pub const fn variant(&self) -> PFSBERM_A {
637        match self.bits {
638            false => PFSBERM_A::VALUE1,
639            true => PFSBERM_A::VALUE2,
640        }
641    }
642    #[doc = "No Single-Bit Error interrupt enabled"]
643    #[inline(always)]
644    pub fn is_value1(&self) -> bool {
645        *self == PFSBERM_A::VALUE1
646    }
647    #[doc = "Single-Bit Error interrupt enabled for PFLASH"]
648    #[inline(always)]
649    pub fn is_value2(&self) -> bool {
650        *self == PFSBERM_A::VALUE2
651    }
652}
653#[doc = "Field `PFSBERM` writer - PFLASH Single-Bit Error Interrupt Mask"]
654pub type PFSBERM_W<'a, REG> = crate::BitWriter<'a, REG, PFSBERM_A>;
655impl<'a, REG> PFSBERM_W<'a, REG>
656where
657    REG: crate::Writable + crate::RegisterSpec,
658{
659    #[doc = "No Single-Bit Error interrupt enabled"]
660    #[inline(always)]
661    pub fn value1(self) -> &'a mut crate::W<REG> {
662        self.variant(PFSBERM_A::VALUE1)
663    }
664    #[doc = "Single-Bit Error interrupt enabled for PFLASH"]
665    #[inline(always)]
666    pub fn value2(self) -> &'a mut crate::W<REG> {
667        self.variant(PFSBERM_A::VALUE2)
668    }
669}
670#[doc = "PFLASH Double-Bit Error Interrupt Mask\n\nValue on reset: 0"]
671#[derive(Clone, Copy, Debug, PartialEq, Eq)]
672pub enum PFDBERM_A {
673    #[doc = "0: Double-Bit Error interrupt for PFLASH not enabled"]
674    VALUE1 = 0,
675    #[doc = "1: Double-Bit Error interrupt for PFLASH enabled. Especially intended for margin check"]
676    VALUE2 = 1,
677}
678impl From<PFDBERM_A> for bool {
679    #[inline(always)]
680    fn from(variant: PFDBERM_A) -> Self {
681        variant as u8 != 0
682    }
683}
684#[doc = "Field `PFDBERM` reader - PFLASH Double-Bit Error Interrupt Mask"]
685pub type PFDBERM_R = crate::BitReader<PFDBERM_A>;
686impl PFDBERM_R {
687    #[doc = "Get enumerated values variant"]
688    #[inline(always)]
689    pub const fn variant(&self) -> PFDBERM_A {
690        match self.bits {
691            false => PFDBERM_A::VALUE1,
692            true => PFDBERM_A::VALUE2,
693        }
694    }
695    #[doc = "Double-Bit Error interrupt for PFLASH not enabled"]
696    #[inline(always)]
697    pub fn is_value1(&self) -> bool {
698        *self == PFDBERM_A::VALUE1
699    }
700    #[doc = "Double-Bit Error interrupt for PFLASH enabled. Especially intended for margin check"]
701    #[inline(always)]
702    pub fn is_value2(&self) -> bool {
703        *self == PFDBERM_A::VALUE2
704    }
705}
706#[doc = "Field `PFDBERM` writer - PFLASH Double-Bit Error Interrupt Mask"]
707pub type PFDBERM_W<'a, REG> = crate::BitWriter<'a, REG, PFDBERM_A>;
708impl<'a, REG> PFDBERM_W<'a, REG>
709where
710    REG: crate::Writable + crate::RegisterSpec,
711{
712    #[doc = "Double-Bit Error interrupt for PFLASH not enabled"]
713    #[inline(always)]
714    pub fn value1(self) -> &'a mut crate::W<REG> {
715        self.variant(PFDBERM_A::VALUE1)
716    }
717    #[doc = "Double-Bit Error interrupt for PFLASH enabled. Especially intended for margin check"]
718    #[inline(always)]
719    pub fn value2(self) -> &'a mut crate::W<REG> {
720        self.variant(PFDBERM_A::VALUE2)
721    }
722}
723#[doc = "End of Busy Interrupt Mask\n\nValue on reset: 0"]
724#[derive(Clone, Copy, Debug, PartialEq, Eq)]
725pub enum EOBM_A {
726    #[doc = "0: Interrupt not enabled"]
727    VALUE1 = 0,
728    #[doc = "1: EOB interrupt is enabled"]
729    VALUE2 = 1,
730}
731impl From<EOBM_A> for bool {
732    #[inline(always)]
733    fn from(variant: EOBM_A) -> Self {
734        variant as u8 != 0
735    }
736}
737#[doc = "Field `EOBM` reader - End of Busy Interrupt Mask"]
738pub type EOBM_R = crate::BitReader<EOBM_A>;
739impl EOBM_R {
740    #[doc = "Get enumerated values variant"]
741    #[inline(always)]
742    pub const fn variant(&self) -> EOBM_A {
743        match self.bits {
744            false => EOBM_A::VALUE1,
745            true => EOBM_A::VALUE2,
746        }
747    }
748    #[doc = "Interrupt not enabled"]
749    #[inline(always)]
750    pub fn is_value1(&self) -> bool {
751        *self == EOBM_A::VALUE1
752    }
753    #[doc = "EOB interrupt is enabled"]
754    #[inline(always)]
755    pub fn is_value2(&self) -> bool {
756        *self == EOBM_A::VALUE2
757    }
758}
759#[doc = "Field `EOBM` writer - End of Busy Interrupt Mask"]
760pub type EOBM_W<'a, REG> = crate::BitWriter<'a, REG, EOBM_A>;
761impl<'a, REG> EOBM_W<'a, REG>
762where
763    REG: crate::Writable + crate::RegisterSpec,
764{
765    #[doc = "Interrupt not enabled"]
766    #[inline(always)]
767    pub fn value1(self) -> &'a mut crate::W<REG> {
768        self.variant(EOBM_A::VALUE1)
769    }
770    #[doc = "EOB interrupt is enabled"]
771    #[inline(always)]
772    pub fn value2(self) -> &'a mut crate::W<REG> {
773        self.variant(EOBM_A::VALUE2)
774    }
775}
776impl R {
777    #[doc = "Bits 0:3 - Wait States for read access to PFLASH"]
778    #[inline(always)]
779    pub fn wspflash(&self) -> WSPFLASH_R {
780        WSPFLASH_R::new((self.bits & 0x0f) as u8)
781    }
782    #[doc = "Bit 4 - Wait State for Error Correction of PFLASH"]
783    #[inline(always)]
784    pub fn wsecpf(&self) -> WSECPF_R {
785        WSECPF_R::new(((self.bits >> 4) & 1) != 0)
786    }
787    #[doc = "Bit 13 - Dynamic Flash Idle"]
788    #[inline(always)]
789    pub fn idle(&self) -> IDLE_R {
790        IDLE_R::new(((self.bits >> 13) & 1) != 0)
791    }
792    #[doc = "Bit 14 - External Sleep Request Disable"]
793    #[inline(always)]
794    pub fn esldis(&self) -> ESLDIS_R {
795        ESLDIS_R::new(((self.bits >> 14) & 1) != 0)
796    }
797    #[doc = "Bit 15 - Flash SLEEP"]
798    #[inline(always)]
799    pub fn sleep(&self) -> SLEEP_R {
800        SLEEP_R::new(((self.bits >> 15) & 1) != 0)
801    }
802    #[doc = "Bit 16 - Read Protection Activated"]
803    #[inline(always)]
804    pub fn rpa(&self) -> RPA_R {
805        RPA_R::new(((self.bits >> 16) & 1) != 0)
806    }
807    #[doc = "Bit 17 - Disable Code Fetch from Flash Memory"]
808    #[inline(always)]
809    pub fn dcf(&self) -> DCF_R {
810        DCF_R::new(((self.bits >> 17) & 1) != 0)
811    }
812    #[doc = "Bit 18 - Disable Any Data Fetch from Flash"]
813    #[inline(always)]
814    pub fn ddf(&self) -> DDF_R {
815        DDF_R::new(((self.bits >> 18) & 1) != 0)
816    }
817    #[doc = "Bit 24 - Verify and Operation Error Interrupt Mask"]
818    #[inline(always)]
819    pub fn voperm(&self) -> VOPERM_R {
820        VOPERM_R::new(((self.bits >> 24) & 1) != 0)
821    }
822    #[doc = "Bit 25 - Command Sequence Error Interrupt Mask"]
823    #[inline(always)]
824    pub fn sqerm(&self) -> SQERM_R {
825        SQERM_R::new(((self.bits >> 25) & 1) != 0)
826    }
827    #[doc = "Bit 26 - Protection Error Interrupt Mask"]
828    #[inline(always)]
829    pub fn proerm(&self) -> PROERM_R {
830        PROERM_R::new(((self.bits >> 26) & 1) != 0)
831    }
832    #[doc = "Bit 27 - PFLASH Single-Bit Error Interrupt Mask"]
833    #[inline(always)]
834    pub fn pfsberm(&self) -> PFSBERM_R {
835        PFSBERM_R::new(((self.bits >> 27) & 1) != 0)
836    }
837    #[doc = "Bit 29 - PFLASH Double-Bit Error Interrupt Mask"]
838    #[inline(always)]
839    pub fn pfdberm(&self) -> PFDBERM_R {
840        PFDBERM_R::new(((self.bits >> 29) & 1) != 0)
841    }
842    #[doc = "Bit 31 - End of Busy Interrupt Mask"]
843    #[inline(always)]
844    pub fn eobm(&self) -> EOBM_R {
845        EOBM_R::new(((self.bits >> 31) & 1) != 0)
846    }
847}
848impl W {
849    #[doc = "Bits 0:3 - Wait States for read access to PFLASH"]
850    #[inline(always)]
851    pub fn wspflash(&mut self) -> WSPFLASH_W<FCON_SPEC> {
852        WSPFLASH_W::new(self, 0)
853    }
854    #[doc = "Bit 4 - Wait State for Error Correction of PFLASH"]
855    #[inline(always)]
856    pub fn wsecpf(&mut self) -> WSECPF_W<FCON_SPEC> {
857        WSECPF_W::new(self, 4)
858    }
859    #[doc = "Bit 13 - Dynamic Flash Idle"]
860    #[inline(always)]
861    pub fn idle(&mut self) -> IDLE_W<FCON_SPEC> {
862        IDLE_W::new(self, 13)
863    }
864    #[doc = "Bit 14 - External Sleep Request Disable"]
865    #[inline(always)]
866    pub fn esldis(&mut self) -> ESLDIS_W<FCON_SPEC> {
867        ESLDIS_W::new(self, 14)
868    }
869    #[doc = "Bit 15 - Flash SLEEP"]
870    #[inline(always)]
871    pub fn sleep(&mut self) -> SLEEP_W<FCON_SPEC> {
872        SLEEP_W::new(self, 15)
873    }
874    #[doc = "Bit 17 - Disable Code Fetch from Flash Memory"]
875    #[inline(always)]
876    pub fn dcf(&mut self) -> DCF_W<FCON_SPEC> {
877        DCF_W::new(self, 17)
878    }
879    #[doc = "Bit 18 - Disable Any Data Fetch from Flash"]
880    #[inline(always)]
881    pub fn ddf(&mut self) -> DDF_W<FCON_SPEC> {
882        DDF_W::new(self, 18)
883    }
884    #[doc = "Bit 24 - Verify and Operation Error Interrupt Mask"]
885    #[inline(always)]
886    pub fn voperm(&mut self) -> VOPERM_W<FCON_SPEC> {
887        VOPERM_W::new(self, 24)
888    }
889    #[doc = "Bit 25 - Command Sequence Error Interrupt Mask"]
890    #[inline(always)]
891    pub fn sqerm(&mut self) -> SQERM_W<FCON_SPEC> {
892        SQERM_W::new(self, 25)
893    }
894    #[doc = "Bit 26 - Protection Error Interrupt Mask"]
895    #[inline(always)]
896    pub fn proerm(&mut self) -> PROERM_W<FCON_SPEC> {
897        PROERM_W::new(self, 26)
898    }
899    #[doc = "Bit 27 - PFLASH Single-Bit Error Interrupt Mask"]
900    #[inline(always)]
901    pub fn pfsberm(&mut self) -> PFSBERM_W<FCON_SPEC> {
902        PFSBERM_W::new(self, 27)
903    }
904    #[doc = "Bit 29 - PFLASH Double-Bit Error Interrupt Mask"]
905    #[inline(always)]
906    pub fn pfdberm(&mut self) -> PFDBERM_W<FCON_SPEC> {
907        PFDBERM_W::new(self, 29)
908    }
909    #[doc = "Bit 31 - End of Busy Interrupt Mask"]
910    #[inline(always)]
911    pub fn eobm(&mut self) -> EOBM_W<FCON_SPEC> {
912        EOBM_W::new(self, 31)
913    }
914}
915#[doc = "Flash Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fcon::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fcon::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
916pub struct FCON_SPEC;
917impl crate::RegisterSpec for FCON_SPEC {
918    type Ux = u32;
919}
920#[doc = "`read()` method returns [`fcon::R`](R) reader structure"]
921impl crate::Readable for FCON_SPEC {}
922#[doc = "`write(|w| ..)` method takes [`fcon::W`](W) writer structure"]
923impl crate::Writable for FCON_SPEC {
924    type Safety = crate::Unsafe;
925    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
926    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
927}
928#[doc = "`reset()` method sets FCON to value 0x06"]
929impl crate::Resettable for FCON_SPEC {
930    const RESET_VALUE: u32 = 0x06;
931}