efm32pg22_pac/efm32pg22c200/gpio_ns/
extipinselh.rs

1#[doc = "Register `EXTIPINSELH` reader"]
2pub struct R(crate::R<EXTIPINSELH_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<EXTIPINSELH_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<EXTIPINSELH_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<EXTIPINSELH_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `EXTIPINSELH` writer"]
17pub struct W(crate::W<EXTIPINSELH_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<EXTIPINSELH_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<EXTIPINSELH_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<EXTIPINSELH_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `EXTIPINSEL0` reader - External Interrupt Pin select"]
38pub type EXTIPINSEL0_R = crate::FieldReader<u8, EXTIPINSEL0_A>;
39#[doc = "External Interrupt Pin select\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum EXTIPINSEL0_A {
43    #[doc = "0: OFFSET=8"]
44    OFFSET8 = 0,
45    #[doc = "1: OFFSET=9"]
46    OFFSET9 = 1,
47    #[doc = "2: OFFSET=10"]
48    OFFSET10 = 2,
49    #[doc = "3: OFFSET=11"]
50    OFFSET11 = 3,
51}
52impl From<EXTIPINSEL0_A> for u8 {
53    #[inline(always)]
54    fn from(variant: EXTIPINSEL0_A) -> Self {
55        variant as _
56    }
57}
58impl EXTIPINSEL0_R {
59    #[doc = "Get enumerated values variant"]
60    #[inline(always)]
61    pub fn variant(&self) -> EXTIPINSEL0_A {
62        match self.bits {
63            0 => EXTIPINSEL0_A::OFFSET8,
64            1 => EXTIPINSEL0_A::OFFSET9,
65            2 => EXTIPINSEL0_A::OFFSET10,
66            3 => EXTIPINSEL0_A::OFFSET11,
67            _ => unreachable!(),
68        }
69    }
70    #[doc = "Checks if the value of the field is `OFFSET8`"]
71    #[inline(always)]
72    pub fn is_offset8(&self) -> bool {
73        *self == EXTIPINSEL0_A::OFFSET8
74    }
75    #[doc = "Checks if the value of the field is `OFFSET9`"]
76    #[inline(always)]
77    pub fn is_offset9(&self) -> bool {
78        *self == EXTIPINSEL0_A::OFFSET9
79    }
80    #[doc = "Checks if the value of the field is `OFFSET10`"]
81    #[inline(always)]
82    pub fn is_offset10(&self) -> bool {
83        *self == EXTIPINSEL0_A::OFFSET10
84    }
85    #[doc = "Checks if the value of the field is `OFFSET11`"]
86    #[inline(always)]
87    pub fn is_offset11(&self) -> bool {
88        *self == EXTIPINSEL0_A::OFFSET11
89    }
90}
91#[doc = "Field `EXTIPINSEL0` writer - External Interrupt Pin select"]
92pub type EXTIPINSEL0_W<'a, const O: u8> =
93    crate::FieldWriterSafe<'a, u32, EXTIPINSELH_SPEC, u8, EXTIPINSEL0_A, 2, O>;
94impl<'a, const O: u8> EXTIPINSEL0_W<'a, O> {
95    #[doc = "OFFSET=8"]
96    #[inline(always)]
97    pub fn offset8(self) -> &'a mut W {
98        self.variant(EXTIPINSEL0_A::OFFSET8)
99    }
100    #[doc = "OFFSET=9"]
101    #[inline(always)]
102    pub fn offset9(self) -> &'a mut W {
103        self.variant(EXTIPINSEL0_A::OFFSET9)
104    }
105    #[doc = "OFFSET=10"]
106    #[inline(always)]
107    pub fn offset10(self) -> &'a mut W {
108        self.variant(EXTIPINSEL0_A::OFFSET10)
109    }
110    #[doc = "OFFSET=11"]
111    #[inline(always)]
112    pub fn offset11(self) -> &'a mut W {
113        self.variant(EXTIPINSEL0_A::OFFSET11)
114    }
115}
116#[doc = "Field `EXTIPINSEL1` reader - External Interrupt Pin select"]
117pub type EXTIPINSEL1_R = crate::FieldReader<u8, EXTIPINSEL1_A>;
118#[doc = "External Interrupt Pin select\n\nValue on reset: 0"]
119#[derive(Clone, Copy, Debug, PartialEq, Eq)]
120#[repr(u8)]
121pub enum EXTIPINSEL1_A {
122    #[doc = "0: OFFSET=8"]
123    OFFSET8 = 0,
124    #[doc = "1: OFFSET=9"]
125    OFFSET9 = 1,
126    #[doc = "2: OFFSET=10"]
127    OFFSET10 = 2,
128    #[doc = "3: OFFSET=11"]
129    OFFSET11 = 3,
130}
131impl From<EXTIPINSEL1_A> for u8 {
132    #[inline(always)]
133    fn from(variant: EXTIPINSEL1_A) -> Self {
134        variant as _
135    }
136}
137impl EXTIPINSEL1_R {
138    #[doc = "Get enumerated values variant"]
139    #[inline(always)]
140    pub fn variant(&self) -> EXTIPINSEL1_A {
141        match self.bits {
142            0 => EXTIPINSEL1_A::OFFSET8,
143            1 => EXTIPINSEL1_A::OFFSET9,
144            2 => EXTIPINSEL1_A::OFFSET10,
145            3 => EXTIPINSEL1_A::OFFSET11,
146            _ => unreachable!(),
147        }
148    }
149    #[doc = "Checks if the value of the field is `OFFSET8`"]
150    #[inline(always)]
151    pub fn is_offset8(&self) -> bool {
152        *self == EXTIPINSEL1_A::OFFSET8
153    }
154    #[doc = "Checks if the value of the field is `OFFSET9`"]
155    #[inline(always)]
156    pub fn is_offset9(&self) -> bool {
157        *self == EXTIPINSEL1_A::OFFSET9
158    }
159    #[doc = "Checks if the value of the field is `OFFSET10`"]
160    #[inline(always)]
161    pub fn is_offset10(&self) -> bool {
162        *self == EXTIPINSEL1_A::OFFSET10
163    }
164    #[doc = "Checks if the value of the field is `OFFSET11`"]
165    #[inline(always)]
166    pub fn is_offset11(&self) -> bool {
167        *self == EXTIPINSEL1_A::OFFSET11
168    }
169}
170#[doc = "Field `EXTIPINSEL1` writer - External Interrupt Pin select"]
171pub type EXTIPINSEL1_W<'a, const O: u8> =
172    crate::FieldWriterSafe<'a, u32, EXTIPINSELH_SPEC, u8, EXTIPINSEL1_A, 2, O>;
173impl<'a, const O: u8> EXTIPINSEL1_W<'a, O> {
174    #[doc = "OFFSET=8"]
175    #[inline(always)]
176    pub fn offset8(self) -> &'a mut W {
177        self.variant(EXTIPINSEL1_A::OFFSET8)
178    }
179    #[doc = "OFFSET=9"]
180    #[inline(always)]
181    pub fn offset9(self) -> &'a mut W {
182        self.variant(EXTIPINSEL1_A::OFFSET9)
183    }
184    #[doc = "OFFSET=10"]
185    #[inline(always)]
186    pub fn offset10(self) -> &'a mut W {
187        self.variant(EXTIPINSEL1_A::OFFSET10)
188    }
189    #[doc = "OFFSET=11"]
190    #[inline(always)]
191    pub fn offset11(self) -> &'a mut W {
192        self.variant(EXTIPINSEL1_A::OFFSET11)
193    }
194}
195#[doc = "Field `EXTIPINSEL2` reader - External Interrupt Pin select"]
196pub type EXTIPINSEL2_R = crate::FieldReader<u8, EXTIPINSEL2_A>;
197#[doc = "External Interrupt Pin select\n\nValue on reset: 0"]
198#[derive(Clone, Copy, Debug, PartialEq, Eq)]
199#[repr(u8)]
200pub enum EXTIPINSEL2_A {
201    #[doc = "0: OFFSET=8"]
202    OFFSET8 = 0,
203    #[doc = "1: OFFSET=9"]
204    OFFSET9 = 1,
205    #[doc = "2: OFFSET=10"]
206    OFFSET10 = 2,
207    #[doc = "3: OFFSET=11"]
208    OFFSET11 = 3,
209}
210impl From<EXTIPINSEL2_A> for u8 {
211    #[inline(always)]
212    fn from(variant: EXTIPINSEL2_A) -> Self {
213        variant as _
214    }
215}
216impl EXTIPINSEL2_R {
217    #[doc = "Get enumerated values variant"]
218    #[inline(always)]
219    pub fn variant(&self) -> EXTIPINSEL2_A {
220        match self.bits {
221            0 => EXTIPINSEL2_A::OFFSET8,
222            1 => EXTIPINSEL2_A::OFFSET9,
223            2 => EXTIPINSEL2_A::OFFSET10,
224            3 => EXTIPINSEL2_A::OFFSET11,
225            _ => unreachable!(),
226        }
227    }
228    #[doc = "Checks if the value of the field is `OFFSET8`"]
229    #[inline(always)]
230    pub fn is_offset8(&self) -> bool {
231        *self == EXTIPINSEL2_A::OFFSET8
232    }
233    #[doc = "Checks if the value of the field is `OFFSET9`"]
234    #[inline(always)]
235    pub fn is_offset9(&self) -> bool {
236        *self == EXTIPINSEL2_A::OFFSET9
237    }
238    #[doc = "Checks if the value of the field is `OFFSET10`"]
239    #[inline(always)]
240    pub fn is_offset10(&self) -> bool {
241        *self == EXTIPINSEL2_A::OFFSET10
242    }
243    #[doc = "Checks if the value of the field is `OFFSET11`"]
244    #[inline(always)]
245    pub fn is_offset11(&self) -> bool {
246        *self == EXTIPINSEL2_A::OFFSET11
247    }
248}
249#[doc = "Field `EXTIPINSEL2` writer - External Interrupt Pin select"]
250pub type EXTIPINSEL2_W<'a, const O: u8> =
251    crate::FieldWriterSafe<'a, u32, EXTIPINSELH_SPEC, u8, EXTIPINSEL2_A, 2, O>;
252impl<'a, const O: u8> EXTIPINSEL2_W<'a, O> {
253    #[doc = "OFFSET=8"]
254    #[inline(always)]
255    pub fn offset8(self) -> &'a mut W {
256        self.variant(EXTIPINSEL2_A::OFFSET8)
257    }
258    #[doc = "OFFSET=9"]
259    #[inline(always)]
260    pub fn offset9(self) -> &'a mut W {
261        self.variant(EXTIPINSEL2_A::OFFSET9)
262    }
263    #[doc = "OFFSET=10"]
264    #[inline(always)]
265    pub fn offset10(self) -> &'a mut W {
266        self.variant(EXTIPINSEL2_A::OFFSET10)
267    }
268    #[doc = "OFFSET=11"]
269    #[inline(always)]
270    pub fn offset11(self) -> &'a mut W {
271        self.variant(EXTIPINSEL2_A::OFFSET11)
272    }
273}
274#[doc = "Field `EXTIPINSEL3` reader - External Interrupt Pin select"]
275pub type EXTIPINSEL3_R = crate::FieldReader<u8, EXTIPINSEL3_A>;
276#[doc = "External Interrupt Pin select\n\nValue on reset: 0"]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278#[repr(u8)]
279pub enum EXTIPINSEL3_A {
280    #[doc = "0: OFFSET=8"]
281    OFFSET8 = 0,
282    #[doc = "1: OFFSET=9"]
283    OFFSET9 = 1,
284    #[doc = "2: OFFSET=10"]
285    OFFSET10 = 2,
286    #[doc = "3: OFFSET=11"]
287    OFFSET11 = 3,
288}
289impl From<EXTIPINSEL3_A> for u8 {
290    #[inline(always)]
291    fn from(variant: EXTIPINSEL3_A) -> Self {
292        variant as _
293    }
294}
295impl EXTIPINSEL3_R {
296    #[doc = "Get enumerated values variant"]
297    #[inline(always)]
298    pub fn variant(&self) -> EXTIPINSEL3_A {
299        match self.bits {
300            0 => EXTIPINSEL3_A::OFFSET8,
301            1 => EXTIPINSEL3_A::OFFSET9,
302            2 => EXTIPINSEL3_A::OFFSET10,
303            3 => EXTIPINSEL3_A::OFFSET11,
304            _ => unreachable!(),
305        }
306    }
307    #[doc = "Checks if the value of the field is `OFFSET8`"]
308    #[inline(always)]
309    pub fn is_offset8(&self) -> bool {
310        *self == EXTIPINSEL3_A::OFFSET8
311    }
312    #[doc = "Checks if the value of the field is `OFFSET9`"]
313    #[inline(always)]
314    pub fn is_offset9(&self) -> bool {
315        *self == EXTIPINSEL3_A::OFFSET9
316    }
317    #[doc = "Checks if the value of the field is `OFFSET10`"]
318    #[inline(always)]
319    pub fn is_offset10(&self) -> bool {
320        *self == EXTIPINSEL3_A::OFFSET10
321    }
322    #[doc = "Checks if the value of the field is `OFFSET11`"]
323    #[inline(always)]
324    pub fn is_offset11(&self) -> bool {
325        *self == EXTIPINSEL3_A::OFFSET11
326    }
327}
328#[doc = "Field `EXTIPINSEL3` writer - External Interrupt Pin select"]
329pub type EXTIPINSEL3_W<'a, const O: u8> =
330    crate::FieldWriterSafe<'a, u32, EXTIPINSELH_SPEC, u8, EXTIPINSEL3_A, 2, O>;
331impl<'a, const O: u8> EXTIPINSEL3_W<'a, O> {
332    #[doc = "OFFSET=8"]
333    #[inline(always)]
334    pub fn offset8(self) -> &'a mut W {
335        self.variant(EXTIPINSEL3_A::OFFSET8)
336    }
337    #[doc = "OFFSET=9"]
338    #[inline(always)]
339    pub fn offset9(self) -> &'a mut W {
340        self.variant(EXTIPINSEL3_A::OFFSET9)
341    }
342    #[doc = "OFFSET=10"]
343    #[inline(always)]
344    pub fn offset10(self) -> &'a mut W {
345        self.variant(EXTIPINSEL3_A::OFFSET10)
346    }
347    #[doc = "OFFSET=11"]
348    #[inline(always)]
349    pub fn offset11(self) -> &'a mut W {
350        self.variant(EXTIPINSEL3_A::OFFSET11)
351    }
352}
353impl R {
354    #[doc = "Bits 0:1 - External Interrupt Pin select"]
355    #[inline(always)]
356    pub fn extipinsel0(&self) -> EXTIPINSEL0_R {
357        EXTIPINSEL0_R::new((self.bits & 3) as u8)
358    }
359    #[doc = "Bits 4:5 - External Interrupt Pin select"]
360    #[inline(always)]
361    pub fn extipinsel1(&self) -> EXTIPINSEL1_R {
362        EXTIPINSEL1_R::new(((self.bits >> 4) & 3) as u8)
363    }
364    #[doc = "Bits 8:9 - External Interrupt Pin select"]
365    #[inline(always)]
366    pub fn extipinsel2(&self) -> EXTIPINSEL2_R {
367        EXTIPINSEL2_R::new(((self.bits >> 8) & 3) as u8)
368    }
369    #[doc = "Bits 12:13 - External Interrupt Pin select"]
370    #[inline(always)]
371    pub fn extipinsel3(&self) -> EXTIPINSEL3_R {
372        EXTIPINSEL3_R::new(((self.bits >> 12) & 3) as u8)
373    }
374}
375impl W {
376    #[doc = "Bits 0:1 - External Interrupt Pin select"]
377    #[inline(always)]
378    #[must_use]
379    pub fn extipinsel0(&mut self) -> EXTIPINSEL0_W<0> {
380        EXTIPINSEL0_W::new(self)
381    }
382    #[doc = "Bits 4:5 - External Interrupt Pin select"]
383    #[inline(always)]
384    #[must_use]
385    pub fn extipinsel1(&mut self) -> EXTIPINSEL1_W<4> {
386        EXTIPINSEL1_W::new(self)
387    }
388    #[doc = "Bits 8:9 - External Interrupt Pin select"]
389    #[inline(always)]
390    #[must_use]
391    pub fn extipinsel2(&mut self) -> EXTIPINSEL2_W<8> {
392        EXTIPINSEL2_W::new(self)
393    }
394    #[doc = "Bits 12:13 - External Interrupt Pin select"]
395    #[inline(always)]
396    #[must_use]
397    pub fn extipinsel3(&mut self) -> EXTIPINSEL3_W<12> {
398        EXTIPINSEL3_W::new(self)
399    }
400    #[doc = "Writes raw bits to the register."]
401    #[inline(always)]
402    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
403        self.0.bits(bits);
404        self
405    }
406}
407#[doc = "External Interrupt Pin Select High\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [extipinselh](index.html) module"]
408pub struct EXTIPINSELH_SPEC;
409impl crate::RegisterSpec for EXTIPINSELH_SPEC {
410    type Ux = u32;
411}
412#[doc = "`read()` method returns [extipinselh::R](R) reader structure"]
413impl crate::Readable for EXTIPINSELH_SPEC {
414    type Reader = R;
415}
416#[doc = "`write(|w| ..)` method takes [extipinselh::W](W) writer structure"]
417impl crate::Writable for EXTIPINSELH_SPEC {
418    type Writer = W;
419    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
420    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
421}
422#[doc = "`reset()` method sets EXTIPINSELH to value 0"]
423impl crate::Resettable for EXTIPINSELH_SPEC {
424    const RESET_VALUE: Self::Ux = 0;
425}