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