mcxa_pac/wuu0/
me.rs

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