stm32l4x2_pac/flash/
cr.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7    bits: u32,
8}
9impl super::CR {
10    #[doc = r" Modifies the contents of the register"]
11    #[inline]
12    pub fn modify<F>(&self, f: F)
13    where
14        for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15    {
16        let bits = self.register.get();
17        let r = R { bits: bits };
18        let mut w = W { bits: bits };
19        f(&r, &mut w);
20        self.register.set(w.bits);
21    }
22    #[doc = r" Reads the contents of the register"]
23    #[inline]
24    pub fn read(&self) -> R {
25        R {
26            bits: self.register.get(),
27        }
28    }
29    #[doc = r" Writes to the register"]
30    #[inline]
31    pub fn write<F>(&self, f: F)
32    where
33        F: FnOnce(&mut W) -> &mut W,
34    {
35        let mut w = W::reset_value();
36        f(&mut w);
37        self.register.set(w.bits);
38    }
39    #[doc = r" Writes the reset value to the register"]
40    #[inline]
41    pub fn reset(&self) {
42        self.write(|w| w)
43    }
44}
45#[doc = r" Value of the field"]
46pub struct PGR {
47    bits: bool,
48}
49impl PGR {
50    #[doc = r" Value of the field as raw bits"]
51    #[inline]
52    pub fn bit(&self) -> bool {
53        self.bits
54    }
55    #[doc = r" Returns `true` if the bit is clear (0)"]
56    #[inline]
57    pub fn bit_is_clear(&self) -> bool {
58        !self.bit()
59    }
60    #[doc = r" Returns `true` if the bit is set (1)"]
61    #[inline]
62    pub fn bit_is_set(&self) -> bool {
63        self.bit()
64    }
65}
66#[doc = r" Value of the field"]
67pub struct PERR {
68    bits: bool,
69}
70impl PERR {
71    #[doc = r" Value of the field as raw bits"]
72    #[inline]
73    pub fn bit(&self) -> bool {
74        self.bits
75    }
76    #[doc = r" Returns `true` if the bit is clear (0)"]
77    #[inline]
78    pub fn bit_is_clear(&self) -> bool {
79        !self.bit()
80    }
81    #[doc = r" Returns `true` if the bit is set (1)"]
82    #[inline]
83    pub fn bit_is_set(&self) -> bool {
84        self.bit()
85    }
86}
87#[doc = r" Value of the field"]
88pub struct MER1R {
89    bits: bool,
90}
91impl MER1R {
92    #[doc = r" Value of the field as raw bits"]
93    #[inline]
94    pub fn bit(&self) -> bool {
95        self.bits
96    }
97    #[doc = r" Returns `true` if the bit is clear (0)"]
98    #[inline]
99    pub fn bit_is_clear(&self) -> bool {
100        !self.bit()
101    }
102    #[doc = r" Returns `true` if the bit is set (1)"]
103    #[inline]
104    pub fn bit_is_set(&self) -> bool {
105        self.bit()
106    }
107}
108#[doc = r" Value of the field"]
109pub struct PNBR {
110    bits: u8,
111}
112impl PNBR {
113    #[doc = r" Value of the field as raw bits"]
114    #[inline]
115    pub fn bits(&self) -> u8 {
116        self.bits
117    }
118}
119#[doc = r" Value of the field"]
120pub struct BKERR {
121    bits: bool,
122}
123impl BKERR {
124    #[doc = r" Value of the field as raw bits"]
125    #[inline]
126    pub fn bit(&self) -> bool {
127        self.bits
128    }
129    #[doc = r" Returns `true` if the bit is clear (0)"]
130    #[inline]
131    pub fn bit_is_clear(&self) -> bool {
132        !self.bit()
133    }
134    #[doc = r" Returns `true` if the bit is set (1)"]
135    #[inline]
136    pub fn bit_is_set(&self) -> bool {
137        self.bit()
138    }
139}
140#[doc = r" Value of the field"]
141pub struct MER2R {
142    bits: bool,
143}
144impl MER2R {
145    #[doc = r" Value of the field as raw bits"]
146    #[inline]
147    pub fn bit(&self) -> bool {
148        self.bits
149    }
150    #[doc = r" Returns `true` if the bit is clear (0)"]
151    #[inline]
152    pub fn bit_is_clear(&self) -> bool {
153        !self.bit()
154    }
155    #[doc = r" Returns `true` if the bit is set (1)"]
156    #[inline]
157    pub fn bit_is_set(&self) -> bool {
158        self.bit()
159    }
160}
161#[doc = r" Value of the field"]
162pub struct STARTR {
163    bits: bool,
164}
165impl STARTR {
166    #[doc = r" Value of the field as raw bits"]
167    #[inline]
168    pub fn bit(&self) -> bool {
169        self.bits
170    }
171    #[doc = r" Returns `true` if the bit is clear (0)"]
172    #[inline]
173    pub fn bit_is_clear(&self) -> bool {
174        !self.bit()
175    }
176    #[doc = r" Returns `true` if the bit is set (1)"]
177    #[inline]
178    pub fn bit_is_set(&self) -> bool {
179        self.bit()
180    }
181}
182#[doc = r" Value of the field"]
183pub struct OPTSTRTR {
184    bits: bool,
185}
186impl OPTSTRTR {
187    #[doc = r" Value of the field as raw bits"]
188    #[inline]
189    pub fn bit(&self) -> bool {
190        self.bits
191    }
192    #[doc = r" Returns `true` if the bit is clear (0)"]
193    #[inline]
194    pub fn bit_is_clear(&self) -> bool {
195        !self.bit()
196    }
197    #[doc = r" Returns `true` if the bit is set (1)"]
198    #[inline]
199    pub fn bit_is_set(&self) -> bool {
200        self.bit()
201    }
202}
203#[doc = r" Value of the field"]
204pub struct FSTPGR {
205    bits: bool,
206}
207impl FSTPGR {
208    #[doc = r" Value of the field as raw bits"]
209    #[inline]
210    pub fn bit(&self) -> bool {
211        self.bits
212    }
213    #[doc = r" Returns `true` if the bit is clear (0)"]
214    #[inline]
215    pub fn bit_is_clear(&self) -> bool {
216        !self.bit()
217    }
218    #[doc = r" Returns `true` if the bit is set (1)"]
219    #[inline]
220    pub fn bit_is_set(&self) -> bool {
221        self.bit()
222    }
223}
224#[doc = r" Value of the field"]
225pub struct EOPIER {
226    bits: bool,
227}
228impl EOPIER {
229    #[doc = r" Value of the field as raw bits"]
230    #[inline]
231    pub fn bit(&self) -> bool {
232        self.bits
233    }
234    #[doc = r" Returns `true` if the bit is clear (0)"]
235    #[inline]
236    pub fn bit_is_clear(&self) -> bool {
237        !self.bit()
238    }
239    #[doc = r" Returns `true` if the bit is set (1)"]
240    #[inline]
241    pub fn bit_is_set(&self) -> bool {
242        self.bit()
243    }
244}
245#[doc = r" Value of the field"]
246pub struct ERRIER {
247    bits: bool,
248}
249impl ERRIER {
250    #[doc = r" Value of the field as raw bits"]
251    #[inline]
252    pub fn bit(&self) -> bool {
253        self.bits
254    }
255    #[doc = r" Returns `true` if the bit is clear (0)"]
256    #[inline]
257    pub fn bit_is_clear(&self) -> bool {
258        !self.bit()
259    }
260    #[doc = r" Returns `true` if the bit is set (1)"]
261    #[inline]
262    pub fn bit_is_set(&self) -> bool {
263        self.bit()
264    }
265}
266#[doc = r" Value of the field"]
267pub struct RDERRIER {
268    bits: bool,
269}
270impl RDERRIER {
271    #[doc = r" Value of the field as raw bits"]
272    #[inline]
273    pub fn bit(&self) -> bool {
274        self.bits
275    }
276    #[doc = r" Returns `true` if the bit is clear (0)"]
277    #[inline]
278    pub fn bit_is_clear(&self) -> bool {
279        !self.bit()
280    }
281    #[doc = r" Returns `true` if the bit is set (1)"]
282    #[inline]
283    pub fn bit_is_set(&self) -> bool {
284        self.bit()
285    }
286}
287#[doc = r" Value of the field"]
288pub struct OBL_LAUNCHR {
289    bits: bool,
290}
291impl OBL_LAUNCHR {
292    #[doc = r" Value of the field as raw bits"]
293    #[inline]
294    pub fn bit(&self) -> bool {
295        self.bits
296    }
297    #[doc = r" Returns `true` if the bit is clear (0)"]
298    #[inline]
299    pub fn bit_is_clear(&self) -> bool {
300        !self.bit()
301    }
302    #[doc = r" Returns `true` if the bit is set (1)"]
303    #[inline]
304    pub fn bit_is_set(&self) -> bool {
305        self.bit()
306    }
307}
308#[doc = r" Value of the field"]
309pub struct OPTLOCKR {
310    bits: bool,
311}
312impl OPTLOCKR {
313    #[doc = r" Value of the field as raw bits"]
314    #[inline]
315    pub fn bit(&self) -> bool {
316        self.bits
317    }
318    #[doc = r" Returns `true` if the bit is clear (0)"]
319    #[inline]
320    pub fn bit_is_clear(&self) -> bool {
321        !self.bit()
322    }
323    #[doc = r" Returns `true` if the bit is set (1)"]
324    #[inline]
325    pub fn bit_is_set(&self) -> bool {
326        self.bit()
327    }
328}
329#[doc = r" Value of the field"]
330pub struct LOCKR {
331    bits: bool,
332}
333impl LOCKR {
334    #[doc = r" Value of the field as raw bits"]
335    #[inline]
336    pub fn bit(&self) -> bool {
337        self.bits
338    }
339    #[doc = r" Returns `true` if the bit is clear (0)"]
340    #[inline]
341    pub fn bit_is_clear(&self) -> bool {
342        !self.bit()
343    }
344    #[doc = r" Returns `true` if the bit is set (1)"]
345    #[inline]
346    pub fn bit_is_set(&self) -> bool {
347        self.bit()
348    }
349}
350#[doc = r" Proxy"]
351pub struct _PGW<'a> {
352    w: &'a mut W,
353}
354impl<'a> _PGW<'a> {
355    #[doc = r" Sets the field bit"]
356    pub fn set_bit(self) -> &'a mut W {
357        self.bit(true)
358    }
359    #[doc = r" Clears the field bit"]
360    pub fn clear_bit(self) -> &'a mut W {
361        self.bit(false)
362    }
363    #[doc = r" Writes raw bits to the field"]
364    #[inline]
365    pub fn bit(self, value: bool) -> &'a mut W {
366        const MASK: bool = true;
367        const OFFSET: u8 = 0;
368        self.w.bits &= !((MASK as u32) << OFFSET);
369        self.w.bits |= ((value & MASK) as u32) << OFFSET;
370        self.w
371    }
372}
373#[doc = r" Proxy"]
374pub struct _PERW<'a> {
375    w: &'a mut W,
376}
377impl<'a> _PERW<'a> {
378    #[doc = r" Sets the field bit"]
379    pub fn set_bit(self) -> &'a mut W {
380        self.bit(true)
381    }
382    #[doc = r" Clears the field bit"]
383    pub fn clear_bit(self) -> &'a mut W {
384        self.bit(false)
385    }
386    #[doc = r" Writes raw bits to the field"]
387    #[inline]
388    pub fn bit(self, value: bool) -> &'a mut W {
389        const MASK: bool = true;
390        const OFFSET: u8 = 1;
391        self.w.bits &= !((MASK as u32) << OFFSET);
392        self.w.bits |= ((value & MASK) as u32) << OFFSET;
393        self.w
394    }
395}
396#[doc = r" Proxy"]
397pub struct _MER1W<'a> {
398    w: &'a mut W,
399}
400impl<'a> _MER1W<'a> {
401    #[doc = r" Sets the field bit"]
402    pub fn set_bit(self) -> &'a mut W {
403        self.bit(true)
404    }
405    #[doc = r" Clears the field bit"]
406    pub fn clear_bit(self) -> &'a mut W {
407        self.bit(false)
408    }
409    #[doc = r" Writes raw bits to the field"]
410    #[inline]
411    pub fn bit(self, value: bool) -> &'a mut W {
412        const MASK: bool = true;
413        const OFFSET: u8 = 2;
414        self.w.bits &= !((MASK as u32) << OFFSET);
415        self.w.bits |= ((value & MASK) as u32) << OFFSET;
416        self.w
417    }
418}
419#[doc = r" Proxy"]
420pub struct _PNBW<'a> {
421    w: &'a mut W,
422}
423impl<'a> _PNBW<'a> {
424    #[doc = r" Writes raw bits to the field"]
425    #[inline]
426    pub unsafe fn bits(self, value: u8) -> &'a mut W {
427        const MASK: u8 = 255;
428        const OFFSET: u8 = 3;
429        self.w.bits &= !((MASK as u32) << OFFSET);
430        self.w.bits |= ((value & MASK) as u32) << OFFSET;
431        self.w
432    }
433}
434#[doc = r" Proxy"]
435pub struct _BKERW<'a> {
436    w: &'a mut W,
437}
438impl<'a> _BKERW<'a> {
439    #[doc = r" Sets the field bit"]
440    pub fn set_bit(self) -> &'a mut W {
441        self.bit(true)
442    }
443    #[doc = r" Clears the field bit"]
444    pub fn clear_bit(self) -> &'a mut W {
445        self.bit(false)
446    }
447    #[doc = r" Writes raw bits to the field"]
448    #[inline]
449    pub fn bit(self, value: bool) -> &'a mut W {
450        const MASK: bool = true;
451        const OFFSET: u8 = 11;
452        self.w.bits &= !((MASK as u32) << OFFSET);
453        self.w.bits |= ((value & MASK) as u32) << OFFSET;
454        self.w
455    }
456}
457#[doc = r" Proxy"]
458pub struct _MER2W<'a> {
459    w: &'a mut W,
460}
461impl<'a> _MER2W<'a> {
462    #[doc = r" Sets the field bit"]
463    pub fn set_bit(self) -> &'a mut W {
464        self.bit(true)
465    }
466    #[doc = r" Clears the field bit"]
467    pub fn clear_bit(self) -> &'a mut W {
468        self.bit(false)
469    }
470    #[doc = r" Writes raw bits to the field"]
471    #[inline]
472    pub fn bit(self, value: bool) -> &'a mut W {
473        const MASK: bool = true;
474        const OFFSET: u8 = 15;
475        self.w.bits &= !((MASK as u32) << OFFSET);
476        self.w.bits |= ((value & MASK) as u32) << OFFSET;
477        self.w
478    }
479}
480#[doc = r" Proxy"]
481pub struct _STARTW<'a> {
482    w: &'a mut W,
483}
484impl<'a> _STARTW<'a> {
485    #[doc = r" Sets the field bit"]
486    pub fn set_bit(self) -> &'a mut W {
487        self.bit(true)
488    }
489    #[doc = r" Clears the field bit"]
490    pub fn clear_bit(self) -> &'a mut W {
491        self.bit(false)
492    }
493    #[doc = r" Writes raw bits to the field"]
494    #[inline]
495    pub fn bit(self, value: bool) -> &'a mut W {
496        const MASK: bool = true;
497        const OFFSET: u8 = 16;
498        self.w.bits &= !((MASK as u32) << OFFSET);
499        self.w.bits |= ((value & MASK) as u32) << OFFSET;
500        self.w
501    }
502}
503#[doc = r" Proxy"]
504pub struct _OPTSTRTW<'a> {
505    w: &'a mut W,
506}
507impl<'a> _OPTSTRTW<'a> {
508    #[doc = r" Sets the field bit"]
509    pub fn set_bit(self) -> &'a mut W {
510        self.bit(true)
511    }
512    #[doc = r" Clears the field bit"]
513    pub fn clear_bit(self) -> &'a mut W {
514        self.bit(false)
515    }
516    #[doc = r" Writes raw bits to the field"]
517    #[inline]
518    pub fn bit(self, value: bool) -> &'a mut W {
519        const MASK: bool = true;
520        const OFFSET: u8 = 17;
521        self.w.bits &= !((MASK as u32) << OFFSET);
522        self.w.bits |= ((value & MASK) as u32) << OFFSET;
523        self.w
524    }
525}
526#[doc = r" Proxy"]
527pub struct _FSTPGW<'a> {
528    w: &'a mut W,
529}
530impl<'a> _FSTPGW<'a> {
531    #[doc = r" Sets the field bit"]
532    pub fn set_bit(self) -> &'a mut W {
533        self.bit(true)
534    }
535    #[doc = r" Clears the field bit"]
536    pub fn clear_bit(self) -> &'a mut W {
537        self.bit(false)
538    }
539    #[doc = r" Writes raw bits to the field"]
540    #[inline]
541    pub fn bit(self, value: bool) -> &'a mut W {
542        const MASK: bool = true;
543        const OFFSET: u8 = 18;
544        self.w.bits &= !((MASK as u32) << OFFSET);
545        self.w.bits |= ((value & MASK) as u32) << OFFSET;
546        self.w
547    }
548}
549#[doc = r" Proxy"]
550pub struct _EOPIEW<'a> {
551    w: &'a mut W,
552}
553impl<'a> _EOPIEW<'a> {
554    #[doc = r" Sets the field bit"]
555    pub fn set_bit(self) -> &'a mut W {
556        self.bit(true)
557    }
558    #[doc = r" Clears the field bit"]
559    pub fn clear_bit(self) -> &'a mut W {
560        self.bit(false)
561    }
562    #[doc = r" Writes raw bits to the field"]
563    #[inline]
564    pub fn bit(self, value: bool) -> &'a mut W {
565        const MASK: bool = true;
566        const OFFSET: u8 = 24;
567        self.w.bits &= !((MASK as u32) << OFFSET);
568        self.w.bits |= ((value & MASK) as u32) << OFFSET;
569        self.w
570    }
571}
572#[doc = r" Proxy"]
573pub struct _ERRIEW<'a> {
574    w: &'a mut W,
575}
576impl<'a> _ERRIEW<'a> {
577    #[doc = r" Sets the field bit"]
578    pub fn set_bit(self) -> &'a mut W {
579        self.bit(true)
580    }
581    #[doc = r" Clears the field bit"]
582    pub fn clear_bit(self) -> &'a mut W {
583        self.bit(false)
584    }
585    #[doc = r" Writes raw bits to the field"]
586    #[inline]
587    pub fn bit(self, value: bool) -> &'a mut W {
588        const MASK: bool = true;
589        const OFFSET: u8 = 25;
590        self.w.bits &= !((MASK as u32) << OFFSET);
591        self.w.bits |= ((value & MASK) as u32) << OFFSET;
592        self.w
593    }
594}
595#[doc = r" Proxy"]
596pub struct _RDERRIEW<'a> {
597    w: &'a mut W,
598}
599impl<'a> _RDERRIEW<'a> {
600    #[doc = r" Sets the field bit"]
601    pub fn set_bit(self) -> &'a mut W {
602        self.bit(true)
603    }
604    #[doc = r" Clears the field bit"]
605    pub fn clear_bit(self) -> &'a mut W {
606        self.bit(false)
607    }
608    #[doc = r" Writes raw bits to the field"]
609    #[inline]
610    pub fn bit(self, value: bool) -> &'a mut W {
611        const MASK: bool = true;
612        const OFFSET: u8 = 26;
613        self.w.bits &= !((MASK as u32) << OFFSET);
614        self.w.bits |= ((value & MASK) as u32) << OFFSET;
615        self.w
616    }
617}
618#[doc = r" Proxy"]
619pub struct _OBL_LAUNCHW<'a> {
620    w: &'a mut W,
621}
622impl<'a> _OBL_LAUNCHW<'a> {
623    #[doc = r" Sets the field bit"]
624    pub fn set_bit(self) -> &'a mut W {
625        self.bit(true)
626    }
627    #[doc = r" Clears the field bit"]
628    pub fn clear_bit(self) -> &'a mut W {
629        self.bit(false)
630    }
631    #[doc = r" Writes raw bits to the field"]
632    #[inline]
633    pub fn bit(self, value: bool) -> &'a mut W {
634        const MASK: bool = true;
635        const OFFSET: u8 = 27;
636        self.w.bits &= !((MASK as u32) << OFFSET);
637        self.w.bits |= ((value & MASK) as u32) << OFFSET;
638        self.w
639    }
640}
641#[doc = r" Proxy"]
642pub struct _OPTLOCKW<'a> {
643    w: &'a mut W,
644}
645impl<'a> _OPTLOCKW<'a> {
646    #[doc = r" Sets the field bit"]
647    pub fn set_bit(self) -> &'a mut W {
648        self.bit(true)
649    }
650    #[doc = r" Clears the field bit"]
651    pub fn clear_bit(self) -> &'a mut W {
652        self.bit(false)
653    }
654    #[doc = r" Writes raw bits to the field"]
655    #[inline]
656    pub fn bit(self, value: bool) -> &'a mut W {
657        const MASK: bool = true;
658        const OFFSET: u8 = 30;
659        self.w.bits &= !((MASK as u32) << OFFSET);
660        self.w.bits |= ((value & MASK) as u32) << OFFSET;
661        self.w
662    }
663}
664#[doc = r" Proxy"]
665pub struct _LOCKW<'a> {
666    w: &'a mut W,
667}
668impl<'a> _LOCKW<'a> {
669    #[doc = r" Sets the field bit"]
670    pub fn set_bit(self) -> &'a mut W {
671        self.bit(true)
672    }
673    #[doc = r" Clears the field bit"]
674    pub fn clear_bit(self) -> &'a mut W {
675        self.bit(false)
676    }
677    #[doc = r" Writes raw bits to the field"]
678    #[inline]
679    pub fn bit(self, value: bool) -> &'a mut W {
680        const MASK: bool = true;
681        const OFFSET: u8 = 31;
682        self.w.bits &= !((MASK as u32) << OFFSET);
683        self.w.bits |= ((value & MASK) as u32) << OFFSET;
684        self.w
685    }
686}
687impl R {
688    #[doc = r" Value of the register as raw bits"]
689    #[inline]
690    pub fn bits(&self) -> u32 {
691        self.bits
692    }
693    #[doc = "Bit 0 - Programming"]
694    #[inline]
695    pub fn pg(&self) -> PGR {
696        let bits = {
697            const MASK: bool = true;
698            const OFFSET: u8 = 0;
699            ((self.bits >> OFFSET) & MASK as u32) != 0
700        };
701        PGR { bits }
702    }
703    #[doc = "Bit 1 - Page erase"]
704    #[inline]
705    pub fn per(&self) -> PERR {
706        let bits = {
707            const MASK: bool = true;
708            const OFFSET: u8 = 1;
709            ((self.bits >> OFFSET) & MASK as u32) != 0
710        };
711        PERR { bits }
712    }
713    #[doc = "Bit 2 - Bank 1 Mass erase"]
714    #[inline]
715    pub fn mer1(&self) -> MER1R {
716        let bits = {
717            const MASK: bool = true;
718            const OFFSET: u8 = 2;
719            ((self.bits >> OFFSET) & MASK as u32) != 0
720        };
721        MER1R { bits }
722    }
723    #[doc = "Bits 3:10 - Page number"]
724    #[inline]
725    pub fn pnb(&self) -> PNBR {
726        let bits = {
727            const MASK: u8 = 255;
728            const OFFSET: u8 = 3;
729            ((self.bits >> OFFSET) & MASK as u32) as u8
730        };
731        PNBR { bits }
732    }
733    #[doc = "Bit 11 - Bank erase"]
734    #[inline]
735    pub fn bker(&self) -> BKERR {
736        let bits = {
737            const MASK: bool = true;
738            const OFFSET: u8 = 11;
739            ((self.bits >> OFFSET) & MASK as u32) != 0
740        };
741        BKERR { bits }
742    }
743    #[doc = "Bit 15 - Bank 2 Mass erase"]
744    #[inline]
745    pub fn mer2(&self) -> MER2R {
746        let bits = {
747            const MASK: bool = true;
748            const OFFSET: u8 = 15;
749            ((self.bits >> OFFSET) & MASK as u32) != 0
750        };
751        MER2R { bits }
752    }
753    #[doc = "Bit 16 - Start"]
754    #[inline]
755    pub fn start(&self) -> STARTR {
756        let bits = {
757            const MASK: bool = true;
758            const OFFSET: u8 = 16;
759            ((self.bits >> OFFSET) & MASK as u32) != 0
760        };
761        STARTR { bits }
762    }
763    #[doc = "Bit 17 - Options modification start"]
764    #[inline]
765    pub fn optstrt(&self) -> OPTSTRTR {
766        let bits = {
767            const MASK: bool = true;
768            const OFFSET: u8 = 17;
769            ((self.bits >> OFFSET) & MASK as u32) != 0
770        };
771        OPTSTRTR { bits }
772    }
773    #[doc = "Bit 18 - Fast programming"]
774    #[inline]
775    pub fn fstpg(&self) -> FSTPGR {
776        let bits = {
777            const MASK: bool = true;
778            const OFFSET: u8 = 18;
779            ((self.bits >> OFFSET) & MASK as u32) != 0
780        };
781        FSTPGR { bits }
782    }
783    #[doc = "Bit 24 - End of operation interrupt enable"]
784    #[inline]
785    pub fn eopie(&self) -> EOPIER {
786        let bits = {
787            const MASK: bool = true;
788            const OFFSET: u8 = 24;
789            ((self.bits >> OFFSET) & MASK as u32) != 0
790        };
791        EOPIER { bits }
792    }
793    #[doc = "Bit 25 - Error interrupt enable"]
794    #[inline]
795    pub fn errie(&self) -> ERRIER {
796        let bits = {
797            const MASK: bool = true;
798            const OFFSET: u8 = 25;
799            ((self.bits >> OFFSET) & MASK as u32) != 0
800        };
801        ERRIER { bits }
802    }
803    #[doc = "Bit 26 - PCROP read error interrupt enable"]
804    #[inline]
805    pub fn rderrie(&self) -> RDERRIER {
806        let bits = {
807            const MASK: bool = true;
808            const OFFSET: u8 = 26;
809            ((self.bits >> OFFSET) & MASK as u32) != 0
810        };
811        RDERRIER { bits }
812    }
813    #[doc = "Bit 27 - Force the option byte loading"]
814    #[inline]
815    pub fn obl_launch(&self) -> OBL_LAUNCHR {
816        let bits = {
817            const MASK: bool = true;
818            const OFFSET: u8 = 27;
819            ((self.bits >> OFFSET) & MASK as u32) != 0
820        };
821        OBL_LAUNCHR { bits }
822    }
823    #[doc = "Bit 30 - Options Lock"]
824    #[inline]
825    pub fn optlock(&self) -> OPTLOCKR {
826        let bits = {
827            const MASK: bool = true;
828            const OFFSET: u8 = 30;
829            ((self.bits >> OFFSET) & MASK as u32) != 0
830        };
831        OPTLOCKR { bits }
832    }
833    #[doc = "Bit 31 - FLASH_CR Lock"]
834    #[inline]
835    pub fn lock(&self) -> LOCKR {
836        let bits = {
837            const MASK: bool = true;
838            const OFFSET: u8 = 31;
839            ((self.bits >> OFFSET) & MASK as u32) != 0
840        };
841        LOCKR { bits }
842    }
843}
844impl W {
845    #[doc = r" Reset value of the register"]
846    #[inline]
847    pub fn reset_value() -> W {
848        W { bits: 3221225472 }
849    }
850    #[doc = r" Writes raw bits to the register"]
851    #[inline]
852    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
853        self.bits = bits;
854        self
855    }
856    #[doc = "Bit 0 - Programming"]
857    #[inline]
858    pub fn pg(&mut self) -> _PGW {
859        _PGW { w: self }
860    }
861    #[doc = "Bit 1 - Page erase"]
862    #[inline]
863    pub fn per(&mut self) -> _PERW {
864        _PERW { w: self }
865    }
866    #[doc = "Bit 2 - Bank 1 Mass erase"]
867    #[inline]
868    pub fn mer1(&mut self) -> _MER1W {
869        _MER1W { w: self }
870    }
871    #[doc = "Bits 3:10 - Page number"]
872    #[inline]
873    pub fn pnb(&mut self) -> _PNBW {
874        _PNBW { w: self }
875    }
876    #[doc = "Bit 11 - Bank erase"]
877    #[inline]
878    pub fn bker(&mut self) -> _BKERW {
879        _BKERW { w: self }
880    }
881    #[doc = "Bit 15 - Bank 2 Mass erase"]
882    #[inline]
883    pub fn mer2(&mut self) -> _MER2W {
884        _MER2W { w: self }
885    }
886    #[doc = "Bit 16 - Start"]
887    #[inline]
888    pub fn start(&mut self) -> _STARTW {
889        _STARTW { w: self }
890    }
891    #[doc = "Bit 17 - Options modification start"]
892    #[inline]
893    pub fn optstrt(&mut self) -> _OPTSTRTW {
894        _OPTSTRTW { w: self }
895    }
896    #[doc = "Bit 18 - Fast programming"]
897    #[inline]
898    pub fn fstpg(&mut self) -> _FSTPGW {
899        _FSTPGW { w: self }
900    }
901    #[doc = "Bit 24 - End of operation interrupt enable"]
902    #[inline]
903    pub fn eopie(&mut self) -> _EOPIEW {
904        _EOPIEW { w: self }
905    }
906    #[doc = "Bit 25 - Error interrupt enable"]
907    #[inline]
908    pub fn errie(&mut self) -> _ERRIEW {
909        _ERRIEW { w: self }
910    }
911    #[doc = "Bit 26 - PCROP read error interrupt enable"]
912    #[inline]
913    pub fn rderrie(&mut self) -> _RDERRIEW {
914        _RDERRIEW { w: self }
915    }
916    #[doc = "Bit 27 - Force the option byte loading"]
917    #[inline]
918    pub fn obl_launch(&mut self) -> _OBL_LAUNCHW {
919        _OBL_LAUNCHW { w: self }
920    }
921    #[doc = "Bit 30 - Options Lock"]
922    #[inline]
923    pub fn optlock(&mut self) -> _OPTLOCKW {
924        _OPTLOCKW { w: self }
925    }
926    #[doc = "Bit 31 - FLASH_CR Lock"]
927    #[inline]
928    pub fn lock(&mut self) -> _LOCKW {
929        _LOCKW { w: self }
930    }
931}