stm32l0/stm32l0x1/exti/
swier.rs1#[doc = "Register `SWIER` reader"]
2pub struct R(crate::R<SWIER_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SWIER_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SWIER_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SWIER_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `SWIER` writer"]
17pub struct W(crate::W<SWIER_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SWIER_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<SWIER_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SWIER_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Software Interrupt on line 0\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum SWI0_A {
40 #[doc = "1: Generates an interrupt request"]
41 Pend = 1,
42}
43impl From<SWI0_A> for bool {
44 #[inline(always)]
45 fn from(variant: SWI0_A) -> Self {
46 variant as u8 != 0
47 }
48}
49#[doc = "Field `SWI0` reader - Software Interrupt on line 0"]
50pub type SWI0_R = crate::BitReader<SWI0_A>;
51impl SWI0_R {
52 #[doc = "Get enumerated values variant"]
53 #[inline(always)]
54 pub fn variant(&self) -> Option<SWI0_A> {
55 match self.bits {
56 true => Some(SWI0_A::Pend),
57 _ => None,
58 }
59 }
60 #[doc = "Checks if the value of the field is `Pend`"]
61 #[inline(always)]
62 pub fn is_pend(&self) -> bool {
63 *self == SWI0_A::Pend
64 }
65}
66#[doc = "Field `SWI0` writer - Software Interrupt on line 0"]
67pub type SWI0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWIER_SPEC, SWI0_A, O>;
68impl<'a, const O: u8> SWI0_W<'a, O> {
69 #[doc = "Generates an interrupt request"]
70 #[inline(always)]
71 pub fn pend(self) -> &'a mut W {
72 self.variant(SWI0_A::Pend)
73 }
74}
75#[doc = "Software Interrupt on line 1"]
76pub use SWI0_A as SWI1_A;
77#[doc = "Software Interrupt on line 2"]
78pub use SWI0_A as SWI2_A;
79#[doc = "Software Interrupt on line 3"]
80pub use SWI0_A as SWI3_A;
81#[doc = "Software Interrupt on line 4"]
82pub use SWI0_A as SWI4_A;
83#[doc = "Software Interrupt on line 5"]
84pub use SWI0_A as SWI5_A;
85#[doc = "Software Interrupt on line 6"]
86pub use SWI0_A as SWI6_A;
87#[doc = "Software Interrupt on line 7"]
88pub use SWI0_A as SWI7_A;
89#[doc = "Software Interrupt on line 8"]
90pub use SWI0_A as SWI8_A;
91#[doc = "Software Interrupt on line 9"]
92pub use SWI0_A as SWI9_A;
93#[doc = "Software Interrupt on line 10"]
94pub use SWI0_A as SWI10_A;
95#[doc = "Software Interrupt on line 11"]
96pub use SWI0_A as SWI11_A;
97#[doc = "Software Interrupt on line 12"]
98pub use SWI0_A as SWI12_A;
99#[doc = "Software Interrupt on line 13"]
100pub use SWI0_A as SWI13_A;
101#[doc = "Software Interrupt on line 14"]
102pub use SWI0_A as SWI14_A;
103#[doc = "Software Interrupt on line 15"]
104pub use SWI0_A as SWI15_A;
105#[doc = "Software Interrupt on line 16"]
106pub use SWI0_A as SWI16_A;
107#[doc = "Software Interrupt on line 17"]
108pub use SWI0_A as SWI17_A;
109#[doc = "Software Interrupt on line 19"]
110pub use SWI0_A as SWI19_A;
111#[doc = "Software Interrupt on line 20"]
112pub use SWI0_A as SWI20_A;
113#[doc = "Software Interrupt on line 21"]
114pub use SWI0_A as SWI21_A;
115#[doc = "Software Interrupt on line 22"]
116pub use SWI0_A as SWI22_A;
117#[doc = "Field `SWI1` reader - Software Interrupt on line 1"]
118pub use SWI0_R as SWI1_R;
119#[doc = "Field `SWI2` reader - Software Interrupt on line 2"]
120pub use SWI0_R as SWI2_R;
121#[doc = "Field `SWI3` reader - Software Interrupt on line 3"]
122pub use SWI0_R as SWI3_R;
123#[doc = "Field `SWI4` reader - Software Interrupt on line 4"]
124pub use SWI0_R as SWI4_R;
125#[doc = "Field `SWI5` reader - Software Interrupt on line 5"]
126pub use SWI0_R as SWI5_R;
127#[doc = "Field `SWI6` reader - Software Interrupt on line 6"]
128pub use SWI0_R as SWI6_R;
129#[doc = "Field `SWI7` reader - Software Interrupt on line 7"]
130pub use SWI0_R as SWI7_R;
131#[doc = "Field `SWI8` reader - Software Interrupt on line 8"]
132pub use SWI0_R as SWI8_R;
133#[doc = "Field `SWI9` reader - Software Interrupt on line 9"]
134pub use SWI0_R as SWI9_R;
135#[doc = "Field `SWI10` reader - Software Interrupt on line 10"]
136pub use SWI0_R as SWI10_R;
137#[doc = "Field `SWI11` reader - Software Interrupt on line 11"]
138pub use SWI0_R as SWI11_R;
139#[doc = "Field `SWI12` reader - Software Interrupt on line 12"]
140pub use SWI0_R as SWI12_R;
141#[doc = "Field `SWI13` reader - Software Interrupt on line 13"]
142pub use SWI0_R as SWI13_R;
143#[doc = "Field `SWI14` reader - Software Interrupt on line 14"]
144pub use SWI0_R as SWI14_R;
145#[doc = "Field `SWI15` reader - Software Interrupt on line 15"]
146pub use SWI0_R as SWI15_R;
147#[doc = "Field `SWI16` reader - Software Interrupt on line 16"]
148pub use SWI0_R as SWI16_R;
149#[doc = "Field `SWI17` reader - Software Interrupt on line 17"]
150pub use SWI0_R as SWI17_R;
151#[doc = "Field `SWI19` reader - Software Interrupt on line 19"]
152pub use SWI0_R as SWI19_R;
153#[doc = "Field `SWI20` reader - Software Interrupt on line 20"]
154pub use SWI0_R as SWI20_R;
155#[doc = "Field `SWI21` reader - Software Interrupt on line 21"]
156pub use SWI0_R as SWI21_R;
157#[doc = "Field `SWI22` reader - Software Interrupt on line 22"]
158pub use SWI0_R as SWI22_R;
159#[doc = "Field `SWI1` writer - Software Interrupt on line 1"]
160pub use SWI0_W as SWI1_W;
161#[doc = "Field `SWI2` writer - Software Interrupt on line 2"]
162pub use SWI0_W as SWI2_W;
163#[doc = "Field `SWI3` writer - Software Interrupt on line 3"]
164pub use SWI0_W as SWI3_W;
165#[doc = "Field `SWI4` writer - Software Interrupt on line 4"]
166pub use SWI0_W as SWI4_W;
167#[doc = "Field `SWI5` writer - Software Interrupt on line 5"]
168pub use SWI0_W as SWI5_W;
169#[doc = "Field `SWI6` writer - Software Interrupt on line 6"]
170pub use SWI0_W as SWI6_W;
171#[doc = "Field `SWI7` writer - Software Interrupt on line 7"]
172pub use SWI0_W as SWI7_W;
173#[doc = "Field `SWI8` writer - Software Interrupt on line 8"]
174pub use SWI0_W as SWI8_W;
175#[doc = "Field `SWI9` writer - Software Interrupt on line 9"]
176pub use SWI0_W as SWI9_W;
177#[doc = "Field `SWI10` writer - Software Interrupt on line 10"]
178pub use SWI0_W as SWI10_W;
179#[doc = "Field `SWI11` writer - Software Interrupt on line 11"]
180pub use SWI0_W as SWI11_W;
181#[doc = "Field `SWI12` writer - Software Interrupt on line 12"]
182pub use SWI0_W as SWI12_W;
183#[doc = "Field `SWI13` writer - Software Interrupt on line 13"]
184pub use SWI0_W as SWI13_W;
185#[doc = "Field `SWI14` writer - Software Interrupt on line 14"]
186pub use SWI0_W as SWI14_W;
187#[doc = "Field `SWI15` writer - Software Interrupt on line 15"]
188pub use SWI0_W as SWI15_W;
189#[doc = "Field `SWI16` writer - Software Interrupt on line 16"]
190pub use SWI0_W as SWI16_W;
191#[doc = "Field `SWI17` writer - Software Interrupt on line 17"]
192pub use SWI0_W as SWI17_W;
193#[doc = "Field `SWI19` writer - Software Interrupt on line 19"]
194pub use SWI0_W as SWI19_W;
195#[doc = "Field `SWI20` writer - Software Interrupt on line 20"]
196pub use SWI0_W as SWI20_W;
197#[doc = "Field `SWI21` writer - Software Interrupt on line 21"]
198pub use SWI0_W as SWI21_W;
199#[doc = "Field `SWI22` writer - Software Interrupt on line 22"]
200pub use SWI0_W as SWI22_W;
201impl R {
202 #[doc = "Bit 0 - Software Interrupt on line 0"]
203 #[inline(always)]
204 pub fn swi0(&self) -> SWI0_R {
205 SWI0_R::new((self.bits & 1) != 0)
206 }
207 #[doc = "Bit 1 - Software Interrupt on line 1"]
208 #[inline(always)]
209 pub fn swi1(&self) -> SWI1_R {
210 SWI1_R::new(((self.bits >> 1) & 1) != 0)
211 }
212 #[doc = "Bit 2 - Software Interrupt on line 2"]
213 #[inline(always)]
214 pub fn swi2(&self) -> SWI2_R {
215 SWI2_R::new(((self.bits >> 2) & 1) != 0)
216 }
217 #[doc = "Bit 3 - Software Interrupt on line 3"]
218 #[inline(always)]
219 pub fn swi3(&self) -> SWI3_R {
220 SWI3_R::new(((self.bits >> 3) & 1) != 0)
221 }
222 #[doc = "Bit 4 - Software Interrupt on line 4"]
223 #[inline(always)]
224 pub fn swi4(&self) -> SWI4_R {
225 SWI4_R::new(((self.bits >> 4) & 1) != 0)
226 }
227 #[doc = "Bit 5 - Software Interrupt on line 5"]
228 #[inline(always)]
229 pub fn swi5(&self) -> SWI5_R {
230 SWI5_R::new(((self.bits >> 5) & 1) != 0)
231 }
232 #[doc = "Bit 6 - Software Interrupt on line 6"]
233 #[inline(always)]
234 pub fn swi6(&self) -> SWI6_R {
235 SWI6_R::new(((self.bits >> 6) & 1) != 0)
236 }
237 #[doc = "Bit 7 - Software Interrupt on line 7"]
238 #[inline(always)]
239 pub fn swi7(&self) -> SWI7_R {
240 SWI7_R::new(((self.bits >> 7) & 1) != 0)
241 }
242 #[doc = "Bit 8 - Software Interrupt on line 8"]
243 #[inline(always)]
244 pub fn swi8(&self) -> SWI8_R {
245 SWI8_R::new(((self.bits >> 8) & 1) != 0)
246 }
247 #[doc = "Bit 9 - Software Interrupt on line 9"]
248 #[inline(always)]
249 pub fn swi9(&self) -> SWI9_R {
250 SWI9_R::new(((self.bits >> 9) & 1) != 0)
251 }
252 #[doc = "Bit 10 - Software Interrupt on line 10"]
253 #[inline(always)]
254 pub fn swi10(&self) -> SWI10_R {
255 SWI10_R::new(((self.bits >> 10) & 1) != 0)
256 }
257 #[doc = "Bit 11 - Software Interrupt on line 11"]
258 #[inline(always)]
259 pub fn swi11(&self) -> SWI11_R {
260 SWI11_R::new(((self.bits >> 11) & 1) != 0)
261 }
262 #[doc = "Bit 12 - Software Interrupt on line 12"]
263 #[inline(always)]
264 pub fn swi12(&self) -> SWI12_R {
265 SWI12_R::new(((self.bits >> 12) & 1) != 0)
266 }
267 #[doc = "Bit 13 - Software Interrupt on line 13"]
268 #[inline(always)]
269 pub fn swi13(&self) -> SWI13_R {
270 SWI13_R::new(((self.bits >> 13) & 1) != 0)
271 }
272 #[doc = "Bit 14 - Software Interrupt on line 14"]
273 #[inline(always)]
274 pub fn swi14(&self) -> SWI14_R {
275 SWI14_R::new(((self.bits >> 14) & 1) != 0)
276 }
277 #[doc = "Bit 15 - Software Interrupt on line 15"]
278 #[inline(always)]
279 pub fn swi15(&self) -> SWI15_R {
280 SWI15_R::new(((self.bits >> 15) & 1) != 0)
281 }
282 #[doc = "Bit 16 - Software Interrupt on line 16"]
283 #[inline(always)]
284 pub fn swi16(&self) -> SWI16_R {
285 SWI16_R::new(((self.bits >> 16) & 1) != 0)
286 }
287 #[doc = "Bit 17 - Software Interrupt on line 17"]
288 #[inline(always)]
289 pub fn swi17(&self) -> SWI17_R {
290 SWI17_R::new(((self.bits >> 17) & 1) != 0)
291 }
292 #[doc = "Bit 19 - Software Interrupt on line 19"]
293 #[inline(always)]
294 pub fn swi19(&self) -> SWI19_R {
295 SWI19_R::new(((self.bits >> 19) & 1) != 0)
296 }
297 #[doc = "Bit 20 - Software Interrupt on line 20"]
298 #[inline(always)]
299 pub fn swi20(&self) -> SWI20_R {
300 SWI20_R::new(((self.bits >> 20) & 1) != 0)
301 }
302 #[doc = "Bit 21 - Software Interrupt on line 21"]
303 #[inline(always)]
304 pub fn swi21(&self) -> SWI21_R {
305 SWI21_R::new(((self.bits >> 21) & 1) != 0)
306 }
307 #[doc = "Bit 22 - Software Interrupt on line 22"]
308 #[inline(always)]
309 pub fn swi22(&self) -> SWI22_R {
310 SWI22_R::new(((self.bits >> 22) & 1) != 0)
311 }
312}
313impl W {
314 #[doc = "Bit 0 - Software Interrupt on line 0"]
315 #[inline(always)]
316 pub fn swi0(&mut self) -> SWI0_W<0> {
317 SWI0_W::new(self)
318 }
319 #[doc = "Bit 1 - Software Interrupt on line 1"]
320 #[inline(always)]
321 pub fn swi1(&mut self) -> SWI1_W<1> {
322 SWI1_W::new(self)
323 }
324 #[doc = "Bit 2 - Software Interrupt on line 2"]
325 #[inline(always)]
326 pub fn swi2(&mut self) -> SWI2_W<2> {
327 SWI2_W::new(self)
328 }
329 #[doc = "Bit 3 - Software Interrupt on line 3"]
330 #[inline(always)]
331 pub fn swi3(&mut self) -> SWI3_W<3> {
332 SWI3_W::new(self)
333 }
334 #[doc = "Bit 4 - Software Interrupt on line 4"]
335 #[inline(always)]
336 pub fn swi4(&mut self) -> SWI4_W<4> {
337 SWI4_W::new(self)
338 }
339 #[doc = "Bit 5 - Software Interrupt on line 5"]
340 #[inline(always)]
341 pub fn swi5(&mut self) -> SWI5_W<5> {
342 SWI5_W::new(self)
343 }
344 #[doc = "Bit 6 - Software Interrupt on line 6"]
345 #[inline(always)]
346 pub fn swi6(&mut self) -> SWI6_W<6> {
347 SWI6_W::new(self)
348 }
349 #[doc = "Bit 7 - Software Interrupt on line 7"]
350 #[inline(always)]
351 pub fn swi7(&mut self) -> SWI7_W<7> {
352 SWI7_W::new(self)
353 }
354 #[doc = "Bit 8 - Software Interrupt on line 8"]
355 #[inline(always)]
356 pub fn swi8(&mut self) -> SWI8_W<8> {
357 SWI8_W::new(self)
358 }
359 #[doc = "Bit 9 - Software Interrupt on line 9"]
360 #[inline(always)]
361 pub fn swi9(&mut self) -> SWI9_W<9> {
362 SWI9_W::new(self)
363 }
364 #[doc = "Bit 10 - Software Interrupt on line 10"]
365 #[inline(always)]
366 pub fn swi10(&mut self) -> SWI10_W<10> {
367 SWI10_W::new(self)
368 }
369 #[doc = "Bit 11 - Software Interrupt on line 11"]
370 #[inline(always)]
371 pub fn swi11(&mut self) -> SWI11_W<11> {
372 SWI11_W::new(self)
373 }
374 #[doc = "Bit 12 - Software Interrupt on line 12"]
375 #[inline(always)]
376 pub fn swi12(&mut self) -> SWI12_W<12> {
377 SWI12_W::new(self)
378 }
379 #[doc = "Bit 13 - Software Interrupt on line 13"]
380 #[inline(always)]
381 pub fn swi13(&mut self) -> SWI13_W<13> {
382 SWI13_W::new(self)
383 }
384 #[doc = "Bit 14 - Software Interrupt on line 14"]
385 #[inline(always)]
386 pub fn swi14(&mut self) -> SWI14_W<14> {
387 SWI14_W::new(self)
388 }
389 #[doc = "Bit 15 - Software Interrupt on line 15"]
390 #[inline(always)]
391 pub fn swi15(&mut self) -> SWI15_W<15> {
392 SWI15_W::new(self)
393 }
394 #[doc = "Bit 16 - Software Interrupt on line 16"]
395 #[inline(always)]
396 pub fn swi16(&mut self) -> SWI16_W<16> {
397 SWI16_W::new(self)
398 }
399 #[doc = "Bit 17 - Software Interrupt on line 17"]
400 #[inline(always)]
401 pub fn swi17(&mut self) -> SWI17_W<17> {
402 SWI17_W::new(self)
403 }
404 #[doc = "Bit 19 - Software Interrupt on line 19"]
405 #[inline(always)]
406 pub fn swi19(&mut self) -> SWI19_W<19> {
407 SWI19_W::new(self)
408 }
409 #[doc = "Bit 20 - Software Interrupt on line 20"]
410 #[inline(always)]
411 pub fn swi20(&mut self) -> SWI20_W<20> {
412 SWI20_W::new(self)
413 }
414 #[doc = "Bit 21 - Software Interrupt on line 21"]
415 #[inline(always)]
416 pub fn swi21(&mut self) -> SWI21_W<21> {
417 SWI21_W::new(self)
418 }
419 #[doc = "Bit 22 - Software Interrupt on line 22"]
420 #[inline(always)]
421 pub fn swi22(&mut self) -> SWI22_W<22> {
422 SWI22_W::new(self)
423 }
424 #[doc = "Writes raw bits to the register."]
425 #[inline(always)]
426 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
427 self.0.bits(bits);
428 self
429 }
430}
431#[doc = "Software interrupt event register (EXTI_SWIER)\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 [swier](index.html) module"]
432pub struct SWIER_SPEC;
433impl crate::RegisterSpec for SWIER_SPEC {
434 type Ux = u32;
435}
436#[doc = "`read()` method returns [swier::R](R) reader structure"]
437impl crate::Readable for SWIER_SPEC {
438 type Reader = R;
439}
440#[doc = "`write(|w| ..)` method takes [swier::W](W) writer structure"]
441impl crate::Writable for SWIER_SPEC {
442 type Writer = W;
443}
444#[doc = "`reset()` method sets SWIER to value 0"]
445impl crate::Resettable for SWIER_SPEC {
446 #[inline(always)]
447 fn reset_value() -> Self::Ux {
448 0
449 }
450}