stm32f0/stm32f0x2/exti/
swier.rs

1///Register `SWIER` reader
2pub type R = crate::R<SWIERrs>;
3///Register `SWIER` writer
4pub type W = crate::W<SWIERrs>;
5/**Software Interrupt on line 0
6
7Value on reset: 0*/
8#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum SOFTWARE_INTERRUPT {
11    ///1: Generates an interrupt request
12    Pend = 1,
13}
14impl From<SOFTWARE_INTERRUPT> for bool {
15    #[inline(always)]
16    fn from(variant: SOFTWARE_INTERRUPT) -> Self {
17        variant as u8 != 0
18    }
19}
20///Field `SWIER0` reader - Software Interrupt on line 0
21pub type SWIER0_R = crate::BitReader<SOFTWARE_INTERRUPT>;
22impl SWIER0_R {
23    ///Get enumerated values variant
24    #[inline(always)]
25    pub const fn variant(&self) -> Option<SOFTWARE_INTERRUPT> {
26        match self.bits {
27            true => Some(SOFTWARE_INTERRUPT::Pend),
28            _ => None,
29        }
30    }
31    ///Generates an interrupt request
32    #[inline(always)]
33    pub fn is_pend(&self) -> bool {
34        *self == SOFTWARE_INTERRUPT::Pend
35    }
36}
37///Field `SWIER0` writer - Software Interrupt on line 0
38pub type SWIER0_W<'a, REG> = crate::BitWriter<'a, REG, SOFTWARE_INTERRUPT>;
39impl<'a, REG> SWIER0_W<'a, REG>
40where
41    REG: crate::Writable + crate::RegisterSpec,
42{
43    ///Generates an interrupt request
44    #[inline(always)]
45    pub fn pend(self) -> &'a mut crate::W<REG> {
46        self.variant(SOFTWARE_INTERRUPT::Pend)
47    }
48}
49///Field `SWIER1` reader - Software Interrupt on line 1
50pub use SWIER0_R as SWIER1_R;
51///Field `SWIER2` reader - Software Interrupt on line 2
52pub use SWIER0_R as SWIER2_R;
53///Field `SWIER3` reader - Software Interrupt on line 3
54pub use SWIER0_R as SWIER3_R;
55///Field `SWIER4` reader - Software Interrupt on line 4
56pub use SWIER0_R as SWIER4_R;
57///Field `SWIER5` reader - Software Interrupt on line 5
58pub use SWIER0_R as SWIER5_R;
59///Field `SWIER6` reader - Software Interrupt on line 6
60pub use SWIER0_R as SWIER6_R;
61///Field `SWIER7` reader - Software Interrupt on line 7
62pub use SWIER0_R as SWIER7_R;
63///Field `SWIER8` reader - Software Interrupt on line 8
64pub use SWIER0_R as SWIER8_R;
65///Field `SWIER9` reader - Software Interrupt on line 9
66pub use SWIER0_R as SWIER9_R;
67///Field `SWIER10` reader - Software Interrupt on line 10
68pub use SWIER0_R as SWIER10_R;
69///Field `SWIER11` reader - Software Interrupt on line 11
70pub use SWIER0_R as SWIER11_R;
71///Field `SWIER12` reader - Software Interrupt on line 12
72pub use SWIER0_R as SWIER12_R;
73///Field `SWIER13` reader - Software Interrupt on line 13
74pub use SWIER0_R as SWIER13_R;
75///Field `SWIER14` reader - Software Interrupt on line 14
76pub use SWIER0_R as SWIER14_R;
77///Field `SWIER15` reader - Software Interrupt on line 15
78pub use SWIER0_R as SWIER15_R;
79///Field `SWIER16` reader - Software Interrupt on line 16
80pub use SWIER0_R as SWIER16_R;
81///Field `SWIER17` reader - Software Interrupt on line 17
82pub use SWIER0_R as SWIER17_R;
83///Field `SWIER19` reader - Software Interrupt on line 19
84pub use SWIER0_R as SWIER19_R;
85///Field `SWIER1` writer - Software Interrupt on line 1
86pub use SWIER0_W as SWIER1_W;
87///Field `SWIER2` writer - Software Interrupt on line 2
88pub use SWIER0_W as SWIER2_W;
89///Field `SWIER3` writer - Software Interrupt on line 3
90pub use SWIER0_W as SWIER3_W;
91///Field `SWIER4` writer - Software Interrupt on line 4
92pub use SWIER0_W as SWIER4_W;
93///Field `SWIER5` writer - Software Interrupt on line 5
94pub use SWIER0_W as SWIER5_W;
95///Field `SWIER6` writer - Software Interrupt on line 6
96pub use SWIER0_W as SWIER6_W;
97///Field `SWIER7` writer - Software Interrupt on line 7
98pub use SWIER0_W as SWIER7_W;
99///Field `SWIER8` writer - Software Interrupt on line 8
100pub use SWIER0_W as SWIER8_W;
101///Field `SWIER9` writer - Software Interrupt on line 9
102pub use SWIER0_W as SWIER9_W;
103///Field `SWIER10` writer - Software Interrupt on line 10
104pub use SWIER0_W as SWIER10_W;
105///Field `SWIER11` writer - Software Interrupt on line 11
106pub use SWIER0_W as SWIER11_W;
107///Field `SWIER12` writer - Software Interrupt on line 12
108pub use SWIER0_W as SWIER12_W;
109///Field `SWIER13` writer - Software Interrupt on line 13
110pub use SWIER0_W as SWIER13_W;
111///Field `SWIER14` writer - Software Interrupt on line 14
112pub use SWIER0_W as SWIER14_W;
113///Field `SWIER15` writer - Software Interrupt on line 15
114pub use SWIER0_W as SWIER15_W;
115///Field `SWIER16` writer - Software Interrupt on line 16
116pub use SWIER0_W as SWIER16_W;
117///Field `SWIER17` writer - Software Interrupt on line 17
118pub use SWIER0_W as SWIER17_W;
119///Field `SWIER19` writer - Software Interrupt on line 19
120pub use SWIER0_W as SWIER19_W;
121impl R {
122    ///Bit 0 - Software Interrupt on line 0
123    #[inline(always)]
124    pub fn swier0(&self) -> SWIER0_R {
125        SWIER0_R::new((self.bits & 1) != 0)
126    }
127    ///Bit 1 - Software Interrupt on line 1
128    #[inline(always)]
129    pub fn swier1(&self) -> SWIER1_R {
130        SWIER1_R::new(((self.bits >> 1) & 1) != 0)
131    }
132    ///Bit 2 - Software Interrupt on line 2
133    #[inline(always)]
134    pub fn swier2(&self) -> SWIER2_R {
135        SWIER2_R::new(((self.bits >> 2) & 1) != 0)
136    }
137    ///Bit 3 - Software Interrupt on line 3
138    #[inline(always)]
139    pub fn swier3(&self) -> SWIER3_R {
140        SWIER3_R::new(((self.bits >> 3) & 1) != 0)
141    }
142    ///Bit 4 - Software Interrupt on line 4
143    #[inline(always)]
144    pub fn swier4(&self) -> SWIER4_R {
145        SWIER4_R::new(((self.bits >> 4) & 1) != 0)
146    }
147    ///Bit 5 - Software Interrupt on line 5
148    #[inline(always)]
149    pub fn swier5(&self) -> SWIER5_R {
150        SWIER5_R::new(((self.bits >> 5) & 1) != 0)
151    }
152    ///Bit 6 - Software Interrupt on line 6
153    #[inline(always)]
154    pub fn swier6(&self) -> SWIER6_R {
155        SWIER6_R::new(((self.bits >> 6) & 1) != 0)
156    }
157    ///Bit 7 - Software Interrupt on line 7
158    #[inline(always)]
159    pub fn swier7(&self) -> SWIER7_R {
160        SWIER7_R::new(((self.bits >> 7) & 1) != 0)
161    }
162    ///Bit 8 - Software Interrupt on line 8
163    #[inline(always)]
164    pub fn swier8(&self) -> SWIER8_R {
165        SWIER8_R::new(((self.bits >> 8) & 1) != 0)
166    }
167    ///Bit 9 - Software Interrupt on line 9
168    #[inline(always)]
169    pub fn swier9(&self) -> SWIER9_R {
170        SWIER9_R::new(((self.bits >> 9) & 1) != 0)
171    }
172    ///Bit 10 - Software Interrupt on line 10
173    #[inline(always)]
174    pub fn swier10(&self) -> SWIER10_R {
175        SWIER10_R::new(((self.bits >> 10) & 1) != 0)
176    }
177    ///Bit 11 - Software Interrupt on line 11
178    #[inline(always)]
179    pub fn swier11(&self) -> SWIER11_R {
180        SWIER11_R::new(((self.bits >> 11) & 1) != 0)
181    }
182    ///Bit 12 - Software Interrupt on line 12
183    #[inline(always)]
184    pub fn swier12(&self) -> SWIER12_R {
185        SWIER12_R::new(((self.bits >> 12) & 1) != 0)
186    }
187    ///Bit 13 - Software Interrupt on line 13
188    #[inline(always)]
189    pub fn swier13(&self) -> SWIER13_R {
190        SWIER13_R::new(((self.bits >> 13) & 1) != 0)
191    }
192    ///Bit 14 - Software Interrupt on line 14
193    #[inline(always)]
194    pub fn swier14(&self) -> SWIER14_R {
195        SWIER14_R::new(((self.bits >> 14) & 1) != 0)
196    }
197    ///Bit 15 - Software Interrupt on line 15
198    #[inline(always)]
199    pub fn swier15(&self) -> SWIER15_R {
200        SWIER15_R::new(((self.bits >> 15) & 1) != 0)
201    }
202    ///Bit 16 - Software Interrupt on line 16
203    #[inline(always)]
204    pub fn swier16(&self) -> SWIER16_R {
205        SWIER16_R::new(((self.bits >> 16) & 1) != 0)
206    }
207    ///Bit 17 - Software Interrupt on line 17
208    #[inline(always)]
209    pub fn swier17(&self) -> SWIER17_R {
210        SWIER17_R::new(((self.bits >> 17) & 1) != 0)
211    }
212    ///Bit 19 - Software Interrupt on line 19
213    #[inline(always)]
214    pub fn swier19(&self) -> SWIER19_R {
215        SWIER19_R::new(((self.bits >> 19) & 1) != 0)
216    }
217}
218impl core::fmt::Debug for R {
219    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
220        f.debug_struct("SWIER")
221            .field("swier0", &self.swier0())
222            .field("swier1", &self.swier1())
223            .field("swier2", &self.swier2())
224            .field("swier3", &self.swier3())
225            .field("swier4", &self.swier4())
226            .field("swier5", &self.swier5())
227            .field("swier6", &self.swier6())
228            .field("swier7", &self.swier7())
229            .field("swier8", &self.swier8())
230            .field("swier9", &self.swier9())
231            .field("swier10", &self.swier10())
232            .field("swier11", &self.swier11())
233            .field("swier12", &self.swier12())
234            .field("swier13", &self.swier13())
235            .field("swier14", &self.swier14())
236            .field("swier15", &self.swier15())
237            .field("swier16", &self.swier16())
238            .field("swier17", &self.swier17())
239            .field("swier19", &self.swier19())
240            .finish()
241    }
242}
243impl W {
244    ///Bit 0 - Software Interrupt on line 0
245    #[inline(always)]
246    pub fn swier0(&mut self) -> SWIER0_W<SWIERrs> {
247        SWIER0_W::new(self, 0)
248    }
249    ///Bit 1 - Software Interrupt on line 1
250    #[inline(always)]
251    pub fn swier1(&mut self) -> SWIER1_W<SWIERrs> {
252        SWIER1_W::new(self, 1)
253    }
254    ///Bit 2 - Software Interrupt on line 2
255    #[inline(always)]
256    pub fn swier2(&mut self) -> SWIER2_W<SWIERrs> {
257        SWIER2_W::new(self, 2)
258    }
259    ///Bit 3 - Software Interrupt on line 3
260    #[inline(always)]
261    pub fn swier3(&mut self) -> SWIER3_W<SWIERrs> {
262        SWIER3_W::new(self, 3)
263    }
264    ///Bit 4 - Software Interrupt on line 4
265    #[inline(always)]
266    pub fn swier4(&mut self) -> SWIER4_W<SWIERrs> {
267        SWIER4_W::new(self, 4)
268    }
269    ///Bit 5 - Software Interrupt on line 5
270    #[inline(always)]
271    pub fn swier5(&mut self) -> SWIER5_W<SWIERrs> {
272        SWIER5_W::new(self, 5)
273    }
274    ///Bit 6 - Software Interrupt on line 6
275    #[inline(always)]
276    pub fn swier6(&mut self) -> SWIER6_W<SWIERrs> {
277        SWIER6_W::new(self, 6)
278    }
279    ///Bit 7 - Software Interrupt on line 7
280    #[inline(always)]
281    pub fn swier7(&mut self) -> SWIER7_W<SWIERrs> {
282        SWIER7_W::new(self, 7)
283    }
284    ///Bit 8 - Software Interrupt on line 8
285    #[inline(always)]
286    pub fn swier8(&mut self) -> SWIER8_W<SWIERrs> {
287        SWIER8_W::new(self, 8)
288    }
289    ///Bit 9 - Software Interrupt on line 9
290    #[inline(always)]
291    pub fn swier9(&mut self) -> SWIER9_W<SWIERrs> {
292        SWIER9_W::new(self, 9)
293    }
294    ///Bit 10 - Software Interrupt on line 10
295    #[inline(always)]
296    pub fn swier10(&mut self) -> SWIER10_W<SWIERrs> {
297        SWIER10_W::new(self, 10)
298    }
299    ///Bit 11 - Software Interrupt on line 11
300    #[inline(always)]
301    pub fn swier11(&mut self) -> SWIER11_W<SWIERrs> {
302        SWIER11_W::new(self, 11)
303    }
304    ///Bit 12 - Software Interrupt on line 12
305    #[inline(always)]
306    pub fn swier12(&mut self) -> SWIER12_W<SWIERrs> {
307        SWIER12_W::new(self, 12)
308    }
309    ///Bit 13 - Software Interrupt on line 13
310    #[inline(always)]
311    pub fn swier13(&mut self) -> SWIER13_W<SWIERrs> {
312        SWIER13_W::new(self, 13)
313    }
314    ///Bit 14 - Software Interrupt on line 14
315    #[inline(always)]
316    pub fn swier14(&mut self) -> SWIER14_W<SWIERrs> {
317        SWIER14_W::new(self, 14)
318    }
319    ///Bit 15 - Software Interrupt on line 15
320    #[inline(always)]
321    pub fn swier15(&mut self) -> SWIER15_W<SWIERrs> {
322        SWIER15_W::new(self, 15)
323    }
324    ///Bit 16 - Software Interrupt on line 16
325    #[inline(always)]
326    pub fn swier16(&mut self) -> SWIER16_W<SWIERrs> {
327        SWIER16_W::new(self, 16)
328    }
329    ///Bit 17 - Software Interrupt on line 17
330    #[inline(always)]
331    pub fn swier17(&mut self) -> SWIER17_W<SWIERrs> {
332        SWIER17_W::new(self, 17)
333    }
334    ///Bit 19 - Software Interrupt on line 19
335    #[inline(always)]
336    pub fn swier19(&mut self) -> SWIER19_W<SWIERrs> {
337        SWIER19_W::new(self, 19)
338    }
339}
340/**Software interrupt event register (EXTI_SWIER)
341
342You can [`read`](crate::Reg::read) this register and get [`swier::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`swier::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
343
344See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F0x2.html#EXTI:SWIER)*/
345pub struct SWIERrs;
346impl crate::RegisterSpec for SWIERrs {
347    type Ux = u32;
348}
349///`read()` method returns [`swier::R`](R) reader structure
350impl crate::Readable for SWIERrs {}
351///`write(|w| ..)` method takes [`swier::W`](W) writer structure
352impl crate::Writable for SWIERrs {
353    type Safety = crate::Unsafe;
354}
355///`reset()` method sets SWIER to value 0
356impl crate::Resettable for SWIERrs {}