efm32pg22_pac/efm32pg22c200/gpio_ns/
if_.rs

1#[doc = "Register `IF` reader"]
2pub struct R(crate::R<IF_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<IF_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<IF_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<IF_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `IF` writer"]
17pub struct W(crate::W<IF_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<IF_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<IF_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<IF_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `EXTIF0` reader - External Pin Flag"]
38pub type EXTIF0_R = crate::BitReader<bool>;
39#[doc = "Field `EXTIF0` writer - External Pin Flag"]
40pub type EXTIF0_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
41#[doc = "Field `EXTIF1` reader - External Pin Flag"]
42pub type EXTIF1_R = crate::BitReader<bool>;
43#[doc = "Field `EXTIF1` writer - External Pin Flag"]
44pub type EXTIF1_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
45#[doc = "Field `EXTIF2` reader - External Pin Flag"]
46pub type EXTIF2_R = crate::BitReader<bool>;
47#[doc = "Field `EXTIF2` writer - External Pin Flag"]
48pub type EXTIF2_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
49#[doc = "Field `EXTIF3` reader - External Pin Flag"]
50pub type EXTIF3_R = crate::BitReader<bool>;
51#[doc = "Field `EXTIF3` writer - External Pin Flag"]
52pub type EXTIF3_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
53#[doc = "Field `EXTIF4` reader - External Pin Flag"]
54pub type EXTIF4_R = crate::BitReader<bool>;
55#[doc = "Field `EXTIF4` writer - External Pin Flag"]
56pub type EXTIF4_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
57#[doc = "Field `EXTIF5` reader - External Pin Flag"]
58pub type EXTIF5_R = crate::BitReader<bool>;
59#[doc = "Field `EXTIF5` writer - External Pin Flag"]
60pub type EXTIF5_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
61#[doc = "Field `EXTIF6` reader - External Pin Flag"]
62pub type EXTIF6_R = crate::BitReader<bool>;
63#[doc = "Field `EXTIF6` writer - External Pin Flag"]
64pub type EXTIF6_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
65#[doc = "Field `EXTIF7` reader - External Pin Flag"]
66pub type EXTIF7_R = crate::BitReader<bool>;
67#[doc = "Field `EXTIF7` writer - External Pin Flag"]
68pub type EXTIF7_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
69#[doc = "Field `EXTIF8` reader - External Pin Flag"]
70pub type EXTIF8_R = crate::BitReader<bool>;
71#[doc = "Field `EXTIF8` writer - External Pin Flag"]
72pub type EXTIF8_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
73#[doc = "Field `EXTIF9` reader - External Pin Flag"]
74pub type EXTIF9_R = crate::BitReader<bool>;
75#[doc = "Field `EXTIF9` writer - External Pin Flag"]
76pub type EXTIF9_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
77#[doc = "Field `EXTIF10` reader - External Pin Flag"]
78pub type EXTIF10_R = crate::BitReader<bool>;
79#[doc = "Field `EXTIF10` writer - External Pin Flag"]
80pub type EXTIF10_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
81#[doc = "Field `EXTIF11` reader - External Pin Flag"]
82pub type EXTIF11_R = crate::BitReader<bool>;
83#[doc = "Field `EXTIF11` writer - External Pin Flag"]
84pub type EXTIF11_W<'a, const O: u8> = crate::BitWriter<'a, u32, IF_SPEC, bool, O>;
85#[doc = "Field `EM4WU` reader - EM4 wake up"]
86pub type EM4WU_R = crate::FieldReader<u16, u16>;
87#[doc = "Field `EM4WU` writer - EM4 wake up"]
88pub type EM4WU_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IF_SPEC, u16, u16, 12, O>;
89impl R {
90    #[doc = "Bit 0 - External Pin Flag"]
91    #[inline(always)]
92    pub fn extif0(&self) -> EXTIF0_R {
93        EXTIF0_R::new((self.bits & 1) != 0)
94    }
95    #[doc = "Bit 1 - External Pin Flag"]
96    #[inline(always)]
97    pub fn extif1(&self) -> EXTIF1_R {
98        EXTIF1_R::new(((self.bits >> 1) & 1) != 0)
99    }
100    #[doc = "Bit 2 - External Pin Flag"]
101    #[inline(always)]
102    pub fn extif2(&self) -> EXTIF2_R {
103        EXTIF2_R::new(((self.bits >> 2) & 1) != 0)
104    }
105    #[doc = "Bit 3 - External Pin Flag"]
106    #[inline(always)]
107    pub fn extif3(&self) -> EXTIF3_R {
108        EXTIF3_R::new(((self.bits >> 3) & 1) != 0)
109    }
110    #[doc = "Bit 4 - External Pin Flag"]
111    #[inline(always)]
112    pub fn extif4(&self) -> EXTIF4_R {
113        EXTIF4_R::new(((self.bits >> 4) & 1) != 0)
114    }
115    #[doc = "Bit 5 - External Pin Flag"]
116    #[inline(always)]
117    pub fn extif5(&self) -> EXTIF5_R {
118        EXTIF5_R::new(((self.bits >> 5) & 1) != 0)
119    }
120    #[doc = "Bit 6 - External Pin Flag"]
121    #[inline(always)]
122    pub fn extif6(&self) -> EXTIF6_R {
123        EXTIF6_R::new(((self.bits >> 6) & 1) != 0)
124    }
125    #[doc = "Bit 7 - External Pin Flag"]
126    #[inline(always)]
127    pub fn extif7(&self) -> EXTIF7_R {
128        EXTIF7_R::new(((self.bits >> 7) & 1) != 0)
129    }
130    #[doc = "Bit 8 - External Pin Flag"]
131    #[inline(always)]
132    pub fn extif8(&self) -> EXTIF8_R {
133        EXTIF8_R::new(((self.bits >> 8) & 1) != 0)
134    }
135    #[doc = "Bit 9 - External Pin Flag"]
136    #[inline(always)]
137    pub fn extif9(&self) -> EXTIF9_R {
138        EXTIF9_R::new(((self.bits >> 9) & 1) != 0)
139    }
140    #[doc = "Bit 10 - External Pin Flag"]
141    #[inline(always)]
142    pub fn extif10(&self) -> EXTIF10_R {
143        EXTIF10_R::new(((self.bits >> 10) & 1) != 0)
144    }
145    #[doc = "Bit 11 - External Pin Flag"]
146    #[inline(always)]
147    pub fn extif11(&self) -> EXTIF11_R {
148        EXTIF11_R::new(((self.bits >> 11) & 1) != 0)
149    }
150    #[doc = "Bits 16:27 - EM4 wake up"]
151    #[inline(always)]
152    pub fn em4wu(&self) -> EM4WU_R {
153        EM4WU_R::new(((self.bits >> 16) & 0x0fff) as u16)
154    }
155}
156impl W {
157    #[doc = "Bit 0 - External Pin Flag"]
158    #[inline(always)]
159    #[must_use]
160    pub fn extif0(&mut self) -> EXTIF0_W<0> {
161        EXTIF0_W::new(self)
162    }
163    #[doc = "Bit 1 - External Pin Flag"]
164    #[inline(always)]
165    #[must_use]
166    pub fn extif1(&mut self) -> EXTIF1_W<1> {
167        EXTIF1_W::new(self)
168    }
169    #[doc = "Bit 2 - External Pin Flag"]
170    #[inline(always)]
171    #[must_use]
172    pub fn extif2(&mut self) -> EXTIF2_W<2> {
173        EXTIF2_W::new(self)
174    }
175    #[doc = "Bit 3 - External Pin Flag"]
176    #[inline(always)]
177    #[must_use]
178    pub fn extif3(&mut self) -> EXTIF3_W<3> {
179        EXTIF3_W::new(self)
180    }
181    #[doc = "Bit 4 - External Pin Flag"]
182    #[inline(always)]
183    #[must_use]
184    pub fn extif4(&mut self) -> EXTIF4_W<4> {
185        EXTIF4_W::new(self)
186    }
187    #[doc = "Bit 5 - External Pin Flag"]
188    #[inline(always)]
189    #[must_use]
190    pub fn extif5(&mut self) -> EXTIF5_W<5> {
191        EXTIF5_W::new(self)
192    }
193    #[doc = "Bit 6 - External Pin Flag"]
194    #[inline(always)]
195    #[must_use]
196    pub fn extif6(&mut self) -> EXTIF6_W<6> {
197        EXTIF6_W::new(self)
198    }
199    #[doc = "Bit 7 - External Pin Flag"]
200    #[inline(always)]
201    #[must_use]
202    pub fn extif7(&mut self) -> EXTIF7_W<7> {
203        EXTIF7_W::new(self)
204    }
205    #[doc = "Bit 8 - External Pin Flag"]
206    #[inline(always)]
207    #[must_use]
208    pub fn extif8(&mut self) -> EXTIF8_W<8> {
209        EXTIF8_W::new(self)
210    }
211    #[doc = "Bit 9 - External Pin Flag"]
212    #[inline(always)]
213    #[must_use]
214    pub fn extif9(&mut self) -> EXTIF9_W<9> {
215        EXTIF9_W::new(self)
216    }
217    #[doc = "Bit 10 - External Pin Flag"]
218    #[inline(always)]
219    #[must_use]
220    pub fn extif10(&mut self) -> EXTIF10_W<10> {
221        EXTIF10_W::new(self)
222    }
223    #[doc = "Bit 11 - External Pin Flag"]
224    #[inline(always)]
225    #[must_use]
226    pub fn extif11(&mut self) -> EXTIF11_W<11> {
227        EXTIF11_W::new(self)
228    }
229    #[doc = "Bits 16:27 - EM4 wake up"]
230    #[inline(always)]
231    #[must_use]
232    pub fn em4wu(&mut self) -> EM4WU_W<16> {
233        EM4WU_W::new(self)
234    }
235    #[doc = "Writes raw bits to the register."]
236    #[inline(always)]
237    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
238        self.0.bits(bits);
239        self
240    }
241}
242#[doc = "Interrupt Flag\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 [if_](index.html) module"]
243pub struct IF_SPEC;
244impl crate::RegisterSpec for IF_SPEC {
245    type Ux = u32;
246}
247#[doc = "`read()` method returns [if_::R](R) reader structure"]
248impl crate::Readable for IF_SPEC {
249    type Reader = R;
250}
251#[doc = "`write(|w| ..)` method takes [if_::W](W) writer structure"]
252impl crate::Writable for IF_SPEC {
253    type Writer = W;
254    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
255    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
256}
257#[doc = "`reset()` method sets IF to value 0"]
258impl crate::Resettable for IF_SPEC {
259    const RESET_VALUE: Self::Ux = 0;
260}