mcxa_pac/fmu0/
fstat.rs

1#[doc = "Register `FSTAT` reader"]
2pub type R = crate::R<FstatSpec>;
3#[doc = "Register `FSTAT` writer"]
4pub type W = crate::W<FstatSpec>;
5#[doc = "Command Fail Flag\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Fail {
9    #[doc = "0: Error not detected"]
10    Fail0 = 0,
11    #[doc = "1: Error detected"]
12    Fail1 = 1,
13}
14impl From<Fail> for bool {
15    #[inline(always)]
16    fn from(variant: Fail) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `FAIL` reader - Command Fail Flag"]
21pub type FailR = crate::BitReader<Fail>;
22impl FailR {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> Fail {
26        match self.bits {
27            false => Fail::Fail0,
28            true => Fail::Fail1,
29        }
30    }
31    #[doc = "Error not detected"]
32    #[inline(always)]
33    pub fn is_fail0(&self) -> bool {
34        *self == Fail::Fail0
35    }
36    #[doc = "Error detected"]
37    #[inline(always)]
38    pub fn is_fail1(&self) -> bool {
39        *self == Fail::Fail1
40    }
41}
42#[doc = "Command Abort Flag\n\nValue on reset: 0"]
43#[cfg_attr(feature = "defmt", derive(defmt::Format))]
44#[derive(Clone, Copy, Debug, PartialEq, Eq)]
45pub enum Cmdabt {
46    #[doc = "0: No command abort detected"]
47    Cmdabt0 = 0,
48    #[doc = "1: Command abort detected"]
49    Cmdabt1 = 1,
50}
51impl From<Cmdabt> for bool {
52    #[inline(always)]
53    fn from(variant: Cmdabt) -> Self {
54        variant as u8 != 0
55    }
56}
57#[doc = "Field `CMDABT` reader - Command Abort Flag"]
58pub type CmdabtR = crate::BitReader<Cmdabt>;
59impl CmdabtR {
60    #[doc = "Get enumerated values variant"]
61    #[inline(always)]
62    pub const fn variant(&self) -> Cmdabt {
63        match self.bits {
64            false => Cmdabt::Cmdabt0,
65            true => Cmdabt::Cmdabt1,
66        }
67    }
68    #[doc = "No command abort detected"]
69    #[inline(always)]
70    pub fn is_cmdabt0(&self) -> bool {
71        *self == Cmdabt::Cmdabt0
72    }
73    #[doc = "Command abort detected"]
74    #[inline(always)]
75    pub fn is_cmdabt1(&self) -> bool {
76        *self == Cmdabt::Cmdabt1
77    }
78}
79#[doc = "Field `CMDABT` writer - Command Abort Flag"]
80pub type CmdabtW<'a, REG> = crate::BitWriter1C<'a, REG, Cmdabt>;
81impl<'a, REG> CmdabtW<'a, REG>
82where
83    REG: crate::Writable + crate::RegisterSpec,
84{
85    #[doc = "No command abort detected"]
86    #[inline(always)]
87    pub fn cmdabt0(self) -> &'a mut crate::W<REG> {
88        self.variant(Cmdabt::Cmdabt0)
89    }
90    #[doc = "Command abort detected"]
91    #[inline(always)]
92    pub fn cmdabt1(self) -> &'a mut crate::W<REG> {
93        self.variant(Cmdabt::Cmdabt1)
94    }
95}
96#[doc = "Command Protection Violation Flag\n\nValue on reset: 0"]
97#[cfg_attr(feature = "defmt", derive(defmt::Format))]
98#[derive(Clone, Copy, Debug, PartialEq, Eq)]
99pub enum Pviol {
100    #[doc = "0: No protection violation detected"]
101    Pviol0 = 0,
102    #[doc = "1: Protection violation detected"]
103    Pviol1 = 1,
104}
105impl From<Pviol> for bool {
106    #[inline(always)]
107    fn from(variant: Pviol) -> Self {
108        variant as u8 != 0
109    }
110}
111#[doc = "Field `PVIOL` reader - Command Protection Violation Flag"]
112pub type PviolR = crate::BitReader<Pviol>;
113impl PviolR {
114    #[doc = "Get enumerated values variant"]
115    #[inline(always)]
116    pub const fn variant(&self) -> Pviol {
117        match self.bits {
118            false => Pviol::Pviol0,
119            true => Pviol::Pviol1,
120        }
121    }
122    #[doc = "No protection violation detected"]
123    #[inline(always)]
124    pub fn is_pviol0(&self) -> bool {
125        *self == Pviol::Pviol0
126    }
127    #[doc = "Protection violation detected"]
128    #[inline(always)]
129    pub fn is_pviol1(&self) -> bool {
130        *self == Pviol::Pviol1
131    }
132}
133#[doc = "Field `PVIOL` writer - Command Protection Violation Flag"]
134pub type PviolW<'a, REG> = crate::BitWriter1C<'a, REG, Pviol>;
135impl<'a, REG> PviolW<'a, REG>
136where
137    REG: crate::Writable + crate::RegisterSpec,
138{
139    #[doc = "No protection violation detected"]
140    #[inline(always)]
141    pub fn pviol0(self) -> &'a mut crate::W<REG> {
142        self.variant(Pviol::Pviol0)
143    }
144    #[doc = "Protection violation detected"]
145    #[inline(always)]
146    pub fn pviol1(self) -> &'a mut crate::W<REG> {
147        self.variant(Pviol::Pviol1)
148    }
149}
150#[doc = "Command Access Error Flag\n\nValue on reset: 0"]
151#[cfg_attr(feature = "defmt", derive(defmt::Format))]
152#[derive(Clone, Copy, Debug, PartialEq, Eq)]
153pub enum Accerr {
154    #[doc = "0: No access error detected"]
155    Accerr0 = 0,
156    #[doc = "1: Access error detected"]
157    Accerr1 = 1,
158}
159impl From<Accerr> for bool {
160    #[inline(always)]
161    fn from(variant: Accerr) -> Self {
162        variant as u8 != 0
163    }
164}
165#[doc = "Field `ACCERR` reader - Command Access Error Flag"]
166pub type AccerrR = crate::BitReader<Accerr>;
167impl AccerrR {
168    #[doc = "Get enumerated values variant"]
169    #[inline(always)]
170    pub const fn variant(&self) -> Accerr {
171        match self.bits {
172            false => Accerr::Accerr0,
173            true => Accerr::Accerr1,
174        }
175    }
176    #[doc = "No access error detected"]
177    #[inline(always)]
178    pub fn is_accerr0(&self) -> bool {
179        *self == Accerr::Accerr0
180    }
181    #[doc = "Access error detected"]
182    #[inline(always)]
183    pub fn is_accerr1(&self) -> bool {
184        *self == Accerr::Accerr1
185    }
186}
187#[doc = "Field `ACCERR` writer - Command Access Error Flag"]
188pub type AccerrW<'a, REG> = crate::BitWriter1C<'a, REG, Accerr>;
189impl<'a, REG> AccerrW<'a, REG>
190where
191    REG: crate::Writable + crate::RegisterSpec,
192{
193    #[doc = "No access error detected"]
194    #[inline(always)]
195    pub fn accerr0(self) -> &'a mut crate::W<REG> {
196        self.variant(Accerr::Accerr0)
197    }
198    #[doc = "Access error detected"]
199    #[inline(always)]
200    pub fn accerr1(self) -> &'a mut crate::W<REG> {
201        self.variant(Accerr::Accerr1)
202    }
203}
204#[doc = "Command Write Sequence Abort Flag\n\nValue on reset: 0"]
205#[cfg_attr(feature = "defmt", derive(defmt::Format))]
206#[derive(Clone, Copy, Debug, PartialEq, Eq)]
207pub enum Cwsabt {
208    #[doc = "0: Command write sequence not aborted"]
209    Cwsabt0 = 0,
210    #[doc = "1: Command write sequence aborted"]
211    Cwsabt1 = 1,
212}
213impl From<Cwsabt> for bool {
214    #[inline(always)]
215    fn from(variant: Cwsabt) -> Self {
216        variant as u8 != 0
217    }
218}
219#[doc = "Field `CWSABT` reader - Command Write Sequence Abort Flag"]
220pub type CwsabtR = crate::BitReader<Cwsabt>;
221impl CwsabtR {
222    #[doc = "Get enumerated values variant"]
223    #[inline(always)]
224    pub const fn variant(&self) -> Cwsabt {
225        match self.bits {
226            false => Cwsabt::Cwsabt0,
227            true => Cwsabt::Cwsabt1,
228        }
229    }
230    #[doc = "Command write sequence not aborted"]
231    #[inline(always)]
232    pub fn is_cwsabt0(&self) -> bool {
233        *self == Cwsabt::Cwsabt0
234    }
235    #[doc = "Command write sequence aborted"]
236    #[inline(always)]
237    pub fn is_cwsabt1(&self) -> bool {
238        *self == Cwsabt::Cwsabt1
239    }
240}
241#[doc = "Field `CWSABT` writer - Command Write Sequence Abort Flag"]
242pub type CwsabtW<'a, REG> = crate::BitWriter1C<'a, REG, Cwsabt>;
243impl<'a, REG> CwsabtW<'a, REG>
244where
245    REG: crate::Writable + crate::RegisterSpec,
246{
247    #[doc = "Command write sequence not aborted"]
248    #[inline(always)]
249    pub fn cwsabt0(self) -> &'a mut crate::W<REG> {
250        self.variant(Cwsabt::Cwsabt0)
251    }
252    #[doc = "Command write sequence aborted"]
253    #[inline(always)]
254    pub fn cwsabt1(self) -> &'a mut crate::W<REG> {
255        self.variant(Cwsabt::Cwsabt1)
256    }
257}
258#[doc = "Command Complete Interrupt Flag\n\nValue on reset: 1"]
259#[cfg_attr(feature = "defmt", derive(defmt::Format))]
260#[derive(Clone, Copy, Debug, PartialEq, Eq)]
261pub enum Ccif {
262    #[doc = "0: Flash command, initialization, or power mode recovery in progress"]
263    Ccif0 = 0,
264    #[doc = "1: Flash command, initialization, or power mode recovery has completed"]
265    Ccif1 = 1,
266}
267impl From<Ccif> for bool {
268    #[inline(always)]
269    fn from(variant: Ccif) -> Self {
270        variant as u8 != 0
271    }
272}
273#[doc = "Field `CCIF` reader - Command Complete Interrupt Flag"]
274pub type CcifR = crate::BitReader<Ccif>;
275impl CcifR {
276    #[doc = "Get enumerated values variant"]
277    #[inline(always)]
278    pub const fn variant(&self) -> Ccif {
279        match self.bits {
280            false => Ccif::Ccif0,
281            true => Ccif::Ccif1,
282        }
283    }
284    #[doc = "Flash command, initialization, or power mode recovery in progress"]
285    #[inline(always)]
286    pub fn is_ccif0(&self) -> bool {
287        *self == Ccif::Ccif0
288    }
289    #[doc = "Flash command, initialization, or power mode recovery has completed"]
290    #[inline(always)]
291    pub fn is_ccif1(&self) -> bool {
292        *self == Ccif::Ccif1
293    }
294}
295#[doc = "Field `CCIF` writer - Command Complete Interrupt Flag"]
296pub type CcifW<'a, REG> = crate::BitWriter1C<'a, REG, Ccif>;
297impl<'a, REG> CcifW<'a, REG>
298where
299    REG: crate::Writable + crate::RegisterSpec,
300{
301    #[doc = "Flash command, initialization, or power mode recovery in progress"]
302    #[inline(always)]
303    pub fn ccif0(self) -> &'a mut crate::W<REG> {
304        self.variant(Ccif::Ccif0)
305    }
306    #[doc = "Flash command, initialization, or power mode recovery has completed"]
307    #[inline(always)]
308    pub fn ccif1(self) -> &'a mut crate::W<REG> {
309        self.variant(Ccif::Ccif1)
310    }
311}
312#[doc = "Command protection level\n\nValue on reset: 0"]
313#[cfg_attr(feature = "defmt", derive(defmt::Format))]
314#[derive(Clone, Copy, Debug, PartialEq, Eq)]
315#[repr(u8)]
316pub enum Cmdprt {
317    #[doc = "0: Secure, normal access"]
318    Cmdprt00 = 0,
319    #[doc = "1: Secure, privileged access"]
320    Cmdprt01 = 1,
321    #[doc = "2: Nonsecure, normal access"]
322    Cmdprt10 = 2,
323    #[doc = "3: Nonsecure, privileged access"]
324    Cmdprt11 = 3,
325}
326impl From<Cmdprt> for u8 {
327    #[inline(always)]
328    fn from(variant: Cmdprt) -> Self {
329        variant as _
330    }
331}
332impl crate::FieldSpec for Cmdprt {
333    type Ux = u8;
334}
335impl crate::IsEnum for Cmdprt {}
336#[doc = "Field `CMDPRT` reader - Command protection level"]
337pub type CmdprtR = crate::FieldReader<Cmdprt>;
338impl CmdprtR {
339    #[doc = "Get enumerated values variant"]
340    #[inline(always)]
341    pub const fn variant(&self) -> Cmdprt {
342        match self.bits {
343            0 => Cmdprt::Cmdprt00,
344            1 => Cmdprt::Cmdprt01,
345            2 => Cmdprt::Cmdprt10,
346            3 => Cmdprt::Cmdprt11,
347            _ => unreachable!(),
348        }
349    }
350    #[doc = "Secure, normal access"]
351    #[inline(always)]
352    pub fn is_cmdprt00(&self) -> bool {
353        *self == Cmdprt::Cmdprt00
354    }
355    #[doc = "Secure, privileged access"]
356    #[inline(always)]
357    pub fn is_cmdprt01(&self) -> bool {
358        *self == Cmdprt::Cmdprt01
359    }
360    #[doc = "Nonsecure, normal access"]
361    #[inline(always)]
362    pub fn is_cmdprt10(&self) -> bool {
363        *self == Cmdprt::Cmdprt10
364    }
365    #[doc = "Nonsecure, privileged access"]
366    #[inline(always)]
367    pub fn is_cmdprt11(&self) -> bool {
368        *self == Cmdprt::Cmdprt11
369    }
370}
371#[doc = "Command protection status flag\n\nValue on reset: 0"]
372#[cfg_attr(feature = "defmt", derive(defmt::Format))]
373#[derive(Clone, Copy, Debug, PartialEq, Eq)]
374pub enum Cmdp {
375    #[doc = "0: Command protection level and domain ID are stale"]
376    Cmdp0 = 0,
377    #[doc = "1: Command protection level (CMDPRT) and domain ID (CMDDID) are set"]
378    Cmdp1 = 1,
379}
380impl From<Cmdp> for bool {
381    #[inline(always)]
382    fn from(variant: Cmdp) -> Self {
383        variant as u8 != 0
384    }
385}
386#[doc = "Field `CMDP` reader - Command protection status flag"]
387pub type CmdpR = crate::BitReader<Cmdp>;
388impl CmdpR {
389    #[doc = "Get enumerated values variant"]
390    #[inline(always)]
391    pub const fn variant(&self) -> Cmdp {
392        match self.bits {
393            false => Cmdp::Cmdp0,
394            true => Cmdp::Cmdp1,
395        }
396    }
397    #[doc = "Command protection level and domain ID are stale"]
398    #[inline(always)]
399    pub fn is_cmdp0(&self) -> bool {
400        *self == Cmdp::Cmdp0
401    }
402    #[doc = "Command protection level (CMDPRT) and domain ID (CMDDID) are set"]
403    #[inline(always)]
404    pub fn is_cmdp1(&self) -> bool {
405        *self == Cmdp::Cmdp1
406    }
407}
408#[doc = "Field `CMDDID` reader - Command domain ID"]
409pub type CmddidR = crate::FieldReader;
410#[doc = "Double Bit Fault Detect Interrupt Flag\n\nValue on reset: 0"]
411#[cfg_attr(feature = "defmt", derive(defmt::Format))]
412#[derive(Clone, Copy, Debug, PartialEq, Eq)]
413pub enum Dfdif {
414    #[doc = "0: Double bit fault not detected during a valid flash read access"]
415    Dfdif0 = 0,
416    #[doc = "1: Double bit fault detected (or FCTRL\\[FDFD\\] is set) during a valid flash read access"]
417    Dfdif1 = 1,
418}
419impl From<Dfdif> for bool {
420    #[inline(always)]
421    fn from(variant: Dfdif) -> Self {
422        variant as u8 != 0
423    }
424}
425#[doc = "Field `DFDIF` reader - Double Bit Fault Detect Interrupt Flag"]
426pub type DfdifR = crate::BitReader<Dfdif>;
427impl DfdifR {
428    #[doc = "Get enumerated values variant"]
429    #[inline(always)]
430    pub const fn variant(&self) -> Dfdif {
431        match self.bits {
432            false => Dfdif::Dfdif0,
433            true => Dfdif::Dfdif1,
434        }
435    }
436    #[doc = "Double bit fault not detected during a valid flash read access"]
437    #[inline(always)]
438    pub fn is_dfdif0(&self) -> bool {
439        *self == Dfdif::Dfdif0
440    }
441    #[doc = "Double bit fault detected (or FCTRL\\[FDFD\\] is set) during a valid flash read access"]
442    #[inline(always)]
443    pub fn is_dfdif1(&self) -> bool {
444        *self == Dfdif::Dfdif1
445    }
446}
447#[doc = "Field `DFDIF` writer - Double Bit Fault Detect Interrupt Flag"]
448pub type DfdifW<'a, REG> = crate::BitWriter1C<'a, REG, Dfdif>;
449impl<'a, REG> DfdifW<'a, REG>
450where
451    REG: crate::Writable + crate::RegisterSpec,
452{
453    #[doc = "Double bit fault not detected during a valid flash read access"]
454    #[inline(always)]
455    pub fn dfdif0(self) -> &'a mut crate::W<REG> {
456        self.variant(Dfdif::Dfdif0)
457    }
458    #[doc = "Double bit fault detected (or FCTRL\\[FDFD\\] is set) during a valid flash read access"]
459    #[inline(always)]
460    pub fn dfdif1(self) -> &'a mut crate::W<REG> {
461        self.variant(Dfdif::Dfdif1)
462    }
463}
464#[doc = "Salvage Used for Erase operation\n\nValue on reset: 0"]
465#[cfg_attr(feature = "defmt", derive(defmt::Format))]
466#[derive(Clone, Copy, Debug, PartialEq, Eq)]
467pub enum SalvUsed {
468    #[doc = "0: Salvage not used during last operation"]
469    SalvUsed0 = 0,
470    #[doc = "1: Salvage used during the last erase operation"]
471    SalvUsed1 = 1,
472}
473impl From<SalvUsed> for bool {
474    #[inline(always)]
475    fn from(variant: SalvUsed) -> Self {
476        variant as u8 != 0
477    }
478}
479#[doc = "Field `SALV_USED` reader - Salvage Used for Erase operation"]
480pub type SalvUsedR = crate::BitReader<SalvUsed>;
481impl SalvUsedR {
482    #[doc = "Get enumerated values variant"]
483    #[inline(always)]
484    pub const fn variant(&self) -> SalvUsed {
485        match self.bits {
486            false => SalvUsed::SalvUsed0,
487            true => SalvUsed::SalvUsed1,
488        }
489    }
490    #[doc = "Salvage not used during last operation"]
491    #[inline(always)]
492    pub fn is_salv_used0(&self) -> bool {
493        *self == SalvUsed::SalvUsed0
494    }
495    #[doc = "Salvage used during the last erase operation"]
496    #[inline(always)]
497    pub fn is_salv_used1(&self) -> bool {
498        *self == SalvUsed::SalvUsed1
499    }
500}
501#[doc = "Program-Erase Write Enable Control\n\nValue on reset: 0"]
502#[cfg_attr(feature = "defmt", derive(defmt::Format))]
503#[derive(Clone, Copy, Debug, PartialEq, Eq)]
504#[repr(u8)]
505pub enum Pewen {
506    #[doc = "0: Writes are not enabled"]
507    Pewen00 = 0,
508    #[doc = "1: Writes are enabled for one flash or IFR phrase (phrase programming, sector erase)"]
509    Pewen01 = 1,
510    #[doc = "2: Writes are enabled for one flash or IFR page (page programming)"]
511    Pewen10 = 2,
512}
513impl From<Pewen> for u8 {
514    #[inline(always)]
515    fn from(variant: Pewen) -> Self {
516        variant as _
517    }
518}
519impl crate::FieldSpec for Pewen {
520    type Ux = u8;
521}
522impl crate::IsEnum for Pewen {}
523#[doc = "Field `PEWEN` reader - Program-Erase Write Enable Control"]
524pub type PewenR = crate::FieldReader<Pewen>;
525impl PewenR {
526    #[doc = "Get enumerated values variant"]
527    #[inline(always)]
528    pub const fn variant(&self) -> Option<Pewen> {
529        match self.bits {
530            0 => Some(Pewen::Pewen00),
531            1 => Some(Pewen::Pewen01),
532            2 => Some(Pewen::Pewen10),
533            _ => None,
534        }
535    }
536    #[doc = "Writes are not enabled"]
537    #[inline(always)]
538    pub fn is_pewen00(&self) -> bool {
539        *self == Pewen::Pewen00
540    }
541    #[doc = "Writes are enabled for one flash or IFR phrase (phrase programming, sector erase)"]
542    #[inline(always)]
543    pub fn is_pewen01(&self) -> bool {
544        *self == Pewen::Pewen01
545    }
546    #[doc = "Writes are enabled for one flash or IFR page (page programming)"]
547    #[inline(always)]
548    pub fn is_pewen10(&self) -> bool {
549        *self == Pewen::Pewen10
550    }
551}
552#[doc = "Program-Erase Ready Control/Status Flag\n\nValue on reset: 0"]
553#[cfg_attr(feature = "defmt", derive(defmt::Format))]
554#[derive(Clone, Copy, Debug, PartialEq, Eq)]
555pub enum Perdy {
556    #[doc = "0: Program or sector erase command operation not stalled"]
557    Perdy0 = 0,
558    #[doc = "1: Program or sector erase command operation ready to execute"]
559    Perdy1 = 1,
560}
561impl From<Perdy> for bool {
562    #[inline(always)]
563    fn from(variant: Perdy) -> Self {
564        variant as u8 != 0
565    }
566}
567#[doc = "Field `PERDY` reader - Program-Erase Ready Control/Status Flag"]
568pub type PerdyR = crate::BitReader<Perdy>;
569impl PerdyR {
570    #[doc = "Get enumerated values variant"]
571    #[inline(always)]
572    pub const fn variant(&self) -> Perdy {
573        match self.bits {
574            false => Perdy::Perdy0,
575            true => Perdy::Perdy1,
576        }
577    }
578    #[doc = "Program or sector erase command operation not stalled"]
579    #[inline(always)]
580    pub fn is_perdy0(&self) -> bool {
581        *self == Perdy::Perdy0
582    }
583    #[doc = "Program or sector erase command operation ready to execute"]
584    #[inline(always)]
585    pub fn is_perdy1(&self) -> bool {
586        *self == Perdy::Perdy1
587    }
588}
589#[doc = "Field `PERDY` writer - Program-Erase Ready Control/Status Flag"]
590pub type PerdyW<'a, REG> = crate::BitWriter1C<'a, REG, Perdy>;
591impl<'a, REG> PerdyW<'a, REG>
592where
593    REG: crate::Writable + crate::RegisterSpec,
594{
595    #[doc = "Program or sector erase command operation not stalled"]
596    #[inline(always)]
597    pub fn perdy0(self) -> &'a mut crate::W<REG> {
598        self.variant(Perdy::Perdy0)
599    }
600    #[doc = "Program or sector erase command operation ready to execute"]
601    #[inline(always)]
602    pub fn perdy1(self) -> &'a mut crate::W<REG> {
603        self.variant(Perdy::Perdy1)
604    }
605}
606impl R {
607    #[doc = "Bit 0 - Command Fail Flag"]
608    #[inline(always)]
609    pub fn fail(&self) -> FailR {
610        FailR::new((self.bits & 1) != 0)
611    }
612    #[doc = "Bit 2 - Command Abort Flag"]
613    #[inline(always)]
614    pub fn cmdabt(&self) -> CmdabtR {
615        CmdabtR::new(((self.bits >> 2) & 1) != 0)
616    }
617    #[doc = "Bit 4 - Command Protection Violation Flag"]
618    #[inline(always)]
619    pub fn pviol(&self) -> PviolR {
620        PviolR::new(((self.bits >> 4) & 1) != 0)
621    }
622    #[doc = "Bit 5 - Command Access Error Flag"]
623    #[inline(always)]
624    pub fn accerr(&self) -> AccerrR {
625        AccerrR::new(((self.bits >> 5) & 1) != 0)
626    }
627    #[doc = "Bit 6 - Command Write Sequence Abort Flag"]
628    #[inline(always)]
629    pub fn cwsabt(&self) -> CwsabtR {
630        CwsabtR::new(((self.bits >> 6) & 1) != 0)
631    }
632    #[doc = "Bit 7 - Command Complete Interrupt Flag"]
633    #[inline(always)]
634    pub fn ccif(&self) -> CcifR {
635        CcifR::new(((self.bits >> 7) & 1) != 0)
636    }
637    #[doc = "Bits 8:9 - Command protection level"]
638    #[inline(always)]
639    pub fn cmdprt(&self) -> CmdprtR {
640        CmdprtR::new(((self.bits >> 8) & 3) as u8)
641    }
642    #[doc = "Bit 11 - Command protection status flag"]
643    #[inline(always)]
644    pub fn cmdp(&self) -> CmdpR {
645        CmdpR::new(((self.bits >> 11) & 1) != 0)
646    }
647    #[doc = "Bits 12:15 - Command domain ID"]
648    #[inline(always)]
649    pub fn cmddid(&self) -> CmddidR {
650        CmddidR::new(((self.bits >> 12) & 0x0f) as u8)
651    }
652    #[doc = "Bit 16 - Double Bit Fault Detect Interrupt Flag"]
653    #[inline(always)]
654    pub fn dfdif(&self) -> DfdifR {
655        DfdifR::new(((self.bits >> 16) & 1) != 0)
656    }
657    #[doc = "Bit 17 - Salvage Used for Erase operation"]
658    #[inline(always)]
659    pub fn salv_used(&self) -> SalvUsedR {
660        SalvUsedR::new(((self.bits >> 17) & 1) != 0)
661    }
662    #[doc = "Bits 24:25 - Program-Erase Write Enable Control"]
663    #[inline(always)]
664    pub fn pewen(&self) -> PewenR {
665        PewenR::new(((self.bits >> 24) & 3) as u8)
666    }
667    #[doc = "Bit 31 - Program-Erase Ready Control/Status Flag"]
668    #[inline(always)]
669    pub fn perdy(&self) -> PerdyR {
670        PerdyR::new(((self.bits >> 31) & 1) != 0)
671    }
672}
673#[cfg(feature = "debug")]
674impl core::fmt::Debug for R {
675    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
676        f.debug_struct("FSTAT")
677            .field("fail", &self.fail())
678            .field("cmdabt", &self.cmdabt())
679            .field("pviol", &self.pviol())
680            .field("accerr", &self.accerr())
681            .field("cwsabt", &self.cwsabt())
682            .field("ccif", &self.ccif())
683            .field("cmdprt", &self.cmdprt())
684            .field("cmdp", &self.cmdp())
685            .field("cmddid", &self.cmddid())
686            .field("dfdif", &self.dfdif())
687            .field("salv_used", &self.salv_used())
688            .field("pewen", &self.pewen())
689            .field("perdy", &self.perdy())
690            .finish()
691    }
692}
693impl W {
694    #[doc = "Bit 2 - Command Abort Flag"]
695    #[inline(always)]
696    pub fn cmdabt(&mut self) -> CmdabtW<'_, FstatSpec> {
697        CmdabtW::new(self, 2)
698    }
699    #[doc = "Bit 4 - Command Protection Violation Flag"]
700    #[inline(always)]
701    pub fn pviol(&mut self) -> PviolW<'_, FstatSpec> {
702        PviolW::new(self, 4)
703    }
704    #[doc = "Bit 5 - Command Access Error Flag"]
705    #[inline(always)]
706    pub fn accerr(&mut self) -> AccerrW<'_, FstatSpec> {
707        AccerrW::new(self, 5)
708    }
709    #[doc = "Bit 6 - Command Write Sequence Abort Flag"]
710    #[inline(always)]
711    pub fn cwsabt(&mut self) -> CwsabtW<'_, FstatSpec> {
712        CwsabtW::new(self, 6)
713    }
714    #[doc = "Bit 7 - Command Complete Interrupt Flag"]
715    #[inline(always)]
716    pub fn ccif(&mut self) -> CcifW<'_, FstatSpec> {
717        CcifW::new(self, 7)
718    }
719    #[doc = "Bit 16 - Double Bit Fault Detect Interrupt Flag"]
720    #[inline(always)]
721    pub fn dfdif(&mut self) -> DfdifW<'_, FstatSpec> {
722        DfdifW::new(self, 16)
723    }
724    #[doc = "Bit 31 - Program-Erase Ready Control/Status Flag"]
725    #[inline(always)]
726    pub fn perdy(&mut self) -> PerdyW<'_, FstatSpec> {
727        PerdyW::new(self, 31)
728    }
729}
730#[doc = "Flash Status Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fstat::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fstat::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
731pub struct FstatSpec;
732impl crate::RegisterSpec for FstatSpec {
733    type Ux = u32;
734}
735#[doc = "`read()` method returns [`fstat::R`](R) reader structure"]
736impl crate::Readable for FstatSpec {}
737#[doc = "`write(|w| ..)` method takes [`fstat::W`](W) writer structure"]
738impl crate::Writable for FstatSpec {
739    type Safety = crate::Unsafe;
740    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x8001_00f4;
741}
742#[doc = "`reset()` method sets FSTAT to value 0x80"]
743impl crate::Resettable for FstatSpec {
744    const RESET_VALUE: u32 = 0x80;
745}