1pub type R = crate::R<CRrs>;
3pub type W = crate::W<CRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum PG {
11 Program = 1,
13}
14impl From<PG> for bool {
15 #[inline(always)]
16 fn from(variant: PG) -> Self {
17 variant as u8 != 0
18 }
19}
20pub type PG_R = crate::BitReader<PG>;
22impl PG_R {
23 #[inline(always)]
25 pub const fn variant(&self) -> Option<PG> {
26 match self.bits {
27 true => Some(PG::Program),
28 _ => None,
29 }
30 }
31 #[inline(always)]
33 pub fn is_program(&self) -> bool {
34 *self == PG::Program
35 }
36}
37pub type PG_W<'a, REG> = crate::BitWriter<'a, REG, PG>;
39impl<'a, REG> PG_W<'a, REG>
40where
41 REG: crate::Writable + crate::RegisterSpec,
42{
43 #[inline(always)]
45 pub fn program(self) -> &'a mut crate::W<REG> {
46 self.variant(PG::Program)
47 }
48}
49#[cfg_attr(feature = "defmt", derive(defmt::Format))]
53#[derive(Clone, Copy, Debug, PartialEq, Eq)]
54pub enum PER {
55 PageErase = 1,
57}
58impl From<PER> for bool {
59 #[inline(always)]
60 fn from(variant: PER) -> Self {
61 variant as u8 != 0
62 }
63}
64pub type PER_R = crate::BitReader<PER>;
66impl PER_R {
67 #[inline(always)]
69 pub const fn variant(&self) -> Option<PER> {
70 match self.bits {
71 true => Some(PER::PageErase),
72 _ => None,
73 }
74 }
75 #[inline(always)]
77 pub fn is_page_erase(&self) -> bool {
78 *self == PER::PageErase
79 }
80}
81pub type PER_W<'a, REG> = crate::BitWriter<'a, REG, PER>;
83impl<'a, REG> PER_W<'a, REG>
84where
85 REG: crate::Writable + crate::RegisterSpec,
86{
87 #[inline(always)]
89 pub fn page_erase(self) -> &'a mut crate::W<REG> {
90 self.variant(PER::PageErase)
91 }
92}
93#[cfg_attr(feature = "defmt", derive(defmt::Format))]
97#[derive(Clone, Copy, Debug, PartialEq, Eq)]
98pub enum MER {
99 MassErase = 1,
101}
102impl From<MER> for bool {
103 #[inline(always)]
104 fn from(variant: MER) -> Self {
105 variant as u8 != 0
106 }
107}
108pub type MER_R = crate::BitReader<MER>;
110impl MER_R {
111 #[inline(always)]
113 pub const fn variant(&self) -> Option<MER> {
114 match self.bits {
115 true => Some(MER::MassErase),
116 _ => None,
117 }
118 }
119 #[inline(always)]
121 pub fn is_mass_erase(&self) -> bool {
122 *self == MER::MassErase
123 }
124}
125pub type MER_W<'a, REG> = crate::BitWriter<'a, REG, MER>;
127impl<'a, REG> MER_W<'a, REG>
128where
129 REG: crate::Writable + crate::RegisterSpec,
130{
131 #[inline(always)]
133 pub fn mass_erase(self) -> &'a mut crate::W<REG> {
134 self.variant(MER::MassErase)
135 }
136}
137#[cfg_attr(feature = "defmt", derive(defmt::Format))]
141#[derive(Clone, Copy, Debug, PartialEq, Eq)]
142pub enum OPTPG {
143 OptionByteProgramming = 1,
145}
146impl From<OPTPG> for bool {
147 #[inline(always)]
148 fn from(variant: OPTPG) -> Self {
149 variant as u8 != 0
150 }
151}
152pub type OPTPG_R = crate::BitReader<OPTPG>;
154impl OPTPG_R {
155 #[inline(always)]
157 pub const fn variant(&self) -> Option<OPTPG> {
158 match self.bits {
159 true => Some(OPTPG::OptionByteProgramming),
160 _ => None,
161 }
162 }
163 #[inline(always)]
165 pub fn is_option_byte_programming(&self) -> bool {
166 *self == OPTPG::OptionByteProgramming
167 }
168}
169pub type OPTPG_W<'a, REG> = crate::BitWriter<'a, REG, OPTPG>;
171impl<'a, REG> OPTPG_W<'a, REG>
172where
173 REG: crate::Writable + crate::RegisterSpec,
174{
175 #[inline(always)]
177 pub fn option_byte_programming(self) -> &'a mut crate::W<REG> {
178 self.variant(OPTPG::OptionByteProgramming)
179 }
180}
181#[cfg_attr(feature = "defmt", derive(defmt::Format))]
185#[derive(Clone, Copy, Debug, PartialEq, Eq)]
186pub enum OPTER {
187 OptionByteErase = 1,
189}
190impl From<OPTER> for bool {
191 #[inline(always)]
192 fn from(variant: OPTER) -> Self {
193 variant as u8 != 0
194 }
195}
196pub type OPTER_R = crate::BitReader<OPTER>;
198impl OPTER_R {
199 #[inline(always)]
201 pub const fn variant(&self) -> Option<OPTER> {
202 match self.bits {
203 true => Some(OPTER::OptionByteErase),
204 _ => None,
205 }
206 }
207 #[inline(always)]
209 pub fn is_option_byte_erase(&self) -> bool {
210 *self == OPTER::OptionByteErase
211 }
212}
213pub type OPTER_W<'a, REG> = crate::BitWriter<'a, REG, OPTER>;
215impl<'a, REG> OPTER_W<'a, REG>
216where
217 REG: crate::Writable + crate::RegisterSpec,
218{
219 #[inline(always)]
221 pub fn option_byte_erase(self) -> &'a mut crate::W<REG> {
222 self.variant(OPTER::OptionByteErase)
223 }
224}
225#[cfg_attr(feature = "defmt", derive(defmt::Format))]
229#[derive(Clone, Copy, Debug, PartialEq, Eq)]
230pub enum STRT {
231 Start = 1,
233}
234impl From<STRT> for bool {
235 #[inline(always)]
236 fn from(variant: STRT) -> Self {
237 variant as u8 != 0
238 }
239}
240pub type STRT_R = crate::BitReader<STRT>;
242impl STRT_R {
243 #[inline(always)]
245 pub const fn variant(&self) -> Option<STRT> {
246 match self.bits {
247 true => Some(STRT::Start),
248 _ => None,
249 }
250 }
251 #[inline(always)]
253 pub fn is_start(&self) -> bool {
254 *self == STRT::Start
255 }
256}
257pub type STRT_W<'a, REG> = crate::BitWriter<'a, REG, STRT>;
259impl<'a, REG> STRT_W<'a, REG>
260where
261 REG: crate::Writable + crate::RegisterSpec,
262{
263 #[inline(always)]
265 pub fn start(self) -> &'a mut crate::W<REG> {
266 self.variant(STRT::Start)
267 }
268}
269#[cfg_attr(feature = "defmt", derive(defmt::Format))]
273#[derive(Clone, Copy, Debug, PartialEq, Eq)]
274pub enum LOCKR {
275 Unlocked = 0,
277 Locked = 1,
279}
280impl From<LOCKR> for bool {
281 #[inline(always)]
282 fn from(variant: LOCKR) -> Self {
283 variant as u8 != 0
284 }
285}
286pub type LOCK_R = crate::BitReader<LOCKR>;
288impl LOCK_R {
289 #[inline(always)]
291 pub const fn variant(&self) -> LOCKR {
292 match self.bits {
293 false => LOCKR::Unlocked,
294 true => LOCKR::Locked,
295 }
296 }
297 #[inline(always)]
299 pub fn is_unlocked(&self) -> bool {
300 *self == LOCKR::Unlocked
301 }
302 #[inline(always)]
304 pub fn is_locked(&self) -> bool {
305 *self == LOCKR::Locked
306 }
307}
308#[cfg_attr(feature = "defmt", derive(defmt::Format))]
312#[derive(Clone, Copy, Debug, PartialEq, Eq)]
313pub enum LOCKW {
314 Lock = 1,
316}
317impl From<LOCKW> for bool {
318 #[inline(always)]
319 fn from(variant: LOCKW) -> Self {
320 variant as u8 != 0
321 }
322}
323pub type LOCK_W<'a, REG> = crate::BitWriter<'a, REG, LOCKW>;
325impl<'a, REG> LOCK_W<'a, REG>
326where
327 REG: crate::Writable + crate::RegisterSpec,
328{
329 #[inline(always)]
331 pub fn lock(self) -> &'a mut crate::W<REG> {
332 self.variant(LOCKW::Lock)
333 }
334}
335#[cfg_attr(feature = "defmt", derive(defmt::Format))]
339#[derive(Clone, Copy, Debug, PartialEq, Eq)]
340pub enum OPTWRE {
341 Disabled = 0,
343 Enabled = 1,
345}
346impl From<OPTWRE> for bool {
347 #[inline(always)]
348 fn from(variant: OPTWRE) -> Self {
349 variant as u8 != 0
350 }
351}
352pub type OPTWRE_R = crate::BitReader<OPTWRE>;
354impl OPTWRE_R {
355 #[inline(always)]
357 pub const fn variant(&self) -> OPTWRE {
358 match self.bits {
359 false => OPTWRE::Disabled,
360 true => OPTWRE::Enabled,
361 }
362 }
363 #[inline(always)]
365 pub fn is_disabled(&self) -> bool {
366 *self == OPTWRE::Disabled
367 }
368 #[inline(always)]
370 pub fn is_enabled(&self) -> bool {
371 *self == OPTWRE::Enabled
372 }
373}
374pub type OPTWRE_W<'a, REG> = crate::BitWriter<'a, REG, OPTWRE>;
376impl<'a, REG> OPTWRE_W<'a, REG>
377where
378 REG: crate::Writable + crate::RegisterSpec,
379{
380 #[inline(always)]
382 pub fn disabled(self) -> &'a mut crate::W<REG> {
383 self.variant(OPTWRE::Disabled)
384 }
385 #[inline(always)]
387 pub fn enabled(self) -> &'a mut crate::W<REG> {
388 self.variant(OPTWRE::Enabled)
389 }
390}
391#[cfg_attr(feature = "defmt", derive(defmt::Format))]
395#[derive(Clone, Copy, Debug, PartialEq, Eq)]
396pub enum ERRIE {
397 Disabled = 0,
399 Enabled = 1,
401}
402impl From<ERRIE> for bool {
403 #[inline(always)]
404 fn from(variant: ERRIE) -> Self {
405 variant as u8 != 0
406 }
407}
408pub type ERRIE_R = crate::BitReader<ERRIE>;
410impl ERRIE_R {
411 #[inline(always)]
413 pub const fn variant(&self) -> ERRIE {
414 match self.bits {
415 false => ERRIE::Disabled,
416 true => ERRIE::Enabled,
417 }
418 }
419 #[inline(always)]
421 pub fn is_disabled(&self) -> bool {
422 *self == ERRIE::Disabled
423 }
424 #[inline(always)]
426 pub fn is_enabled(&self) -> bool {
427 *self == ERRIE::Enabled
428 }
429}
430pub type ERRIE_W<'a, REG> = crate::BitWriter<'a, REG, ERRIE>;
432impl<'a, REG> ERRIE_W<'a, REG>
433where
434 REG: crate::Writable + crate::RegisterSpec,
435{
436 #[inline(always)]
438 pub fn disabled(self) -> &'a mut crate::W<REG> {
439 self.variant(ERRIE::Disabled)
440 }
441 #[inline(always)]
443 pub fn enabled(self) -> &'a mut crate::W<REG> {
444 self.variant(ERRIE::Enabled)
445 }
446}
447#[cfg_attr(feature = "defmt", derive(defmt::Format))]
451#[derive(Clone, Copy, Debug, PartialEq, Eq)]
452pub enum EOPIE {
453 Disabled = 0,
455 Enabled = 1,
457}
458impl From<EOPIE> for bool {
459 #[inline(always)]
460 fn from(variant: EOPIE) -> Self {
461 variant as u8 != 0
462 }
463}
464pub type EOPIE_R = crate::BitReader<EOPIE>;
466impl EOPIE_R {
467 #[inline(always)]
469 pub const fn variant(&self) -> EOPIE {
470 match self.bits {
471 false => EOPIE::Disabled,
472 true => EOPIE::Enabled,
473 }
474 }
475 #[inline(always)]
477 pub fn is_disabled(&self) -> bool {
478 *self == EOPIE::Disabled
479 }
480 #[inline(always)]
482 pub fn is_enabled(&self) -> bool {
483 *self == EOPIE::Enabled
484 }
485}
486pub type EOPIE_W<'a, REG> = crate::BitWriter<'a, REG, EOPIE>;
488impl<'a, REG> EOPIE_W<'a, REG>
489where
490 REG: crate::Writable + crate::RegisterSpec,
491{
492 #[inline(always)]
494 pub fn disabled(self) -> &'a mut crate::W<REG> {
495 self.variant(EOPIE::Disabled)
496 }
497 #[inline(always)]
499 pub fn enabled(self) -> &'a mut crate::W<REG> {
500 self.variant(EOPIE::Enabled)
501 }
502}
503#[cfg_attr(feature = "defmt", derive(defmt::Format))]
507#[derive(Clone, Copy, Debug, PartialEq, Eq)]
508pub enum OBL_LAUNCH {
509 Inactive = 0,
511 Active = 1,
513}
514impl From<OBL_LAUNCH> for bool {
515 #[inline(always)]
516 fn from(variant: OBL_LAUNCH) -> Self {
517 variant as u8 != 0
518 }
519}
520pub type OBL_LAUNCH_R = crate::BitReader<OBL_LAUNCH>;
522impl OBL_LAUNCH_R {
523 #[inline(always)]
525 pub const fn variant(&self) -> OBL_LAUNCH {
526 match self.bits {
527 false => OBL_LAUNCH::Inactive,
528 true => OBL_LAUNCH::Active,
529 }
530 }
531 #[inline(always)]
533 pub fn is_inactive(&self) -> bool {
534 *self == OBL_LAUNCH::Inactive
535 }
536 #[inline(always)]
538 pub fn is_active(&self) -> bool {
539 *self == OBL_LAUNCH::Active
540 }
541}
542pub type OBL_LAUNCH_W<'a, REG> = crate::BitWriter<'a, REG, OBL_LAUNCH>;
544impl<'a, REG> OBL_LAUNCH_W<'a, REG>
545where
546 REG: crate::Writable + crate::RegisterSpec,
547{
548 #[inline(always)]
550 pub fn inactive(self) -> &'a mut crate::W<REG> {
551 self.variant(OBL_LAUNCH::Inactive)
552 }
553 #[inline(always)]
555 pub fn active(self) -> &'a mut crate::W<REG> {
556 self.variant(OBL_LAUNCH::Active)
557 }
558}
559impl R {
560 #[inline(always)]
562 pub fn pg(&self) -> PG_R {
563 PG_R::new((self.bits & 1) != 0)
564 }
565 #[inline(always)]
567 pub fn per(&self) -> PER_R {
568 PER_R::new(((self.bits >> 1) & 1) != 0)
569 }
570 #[inline(always)]
572 pub fn mer(&self) -> MER_R {
573 MER_R::new(((self.bits >> 2) & 1) != 0)
574 }
575 #[inline(always)]
577 pub fn optpg(&self) -> OPTPG_R {
578 OPTPG_R::new(((self.bits >> 4) & 1) != 0)
579 }
580 #[inline(always)]
582 pub fn opter(&self) -> OPTER_R {
583 OPTER_R::new(((self.bits >> 5) & 1) != 0)
584 }
585 #[inline(always)]
587 pub fn strt(&self) -> STRT_R {
588 STRT_R::new(((self.bits >> 6) & 1) != 0)
589 }
590 #[inline(always)]
592 pub fn lock(&self) -> LOCK_R {
593 LOCK_R::new(((self.bits >> 7) & 1) != 0)
594 }
595 #[inline(always)]
597 pub fn optwre(&self) -> OPTWRE_R {
598 OPTWRE_R::new(((self.bits >> 9) & 1) != 0)
599 }
600 #[inline(always)]
602 pub fn errie(&self) -> ERRIE_R {
603 ERRIE_R::new(((self.bits >> 10) & 1) != 0)
604 }
605 #[inline(always)]
607 pub fn eopie(&self) -> EOPIE_R {
608 EOPIE_R::new(((self.bits >> 12) & 1) != 0)
609 }
610 #[inline(always)]
612 pub fn obl_launch(&self) -> OBL_LAUNCH_R {
613 OBL_LAUNCH_R::new(((self.bits >> 13) & 1) != 0)
614 }
615}
616impl core::fmt::Debug for R {
617 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
618 f.debug_struct("CR")
619 .field("obl_launch", &self.obl_launch())
620 .field("eopie", &self.eopie())
621 .field("errie", &self.errie())
622 .field("optwre", &self.optwre())
623 .field("lock", &self.lock())
624 .field("strt", &self.strt())
625 .field("opter", &self.opter())
626 .field("optpg", &self.optpg())
627 .field("mer", &self.mer())
628 .field("per", &self.per())
629 .field("pg", &self.pg())
630 .finish()
631 }
632}
633impl W {
634 #[inline(always)]
636 pub fn pg(&mut self) -> PG_W<CRrs> {
637 PG_W::new(self, 0)
638 }
639 #[inline(always)]
641 pub fn per(&mut self) -> PER_W<CRrs> {
642 PER_W::new(self, 1)
643 }
644 #[inline(always)]
646 pub fn mer(&mut self) -> MER_W<CRrs> {
647 MER_W::new(self, 2)
648 }
649 #[inline(always)]
651 pub fn optpg(&mut self) -> OPTPG_W<CRrs> {
652 OPTPG_W::new(self, 4)
653 }
654 #[inline(always)]
656 pub fn opter(&mut self) -> OPTER_W<CRrs> {
657 OPTER_W::new(self, 5)
658 }
659 #[inline(always)]
661 pub fn strt(&mut self) -> STRT_W<CRrs> {
662 STRT_W::new(self, 6)
663 }
664 #[inline(always)]
666 pub fn lock(&mut self) -> LOCK_W<CRrs> {
667 LOCK_W::new(self, 7)
668 }
669 #[inline(always)]
671 pub fn optwre(&mut self) -> OPTWRE_W<CRrs> {
672 OPTWRE_W::new(self, 9)
673 }
674 #[inline(always)]
676 pub fn errie(&mut self) -> ERRIE_W<CRrs> {
677 ERRIE_W::new(self, 10)
678 }
679 #[inline(always)]
681 pub fn eopie(&mut self) -> EOPIE_W<CRrs> {
682 EOPIE_W::new(self, 12)
683 }
684 #[inline(always)]
686 pub fn obl_launch(&mut self) -> OBL_LAUNCH_W<CRrs> {
687 OBL_LAUNCH_W::new(self, 13)
688 }
689}
690pub struct CRrs;
696impl crate::RegisterSpec for CRrs {
697 type Ux = u32;
698}
699impl crate::Readable for CRrs {}
701impl crate::Writable for CRrs {
703 type Safety = crate::Unsafe;
704 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
705 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
706}
707impl crate::Resettable for CRrs {
709 const RESET_VALUE: u32 = 0x80;
710}