1#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"Key Interrupt Function"]
28unsafe impl ::core::marker::Send for super::Kint {}
29unsafe impl ::core::marker::Sync for super::Kint {}
30impl super::Kint {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36
37 #[doc = "KEY Return Control Register"]
38 #[inline(always)]
39 pub const fn krctl(&self) -> &'static crate::common::Reg<self::Krctl_SPEC, crate::common::RW> {
40 unsafe {
41 crate::common::Reg::<self::Krctl_SPEC, crate::common::RW>::from_ptr(
42 self._svd2pac_as_ptr().add(0usize),
43 )
44 }
45 }
46
47 #[doc = "KEY Return Flag Register"]
48 #[inline(always)]
49 pub const fn krf(&self) -> &'static crate::common::Reg<self::Krf_SPEC, crate::common::RW> {
50 unsafe {
51 crate::common::Reg::<self::Krf_SPEC, crate::common::RW>::from_ptr(
52 self._svd2pac_as_ptr().add(4usize),
53 )
54 }
55 }
56
57 #[doc = "KEY Return Mode Register"]
58 #[inline(always)]
59 pub const fn krm(&self) -> &'static crate::common::Reg<self::Krm_SPEC, crate::common::RW> {
60 unsafe {
61 crate::common::Reg::<self::Krm_SPEC, crate::common::RW>::from_ptr(
62 self._svd2pac_as_ptr().add(8usize),
63 )
64 }
65 }
66}
67#[doc(hidden)]
68#[derive(Copy, Clone, Eq, PartialEq)]
69pub struct Krctl_SPEC;
70impl crate::sealed::RegSpec for Krctl_SPEC {
71 type DataType = u8;
72}
73
74#[doc = "KEY Return Control Register"]
75pub type Krctl = crate::RegValueT<Krctl_SPEC>;
76
77impl Krctl {
78 #[doc = "Usage of Key Interrupt Flags(KR0 to KR7)"]
79 #[inline(always)]
80 pub fn krmd(
81 self,
82 ) -> crate::common::RegisterField<
83 7,
84 0x1,
85 1,
86 0,
87 krctl::Krmd,
88 krctl::Krmd,
89 Krctl_SPEC,
90 crate::common::RW,
91 > {
92 crate::common::RegisterField::<
93 7,
94 0x1,
95 1,
96 0,
97 krctl::Krmd,
98 krctl::Krmd,
99 Krctl_SPEC,
100 crate::common::RW,
101 >::from_register(self, 0)
102 }
103
104 #[doc = "These bits are read as 000000. The write value should be 000000."]
105 #[inline(always)]
106 pub fn reserved(
107 self,
108 ) -> crate::common::RegisterField<1, 0x3f, 1, 0, u8, u8, Krctl_SPEC, crate::common::RW> {
109 crate::common::RegisterField::<1,0x3f,1,0,u8,u8,Krctl_SPEC,crate::common::RW>::from_register(self,0)
110 }
111
112 #[doc = "Detection Edge Selection (KRF0 to KRF7)"]
113 #[inline(always)]
114 pub fn kreg(
115 self,
116 ) -> crate::common::RegisterField<
117 0,
118 0x1,
119 1,
120 0,
121 krctl::Kreg,
122 krctl::Kreg,
123 Krctl_SPEC,
124 crate::common::RW,
125 > {
126 crate::common::RegisterField::<
127 0,
128 0x1,
129 1,
130 0,
131 krctl::Kreg,
132 krctl::Kreg,
133 Krctl_SPEC,
134 crate::common::RW,
135 >::from_register(self, 0)
136 }
137}
138impl ::core::default::Default for Krctl {
139 #[inline(always)]
140 fn default() -> Krctl {
141 <crate::RegValueT<Krctl_SPEC> as RegisterValue<_>>::new(0)
142 }
143}
144pub mod krctl {
145
146 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
147 pub struct Krmd_SPEC;
148 pub type Krmd = crate::EnumBitfieldStruct<u8, Krmd_SPEC>;
149 impl Krmd {
150 #[doc = "Do not use key interrupt flags"]
151 pub const _0: Self = Self::new(0);
152
153 #[doc = "Use key interrupt flags."]
154 pub const _1: Self = Self::new(1);
155 }
156 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
157 pub struct Kreg_SPEC;
158 pub type Kreg = crate::EnumBitfieldStruct<u8, Kreg_SPEC>;
159 impl Kreg {
160 #[doc = "Falling edge"]
161 pub const _0: Self = Self::new(0);
162
163 #[doc = "Rising edge"]
164 pub const _1: Self = Self::new(1);
165 }
166}
167#[doc(hidden)]
168#[derive(Copy, Clone, Eq, PartialEq)]
169pub struct Krf_SPEC;
170impl crate::sealed::RegSpec for Krf_SPEC {
171 type DataType = u8;
172}
173
174#[doc = "KEY Return Flag Register"]
175pub type Krf = crate::RegValueT<Krf_SPEC>;
176
177impl Krf {
178 #[doc = "Key interrupt flag 7"]
179 #[inline(always)]
180 pub fn krf7(
181 self,
182 ) -> crate::common::RegisterField<7, 0x1, 1, 0, krf::Krf7, krf::Krf7, Krf_SPEC, crate::common::RW>
183 {
184 crate::common::RegisterField::<
185 7,
186 0x1,
187 1,
188 0,
189 krf::Krf7,
190 krf::Krf7,
191 Krf_SPEC,
192 crate::common::RW,
193 >::from_register(self, 0)
194 }
195
196 #[doc = "Key interrupt flag 6"]
197 #[inline(always)]
198 pub fn krf6(
199 self,
200 ) -> crate::common::RegisterField<6, 0x1, 1, 0, krf::Krf6, krf::Krf6, Krf_SPEC, crate::common::RW>
201 {
202 crate::common::RegisterField::<
203 6,
204 0x1,
205 1,
206 0,
207 krf::Krf6,
208 krf::Krf6,
209 Krf_SPEC,
210 crate::common::RW,
211 >::from_register(self, 0)
212 }
213
214 #[doc = "Key interrupt flag 5"]
215 #[inline(always)]
216 pub fn krf5(
217 self,
218 ) -> crate::common::RegisterField<5, 0x1, 1, 0, krf::Krf5, krf::Krf5, Krf_SPEC, crate::common::RW>
219 {
220 crate::common::RegisterField::<
221 5,
222 0x1,
223 1,
224 0,
225 krf::Krf5,
226 krf::Krf5,
227 Krf_SPEC,
228 crate::common::RW,
229 >::from_register(self, 0)
230 }
231
232 #[doc = "Key interrupt flag 4"]
233 #[inline(always)]
234 pub fn krf4(
235 self,
236 ) -> crate::common::RegisterField<4, 0x1, 1, 0, krf::Krf4, krf::Krf4, Krf_SPEC, crate::common::RW>
237 {
238 crate::common::RegisterField::<
239 4,
240 0x1,
241 1,
242 0,
243 krf::Krf4,
244 krf::Krf4,
245 Krf_SPEC,
246 crate::common::RW,
247 >::from_register(self, 0)
248 }
249
250 #[doc = "Key interrupt flag 3"]
251 #[inline(always)]
252 pub fn krf3(
253 self,
254 ) -> crate::common::RegisterField<3, 0x1, 1, 0, krf::Krf3, krf::Krf3, Krf_SPEC, crate::common::RW>
255 {
256 crate::common::RegisterField::<
257 3,
258 0x1,
259 1,
260 0,
261 krf::Krf3,
262 krf::Krf3,
263 Krf_SPEC,
264 crate::common::RW,
265 >::from_register(self, 0)
266 }
267
268 #[doc = "Key interrupt flag 2"]
269 #[inline(always)]
270 pub fn krf2(
271 self,
272 ) -> crate::common::RegisterField<2, 0x1, 1, 0, krf::Krf2, krf::Krf2, Krf_SPEC, crate::common::RW>
273 {
274 crate::common::RegisterField::<
275 2,
276 0x1,
277 1,
278 0,
279 krf::Krf2,
280 krf::Krf2,
281 Krf_SPEC,
282 crate::common::RW,
283 >::from_register(self, 0)
284 }
285
286 #[doc = "Key interrupt flag 1"]
287 #[inline(always)]
288 pub fn krf1(
289 self,
290 ) -> crate::common::RegisterField<1, 0x1, 1, 0, krf::Krf1, krf::Krf1, Krf_SPEC, crate::common::RW>
291 {
292 crate::common::RegisterField::<
293 1,
294 0x1,
295 1,
296 0,
297 krf::Krf1,
298 krf::Krf1,
299 Krf_SPEC,
300 crate::common::RW,
301 >::from_register(self, 0)
302 }
303
304 #[doc = "Key interrupt flag 0"]
305 #[inline(always)]
306 pub fn krf0(
307 self,
308 ) -> crate::common::RegisterField<0, 0x1, 1, 0, krf::Krf0, krf::Krf0, Krf_SPEC, crate::common::RW>
309 {
310 crate::common::RegisterField::<
311 0,
312 0x1,
313 1,
314 0,
315 krf::Krf0,
316 krf::Krf0,
317 Krf_SPEC,
318 crate::common::RW,
319 >::from_register(self, 0)
320 }
321}
322impl ::core::default::Default for Krf {
323 #[inline(always)]
324 fn default() -> Krf {
325 <crate::RegValueT<Krf_SPEC> as RegisterValue<_>>::new(0)
326 }
327}
328pub mod krf {
329
330 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
331 pub struct Krf7_SPEC;
332 pub type Krf7 = crate::EnumBitfieldStruct<u8, Krf7_SPEC>;
333 impl Krf7 {
334 #[doc = "No interrupt detected"]
335 pub const _0: Self = Self::new(0);
336
337 #[doc = "Interrupt detected."]
338 pub const _1: Self = Self::new(1);
339 }
340 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
341 pub struct Krf6_SPEC;
342 pub type Krf6 = crate::EnumBitfieldStruct<u8, Krf6_SPEC>;
343 impl Krf6 {
344 #[doc = "No interrupt detected"]
345 pub const _0: Self = Self::new(0);
346
347 #[doc = "Interrupt detected."]
348 pub const _1: Self = Self::new(1);
349 }
350 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
351 pub struct Krf5_SPEC;
352 pub type Krf5 = crate::EnumBitfieldStruct<u8, Krf5_SPEC>;
353 impl Krf5 {
354 #[doc = "No interrupt detected"]
355 pub const _0: Self = Self::new(0);
356
357 #[doc = "Interrupt detected."]
358 pub const _1: Self = Self::new(1);
359 }
360 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
361 pub struct Krf4_SPEC;
362 pub type Krf4 = crate::EnumBitfieldStruct<u8, Krf4_SPEC>;
363 impl Krf4 {
364 #[doc = "No interrupt detected"]
365 pub const _0: Self = Self::new(0);
366
367 #[doc = "Interrupt detected."]
368 pub const _1: Self = Self::new(1);
369 }
370 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
371 pub struct Krf3_SPEC;
372 pub type Krf3 = crate::EnumBitfieldStruct<u8, Krf3_SPEC>;
373 impl Krf3 {
374 #[doc = "No interrupt detected"]
375 pub const _0: Self = Self::new(0);
376
377 #[doc = "Interrupt detected."]
378 pub const _1: Self = Self::new(1);
379 }
380 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
381 pub struct Krf2_SPEC;
382 pub type Krf2 = crate::EnumBitfieldStruct<u8, Krf2_SPEC>;
383 impl Krf2 {
384 #[doc = "No interrupt detected"]
385 pub const _0: Self = Self::new(0);
386
387 #[doc = "Interrupt detected."]
388 pub const _1: Self = Self::new(1);
389 }
390 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
391 pub struct Krf1_SPEC;
392 pub type Krf1 = crate::EnumBitfieldStruct<u8, Krf1_SPEC>;
393 impl Krf1 {
394 #[doc = "No interrupt detected"]
395 pub const _0: Self = Self::new(0);
396
397 #[doc = "Interrupt detected."]
398 pub const _1: Self = Self::new(1);
399 }
400 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
401 pub struct Krf0_SPEC;
402 pub type Krf0 = crate::EnumBitfieldStruct<u8, Krf0_SPEC>;
403 impl Krf0 {
404 #[doc = "No interrupt detected"]
405 pub const _0: Self = Self::new(0);
406
407 #[doc = "Interrupt detected."]
408 pub const _1: Self = Self::new(1);
409 }
410}
411#[doc(hidden)]
412#[derive(Copy, Clone, Eq, PartialEq)]
413pub struct Krm_SPEC;
414impl crate::sealed::RegSpec for Krm_SPEC {
415 type DataType = u8;
416}
417
418#[doc = "KEY Return Mode Register"]
419pub type Krm = crate::RegValueT<Krm_SPEC>;
420
421impl Krm {
422 #[doc = "Key interrupt mode control 7"]
423 #[inline(always)]
424 pub fn krm7(
425 self,
426 ) -> crate::common::RegisterField<7, 0x1, 1, 0, krm::Krm7, krm::Krm7, Krm_SPEC, crate::common::RW>
427 {
428 crate::common::RegisterField::<
429 7,
430 0x1,
431 1,
432 0,
433 krm::Krm7,
434 krm::Krm7,
435 Krm_SPEC,
436 crate::common::RW,
437 >::from_register(self, 0)
438 }
439
440 #[doc = "Key interrupt mode control 6"]
441 #[inline(always)]
442 pub fn krm6(
443 self,
444 ) -> crate::common::RegisterField<6, 0x1, 1, 0, krm::Krm6, krm::Krm6, Krm_SPEC, crate::common::RW>
445 {
446 crate::common::RegisterField::<
447 6,
448 0x1,
449 1,
450 0,
451 krm::Krm6,
452 krm::Krm6,
453 Krm_SPEC,
454 crate::common::RW,
455 >::from_register(self, 0)
456 }
457
458 #[doc = "Key interrupt mode control 5"]
459 #[inline(always)]
460 pub fn krm5(
461 self,
462 ) -> crate::common::RegisterField<5, 0x1, 1, 0, krm::Krm5, krm::Krm5, Krm_SPEC, crate::common::RW>
463 {
464 crate::common::RegisterField::<
465 5,
466 0x1,
467 1,
468 0,
469 krm::Krm5,
470 krm::Krm5,
471 Krm_SPEC,
472 crate::common::RW,
473 >::from_register(self, 0)
474 }
475
476 #[doc = "Key interrupt mode control 4"]
477 #[inline(always)]
478 pub fn krm4(
479 self,
480 ) -> crate::common::RegisterField<4, 0x1, 1, 0, krm::Krm4, krm::Krm4, Krm_SPEC, crate::common::RW>
481 {
482 crate::common::RegisterField::<
483 4,
484 0x1,
485 1,
486 0,
487 krm::Krm4,
488 krm::Krm4,
489 Krm_SPEC,
490 crate::common::RW,
491 >::from_register(self, 0)
492 }
493
494 #[doc = "Key interrupt mode control 3"]
495 #[inline(always)]
496 pub fn krm3(
497 self,
498 ) -> crate::common::RegisterField<3, 0x1, 1, 0, krm::Krm3, krm::Krm3, Krm_SPEC, crate::common::RW>
499 {
500 crate::common::RegisterField::<
501 3,
502 0x1,
503 1,
504 0,
505 krm::Krm3,
506 krm::Krm3,
507 Krm_SPEC,
508 crate::common::RW,
509 >::from_register(self, 0)
510 }
511
512 #[doc = "Key interrupt mode control 2"]
513 #[inline(always)]
514 pub fn krm2(
515 self,
516 ) -> crate::common::RegisterField<2, 0x1, 1, 0, krm::Krm2, krm::Krm2, Krm_SPEC, crate::common::RW>
517 {
518 crate::common::RegisterField::<
519 2,
520 0x1,
521 1,
522 0,
523 krm::Krm2,
524 krm::Krm2,
525 Krm_SPEC,
526 crate::common::RW,
527 >::from_register(self, 0)
528 }
529
530 #[doc = "Key interrupt mode control 1"]
531 #[inline(always)]
532 pub fn krm1(
533 self,
534 ) -> crate::common::RegisterField<1, 0x1, 1, 0, krm::Krm1, krm::Krm1, Krm_SPEC, crate::common::RW>
535 {
536 crate::common::RegisterField::<
537 1,
538 0x1,
539 1,
540 0,
541 krm::Krm1,
542 krm::Krm1,
543 Krm_SPEC,
544 crate::common::RW,
545 >::from_register(self, 0)
546 }
547
548 #[doc = "Key interrupt mode control 0"]
549 #[inline(always)]
550 pub fn krm0(
551 self,
552 ) -> crate::common::RegisterField<0, 0x1, 1, 0, krm::Krm0, krm::Krm0, Krm_SPEC, crate::common::RW>
553 {
554 crate::common::RegisterField::<
555 0,
556 0x1,
557 1,
558 0,
559 krm::Krm0,
560 krm::Krm0,
561 Krm_SPEC,
562 crate::common::RW,
563 >::from_register(self, 0)
564 }
565}
566impl ::core::default::Default for Krm {
567 #[inline(always)]
568 fn default() -> Krm {
569 <crate::RegValueT<Krm_SPEC> as RegisterValue<_>>::new(0)
570 }
571}
572pub mod krm {
573
574 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
575 pub struct Krm7_SPEC;
576 pub type Krm7 = crate::EnumBitfieldStruct<u8, Krm7_SPEC>;
577 impl Krm7 {
578 #[doc = "Does not detect key interrupt signal"]
579 pub const _0: Self = Self::new(0);
580
581 #[doc = "Detect key interrupt signal."]
582 pub const _1: Self = Self::new(1);
583 }
584 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
585 pub struct Krm6_SPEC;
586 pub type Krm6 = crate::EnumBitfieldStruct<u8, Krm6_SPEC>;
587 impl Krm6 {
588 #[doc = "Does not detect key interrupt signal"]
589 pub const _0: Self = Self::new(0);
590
591 #[doc = "Detect key interrupt signal."]
592 pub const _1: Self = Self::new(1);
593 }
594 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
595 pub struct Krm5_SPEC;
596 pub type Krm5 = crate::EnumBitfieldStruct<u8, Krm5_SPEC>;
597 impl Krm5 {
598 #[doc = "Does not detect key interrupt signal"]
599 pub const _0: Self = Self::new(0);
600
601 #[doc = "Detect key interrupt signal."]
602 pub const _1: Self = Self::new(1);
603 }
604 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
605 pub struct Krm4_SPEC;
606 pub type Krm4 = crate::EnumBitfieldStruct<u8, Krm4_SPEC>;
607 impl Krm4 {
608 #[doc = "Does not detect key interrupt signal"]
609 pub const _0: Self = Self::new(0);
610
611 #[doc = "Detect key interrupt signal."]
612 pub const _1: Self = Self::new(1);
613 }
614 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
615 pub struct Krm3_SPEC;
616 pub type Krm3 = crate::EnumBitfieldStruct<u8, Krm3_SPEC>;
617 impl Krm3 {
618 #[doc = "Does not detect key interrupt signal"]
619 pub const _0: Self = Self::new(0);
620
621 #[doc = "Detect key interrupt signal."]
622 pub const _1: Self = Self::new(1);
623 }
624 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
625 pub struct Krm2_SPEC;
626 pub type Krm2 = crate::EnumBitfieldStruct<u8, Krm2_SPEC>;
627 impl Krm2 {
628 #[doc = "Does not detect key interrupt signal"]
629 pub const _0: Self = Self::new(0);
630
631 #[doc = "Detect key interrupt signal."]
632 pub const _1: Self = Self::new(1);
633 }
634 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
635 pub struct Krm1_SPEC;
636 pub type Krm1 = crate::EnumBitfieldStruct<u8, Krm1_SPEC>;
637 impl Krm1 {
638 #[doc = "Does not detect key interrupt signal"]
639 pub const _0: Self = Self::new(0);
640
641 #[doc = "Detect key interrupt signal."]
642 pub const _1: Self = Self::new(1);
643 }
644 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
645 pub struct Krm0_SPEC;
646 pub type Krm0 = crate::EnumBitfieldStruct<u8, Krm0_SPEC>;
647 impl Krm0 {
648 #[doc = "Does not detect key interrupt signal"]
649 pub const _0: Self = Self::new(0);
650
651 #[doc = "Detect key interrupt signal."]
652 pub const _1: Self = Self::new(1);
653 }
654}