swm341_pac/gpioa/
intstat.rs

1#[doc = "Register `INTSTAT` reader"]
2pub struct R(crate::R<INTSTAT_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTSTAT_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTSTAT_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTSTAT_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTSTAT` writer"]
17pub struct W(crate::W<INTSTAT_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTSTAT_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<INTSTAT_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTSTAT_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `PIN0` reader - PIN0 field"]
38pub type PIN0_R = crate::BitReader<bool>;
39#[doc = "Field `PIN0` writer - PIN0 field"]
40pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
41#[doc = "Field `PIN1` reader - PIN1 field"]
42pub type PIN1_R = crate::BitReader<bool>;
43#[doc = "Field `PIN1` writer - PIN1 field"]
44pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
45#[doc = "Field `PIN2` reader - PIN2 field"]
46pub type PIN2_R = crate::BitReader<bool>;
47#[doc = "Field `PIN2` writer - PIN2 field"]
48pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
49#[doc = "Field `PIN3` reader - PIN3 field"]
50pub type PIN3_R = crate::BitReader<bool>;
51#[doc = "Field `PIN3` writer - PIN3 field"]
52pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
53#[doc = "Field `PIN4` reader - PIN4 field"]
54pub type PIN4_R = crate::BitReader<bool>;
55#[doc = "Field `PIN4` writer - PIN4 field"]
56pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
57#[doc = "Field `PIN5` reader - PIN5 field"]
58pub type PIN5_R = crate::BitReader<bool>;
59#[doc = "Field `PIN5` writer - PIN5 field"]
60pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
61#[doc = "Field `PIN6` reader - PIN6 field"]
62pub type PIN6_R = crate::BitReader<bool>;
63#[doc = "Field `PIN6` writer - PIN6 field"]
64pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
65#[doc = "Field `PIN7` reader - PIN7 field"]
66pub type PIN7_R = crate::BitReader<bool>;
67#[doc = "Field `PIN7` writer - PIN7 field"]
68pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
69#[doc = "Field `PIN8` reader - PIN8 field"]
70pub type PIN8_R = crate::BitReader<bool>;
71#[doc = "Field `PIN8` writer - PIN8 field"]
72pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
73#[doc = "Field `PIN9` reader - PIN9 field"]
74pub type PIN9_R = crate::BitReader<bool>;
75#[doc = "Field `PIN9` writer - PIN9 field"]
76pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
77#[doc = "Field `PIN10` reader - PIN10 field"]
78pub type PIN10_R = crate::BitReader<bool>;
79#[doc = "Field `PIN10` writer - PIN10 field"]
80pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
81#[doc = "Field `PIN11` reader - PIN11 field"]
82pub type PIN11_R = crate::BitReader<bool>;
83#[doc = "Field `PIN11` writer - PIN11 field"]
84pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
85#[doc = "Field `PIN12` reader - PIN12 field"]
86pub type PIN12_R = crate::BitReader<bool>;
87#[doc = "Field `PIN12` writer - PIN12 field"]
88pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
89#[doc = "Field `PIN13` reader - PIN13 field"]
90pub type PIN13_R = crate::BitReader<bool>;
91#[doc = "Field `PIN13` writer - PIN13 field"]
92pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
93#[doc = "Field `PIN14` reader - PIN14 field"]
94pub type PIN14_R = crate::BitReader<bool>;
95#[doc = "Field `PIN14` writer - PIN14 field"]
96pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
97#[doc = "Field `PIN15` reader - PIN15 field"]
98pub type PIN15_R = crate::BitReader<bool>;
99#[doc = "Field `PIN15` writer - PIN15 field"]
100pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTSTAT_SPEC, bool, O>;
101impl R {
102    #[doc = "Bit 0 - PIN0 field"]
103    #[inline(always)]
104    pub fn pin0(&self) -> PIN0_R {
105        PIN0_R::new((self.bits & 1) != 0)
106    }
107    #[doc = "Bit 1 - PIN1 field"]
108    #[inline(always)]
109    pub fn pin1(&self) -> PIN1_R {
110        PIN1_R::new(((self.bits >> 1) & 1) != 0)
111    }
112    #[doc = "Bit 2 - PIN2 field"]
113    #[inline(always)]
114    pub fn pin2(&self) -> PIN2_R {
115        PIN2_R::new(((self.bits >> 2) & 1) != 0)
116    }
117    #[doc = "Bit 3 - PIN3 field"]
118    #[inline(always)]
119    pub fn pin3(&self) -> PIN3_R {
120        PIN3_R::new(((self.bits >> 3) & 1) != 0)
121    }
122    #[doc = "Bit 4 - PIN4 field"]
123    #[inline(always)]
124    pub fn pin4(&self) -> PIN4_R {
125        PIN4_R::new(((self.bits >> 4) & 1) != 0)
126    }
127    #[doc = "Bit 5 - PIN5 field"]
128    #[inline(always)]
129    pub fn pin5(&self) -> PIN5_R {
130        PIN5_R::new(((self.bits >> 5) & 1) != 0)
131    }
132    #[doc = "Bit 6 - PIN6 field"]
133    #[inline(always)]
134    pub fn pin6(&self) -> PIN6_R {
135        PIN6_R::new(((self.bits >> 6) & 1) != 0)
136    }
137    #[doc = "Bit 7 - PIN7 field"]
138    #[inline(always)]
139    pub fn pin7(&self) -> PIN7_R {
140        PIN7_R::new(((self.bits >> 7) & 1) != 0)
141    }
142    #[doc = "Bit 8 - PIN8 field"]
143    #[inline(always)]
144    pub fn pin8(&self) -> PIN8_R {
145        PIN8_R::new(((self.bits >> 8) & 1) != 0)
146    }
147    #[doc = "Bit 9 - PIN9 field"]
148    #[inline(always)]
149    pub fn pin9(&self) -> PIN9_R {
150        PIN9_R::new(((self.bits >> 9) & 1) != 0)
151    }
152    #[doc = "Bit 10 - PIN10 field"]
153    #[inline(always)]
154    pub fn pin10(&self) -> PIN10_R {
155        PIN10_R::new(((self.bits >> 10) & 1) != 0)
156    }
157    #[doc = "Bit 11 - PIN11 field"]
158    #[inline(always)]
159    pub fn pin11(&self) -> PIN11_R {
160        PIN11_R::new(((self.bits >> 11) & 1) != 0)
161    }
162    #[doc = "Bit 12 - PIN12 field"]
163    #[inline(always)]
164    pub fn pin12(&self) -> PIN12_R {
165        PIN12_R::new(((self.bits >> 12) & 1) != 0)
166    }
167    #[doc = "Bit 13 - PIN13 field"]
168    #[inline(always)]
169    pub fn pin13(&self) -> PIN13_R {
170        PIN13_R::new(((self.bits >> 13) & 1) != 0)
171    }
172    #[doc = "Bit 14 - PIN14 field"]
173    #[inline(always)]
174    pub fn pin14(&self) -> PIN14_R {
175        PIN14_R::new(((self.bits >> 14) & 1) != 0)
176    }
177    #[doc = "Bit 15 - PIN15 field"]
178    #[inline(always)]
179    pub fn pin15(&self) -> PIN15_R {
180        PIN15_R::new(((self.bits >> 15) & 1) != 0)
181    }
182}
183impl W {
184    #[doc = "Bit 0 - PIN0 field"]
185    #[inline(always)]
186    pub fn pin0(&mut self) -> PIN0_W<0> {
187        PIN0_W::new(self)
188    }
189    #[doc = "Bit 1 - PIN1 field"]
190    #[inline(always)]
191    pub fn pin1(&mut self) -> PIN1_W<1> {
192        PIN1_W::new(self)
193    }
194    #[doc = "Bit 2 - PIN2 field"]
195    #[inline(always)]
196    pub fn pin2(&mut self) -> PIN2_W<2> {
197        PIN2_W::new(self)
198    }
199    #[doc = "Bit 3 - PIN3 field"]
200    #[inline(always)]
201    pub fn pin3(&mut self) -> PIN3_W<3> {
202        PIN3_W::new(self)
203    }
204    #[doc = "Bit 4 - PIN4 field"]
205    #[inline(always)]
206    pub fn pin4(&mut self) -> PIN4_W<4> {
207        PIN4_W::new(self)
208    }
209    #[doc = "Bit 5 - PIN5 field"]
210    #[inline(always)]
211    pub fn pin5(&mut self) -> PIN5_W<5> {
212        PIN5_W::new(self)
213    }
214    #[doc = "Bit 6 - PIN6 field"]
215    #[inline(always)]
216    pub fn pin6(&mut self) -> PIN6_W<6> {
217        PIN6_W::new(self)
218    }
219    #[doc = "Bit 7 - PIN7 field"]
220    #[inline(always)]
221    pub fn pin7(&mut self) -> PIN7_W<7> {
222        PIN7_W::new(self)
223    }
224    #[doc = "Bit 8 - PIN8 field"]
225    #[inline(always)]
226    pub fn pin8(&mut self) -> PIN8_W<8> {
227        PIN8_W::new(self)
228    }
229    #[doc = "Bit 9 - PIN9 field"]
230    #[inline(always)]
231    pub fn pin9(&mut self) -> PIN9_W<9> {
232        PIN9_W::new(self)
233    }
234    #[doc = "Bit 10 - PIN10 field"]
235    #[inline(always)]
236    pub fn pin10(&mut self) -> PIN10_W<10> {
237        PIN10_W::new(self)
238    }
239    #[doc = "Bit 11 - PIN11 field"]
240    #[inline(always)]
241    pub fn pin11(&mut self) -> PIN11_W<11> {
242        PIN11_W::new(self)
243    }
244    #[doc = "Bit 12 - PIN12 field"]
245    #[inline(always)]
246    pub fn pin12(&mut self) -> PIN12_W<12> {
247        PIN12_W::new(self)
248    }
249    #[doc = "Bit 13 - PIN13 field"]
250    #[inline(always)]
251    pub fn pin13(&mut self) -> PIN13_W<13> {
252        PIN13_W::new(self)
253    }
254    #[doc = "Bit 14 - PIN14 field"]
255    #[inline(always)]
256    pub fn pin14(&mut self) -> PIN14_W<14> {
257        PIN14_W::new(self)
258    }
259    #[doc = "Bit 15 - PIN15 field"]
260    #[inline(always)]
261    pub fn pin15(&mut self) -> PIN15_W<15> {
262        PIN15_W::new(self)
263    }
264    #[doc = "Writes raw bits to the register."]
265    #[inline(always)]
266    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
267        self.0.bits(bits);
268        self
269    }
270}
271#[doc = "INTSTAT register\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 [intstat](index.html) module"]
272pub struct INTSTAT_SPEC;
273impl crate::RegisterSpec for INTSTAT_SPEC {
274    type Ux = u32;
275}
276#[doc = "`read()` method returns [intstat::R](R) reader structure"]
277impl crate::Readable for INTSTAT_SPEC {
278    type Reader = R;
279}
280#[doc = "`write(|w| ..)` method takes [intstat::W](W) writer structure"]
281impl crate::Writable for INTSTAT_SPEC {
282    type Writer = W;
283}
284#[doc = "`reset()` method sets INTSTAT to value 0"]
285impl crate::Resettable for INTSTAT_SPEC {
286    #[inline(always)]
287    fn reset_value() -> Self::Ux {
288        0
289    }
290}