mimxrt685s_pac/sysctl0/
pdwakecfg.rs

1#[doc = "Register `PDWAKECFG` reader"]
2pub type R = crate::R<PdwakecfgSpec>;
3#[doc = "Register `PDWAKECFG` writer"]
4pub type W = crate::W<PdwakecfgSpec>;
5#[doc = "RBB mode on wakeup\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Rbbkeepst {
9    #[doc = "0: Use value of RBB_PD in PDRUNCFG on wakeup."]
10    Rbbkeepst0 = 0,
11    #[doc = "1: Copy PDSLEEPCFG RBB_PD value to PDRUNCFG RBB_PD on wakeup to keep RBB state."]
12    Rbbkeepst1 = 1,
13}
14impl From<Rbbkeepst> for bool {
15    #[inline(always)]
16    fn from(variant: Rbbkeepst) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `RBBKEEPST` reader - RBB mode on wakeup"]
21pub type RbbkeepstR = crate::BitReader<Rbbkeepst>;
22impl RbbkeepstR {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> Rbbkeepst {
26        match self.bits {
27            false => Rbbkeepst::Rbbkeepst0,
28            true => Rbbkeepst::Rbbkeepst1,
29        }
30    }
31    #[doc = "Use value of RBB_PD in PDRUNCFG on wakeup."]
32    #[inline(always)]
33    pub fn is_rbbkeepst_0(&self) -> bool {
34        *self == Rbbkeepst::Rbbkeepst0
35    }
36    #[doc = "Copy PDSLEEPCFG RBB_PD value to PDRUNCFG RBB_PD on wakeup to keep RBB state."]
37    #[inline(always)]
38    pub fn is_rbbkeepst_1(&self) -> bool {
39        *self == Rbbkeepst::Rbbkeepst1
40    }
41}
42#[doc = "Field `RBBKEEPST` writer - RBB mode on wakeup"]
43pub type RbbkeepstW<'a, REG> = crate::BitWriter<'a, REG, Rbbkeepst>;
44impl<'a, REG> RbbkeepstW<'a, REG>
45where
46    REG: crate::Writable + crate::RegisterSpec,
47{
48    #[doc = "Use value of RBB_PD in PDRUNCFG on wakeup."]
49    #[inline(always)]
50    pub fn rbbkeepst_0(self) -> &'a mut crate::W<REG> {
51        self.variant(Rbbkeepst::Rbbkeepst0)
52    }
53    #[doc = "Copy PDSLEEPCFG RBB_PD value to PDRUNCFG RBB_PD on wakeup to keep RBB state."]
54    #[inline(always)]
55    pub fn rbbkeepst_1(self) -> &'a mut crate::W<REG> {
56        self.variant(Rbbkeepst::Rbbkeepst1)
57    }
58}
59#[doc = "FBB mode on wakeup\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Fbbkeepst {
63    #[doc = "0: Use value of FBB_PD in PDRUNCFG on wakeup"]
64    Fbbkeepst0 = 0,
65    #[doc = "1: Copy PDSLEEPCFG FBB_PD value to PDRUNCFG FBB_PD on wakeup to keep FBB state"]
66    Fbbkeepst1 = 1,
67}
68impl From<Fbbkeepst> for bool {
69    #[inline(always)]
70    fn from(variant: Fbbkeepst) -> Self {
71        variant as u8 != 0
72    }
73}
74#[doc = "Field `FBBKEEPST` reader - FBB mode on wakeup"]
75pub type FbbkeepstR = crate::BitReader<Fbbkeepst>;
76impl FbbkeepstR {
77    #[doc = "Get enumerated values variant"]
78    #[inline(always)]
79    pub const fn variant(&self) -> Fbbkeepst {
80        match self.bits {
81            false => Fbbkeepst::Fbbkeepst0,
82            true => Fbbkeepst::Fbbkeepst1,
83        }
84    }
85    #[doc = "Use value of FBB_PD in PDRUNCFG on wakeup"]
86    #[inline(always)]
87    pub fn is_fbbkeepst_0(&self) -> bool {
88        *self == Fbbkeepst::Fbbkeepst0
89    }
90    #[doc = "Copy PDSLEEPCFG FBB_PD value to PDRUNCFG FBB_PD on wakeup to keep FBB state"]
91    #[inline(always)]
92    pub fn is_fbbkeepst_1(&self) -> bool {
93        *self == Fbbkeepst::Fbbkeepst1
94    }
95}
96#[doc = "Field `FBBKEEPST` writer - FBB mode on wakeup"]
97pub type FbbkeepstW<'a, REG> = crate::BitWriter<'a, REG, Fbbkeepst>;
98impl<'a, REG> FbbkeepstW<'a, REG>
99where
100    REG: crate::Writable + crate::RegisterSpec,
101{
102    #[doc = "Use value of FBB_PD in PDRUNCFG on wakeup"]
103    #[inline(always)]
104    pub fn fbbkeepst_0(self) -> &'a mut crate::W<REG> {
105        self.variant(Fbbkeepst::Fbbkeepst0)
106    }
107    #[doc = "Copy PDSLEEPCFG FBB_PD value to PDRUNCFG FBB_PD on wakeup to keep FBB state"]
108    #[inline(always)]
109    pub fn fbbkeepst_1(self) -> &'a mut crate::W<REG> {
110        self.variant(Fbbkeepst::Fbbkeepst1)
111    }
112}
113impl R {
114    #[doc = "Bit 0 - RBB mode on wakeup"]
115    #[inline(always)]
116    pub fn rbbkeepst(&self) -> RbbkeepstR {
117        RbbkeepstR::new((self.bits & 1) != 0)
118    }
119    #[doc = "Bit 1 - FBB mode on wakeup"]
120    #[inline(always)]
121    pub fn fbbkeepst(&self) -> FbbkeepstR {
122        FbbkeepstR::new(((self.bits >> 1) & 1) != 0)
123    }
124}
125#[cfg(feature = "debug")]
126impl core::fmt::Debug for R {
127    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
128        f.debug_struct("PDWAKECFG")
129            .field("rbbkeepst", &self.rbbkeepst())
130            .field("fbbkeepst", &self.fbbkeepst())
131            .finish()
132    }
133}
134impl W {
135    #[doc = "Bit 0 - RBB mode on wakeup"]
136    #[inline(always)]
137    pub fn rbbkeepst(&mut self) -> RbbkeepstW<PdwakecfgSpec> {
138        RbbkeepstW::new(self, 0)
139    }
140    #[doc = "Bit 1 - FBB mode on wakeup"]
141    #[inline(always)]
142    pub fn fbbkeepst(&mut self) -> FbbkeepstW<PdwakecfgSpec> {
143        FbbkeepstW::new(self, 1)
144    }
145}
146#[doc = "PD Wake Configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`pdwakecfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pdwakecfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
147pub struct PdwakecfgSpec;
148impl crate::RegisterSpec for PdwakecfgSpec {
149    type Ux = u32;
150}
151#[doc = "`read()` method returns [`pdwakecfg::R`](R) reader structure"]
152impl crate::Readable for PdwakecfgSpec {}
153#[doc = "`write(|w| ..)` method takes [`pdwakecfg::W`](W) writer structure"]
154impl crate::Writable for PdwakecfgSpec {
155    type Safety = crate::Unsafe;
156    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
157    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
158}
159#[doc = "`reset()` method sets PDWAKECFG to value 0"]
160impl crate::Resettable for PdwakecfgSpec {
161    const RESET_VALUE: u32 = 0;
162}