xmc4100/scu_hibernate/
hintset.rs

1#[doc = "Register `HINTSET` writer"]
2pub type W = crate::W<HINTSET_SPEC>;
3#[doc = "Internally Controlled Hibernate Sequence Request Set\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum HIBNINT_A {
6    #[doc = "0: No effect"]
7    VALUE1 = 0,
8    #[doc = "1: Hardware controlled hibernate sequence request active"]
9    VALUE2 = 1,
10}
11impl From<HIBNINT_A> for bool {
12    #[inline(always)]
13    fn from(variant: HIBNINT_A) -> Self {
14        variant as u8 != 0
15    }
16}
17#[doc = "Field `HIBNINT` writer - Internally Controlled Hibernate Sequence Request Set"]
18pub type HIBNINT_W<'a, REG> = crate::BitWriter<'a, REG, HIBNINT_A>;
19impl<'a, REG> HIBNINT_W<'a, REG>
20where
21    REG: crate::Writable + crate::RegisterSpec,
22{
23    #[doc = "No effect"]
24    #[inline(always)]
25    pub fn value1(self) -> &'a mut crate::W<REG> {
26        self.variant(HIBNINT_A::VALUE1)
27    }
28    #[doc = "Hardware controlled hibernate sequence request active"]
29    #[inline(always)]
30    pub fn value2(self) -> &'a mut crate::W<REG> {
31        self.variant(HIBNINT_A::VALUE2)
32    }
33}
34#[doc = "VDDC Generation off on EVR Set\n\nValue on reset: 0"]
35#[derive(Clone, Copy, Debug, PartialEq, Eq)]
36pub enum VCOREOFF_A {
37    #[doc = "0: No effect"]
38    VALUE1 = 0,
39    #[doc = "1: VDDC off to EVR set"]
40    VALUE2 = 1,
41}
42impl From<VCOREOFF_A> for bool {
43    #[inline(always)]
44    fn from(variant: VCOREOFF_A) -> Self {
45        variant as u8 != 0
46    }
47}
48#[doc = "Field `VCOREOFF` writer - VDDC Generation off on EVR Set"]
49pub type VCOREOFF_W<'a, REG> = crate::BitWriter<'a, REG, VCOREOFF_A>;
50impl<'a, REG> VCOREOFF_W<'a, REG>
51where
52    REG: crate::Writable + crate::RegisterSpec,
53{
54    #[doc = "No effect"]
55    #[inline(always)]
56    pub fn value1(self) -> &'a mut crate::W<REG> {
57        self.variant(VCOREOFF_A::VALUE1)
58    }
59    #[doc = "VDDC off to EVR set"]
60    #[inline(always)]
61    pub fn value2(self) -> &'a mut crate::W<REG> {
62        self.variant(VCOREOFF_A::VALUE2)
63    }
64}
65#[doc = "VDDP Supply Switch of Flash Set\n\nValue on reset: 0"]
66#[derive(Clone, Copy, Debug, PartialEq, Eq)]
67pub enum FLASHOFF_A {
68    #[doc = "0: No effect"]
69    VALUE1 = 0,
70    #[doc = "1: Switch off VDDP supply of Flash"]
71    VALUE2 = 1,
72}
73impl From<FLASHOFF_A> for bool {
74    #[inline(always)]
75    fn from(variant: FLASHOFF_A) -> Self {
76        variant as u8 != 0
77    }
78}
79#[doc = "Field `FLASHOFF` writer - VDDP Supply Switch of Flash Set"]
80pub type FLASHOFF_W<'a, REG> = crate::BitWriter<'a, REG, FLASHOFF_A>;
81impl<'a, REG> FLASHOFF_W<'a, REG>
82where
83    REG: crate::Writable + crate::RegisterSpec,
84{
85    #[doc = "No effect"]
86    #[inline(always)]
87    pub fn value1(self) -> &'a mut crate::W<REG> {
88        self.variant(FLASHOFF_A::VALUE1)
89    }
90    #[doc = "Switch off VDDP supply of Flash"]
91    #[inline(always)]
92    pub fn value2(self) -> &'a mut crate::W<REG> {
93        self.variant(FLASHOFF_A::VALUE2)
94    }
95}
96#[doc = "Flash Power Down Set\n\nValue on reset: 0"]
97#[derive(Clone, Copy, Debug, PartialEq, Eq)]
98pub enum FLASHPD_A {
99    #[doc = "0: No effect"]
100    VALUE1 = 0,
101    #[doc = "1: Flash power down mode request set"]
102    VALUE2 = 1,
103}
104impl From<FLASHPD_A> for bool {
105    #[inline(always)]
106    fn from(variant: FLASHPD_A) -> Self {
107        variant as u8 != 0
108    }
109}
110#[doc = "Field `FLASHPD` writer - Flash Power Down Set"]
111pub type FLASHPD_W<'a, REG> = crate::BitWriter<'a, REG, FLASHPD_A>;
112impl<'a, REG> FLASHPD_W<'a, REG>
113where
114    REG: crate::Writable + crate::RegisterSpec,
115{
116    #[doc = "No effect"]
117    #[inline(always)]
118    pub fn value1(self) -> &'a mut crate::W<REG> {
119        self.variant(FLASHPD_A::VALUE1)
120    }
121    #[doc = "Flash power down mode request set"]
122    #[inline(always)]
123    pub fn value2(self) -> &'a mut crate::W<REG> {
124        self.variant(FLASHPD_A::VALUE2)
125    }
126}
127#[doc = "PORST Pull-up OFF Direct Control Set\n\nValue on reset: 0"]
128#[derive(Clone, Copy, Debug, PartialEq, Eq)]
129pub enum POFFD_A {
130    #[doc = "0: No effect"]
131    VALUE1 = 0,
132    #[doc = "1: Pull-up off"]
133    VALUE2 = 1,
134}
135impl From<POFFD_A> for bool {
136    #[inline(always)]
137    fn from(variant: POFFD_A) -> Self {
138        variant as u8 != 0
139    }
140}
141#[doc = "Field `POFFD` writer - PORST Pull-up OFF Direct Control Set"]
142pub type POFFD_W<'a, REG> = crate::BitWriter<'a, REG, POFFD_A>;
143impl<'a, REG> POFFD_W<'a, REG>
144where
145    REG: crate::Writable + crate::RegisterSpec,
146{
147    #[doc = "No effect"]
148    #[inline(always)]
149    pub fn value1(self) -> &'a mut crate::W<REG> {
150        self.variant(POFFD_A::VALUE1)
151    }
152    #[doc = "Pull-up off"]
153    #[inline(always)]
154    pub fn value2(self) -> &'a mut crate::W<REG> {
155        self.variant(POFFD_A::VALUE2)
156    }
157}
158#[doc = "Field `PPODEL` writer - Delay on PORTS Pull-up Switching OFF on Hibernate Request Set"]
159pub type PPODEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
160#[doc = "PORST Pull-up OFF in Hibernate Mode Set\n\nValue on reset: 0"]
161#[derive(Clone, Copy, Debug, PartialEq, Eq)]
162pub enum POFFH_A {
163    #[doc = "0: No effect"]
164    VALUE1 = 0,
165    #[doc = "1: Pull-up off"]
166    VALUE2 = 1,
167}
168impl From<POFFH_A> for bool {
169    #[inline(always)]
170    fn from(variant: POFFH_A) -> Self {
171        variant as u8 != 0
172    }
173}
174#[doc = "Field `POFFH` writer - PORST Pull-up OFF in Hibernate Mode Set"]
175pub type POFFH_W<'a, REG> = crate::BitWriter<'a, REG, POFFH_A>;
176impl<'a, REG> POFFH_W<'a, REG>
177where
178    REG: crate::Writable + crate::RegisterSpec,
179{
180    #[doc = "No effect"]
181    #[inline(always)]
182    pub fn value1(self) -> &'a mut crate::W<REG> {
183        self.variant(POFFH_A::VALUE1)
184    }
185    #[doc = "Pull-up off"]
186    #[inline(always)]
187    pub fn value2(self) -> &'a mut crate::W<REG> {
188        self.variant(POFFH_A::VALUE2)
189    }
190}
191impl W {
192    #[doc = "Bit 0 - Internally Controlled Hibernate Sequence Request Set"]
193    #[inline(always)]
194    pub fn hibnint(&mut self) -> HIBNINT_W<HINTSET_SPEC> {
195        HIBNINT_W::new(self, 0)
196    }
197    #[doc = "Bit 1 - VDDC Generation off on EVR Set"]
198    #[inline(always)]
199    pub fn vcoreoff(&mut self) -> VCOREOFF_W<HINTSET_SPEC> {
200        VCOREOFF_W::new(self, 1)
201    }
202    #[doc = "Bit 2 - VDDP Supply Switch of Flash Set"]
203    #[inline(always)]
204    pub fn flashoff(&mut self) -> FLASHOFF_W<HINTSET_SPEC> {
205        FLASHOFF_W::new(self, 2)
206    }
207    #[doc = "Bit 3 - Flash Power Down Set"]
208    #[inline(always)]
209    pub fn flashpd(&mut self) -> FLASHPD_W<HINTSET_SPEC> {
210        FLASHPD_W::new(self, 3)
211    }
212    #[doc = "Bit 4 - PORST Pull-up OFF Direct Control Set"]
213    #[inline(always)]
214    pub fn poffd(&mut self) -> POFFD_W<HINTSET_SPEC> {
215        POFFD_W::new(self, 4)
216    }
217    #[doc = "Bits 16:17 - Delay on PORTS Pull-up Switching OFF on Hibernate Request Set"]
218    #[inline(always)]
219    pub fn ppodel(&mut self) -> PPODEL_W<HINTSET_SPEC> {
220        PPODEL_W::new(self, 16)
221    }
222    #[doc = "Bit 20 - PORST Pull-up OFF in Hibernate Mode Set"]
223    #[inline(always)]
224    pub fn poffh(&mut self) -> POFFH_W<HINTSET_SPEC> {
225        POFFH_W::new(self, 20)
226    }
227}
228#[doc = "Hibernate Internal Control Set Register\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`hintset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
229pub struct HINTSET_SPEC;
230impl crate::RegisterSpec for HINTSET_SPEC {
231    type Ux = u32;
232}
233#[doc = "`write(|w| ..)` method takes [`hintset::W`](W) writer structure"]
234impl crate::Writable for HINTSET_SPEC {
235    type Safety = crate::Unsafe;
236    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
237    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
238}
239#[doc = "`reset()` method sets HINTSET to value 0"]
240impl crate::Resettable for HINTSET_SPEC {
241    const RESET_VALUE: u32 = 0;
242}