Skip to main content

mcxa_pac/mrcc0/
mrcc_glb_rst2.rs

1#[doc = "Register `MRCC_GLB_RST2` reader"]
2pub type R = crate::R<MrccGlbRst2Spec>;
3#[doc = "Register `MRCC_GLB_RST2` writer"]
4pub type W = crate::W<MrccGlbRst2Spec>;
5#[doc = "GPIO0\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Gpio0 {
9    #[doc = "0: Peripheral is held in reset"]
10    Disabled = 0,
11    #[doc = "1: Peripheral is released from reset"]
12    Enabled = 1,
13}
14impl From<Gpio0> for bool {
15    #[inline(always)]
16    fn from(variant: Gpio0) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `GPIO0` reader - GPIO0"]
21pub type Gpio0R = crate::BitReader<Gpio0>;
22impl Gpio0R {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> Gpio0 {
26        match self.bits {
27            false => Gpio0::Disabled,
28            true => Gpio0::Enabled,
29        }
30    }
31    #[doc = "Peripheral is held in reset"]
32    #[inline(always)]
33    pub fn is_disabled(&self) -> bool {
34        *self == Gpio0::Disabled
35    }
36    #[doc = "Peripheral is released from reset"]
37    #[inline(always)]
38    pub fn is_enabled(&self) -> bool {
39        *self == Gpio0::Enabled
40    }
41}
42#[doc = "Field `GPIO0` writer - GPIO0"]
43pub type Gpio0W<'a, REG> = crate::BitWriter<'a, REG, Gpio0>;
44impl<'a, REG> Gpio0W<'a, REG>
45where
46    REG: crate::Writable + crate::RegisterSpec,
47{
48    #[doc = "Peripheral is held in reset"]
49    #[inline(always)]
50    pub fn disabled(self) -> &'a mut crate::W<REG> {
51        self.variant(Gpio0::Disabled)
52    }
53    #[doc = "Peripheral is released from reset"]
54    #[inline(always)]
55    pub fn enabled(self) -> &'a mut crate::W<REG> {
56        self.variant(Gpio0::Enabled)
57    }
58}
59#[doc = "GPIO1\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Gpio1 {
63    #[doc = "0: Peripheral is held in reset"]
64    Disabled = 0,
65    #[doc = "1: Peripheral is released from reset"]
66    Enabled = 1,
67}
68impl From<Gpio1> for bool {
69    #[inline(always)]
70    fn from(variant: Gpio1) -> Self {
71        variant as u8 != 0
72    }
73}
74#[doc = "Field `GPIO1` reader - GPIO1"]
75pub type Gpio1R = crate::BitReader<Gpio1>;
76impl Gpio1R {
77    #[doc = "Get enumerated values variant"]
78    #[inline(always)]
79    pub const fn variant(&self) -> Gpio1 {
80        match self.bits {
81            false => Gpio1::Disabled,
82            true => Gpio1::Enabled,
83        }
84    }
85    #[doc = "Peripheral is held in reset"]
86    #[inline(always)]
87    pub fn is_disabled(&self) -> bool {
88        *self == Gpio1::Disabled
89    }
90    #[doc = "Peripheral is released from reset"]
91    #[inline(always)]
92    pub fn is_enabled(&self) -> bool {
93        *self == Gpio1::Enabled
94    }
95}
96#[doc = "Field `GPIO1` writer - GPIO1"]
97pub type Gpio1W<'a, REG> = crate::BitWriter<'a, REG, Gpio1>;
98impl<'a, REG> Gpio1W<'a, REG>
99where
100    REG: crate::Writable + crate::RegisterSpec,
101{
102    #[doc = "Peripheral is held in reset"]
103    #[inline(always)]
104    pub fn disabled(self) -> &'a mut crate::W<REG> {
105        self.variant(Gpio1::Disabled)
106    }
107    #[doc = "Peripheral is released from reset"]
108    #[inline(always)]
109    pub fn enabled(self) -> &'a mut crate::W<REG> {
110        self.variant(Gpio1::Enabled)
111    }
112}
113#[doc = "GPIO2\n\nValue on reset: 0"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum Gpio2 {
117    #[doc = "0: Peripheral is held in reset"]
118    Disabled = 0,
119    #[doc = "1: Peripheral is released from reset"]
120    Enabled = 1,
121}
122impl From<Gpio2> for bool {
123    #[inline(always)]
124    fn from(variant: Gpio2) -> Self {
125        variant as u8 != 0
126    }
127}
128#[doc = "Field `GPIO2` reader - GPIO2"]
129pub type Gpio2R = crate::BitReader<Gpio2>;
130impl Gpio2R {
131    #[doc = "Get enumerated values variant"]
132    #[inline(always)]
133    pub const fn variant(&self) -> Gpio2 {
134        match self.bits {
135            false => Gpio2::Disabled,
136            true => Gpio2::Enabled,
137        }
138    }
139    #[doc = "Peripheral is held in reset"]
140    #[inline(always)]
141    pub fn is_disabled(&self) -> bool {
142        *self == Gpio2::Disabled
143    }
144    #[doc = "Peripheral is released from reset"]
145    #[inline(always)]
146    pub fn is_enabled(&self) -> bool {
147        *self == Gpio2::Enabled
148    }
149}
150#[doc = "Field `GPIO2` writer - GPIO2"]
151pub type Gpio2W<'a, REG> = crate::BitWriter<'a, REG, Gpio2>;
152impl<'a, REG> Gpio2W<'a, REG>
153where
154    REG: crate::Writable + crate::RegisterSpec,
155{
156    #[doc = "Peripheral is held in reset"]
157    #[inline(always)]
158    pub fn disabled(self) -> &'a mut crate::W<REG> {
159        self.variant(Gpio2::Disabled)
160    }
161    #[doc = "Peripheral is released from reset"]
162    #[inline(always)]
163    pub fn enabled(self) -> &'a mut crate::W<REG> {
164        self.variant(Gpio2::Enabled)
165    }
166}
167#[doc = "GPIO3\n\nValue on reset: 0"]
168#[cfg_attr(feature = "defmt", derive(defmt::Format))]
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
170pub enum Gpio3 {
171    #[doc = "0: Peripheral is held in reset"]
172    Disabled = 0,
173    #[doc = "1: Peripheral is released from reset"]
174    Enabled = 1,
175}
176impl From<Gpio3> for bool {
177    #[inline(always)]
178    fn from(variant: Gpio3) -> Self {
179        variant as u8 != 0
180    }
181}
182#[doc = "Field `GPIO3` reader - GPIO3"]
183pub type Gpio3R = crate::BitReader<Gpio3>;
184impl Gpio3R {
185    #[doc = "Get enumerated values variant"]
186    #[inline(always)]
187    pub const fn variant(&self) -> Gpio3 {
188        match self.bits {
189            false => Gpio3::Disabled,
190            true => Gpio3::Enabled,
191        }
192    }
193    #[doc = "Peripheral is held in reset"]
194    #[inline(always)]
195    pub fn is_disabled(&self) -> bool {
196        *self == Gpio3::Disabled
197    }
198    #[doc = "Peripheral is released from reset"]
199    #[inline(always)]
200    pub fn is_enabled(&self) -> bool {
201        *self == Gpio3::Enabled
202    }
203}
204#[doc = "Field `GPIO3` writer - GPIO3"]
205pub type Gpio3W<'a, REG> = crate::BitWriter<'a, REG, Gpio3>;
206impl<'a, REG> Gpio3W<'a, REG>
207where
208    REG: crate::Writable + crate::RegisterSpec,
209{
210    #[doc = "Peripheral is held in reset"]
211    #[inline(always)]
212    pub fn disabled(self) -> &'a mut crate::W<REG> {
213        self.variant(Gpio3::Disabled)
214    }
215    #[doc = "Peripheral is released from reset"]
216    #[inline(always)]
217    pub fn enabled(self) -> &'a mut crate::W<REG> {
218        self.variant(Gpio3::Enabled)
219    }
220}
221#[doc = "GPIO4\n\nValue on reset: 0"]
222#[cfg_attr(feature = "defmt", derive(defmt::Format))]
223#[derive(Clone, Copy, Debug, PartialEq, Eq)]
224pub enum Gpio4 {
225    #[doc = "0: Peripheral is held in reset"]
226    Disabled = 0,
227    #[doc = "1: Peripheral is released from reset"]
228    Enabled = 1,
229}
230impl From<Gpio4> for bool {
231    #[inline(always)]
232    fn from(variant: Gpio4) -> Self {
233        variant as u8 != 0
234    }
235}
236#[doc = "Field `GPIO4` reader - GPIO4"]
237pub type Gpio4R = crate::BitReader<Gpio4>;
238impl Gpio4R {
239    #[doc = "Get enumerated values variant"]
240    #[inline(always)]
241    pub const fn variant(&self) -> Gpio4 {
242        match self.bits {
243            false => Gpio4::Disabled,
244            true => Gpio4::Enabled,
245        }
246    }
247    #[doc = "Peripheral is held in reset"]
248    #[inline(always)]
249    pub fn is_disabled(&self) -> bool {
250        *self == Gpio4::Disabled
251    }
252    #[doc = "Peripheral is released from reset"]
253    #[inline(always)]
254    pub fn is_enabled(&self) -> bool {
255        *self == Gpio4::Enabled
256    }
257}
258#[doc = "Field `GPIO4` writer - GPIO4"]
259pub type Gpio4W<'a, REG> = crate::BitWriter<'a, REG, Gpio4>;
260impl<'a, REG> Gpio4W<'a, REG>
261where
262    REG: crate::Writable + crate::RegisterSpec,
263{
264    #[doc = "Peripheral is held in reset"]
265    #[inline(always)]
266    pub fn disabled(self) -> &'a mut crate::W<REG> {
267        self.variant(Gpio4::Disabled)
268    }
269    #[doc = "Peripheral is released from reset"]
270    #[inline(always)]
271    pub fn enabled(self) -> &'a mut crate::W<REG> {
272        self.variant(Gpio4::Enabled)
273    }
274}
275#[doc = "MAU0\n\nValue on reset: 0"]
276#[cfg_attr(feature = "defmt", derive(defmt::Format))]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278pub enum Mau0 {
279    #[doc = "0: Peripheral is held in reset"]
280    Disabled = 0,
281    #[doc = "1: Peripheral is released from reset"]
282    Enabled = 1,
283}
284impl From<Mau0> for bool {
285    #[inline(always)]
286    fn from(variant: Mau0) -> Self {
287        variant as u8 != 0
288    }
289}
290#[doc = "Field `MAU0` reader - MAU0"]
291pub type Mau0R = crate::BitReader<Mau0>;
292impl Mau0R {
293    #[doc = "Get enumerated values variant"]
294    #[inline(always)]
295    pub const fn variant(&self) -> Mau0 {
296        match self.bits {
297            false => Mau0::Disabled,
298            true => Mau0::Enabled,
299        }
300    }
301    #[doc = "Peripheral is held in reset"]
302    #[inline(always)]
303    pub fn is_disabled(&self) -> bool {
304        *self == Mau0::Disabled
305    }
306    #[doc = "Peripheral is released from reset"]
307    #[inline(always)]
308    pub fn is_enabled(&self) -> bool {
309        *self == Mau0::Enabled
310    }
311}
312#[doc = "Field `MAU0` writer - MAU0"]
313pub type Mau0W<'a, REG> = crate::BitWriter<'a, REG, Mau0>;
314impl<'a, REG> Mau0W<'a, REG>
315where
316    REG: crate::Writable + crate::RegisterSpec,
317{
318    #[doc = "Peripheral is held in reset"]
319    #[inline(always)]
320    pub fn disabled(self) -> &'a mut crate::W<REG> {
321        self.variant(Mau0::Disabled)
322    }
323    #[doc = "Peripheral is released from reset"]
324    #[inline(always)]
325    pub fn enabled(self) -> &'a mut crate::W<REG> {
326        self.variant(Mau0::Enabled)
327    }
328}
329impl R {
330    #[doc = "Bit 4 - GPIO0"]
331    #[inline(always)]
332    pub fn gpio0(&self) -> Gpio0R {
333        Gpio0R::new(((self.bits >> 4) & 1) != 0)
334    }
335    #[doc = "Bit 5 - GPIO1"]
336    #[inline(always)]
337    pub fn gpio1(&self) -> Gpio1R {
338        Gpio1R::new(((self.bits >> 5) & 1) != 0)
339    }
340    #[doc = "Bit 6 - GPIO2"]
341    #[inline(always)]
342    pub fn gpio2(&self) -> Gpio2R {
343        Gpio2R::new(((self.bits >> 6) & 1) != 0)
344    }
345    #[doc = "Bit 7 - GPIO3"]
346    #[inline(always)]
347    pub fn gpio3(&self) -> Gpio3R {
348        Gpio3R::new(((self.bits >> 7) & 1) != 0)
349    }
350    #[doc = "Bit 8 - GPIO4"]
351    #[inline(always)]
352    pub fn gpio4(&self) -> Gpio4R {
353        Gpio4R::new(((self.bits >> 8) & 1) != 0)
354    }
355    #[doc = "Bit 9 - MAU0"]
356    #[inline(always)]
357    pub fn mau0(&self) -> Mau0R {
358        Mau0R::new(((self.bits >> 9) & 1) != 0)
359    }
360}
361#[cfg(feature = "debug")]
362impl core::fmt::Debug for R {
363    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
364        f.debug_struct("MRCC_GLB_RST2")
365            .field("gpio0", &self.gpio0())
366            .field("gpio1", &self.gpio1())
367            .field("gpio2", &self.gpio2())
368            .field("gpio3", &self.gpio3())
369            .field("gpio4", &self.gpio4())
370            .field("mau0", &self.mau0())
371            .finish()
372    }
373}
374impl W {
375    #[doc = "Bit 4 - GPIO0"]
376    #[inline(always)]
377    pub fn gpio0(&mut self) -> Gpio0W<'_, MrccGlbRst2Spec> {
378        Gpio0W::new(self, 4)
379    }
380    #[doc = "Bit 5 - GPIO1"]
381    #[inline(always)]
382    pub fn gpio1(&mut self) -> Gpio1W<'_, MrccGlbRst2Spec> {
383        Gpio1W::new(self, 5)
384    }
385    #[doc = "Bit 6 - GPIO2"]
386    #[inline(always)]
387    pub fn gpio2(&mut self) -> Gpio2W<'_, MrccGlbRst2Spec> {
388        Gpio2W::new(self, 6)
389    }
390    #[doc = "Bit 7 - GPIO3"]
391    #[inline(always)]
392    pub fn gpio3(&mut self) -> Gpio3W<'_, MrccGlbRst2Spec> {
393        Gpio3W::new(self, 7)
394    }
395    #[doc = "Bit 8 - GPIO4"]
396    #[inline(always)]
397    pub fn gpio4(&mut self) -> Gpio4W<'_, MrccGlbRst2Spec> {
398        Gpio4W::new(self, 8)
399    }
400    #[doc = "Bit 9 - MAU0"]
401    #[inline(always)]
402    pub fn mau0(&mut self) -> Mau0W<'_, MrccGlbRst2Spec> {
403        Mau0W::new(self, 9)
404    }
405}
406#[doc = "Peripheral Reset Control 2\n\nYou can [`read`](crate::Reg::read) this register and get [`mrcc_glb_rst2::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mrcc_glb_rst2::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
407pub struct MrccGlbRst2Spec;
408impl crate::RegisterSpec for MrccGlbRst2Spec {
409    type Ux = u32;
410}
411#[doc = "`read()` method returns [`mrcc_glb_rst2::R`](R) reader structure"]
412impl crate::Readable for MrccGlbRst2Spec {}
413#[doc = "`write(|w| ..)` method takes [`mrcc_glb_rst2::W`](W) writer structure"]
414impl crate::Writable for MrccGlbRst2Spec {
415    type Safety = crate::Unsafe;
416}
417#[doc = "`reset()` method sets MRCC_GLB_RST2 to value 0"]
418impl crate::Resettable for MrccGlbRst2Spec {}