stm32g4_staging/stm32g484/exti/
emr1.rs1pub type R = crate::R<EMR1rs>;
3pub type W = crate::W<EMR1rs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum EVENT_MASK {
11 Masked = 0,
13 Unmasked = 1,
15}
16impl From<EVENT_MASK> for bool {
17 #[inline(always)]
18 fn from(variant: EVENT_MASK) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type EM0_R = crate::BitReader<EVENT_MASK>;
24impl EM0_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> EVENT_MASK {
28 match self.bits {
29 false => EVENT_MASK::Masked,
30 true => EVENT_MASK::Unmasked,
31 }
32 }
33 #[inline(always)]
35 pub fn is_masked(&self) -> bool {
36 *self == EVENT_MASK::Masked
37 }
38 #[inline(always)]
40 pub fn is_unmasked(&self) -> bool {
41 *self == EVENT_MASK::Unmasked
42 }
43}
44pub type EM0_W<'a, REG> = crate::BitWriter<'a, REG, EVENT_MASK>;
46impl<'a, REG> EM0_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn masked(self) -> &'a mut crate::W<REG> {
53 self.variant(EVENT_MASK::Masked)
54 }
55 #[inline(always)]
57 pub fn unmasked(self) -> &'a mut crate::W<REG> {
58 self.variant(EVENT_MASK::Unmasked)
59 }
60}
61pub use EM0_R as EM1_R;
63pub use EM0_R as EM2_R;
65pub use EM0_R as EM3_R;
67pub use EM0_R as EM4_R;
69pub use EM0_R as EM5_R;
71pub use EM0_R as EM6_R;
73pub use EM0_R as EM7_R;
75pub use EM0_R as EM8_R;
77pub use EM0_R as EM9_R;
79pub use EM0_R as EM10_R;
81pub use EM0_R as EM11_R;
83pub use EM0_R as EM12_R;
85pub use EM0_R as EM13_R;
87pub use EM0_R as EM14_R;
89pub use EM0_R as EM15_R;
91pub use EM0_R as EM16_R;
93pub use EM0_R as EM17_R;
95pub use EM0_R as EM18_R;
97pub use EM0_R as EM19_R;
99pub use EM0_R as EM20_R;
101pub use EM0_R as EM21_R;
103pub use EM0_R as EM22_R;
105pub use EM0_R as EM23_R;
107pub use EM0_R as EM24_R;
109pub use EM0_R as EM25_R;
111pub use EM0_R as EM26_R;
113pub use EM0_R as EM27_R;
115pub use EM0_R as EM28_R;
117pub use EM0_R as EM29_R;
119pub use EM0_R as EM30_R;
121pub use EM0_R as EM31_R;
123pub use EM0_W as EM1_W;
125pub use EM0_W as EM2_W;
127pub use EM0_W as EM3_W;
129pub use EM0_W as EM4_W;
131pub use EM0_W as EM5_W;
133pub use EM0_W as EM6_W;
135pub use EM0_W as EM7_W;
137pub use EM0_W as EM8_W;
139pub use EM0_W as EM9_W;
141pub use EM0_W as EM10_W;
143pub use EM0_W as EM11_W;
145pub use EM0_W as EM12_W;
147pub use EM0_W as EM13_W;
149pub use EM0_W as EM14_W;
151pub use EM0_W as EM15_W;
153pub use EM0_W as EM16_W;
155pub use EM0_W as EM17_W;
157pub use EM0_W as EM18_W;
159pub use EM0_W as EM19_W;
161pub use EM0_W as EM20_W;
163pub use EM0_W as EM21_W;
165pub use EM0_W as EM22_W;
167pub use EM0_W as EM23_W;
169pub use EM0_W as EM24_W;
171pub use EM0_W as EM25_W;
173pub use EM0_W as EM26_W;
175pub use EM0_W as EM27_W;
177pub use EM0_W as EM28_W;
179pub use EM0_W as EM29_W;
181pub use EM0_W as EM30_W;
183pub use EM0_W as EM31_W;
185impl R {
186 #[inline(always)]
188 pub fn em0(&self) -> EM0_R {
189 EM0_R::new((self.bits & 1) != 0)
190 }
191 #[inline(always)]
193 pub fn em1(&self) -> EM1_R {
194 EM1_R::new(((self.bits >> 1) & 1) != 0)
195 }
196 #[inline(always)]
198 pub fn em2(&self) -> EM2_R {
199 EM2_R::new(((self.bits >> 2) & 1) != 0)
200 }
201 #[inline(always)]
203 pub fn em3(&self) -> EM3_R {
204 EM3_R::new(((self.bits >> 3) & 1) != 0)
205 }
206 #[inline(always)]
208 pub fn em4(&self) -> EM4_R {
209 EM4_R::new(((self.bits >> 4) & 1) != 0)
210 }
211 #[inline(always)]
213 pub fn em5(&self) -> EM5_R {
214 EM5_R::new(((self.bits >> 5) & 1) != 0)
215 }
216 #[inline(always)]
218 pub fn em6(&self) -> EM6_R {
219 EM6_R::new(((self.bits >> 6) & 1) != 0)
220 }
221 #[inline(always)]
223 pub fn em7(&self) -> EM7_R {
224 EM7_R::new(((self.bits >> 7) & 1) != 0)
225 }
226 #[inline(always)]
228 pub fn em8(&self) -> EM8_R {
229 EM8_R::new(((self.bits >> 8) & 1) != 0)
230 }
231 #[inline(always)]
233 pub fn em9(&self) -> EM9_R {
234 EM9_R::new(((self.bits >> 9) & 1) != 0)
235 }
236 #[inline(always)]
238 pub fn em10(&self) -> EM10_R {
239 EM10_R::new(((self.bits >> 10) & 1) != 0)
240 }
241 #[inline(always)]
243 pub fn em11(&self) -> EM11_R {
244 EM11_R::new(((self.bits >> 11) & 1) != 0)
245 }
246 #[inline(always)]
248 pub fn em12(&self) -> EM12_R {
249 EM12_R::new(((self.bits >> 12) & 1) != 0)
250 }
251 #[inline(always)]
253 pub fn em13(&self) -> EM13_R {
254 EM13_R::new(((self.bits >> 13) & 1) != 0)
255 }
256 #[inline(always)]
258 pub fn em14(&self) -> EM14_R {
259 EM14_R::new(((self.bits >> 14) & 1) != 0)
260 }
261 #[inline(always)]
263 pub fn em15(&self) -> EM15_R {
264 EM15_R::new(((self.bits >> 15) & 1) != 0)
265 }
266 #[inline(always)]
268 pub fn em16(&self) -> EM16_R {
269 EM16_R::new(((self.bits >> 16) & 1) != 0)
270 }
271 #[inline(always)]
273 pub fn em17(&self) -> EM17_R {
274 EM17_R::new(((self.bits >> 17) & 1) != 0)
275 }
276 #[inline(always)]
278 pub fn em18(&self) -> EM18_R {
279 EM18_R::new(((self.bits >> 18) & 1) != 0)
280 }
281 #[inline(always)]
283 pub fn em19(&self) -> EM19_R {
284 EM19_R::new(((self.bits >> 19) & 1) != 0)
285 }
286 #[inline(always)]
288 pub fn em20(&self) -> EM20_R {
289 EM20_R::new(((self.bits >> 20) & 1) != 0)
290 }
291 #[inline(always)]
293 pub fn em21(&self) -> EM21_R {
294 EM21_R::new(((self.bits >> 21) & 1) != 0)
295 }
296 #[inline(always)]
298 pub fn em22(&self) -> EM22_R {
299 EM22_R::new(((self.bits >> 22) & 1) != 0)
300 }
301 #[inline(always)]
303 pub fn em23(&self) -> EM23_R {
304 EM23_R::new(((self.bits >> 23) & 1) != 0)
305 }
306 #[inline(always)]
308 pub fn em24(&self) -> EM24_R {
309 EM24_R::new(((self.bits >> 24) & 1) != 0)
310 }
311 #[inline(always)]
313 pub fn em25(&self) -> EM25_R {
314 EM25_R::new(((self.bits >> 25) & 1) != 0)
315 }
316 #[inline(always)]
318 pub fn em26(&self) -> EM26_R {
319 EM26_R::new(((self.bits >> 26) & 1) != 0)
320 }
321 #[inline(always)]
323 pub fn em27(&self) -> EM27_R {
324 EM27_R::new(((self.bits >> 27) & 1) != 0)
325 }
326 #[inline(always)]
328 pub fn em28(&self) -> EM28_R {
329 EM28_R::new(((self.bits >> 28) & 1) != 0)
330 }
331 #[inline(always)]
333 pub fn em29(&self) -> EM29_R {
334 EM29_R::new(((self.bits >> 29) & 1) != 0)
335 }
336 #[inline(always)]
338 pub fn em30(&self) -> EM30_R {
339 EM30_R::new(((self.bits >> 30) & 1) != 0)
340 }
341 #[inline(always)]
343 pub fn em31(&self) -> EM31_R {
344 EM31_R::new(((self.bits >> 31) & 1) != 0)
345 }
346}
347impl core::fmt::Debug for R {
348 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
349 f.debug_struct("EMR1")
350 .field("em0", &self.em0())
351 .field("em1", &self.em1())
352 .field("em2", &self.em2())
353 .field("em3", &self.em3())
354 .field("em4", &self.em4())
355 .field("em5", &self.em5())
356 .field("em6", &self.em6())
357 .field("em7", &self.em7())
358 .field("em8", &self.em8())
359 .field("em9", &self.em9())
360 .field("em10", &self.em10())
361 .field("em11", &self.em11())
362 .field("em12", &self.em12())
363 .field("em13", &self.em13())
364 .field("em14", &self.em14())
365 .field("em15", &self.em15())
366 .field("em16", &self.em16())
367 .field("em17", &self.em17())
368 .field("em18", &self.em18())
369 .field("em19", &self.em19())
370 .field("em20", &self.em20())
371 .field("em21", &self.em21())
372 .field("em22", &self.em22())
373 .field("em23", &self.em23())
374 .field("em24", &self.em24())
375 .field("em25", &self.em25())
376 .field("em26", &self.em26())
377 .field("em27", &self.em27())
378 .field("em28", &self.em28())
379 .field("em29", &self.em29())
380 .field("em30", &self.em30())
381 .field("em31", &self.em31())
382 .finish()
383 }
384}
385impl W {
386 #[inline(always)]
388 pub fn em0(&mut self) -> EM0_W<EMR1rs> {
389 EM0_W::new(self, 0)
390 }
391 #[inline(always)]
393 pub fn em1(&mut self) -> EM1_W<EMR1rs> {
394 EM1_W::new(self, 1)
395 }
396 #[inline(always)]
398 pub fn em2(&mut self) -> EM2_W<EMR1rs> {
399 EM2_W::new(self, 2)
400 }
401 #[inline(always)]
403 pub fn em3(&mut self) -> EM3_W<EMR1rs> {
404 EM3_W::new(self, 3)
405 }
406 #[inline(always)]
408 pub fn em4(&mut self) -> EM4_W<EMR1rs> {
409 EM4_W::new(self, 4)
410 }
411 #[inline(always)]
413 pub fn em5(&mut self) -> EM5_W<EMR1rs> {
414 EM5_W::new(self, 5)
415 }
416 #[inline(always)]
418 pub fn em6(&mut self) -> EM6_W<EMR1rs> {
419 EM6_W::new(self, 6)
420 }
421 #[inline(always)]
423 pub fn em7(&mut self) -> EM7_W<EMR1rs> {
424 EM7_W::new(self, 7)
425 }
426 #[inline(always)]
428 pub fn em8(&mut self) -> EM8_W<EMR1rs> {
429 EM8_W::new(self, 8)
430 }
431 #[inline(always)]
433 pub fn em9(&mut self) -> EM9_W<EMR1rs> {
434 EM9_W::new(self, 9)
435 }
436 #[inline(always)]
438 pub fn em10(&mut self) -> EM10_W<EMR1rs> {
439 EM10_W::new(self, 10)
440 }
441 #[inline(always)]
443 pub fn em11(&mut self) -> EM11_W<EMR1rs> {
444 EM11_W::new(self, 11)
445 }
446 #[inline(always)]
448 pub fn em12(&mut self) -> EM12_W<EMR1rs> {
449 EM12_W::new(self, 12)
450 }
451 #[inline(always)]
453 pub fn em13(&mut self) -> EM13_W<EMR1rs> {
454 EM13_W::new(self, 13)
455 }
456 #[inline(always)]
458 pub fn em14(&mut self) -> EM14_W<EMR1rs> {
459 EM14_W::new(self, 14)
460 }
461 #[inline(always)]
463 pub fn em15(&mut self) -> EM15_W<EMR1rs> {
464 EM15_W::new(self, 15)
465 }
466 #[inline(always)]
468 pub fn em16(&mut self) -> EM16_W<EMR1rs> {
469 EM16_W::new(self, 16)
470 }
471 #[inline(always)]
473 pub fn em17(&mut self) -> EM17_W<EMR1rs> {
474 EM17_W::new(self, 17)
475 }
476 #[inline(always)]
478 pub fn em18(&mut self) -> EM18_W<EMR1rs> {
479 EM18_W::new(self, 18)
480 }
481 #[inline(always)]
483 pub fn em19(&mut self) -> EM19_W<EMR1rs> {
484 EM19_W::new(self, 19)
485 }
486 #[inline(always)]
488 pub fn em20(&mut self) -> EM20_W<EMR1rs> {
489 EM20_W::new(self, 20)
490 }
491 #[inline(always)]
493 pub fn em21(&mut self) -> EM21_W<EMR1rs> {
494 EM21_W::new(self, 21)
495 }
496 #[inline(always)]
498 pub fn em22(&mut self) -> EM22_W<EMR1rs> {
499 EM22_W::new(self, 22)
500 }
501 #[inline(always)]
503 pub fn em23(&mut self) -> EM23_W<EMR1rs> {
504 EM23_W::new(self, 23)
505 }
506 #[inline(always)]
508 pub fn em24(&mut self) -> EM24_W<EMR1rs> {
509 EM24_W::new(self, 24)
510 }
511 #[inline(always)]
513 pub fn em25(&mut self) -> EM25_W<EMR1rs> {
514 EM25_W::new(self, 25)
515 }
516 #[inline(always)]
518 pub fn em26(&mut self) -> EM26_W<EMR1rs> {
519 EM26_W::new(self, 26)
520 }
521 #[inline(always)]
523 pub fn em27(&mut self) -> EM27_W<EMR1rs> {
524 EM27_W::new(self, 27)
525 }
526 #[inline(always)]
528 pub fn em28(&mut self) -> EM28_W<EMR1rs> {
529 EM28_W::new(self, 28)
530 }
531 #[inline(always)]
533 pub fn em29(&mut self) -> EM29_W<EMR1rs> {
534 EM29_W::new(self, 29)
535 }
536 #[inline(always)]
538 pub fn em30(&mut self) -> EM30_W<EMR1rs> {
539 EM30_W::new(self, 30)
540 }
541 #[inline(always)]
543 pub fn em31(&mut self) -> EM31_W<EMR1rs> {
544 EM31_W::new(self, 31)
545 }
546}
547pub struct EMR1rs;
553impl crate::RegisterSpec for EMR1rs {
554 type Ux = u32;
555}
556impl crate::Readable for EMR1rs {}
558impl crate::Writable for EMR1rs {
560 type Safety = crate::Unsafe;
561}
562impl crate::Resettable for EMR1rs {}