max32660/gpio0/
int_en_set.rs

1#[doc = "Register `INT_EN_SET` writer"]
2pub type W = crate::W<INT_EN_SET_SPEC>;
3#[doc = "Interrupt enable set for pin 0.\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum P0_AW {
6    #[doc = "1: Interrupt enabled for pin 0."]
7    ENABLED = 1,
8}
9impl From<P0_AW> for bool {
10    #[inline(always)]
11    fn from(variant: P0_AW) -> Self {
12        variant as u8 != 0
13    }
14}
15#[doc = "Field `p0` writer - Interrupt enable set for pin 0."]
16pub type P0_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P0_AW>;
17impl<'a, REG, const O: u8> P0_W<'a, REG, O>
18where
19    REG: crate::Writable + crate::RegisterSpec,
20{
21    #[doc = "Interrupt enabled for pin 0."]
22    #[inline(always)]
23    pub fn enabled(self) -> &'a mut crate::W<REG> {
24        self.variant(P0_AW::ENABLED)
25    }
26}
27#[doc = "Interrupt enable set for pin 1.\n\nValue on reset: 0"]
28#[derive(Clone, Copy, Debug, PartialEq, Eq)]
29pub enum P1_AW {
30    #[doc = "1: Interrupt enabled for pin 1."]
31    ENABLED = 1,
32}
33impl From<P1_AW> for bool {
34    #[inline(always)]
35    fn from(variant: P1_AW) -> Self {
36        variant as u8 != 0
37    }
38}
39#[doc = "Field `p1` writer - Interrupt enable set for pin 1."]
40pub type P1_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P1_AW>;
41impl<'a, REG, const O: u8> P1_W<'a, REG, O>
42where
43    REG: crate::Writable + crate::RegisterSpec,
44{
45    #[doc = "Interrupt enabled for pin 1."]
46    #[inline(always)]
47    pub fn enabled(self) -> &'a mut crate::W<REG> {
48        self.variant(P1_AW::ENABLED)
49    }
50}
51#[doc = "Interrupt enable set for pin 2.\n\nValue on reset: 0"]
52#[derive(Clone, Copy, Debug, PartialEq, Eq)]
53pub enum P2_AW {
54    #[doc = "1: Interrupt enabled for pin 2."]
55    ENABLED = 1,
56}
57impl From<P2_AW> for bool {
58    #[inline(always)]
59    fn from(variant: P2_AW) -> Self {
60        variant as u8 != 0
61    }
62}
63#[doc = "Field `p2` writer - Interrupt enable set for pin 2."]
64pub type P2_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P2_AW>;
65impl<'a, REG, const O: u8> P2_W<'a, REG, O>
66where
67    REG: crate::Writable + crate::RegisterSpec,
68{
69    #[doc = "Interrupt enabled for pin 2."]
70    #[inline(always)]
71    pub fn enabled(self) -> &'a mut crate::W<REG> {
72        self.variant(P2_AW::ENABLED)
73    }
74}
75#[doc = "Interrupt enable set for pin 3.\n\nValue on reset: 0"]
76#[derive(Clone, Copy, Debug, PartialEq, Eq)]
77pub enum P3_AW {
78    #[doc = "1: Interrupt enabled for pin 3."]
79    ENABLED = 1,
80}
81impl From<P3_AW> for bool {
82    #[inline(always)]
83    fn from(variant: P3_AW) -> Self {
84        variant as u8 != 0
85    }
86}
87#[doc = "Field `p3` writer - Interrupt enable set for pin 3."]
88pub type P3_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P3_AW>;
89impl<'a, REG, const O: u8> P3_W<'a, REG, O>
90where
91    REG: crate::Writable + crate::RegisterSpec,
92{
93    #[doc = "Interrupt enabled for pin 3."]
94    #[inline(always)]
95    pub fn enabled(self) -> &'a mut crate::W<REG> {
96        self.variant(P3_AW::ENABLED)
97    }
98}
99#[doc = "Interrupt enable set for pin 4.\n\nValue on reset: 0"]
100#[derive(Clone, Copy, Debug, PartialEq, Eq)]
101pub enum P4_AW {
102    #[doc = "1: Interrupt enabled for pin 4."]
103    ENABLED = 1,
104}
105impl From<P4_AW> for bool {
106    #[inline(always)]
107    fn from(variant: P4_AW) -> Self {
108        variant as u8 != 0
109    }
110}
111#[doc = "Field `p4` writer - Interrupt enable set for pin 4."]
112pub type P4_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P4_AW>;
113impl<'a, REG, const O: u8> P4_W<'a, REG, O>
114where
115    REG: crate::Writable + crate::RegisterSpec,
116{
117    #[doc = "Interrupt enabled for pin 4."]
118    #[inline(always)]
119    pub fn enabled(self) -> &'a mut crate::W<REG> {
120        self.variant(P4_AW::ENABLED)
121    }
122}
123#[doc = "Interrupt enable set for pin 5.\n\nValue on reset: 0"]
124#[derive(Clone, Copy, Debug, PartialEq, Eq)]
125pub enum P5_AW {
126    #[doc = "1: Interrupt enabled for pin 5."]
127    ENABLED = 1,
128}
129impl From<P5_AW> for bool {
130    #[inline(always)]
131    fn from(variant: P5_AW) -> Self {
132        variant as u8 != 0
133    }
134}
135#[doc = "Field `p5` writer - Interrupt enable set for pin 5."]
136pub type P5_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P5_AW>;
137impl<'a, REG, const O: u8> P5_W<'a, REG, O>
138where
139    REG: crate::Writable + crate::RegisterSpec,
140{
141    #[doc = "Interrupt enabled for pin 5."]
142    #[inline(always)]
143    pub fn enabled(self) -> &'a mut crate::W<REG> {
144        self.variant(P5_AW::ENABLED)
145    }
146}
147#[doc = "Interrupt enable set for pin 6.\n\nValue on reset: 0"]
148#[derive(Clone, Copy, Debug, PartialEq, Eq)]
149pub enum P6_AW {
150    #[doc = "1: Interrupt enabled for pin 6."]
151    ENABLED = 1,
152}
153impl From<P6_AW> for bool {
154    #[inline(always)]
155    fn from(variant: P6_AW) -> Self {
156        variant as u8 != 0
157    }
158}
159#[doc = "Field `p6` writer - Interrupt enable set for pin 6."]
160pub type P6_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P6_AW>;
161impl<'a, REG, const O: u8> P6_W<'a, REG, O>
162where
163    REG: crate::Writable + crate::RegisterSpec,
164{
165    #[doc = "Interrupt enabled for pin 6."]
166    #[inline(always)]
167    pub fn enabled(self) -> &'a mut crate::W<REG> {
168        self.variant(P6_AW::ENABLED)
169    }
170}
171#[doc = "Interrupt enable set for pin 7.\n\nValue on reset: 0"]
172#[derive(Clone, Copy, Debug, PartialEq, Eq)]
173pub enum P7_AW {
174    #[doc = "1: Interrupt enabled for pin 7."]
175    ENABLED = 1,
176}
177impl From<P7_AW> for bool {
178    #[inline(always)]
179    fn from(variant: P7_AW) -> Self {
180        variant as u8 != 0
181    }
182}
183#[doc = "Field `p7` writer - Interrupt enable set for pin 7."]
184pub type P7_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P7_AW>;
185impl<'a, REG, const O: u8> P7_W<'a, REG, O>
186where
187    REG: crate::Writable + crate::RegisterSpec,
188{
189    #[doc = "Interrupt enabled for pin 7."]
190    #[inline(always)]
191    pub fn enabled(self) -> &'a mut crate::W<REG> {
192        self.variant(P7_AW::ENABLED)
193    }
194}
195#[doc = "Interrupt enable set for pin 8.\n\nValue on reset: 0"]
196#[derive(Clone, Copy, Debug, PartialEq, Eq)]
197pub enum P8_AW {
198    #[doc = "1: Interrupt enabled for pin 8."]
199    ENABLED = 1,
200}
201impl From<P8_AW> for bool {
202    #[inline(always)]
203    fn from(variant: P8_AW) -> Self {
204        variant as u8 != 0
205    }
206}
207#[doc = "Field `p8` writer - Interrupt enable set for pin 8."]
208pub type P8_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P8_AW>;
209impl<'a, REG, const O: u8> P8_W<'a, REG, O>
210where
211    REG: crate::Writable + crate::RegisterSpec,
212{
213    #[doc = "Interrupt enabled for pin 8."]
214    #[inline(always)]
215    pub fn enabled(self) -> &'a mut crate::W<REG> {
216        self.variant(P8_AW::ENABLED)
217    }
218}
219#[doc = "Interrupt enable set for pin 9.\n\nValue on reset: 0"]
220#[derive(Clone, Copy, Debug, PartialEq, Eq)]
221pub enum P9_AW {
222    #[doc = "1: Interrupt enabled for pin 9."]
223    ENABLED = 1,
224}
225impl From<P9_AW> for bool {
226    #[inline(always)]
227    fn from(variant: P9_AW) -> Self {
228        variant as u8 != 0
229    }
230}
231#[doc = "Field `p9` writer - Interrupt enable set for pin 9."]
232pub type P9_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P9_AW>;
233impl<'a, REG, const O: u8> P9_W<'a, REG, O>
234where
235    REG: crate::Writable + crate::RegisterSpec,
236{
237    #[doc = "Interrupt enabled for pin 9."]
238    #[inline(always)]
239    pub fn enabled(self) -> &'a mut crate::W<REG> {
240        self.variant(P9_AW::ENABLED)
241    }
242}
243#[doc = "Interrupt enable set for pin 10.\n\nValue on reset: 0"]
244#[derive(Clone, Copy, Debug, PartialEq, Eq)]
245pub enum P10_AW {
246    #[doc = "1: Interrupt enabled for pin 10."]
247    ENABLED = 1,
248}
249impl From<P10_AW> for bool {
250    #[inline(always)]
251    fn from(variant: P10_AW) -> Self {
252        variant as u8 != 0
253    }
254}
255#[doc = "Field `p10` writer - Interrupt enable set for pin 10."]
256pub type P10_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P10_AW>;
257impl<'a, REG, const O: u8> P10_W<'a, REG, O>
258where
259    REG: crate::Writable + crate::RegisterSpec,
260{
261    #[doc = "Interrupt enabled for pin 10."]
262    #[inline(always)]
263    pub fn enabled(self) -> &'a mut crate::W<REG> {
264        self.variant(P10_AW::ENABLED)
265    }
266}
267#[doc = "Interrupt enable set for pin 11.\n\nValue on reset: 0"]
268#[derive(Clone, Copy, Debug, PartialEq, Eq)]
269pub enum P11_AW {
270    #[doc = "1: Interrupt enabled for pin 11."]
271    ENABLED = 1,
272}
273impl From<P11_AW> for bool {
274    #[inline(always)]
275    fn from(variant: P11_AW) -> Self {
276        variant as u8 != 0
277    }
278}
279#[doc = "Field `p11` writer - Interrupt enable set for pin 11."]
280pub type P11_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P11_AW>;
281impl<'a, REG, const O: u8> P11_W<'a, REG, O>
282where
283    REG: crate::Writable + crate::RegisterSpec,
284{
285    #[doc = "Interrupt enabled for pin 11."]
286    #[inline(always)]
287    pub fn enabled(self) -> &'a mut crate::W<REG> {
288        self.variant(P11_AW::ENABLED)
289    }
290}
291#[doc = "Interrupt enable set for pin 12.\n\nValue on reset: 0"]
292#[derive(Clone, Copy, Debug, PartialEq, Eq)]
293pub enum P12_AW {
294    #[doc = "1: Interrupt enabled for pin 12."]
295    ENABLED = 1,
296}
297impl From<P12_AW> for bool {
298    #[inline(always)]
299    fn from(variant: P12_AW) -> Self {
300        variant as u8 != 0
301    }
302}
303#[doc = "Field `p12` writer - Interrupt enable set for pin 12."]
304pub type P12_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P12_AW>;
305impl<'a, REG, const O: u8> P12_W<'a, REG, O>
306where
307    REG: crate::Writable + crate::RegisterSpec,
308{
309    #[doc = "Interrupt enabled for pin 12."]
310    #[inline(always)]
311    pub fn enabled(self) -> &'a mut crate::W<REG> {
312        self.variant(P12_AW::ENABLED)
313    }
314}
315#[doc = "Interrupt enable set for pin 13.\n\nValue on reset: 0"]
316#[derive(Clone, Copy, Debug, PartialEq, Eq)]
317pub enum P13_AW {
318    #[doc = "1: Interrupt enabled for pin 13."]
319    ENABLED = 1,
320}
321impl From<P13_AW> for bool {
322    #[inline(always)]
323    fn from(variant: P13_AW) -> Self {
324        variant as u8 != 0
325    }
326}
327#[doc = "Field `p13` writer - Interrupt enable set for pin 13."]
328pub type P13_W<'a, REG, const O: u8> = crate::BitWriter<'a, REG, O, P13_AW>;
329impl<'a, REG, const O: u8> P13_W<'a, REG, O>
330where
331    REG: crate::Writable + crate::RegisterSpec,
332{
333    #[doc = "Interrupt enabled for pin 13."]
334    #[inline(always)]
335    pub fn enabled(self) -> &'a mut crate::W<REG> {
336        self.variant(P13_AW::ENABLED)
337    }
338}
339impl W {
340    #[doc = "Bit 0 - Interrupt enable set for pin 0."]
341    #[inline(always)]
342    #[must_use]
343    pub fn p0(&mut self) -> P0_W<INT_EN_SET_SPEC, 0> {
344        P0_W::new(self)
345    }
346    #[doc = "Bit 1 - Interrupt enable set for pin 1."]
347    #[inline(always)]
348    #[must_use]
349    pub fn p1(&mut self) -> P1_W<INT_EN_SET_SPEC, 1> {
350        P1_W::new(self)
351    }
352    #[doc = "Bit 2 - Interrupt enable set for pin 2."]
353    #[inline(always)]
354    #[must_use]
355    pub fn p2(&mut self) -> P2_W<INT_EN_SET_SPEC, 2> {
356        P2_W::new(self)
357    }
358    #[doc = "Bit 3 - Interrupt enable set for pin 3."]
359    #[inline(always)]
360    #[must_use]
361    pub fn p3(&mut self) -> P3_W<INT_EN_SET_SPEC, 3> {
362        P3_W::new(self)
363    }
364    #[doc = "Bit 4 - Interrupt enable set for pin 4."]
365    #[inline(always)]
366    #[must_use]
367    pub fn p4(&mut self) -> P4_W<INT_EN_SET_SPEC, 4> {
368        P4_W::new(self)
369    }
370    #[doc = "Bit 5 - Interrupt enable set for pin 5."]
371    #[inline(always)]
372    #[must_use]
373    pub fn p5(&mut self) -> P5_W<INT_EN_SET_SPEC, 5> {
374        P5_W::new(self)
375    }
376    #[doc = "Bit 6 - Interrupt enable set for pin 6."]
377    #[inline(always)]
378    #[must_use]
379    pub fn p6(&mut self) -> P6_W<INT_EN_SET_SPEC, 6> {
380        P6_W::new(self)
381    }
382    #[doc = "Bit 7 - Interrupt enable set for pin 7."]
383    #[inline(always)]
384    #[must_use]
385    pub fn p7(&mut self) -> P7_W<INT_EN_SET_SPEC, 7> {
386        P7_W::new(self)
387    }
388    #[doc = "Bit 8 - Interrupt enable set for pin 8."]
389    #[inline(always)]
390    #[must_use]
391    pub fn p8(&mut self) -> P8_W<INT_EN_SET_SPEC, 8> {
392        P8_W::new(self)
393    }
394    #[doc = "Bit 9 - Interrupt enable set for pin 9."]
395    #[inline(always)]
396    #[must_use]
397    pub fn p9(&mut self) -> P9_W<INT_EN_SET_SPEC, 9> {
398        P9_W::new(self)
399    }
400    #[doc = "Bit 10 - Interrupt enable set for pin 10."]
401    #[inline(always)]
402    #[must_use]
403    pub fn p10(&mut self) -> P10_W<INT_EN_SET_SPEC, 10> {
404        P10_W::new(self)
405    }
406    #[doc = "Bit 11 - Interrupt enable set for pin 11."]
407    #[inline(always)]
408    #[must_use]
409    pub fn p11(&mut self) -> P11_W<INT_EN_SET_SPEC, 11> {
410        P11_W::new(self)
411    }
412    #[doc = "Bit 12 - Interrupt enable set for pin 12."]
413    #[inline(always)]
414    #[must_use]
415    pub fn p12(&mut self) -> P12_W<INT_EN_SET_SPEC, 12> {
416        P12_W::new(self)
417    }
418    #[doc = "Bit 13 - Interrupt enable set for pin 13."]
419    #[inline(always)]
420    #[must_use]
421    pub fn p13(&mut self) -> P13_W<INT_EN_SET_SPEC, 13> {
422        P13_W::new(self)
423    }
424    #[doc = r" Writes raw bits to the register."]
425    #[doc = r""]
426    #[doc = r" # Safety"]
427    #[doc = r""]
428    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
429    #[inline(always)]
430    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
431        self.bits = bits;
432        self
433    }
434}
435#[doc = "Interrupt Enable Set.\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`int_en_set::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
436pub struct INT_EN_SET_SPEC;
437impl crate::RegisterSpec for INT_EN_SET_SPEC {
438    type Ux = u32;
439}
440#[doc = "`write(|w| ..)` method takes [`int_en_set::W`](W) writer structure"]
441impl crate::Writable for INT_EN_SET_SPEC {
442    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
443    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
444}
445#[doc = "`reset()` method sets INT_EN_SET to value 0"]
446impl crate::Resettable for INT_EN_SET_SPEC {
447    const RESET_VALUE: Self::Ux = 0;
448}