Skip to main content

mcxa_pac/mau0/
res_status_ie.rs

1#[doc = "Register `RES_STATUS_IE` reader"]
2pub type R = crate::R<ResStatusIeSpec>;
3#[doc = "Register `RES_STATUS_IE` writer"]
4pub type W = crate::W<ResStatusIeSpec>;
5#[doc = "RES0 Interrupt Enable\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Res0Ie {
9    #[doc = "0: Disable"]
10    Disable = 0,
11    #[doc = "1: Enable"]
12    Enable = 1,
13}
14impl From<Res0Ie> for bool {
15    #[inline(always)]
16    fn from(variant: Res0Ie) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `RES0_IE` reader - RES0 Interrupt Enable"]
21pub type Res0IeR = crate::BitReader<Res0Ie>;
22impl Res0IeR {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> Res0Ie {
26        match self.bits {
27            false => Res0Ie::Disable,
28            true => Res0Ie::Enable,
29        }
30    }
31    #[doc = "Disable"]
32    #[inline(always)]
33    pub fn is_disable(&self) -> bool {
34        *self == Res0Ie::Disable
35    }
36    #[doc = "Enable"]
37    #[inline(always)]
38    pub fn is_enable(&self) -> bool {
39        *self == Res0Ie::Enable
40    }
41}
42#[doc = "Field `RES0_IE` writer - RES0 Interrupt Enable"]
43pub type Res0IeW<'a, REG> = crate::BitWriter<'a, REG, Res0Ie>;
44impl<'a, REG> Res0IeW<'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(Res0Ie::Disable)
52    }
53    #[doc = "Enable"]
54    #[inline(always)]
55    pub fn enable(self) -> &'a mut crate::W<REG> {
56        self.variant(Res0Ie::Enable)
57    }
58}
59#[doc = "RES1 Interrupt Enable\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Res1Ie {
63    #[doc = "0: Disable"]
64    Disable = 0,
65    #[doc = "1: Enable"]
66    Enable = 1,
67}
68impl From<Res1Ie> for bool {
69    #[inline(always)]
70    fn from(variant: Res1Ie) -> Self {
71        variant as u8 != 0
72    }
73}
74#[doc = "Field `RES1_IE` reader - RES1 Interrupt Enable"]
75pub type Res1IeR = crate::BitReader<Res1Ie>;
76impl Res1IeR {
77    #[doc = "Get enumerated values variant"]
78    #[inline(always)]
79    pub const fn variant(&self) -> Res1Ie {
80        match self.bits {
81            false => Res1Ie::Disable,
82            true => Res1Ie::Enable,
83        }
84    }
85    #[doc = "Disable"]
86    #[inline(always)]
87    pub fn is_disable(&self) -> bool {
88        *self == Res1Ie::Disable
89    }
90    #[doc = "Enable"]
91    #[inline(always)]
92    pub fn is_enable(&self) -> bool {
93        *self == Res1Ie::Enable
94    }
95}
96#[doc = "Field `RES1_IE` writer - RES1 Interrupt Enable"]
97pub type Res1IeW<'a, REG> = crate::BitWriter<'a, REG, Res1Ie>;
98impl<'a, REG> Res1IeW<'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(Res1Ie::Disable)
106    }
107    #[doc = "Enable"]
108    #[inline(always)]
109    pub fn enable(self) -> &'a mut crate::W<REG> {
110        self.variant(Res1Ie::Enable)
111    }
112}
113#[doc = "RES2 Interrupt Enable\n\nValue on reset: 0"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum Res2Ie {
117    #[doc = "0: Disable"]
118    Disable = 0,
119    #[doc = "1: Enable"]
120    Enable = 1,
121}
122impl From<Res2Ie> for bool {
123    #[inline(always)]
124    fn from(variant: Res2Ie) -> Self {
125        variant as u8 != 0
126    }
127}
128#[doc = "Field `RES2_IE` reader - RES2 Interrupt Enable"]
129pub type Res2IeR = crate::BitReader<Res2Ie>;
130impl Res2IeR {
131    #[doc = "Get enumerated values variant"]
132    #[inline(always)]
133    pub const fn variant(&self) -> Res2Ie {
134        match self.bits {
135            false => Res2Ie::Disable,
136            true => Res2Ie::Enable,
137        }
138    }
139    #[doc = "Disable"]
140    #[inline(always)]
141    pub fn is_disable(&self) -> bool {
142        *self == Res2Ie::Disable
143    }
144    #[doc = "Enable"]
145    #[inline(always)]
146    pub fn is_enable(&self) -> bool {
147        *self == Res2Ie::Enable
148    }
149}
150#[doc = "Field `RES2_IE` writer - RES2 Interrupt Enable"]
151pub type Res2IeW<'a, REG> = crate::BitWriter<'a, REG, Res2Ie>;
152impl<'a, REG> Res2IeW<'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(Res2Ie::Disable)
160    }
161    #[doc = "Enable"]
162    #[inline(always)]
163    pub fn enable(self) -> &'a mut crate::W<REG> {
164        self.variant(Res2Ie::Enable)
165    }
166}
167#[doc = "RES3 Interrupt Enable\n\nValue on reset: 0"]
168#[cfg_attr(feature = "defmt", derive(defmt::Format))]
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
170pub enum Res3Ie {
171    #[doc = "0: Disable"]
172    Disable = 0,
173    #[doc = "1: Enable"]
174    Enable = 1,
175}
176impl From<Res3Ie> for bool {
177    #[inline(always)]
178    fn from(variant: Res3Ie) -> Self {
179        variant as u8 != 0
180    }
181}
182#[doc = "Field `RES3_IE` reader - RES3 Interrupt Enable"]
183pub type Res3IeR = crate::BitReader<Res3Ie>;
184impl Res3IeR {
185    #[doc = "Get enumerated values variant"]
186    #[inline(always)]
187    pub const fn variant(&self) -> Res3Ie {
188        match self.bits {
189            false => Res3Ie::Disable,
190            true => Res3Ie::Enable,
191        }
192    }
193    #[doc = "Disable"]
194    #[inline(always)]
195    pub fn is_disable(&self) -> bool {
196        *self == Res3Ie::Disable
197    }
198    #[doc = "Enable"]
199    #[inline(always)]
200    pub fn is_enable(&self) -> bool {
201        *self == Res3Ie::Enable
202    }
203}
204#[doc = "Field `RES3_IE` writer - RES3 Interrupt Enable"]
205pub type Res3IeW<'a, REG> = crate::BitWriter<'a, REG, Res3Ie>;
206impl<'a, REG> Res3IeW<'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(Res3Ie::Disable)
214    }
215    #[doc = "Enable"]
216    #[inline(always)]
217    pub fn enable(self) -> &'a mut crate::W<REG> {
218        self.variant(Res3Ie::Enable)
219    }
220}
221impl R {
222    #[doc = "Bit 0 - RES0 Interrupt Enable"]
223    #[inline(always)]
224    pub fn res0_ie(&self) -> Res0IeR {
225        Res0IeR::new((self.bits & 1) != 0)
226    }
227    #[doc = "Bit 1 - RES1 Interrupt Enable"]
228    #[inline(always)]
229    pub fn res1_ie(&self) -> Res1IeR {
230        Res1IeR::new(((self.bits >> 1) & 1) != 0)
231    }
232    #[doc = "Bit 2 - RES2 Interrupt Enable"]
233    #[inline(always)]
234    pub fn res2_ie(&self) -> Res2IeR {
235        Res2IeR::new(((self.bits >> 2) & 1) != 0)
236    }
237    #[doc = "Bit 3 - RES3 Interrupt Enable"]
238    #[inline(always)]
239    pub fn res3_ie(&self) -> Res3IeR {
240        Res3IeR::new(((self.bits >> 3) & 1) != 0)
241    }
242}
243#[cfg(feature = "debug")]
244impl core::fmt::Debug for R {
245    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
246        f.debug_struct("RES_STATUS_IE")
247            .field("res0_ie", &self.res0_ie())
248            .field("res1_ie", &self.res1_ie())
249            .field("res2_ie", &self.res2_ie())
250            .field("res3_ie", &self.res3_ie())
251            .finish()
252    }
253}
254impl W {
255    #[doc = "Bit 0 - RES0 Interrupt Enable"]
256    #[inline(always)]
257    pub fn res0_ie(&mut self) -> Res0IeW<'_, ResStatusIeSpec> {
258        Res0IeW::new(self, 0)
259    }
260    #[doc = "Bit 1 - RES1 Interrupt Enable"]
261    #[inline(always)]
262    pub fn res1_ie(&mut self) -> Res1IeW<'_, ResStatusIeSpec> {
263        Res1IeW::new(self, 1)
264    }
265    #[doc = "Bit 2 - RES2 Interrupt Enable"]
266    #[inline(always)]
267    pub fn res2_ie(&mut self) -> Res2IeW<'_, ResStatusIeSpec> {
268        Res2IeW::new(self, 2)
269    }
270    #[doc = "Bit 3 - RES3 Interrupt Enable"]
271    #[inline(always)]
272    pub fn res3_ie(&mut self) -> Res3IeW<'_, ResStatusIeSpec> {
273        Res3IeW::new(self, 3)
274    }
275}
276#[doc = "Result Status Interrupt Enable\n\nYou can [`read`](crate::Reg::read) this register and get [`res_status_ie::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`res_status_ie::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
277pub struct ResStatusIeSpec;
278impl crate::RegisterSpec for ResStatusIeSpec {
279    type Ux = u32;
280}
281#[doc = "`read()` method returns [`res_status_ie::R`](R) reader structure"]
282impl crate::Readable for ResStatusIeSpec {}
283#[doc = "`write(|w| ..)` method takes [`res_status_ie::W`](W) writer structure"]
284impl crate::Writable for ResStatusIeSpec {
285    type Safety = crate::Unsafe;
286}
287#[doc = "`reset()` method sets RES_STATUS_IE to value 0"]
288impl crate::Resettable for ResStatusIeSpec {}