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"WAKEUP registers"]
28unsafe impl ::core::marker::Send for super::Wakeup {}
29unsafe impl ::core::marker::Sync for super::Wakeup {}
30impl super::Wakeup {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36
37 #[doc = "Clear event register for P0"]
38 #[inline(always)]
39 pub const fn wkup_clear_p0_reg(
40 &self,
41 ) -> &'static crate::common::Reg<self::WkupClearP0Reg_SPEC, crate::common::RW> {
42 unsafe {
43 crate::common::Reg::<self::WkupClearP0Reg_SPEC, crate::common::RW>::from_ptr(
44 self._svd2pac_as_ptr().add(72usize),
45 )
46 }
47 }
48
49 #[doc = "Clear event register for P1"]
50 #[inline(always)]
51 pub const fn wkup_clear_p1_reg(
52 &self,
53 ) -> &'static crate::common::Reg<self::WkupClearP1Reg_SPEC, crate::common::RW> {
54 unsafe {
55 crate::common::Reg::<self::WkupClearP1Reg_SPEC, crate::common::RW>::from_ptr(
56 self._svd2pac_as_ptr().add(76usize),
57 )
58 }
59 }
60
61 #[doc = "Control register for the wakeup counter"]
62 #[inline(always)]
63 pub const fn wkup_ctrl_reg(
64 &self,
65 ) -> &'static crate::common::Reg<self::WkupCtrlReg_SPEC, crate::common::RW> {
66 unsafe {
67 crate::common::Reg::<self::WkupCtrlReg_SPEC, crate::common::RW>::from_ptr(
68 self._svd2pac_as_ptr().add(0usize),
69 )
70 }
71 }
72
73 #[doc = "select the sesitivity polarity for each P0 input"]
74 #[inline(always)]
75 pub const fn wkup_pol_p0_reg(
76 &self,
77 ) -> &'static crate::common::Reg<self::WkupPolP0Reg_SPEC, crate::common::RW> {
78 unsafe {
79 crate::common::Reg::<self::WkupPolP0Reg_SPEC, crate::common::RW>::from_ptr(
80 self._svd2pac_as_ptr().add(40usize),
81 )
82 }
83 }
84
85 #[doc = "select the sesitivity polarity for each P1 input"]
86 #[inline(always)]
87 pub const fn wkup_pol_p1_reg(
88 &self,
89 ) -> &'static crate::common::Reg<self::WkupPolP1Reg_SPEC, crate::common::RW> {
90 unsafe {
91 crate::common::Reg::<self::WkupPolP1Reg_SPEC, crate::common::RW>::from_ptr(
92 self._svd2pac_as_ptr().add(44usize),
93 )
94 }
95 }
96
97 #[doc = "Reset wakeup interrupt"]
98 #[inline(always)]
99 pub const fn wkup_reset_irq_reg(
100 &self,
101 ) -> &'static crate::common::Reg<self::WkupResetIrqReg_SPEC, crate::common::RW> {
102 unsafe {
103 crate::common::Reg::<self::WkupResetIrqReg_SPEC, crate::common::RW>::from_ptr(
104 self._svd2pac_as_ptr().add(8usize),
105 )
106 }
107 }
108
109 #[doc = "select which inputs from P0 port can trigger wkup counter"]
110 #[inline(always)]
111 pub const fn wkup_select_p0_reg(
112 &self,
113 ) -> &'static crate::common::Reg<self::WkupSelectP0Reg_SPEC, crate::common::RW> {
114 unsafe {
115 crate::common::Reg::<self::WkupSelectP0Reg_SPEC, crate::common::RW>::from_ptr(
116 self._svd2pac_as_ptr().add(20usize),
117 )
118 }
119 }
120
121 #[doc = "select which inputs from P1 port can trigger wkup counter"]
122 #[inline(always)]
123 pub const fn wkup_select_p1_reg(
124 &self,
125 ) -> &'static crate::common::Reg<self::WkupSelectP1Reg_SPEC, crate::common::RW> {
126 unsafe {
127 crate::common::Reg::<self::WkupSelectP1Reg_SPEC, crate::common::RW>::from_ptr(
128 self._svd2pac_as_ptr().add(24usize),
129 )
130 }
131 }
132
133 #[doc = "select which inputs from P0 port can trigger interrupt"]
134 #[inline(always)]
135 pub const fn wkup_sel_gpio_p0_reg(
136 &self,
137 ) -> &'static crate::common::Reg<self::WkupSelGpioP0Reg_SPEC, crate::common::RW> {
138 unsafe {
139 crate::common::Reg::<self::WkupSelGpioP0Reg_SPEC, crate::common::RW>::from_ptr(
140 self._svd2pac_as_ptr().add(84usize),
141 )
142 }
143 }
144
145 #[doc = "select which inputs from P1 port can trigger interrupt"]
146 #[inline(always)]
147 pub const fn wkup_sel_gpio_p1_reg(
148 &self,
149 ) -> &'static crate::common::Reg<self::WkupSelGpioP1Reg_SPEC, crate::common::RW> {
150 unsafe {
151 crate::common::Reg::<self::WkupSelGpioP1Reg_SPEC, crate::common::RW>::from_ptr(
152 self._svd2pac_as_ptr().add(88usize),
153 )
154 }
155 }
156
157 #[doc = "Event status register for P0"]
158 #[inline(always)]
159 pub const fn wkup_status_p0_reg(
160 &self,
161 ) -> &'static crate::common::Reg<self::WkupStatusP0Reg_SPEC, crate::common::RW> {
162 unsafe {
163 crate::common::Reg::<self::WkupStatusP0Reg_SPEC, crate::common::RW>::from_ptr(
164 self._svd2pac_as_ptr().add(60usize),
165 )
166 }
167 }
168
169 #[doc = "Event status register for P1"]
170 #[inline(always)]
171 pub const fn wkup_status_p1_reg(
172 &self,
173 ) -> &'static crate::common::Reg<self::WkupStatusP1Reg_SPEC, crate::common::RW> {
174 unsafe {
175 crate::common::Reg::<self::WkupStatusP1Reg_SPEC, crate::common::RW>::from_ptr(
176 self._svd2pac_as_ptr().add(64usize),
177 )
178 }
179 }
180}
181#[doc(hidden)]
182#[derive(Copy, Clone, Eq, PartialEq)]
183pub struct WkupClearP0Reg_SPEC;
184impl crate::sealed::RegSpec for WkupClearP0Reg_SPEC {
185 type DataType = u32;
186}
187
188#[doc = "Clear event register for P0"]
189pub type WkupClearP0Reg = crate::RegValueT<WkupClearP0Reg_SPEC>;
190
191impl WkupClearP0Reg {
192 #[doc = "Clear latched value of the GPIOs P0 when corresponding bit is 1"]
193 #[inline(always)]
194 pub fn wkup_clear_p0(
195 self,
196 ) -> crate::common::RegisterField<
197 0,
198 0xffffffff,
199 1,
200 0,
201 u32,
202 u32,
203 WkupClearP0Reg_SPEC,
204 crate::common::W,
205 > {
206 crate::common::RegisterField::<
207 0,
208 0xffffffff,
209 1,
210 0,
211 u32,
212 u32,
213 WkupClearP0Reg_SPEC,
214 crate::common::W,
215 >::from_register(self, 0)
216 }
217}
218impl ::core::default::Default for WkupClearP0Reg {
219 #[inline(always)]
220 fn default() -> WkupClearP0Reg {
221 <crate::RegValueT<WkupClearP0Reg_SPEC> as RegisterValue<_>>::new(0)
222 }
223}
224
225#[doc(hidden)]
226#[derive(Copy, Clone, Eq, PartialEq)]
227pub struct WkupClearP1Reg_SPEC;
228impl crate::sealed::RegSpec for WkupClearP1Reg_SPEC {
229 type DataType = u32;
230}
231
232#[doc = "Clear event register for P1"]
233pub type WkupClearP1Reg = crate::RegValueT<WkupClearP1Reg_SPEC>;
234
235impl WkupClearP1Reg {
236 #[doc = "Clear latched value of the GPIOs P1 when corresponding bit is 1"]
237 #[inline(always)]
238 pub fn wkup_clear_p1(
239 self,
240 ) -> crate::common::RegisterField<
241 0,
242 0x7fffff,
243 1,
244 0,
245 u32,
246 u32,
247 WkupClearP1Reg_SPEC,
248 crate::common::W,
249 > {
250 crate::common::RegisterField::<
251 0,
252 0x7fffff,
253 1,
254 0,
255 u32,
256 u32,
257 WkupClearP1Reg_SPEC,
258 crate::common::W,
259 >::from_register(self, 0)
260 }
261}
262impl ::core::default::Default for WkupClearP1Reg {
263 #[inline(always)]
264 fn default() -> WkupClearP1Reg {
265 <crate::RegValueT<WkupClearP1Reg_SPEC> as RegisterValue<_>>::new(0)
266 }
267}
268
269#[doc(hidden)]
270#[derive(Copy, Clone, Eq, PartialEq)]
271pub struct WkupCtrlReg_SPEC;
272impl crate::sealed::RegSpec for WkupCtrlReg_SPEC {
273 type DataType = u32;
274}
275
276#[doc = "Control register for the wakeup counter"]
277pub type WkupCtrlReg = crate::RegValueT<WkupCtrlReg_SPEC>;
278
279impl WkupCtrlReg {
280 #[doc = "0: no interrupt will be enabled\n1: if you have an event an IRQ will be generated"]
281 #[inline(always)]
282 pub fn wkup_enable_irq(
283 self,
284 ) -> crate::common::RegisterFieldBool<7, 1, 0, WkupCtrlReg_SPEC, crate::common::RW> {
285 crate::common::RegisterFieldBool::<7,1,0,WkupCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
286 }
287
288 #[doc = "0 = no effect\n1 = emulate key hit. First make this bit 0 before any new key hit can be sensed."]
289 #[inline(always)]
290 pub fn wkup_sft_keyhit(
291 self,
292 ) -> crate::common::RegisterFieldBool<6, 1, 0, WkupCtrlReg_SPEC, crate::common::RW> {
293 crate::common::RegisterFieldBool::<6,1,0,WkupCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
294 }
295
296 #[doc = "Wakeup debounce time. If set to 0, no debouncing will be done.\nDebounce time: N*1 ms. N =1..63"]
297 #[inline(always)]
298 pub fn wkup_deb_value(
299 self,
300 ) -> crate::common::RegisterField<0, 0x3f, 1, 0, u8, u8, WkupCtrlReg_SPEC, crate::common::RW>
301 {
302 crate::common::RegisterField::<0,0x3f,1,0,u8,u8,WkupCtrlReg_SPEC,crate::common::RW>::from_register(self,0)
303 }
304}
305impl ::core::default::Default for WkupCtrlReg {
306 #[inline(always)]
307 fn default() -> WkupCtrlReg {
308 <crate::RegValueT<WkupCtrlReg_SPEC> as RegisterValue<_>>::new(0)
309 }
310}
311
312#[doc(hidden)]
313#[derive(Copy, Clone, Eq, PartialEq)]
314pub struct WkupPolP0Reg_SPEC;
315impl crate::sealed::RegSpec for WkupPolP0Reg_SPEC {
316 type DataType = u32;
317}
318
319#[doc = "select the sesitivity polarity for each P0 input"]
320pub type WkupPolP0Reg = crate::RegValueT<WkupPolP0Reg_SPEC>;
321
322impl WkupPolP0Reg {
323 #[doc = "0: enabled input P0_xx will give an event if that input goes high\n1: enabled input P0_xx will give an event if that input goes low"]
324 #[inline(always)]
325 pub fn wkup_pol_p0(
326 self,
327 ) -> crate::common::RegisterField<
328 0,
329 0xffffffff,
330 1,
331 0,
332 u32,
333 u32,
334 WkupPolP0Reg_SPEC,
335 crate::common::RW,
336 > {
337 crate::common::RegisterField::<
338 0,
339 0xffffffff,
340 1,
341 0,
342 u32,
343 u32,
344 WkupPolP0Reg_SPEC,
345 crate::common::RW,
346 >::from_register(self, 0)
347 }
348}
349impl ::core::default::Default for WkupPolP0Reg {
350 #[inline(always)]
351 fn default() -> WkupPolP0Reg {
352 <crate::RegValueT<WkupPolP0Reg_SPEC> as RegisterValue<_>>::new(0)
353 }
354}
355
356#[doc(hidden)]
357#[derive(Copy, Clone, Eq, PartialEq)]
358pub struct WkupPolP1Reg_SPEC;
359impl crate::sealed::RegSpec for WkupPolP1Reg_SPEC {
360 type DataType = u32;
361}
362
363#[doc = "select the sesitivity polarity for each P1 input"]
364pub type WkupPolP1Reg = crate::RegValueT<WkupPolP1Reg_SPEC>;
365
366impl WkupPolP1Reg {
367 #[doc = "0: enabled input P1_xx will give an event if that input goes high\n1: enabled input P1_xx will give an event if that input goes low"]
368 #[inline(always)]
369 pub fn wkup_pol_p1(
370 self,
371 ) -> crate::common::RegisterField<
372 0,
373 0x7fffff,
374 1,
375 0,
376 u32,
377 u32,
378 WkupPolP1Reg_SPEC,
379 crate::common::RW,
380 > {
381 crate::common::RegisterField::<
382 0,
383 0x7fffff,
384 1,
385 0,
386 u32,
387 u32,
388 WkupPolP1Reg_SPEC,
389 crate::common::RW,
390 >::from_register(self, 0)
391 }
392}
393impl ::core::default::Default for WkupPolP1Reg {
394 #[inline(always)]
395 fn default() -> WkupPolP1Reg {
396 <crate::RegValueT<WkupPolP1Reg_SPEC> as RegisterValue<_>>::new(0)
397 }
398}
399
400#[doc(hidden)]
401#[derive(Copy, Clone, Eq, PartialEq)]
402pub struct WkupResetIrqReg_SPEC;
403impl crate::sealed::RegSpec for WkupResetIrqReg_SPEC {
404 type DataType = u32;
405}
406
407#[doc = "Reset wakeup interrupt"]
408pub type WkupResetIrqReg = crate::RegValueT<WkupResetIrqReg_SPEC>;
409
410impl WkupResetIrqReg {
411 #[doc = "writing any value to this register will reset the interrupt. reading always returns 0."]
412 #[inline(always)]
413 pub fn wkup_irq_rst(
414 self,
415 ) -> crate::common::RegisterField<
416 0,
417 0xffff,
418 1,
419 0,
420 u16,
421 u16,
422 WkupResetIrqReg_SPEC,
423 crate::common::W,
424 > {
425 crate::common::RegisterField::<
426 0,
427 0xffff,
428 1,
429 0,
430 u16,
431 u16,
432 WkupResetIrqReg_SPEC,
433 crate::common::W,
434 >::from_register(self, 0)
435 }
436}
437impl ::core::default::Default for WkupResetIrqReg {
438 #[inline(always)]
439 fn default() -> WkupResetIrqReg {
440 <crate::RegValueT<WkupResetIrqReg_SPEC> as RegisterValue<_>>::new(0)
441 }
442}
443
444#[doc(hidden)]
445#[derive(Copy, Clone, Eq, PartialEq)]
446pub struct WkupSelectP0Reg_SPEC;
447impl crate::sealed::RegSpec for WkupSelectP0Reg_SPEC {
448 type DataType = u32;
449}
450
451#[doc = "select which inputs from P0 port can trigger wkup counter"]
452pub type WkupSelectP0Reg = crate::RegValueT<WkupSelectP0Reg_SPEC>;
453
454impl WkupSelectP0Reg {
455 #[doc = "0: input P0_xx is not enabled for wakeup event\n1: input P0_xx is enabled for wakeup event"]
456 #[inline(always)]
457 pub fn wkup_select_p0(
458 self,
459 ) -> crate::common::RegisterField<
460 0,
461 0xffffffff,
462 1,
463 0,
464 u32,
465 u32,
466 WkupSelectP0Reg_SPEC,
467 crate::common::RW,
468 > {
469 crate::common::RegisterField::<
470 0,
471 0xffffffff,
472 1,
473 0,
474 u32,
475 u32,
476 WkupSelectP0Reg_SPEC,
477 crate::common::RW,
478 >::from_register(self, 0)
479 }
480}
481impl ::core::default::Default for WkupSelectP0Reg {
482 #[inline(always)]
483 fn default() -> WkupSelectP0Reg {
484 <crate::RegValueT<WkupSelectP0Reg_SPEC> as RegisterValue<_>>::new(0)
485 }
486}
487
488#[doc(hidden)]
489#[derive(Copy, Clone, Eq, PartialEq)]
490pub struct WkupSelectP1Reg_SPEC;
491impl crate::sealed::RegSpec for WkupSelectP1Reg_SPEC {
492 type DataType = u32;
493}
494
495#[doc = "select which inputs from P1 port can trigger wkup counter"]
496pub type WkupSelectP1Reg = crate::RegValueT<WkupSelectP1Reg_SPEC>;
497
498impl WkupSelectP1Reg {
499 #[doc = "0: input P1_xx is not enabled for wakeup event\n1: input P1_xx is enabled for wakeup event"]
500 #[inline(always)]
501 pub fn wkup_select_p1(
502 self,
503 ) -> crate::common::RegisterField<
504 0,
505 0x7fffff,
506 1,
507 0,
508 u32,
509 u32,
510 WkupSelectP1Reg_SPEC,
511 crate::common::RW,
512 > {
513 crate::common::RegisterField::<
514 0,
515 0x7fffff,
516 1,
517 0,
518 u32,
519 u32,
520 WkupSelectP1Reg_SPEC,
521 crate::common::RW,
522 >::from_register(self, 0)
523 }
524}
525impl ::core::default::Default for WkupSelectP1Reg {
526 #[inline(always)]
527 fn default() -> WkupSelectP1Reg {
528 <crate::RegValueT<WkupSelectP1Reg_SPEC> as RegisterValue<_>>::new(0)
529 }
530}
531
532#[doc(hidden)]
533#[derive(Copy, Clone, Eq, PartialEq)]
534pub struct WkupSelGpioP0Reg_SPEC;
535impl crate::sealed::RegSpec for WkupSelGpioP0Reg_SPEC {
536 type DataType = u32;
537}
538
539#[doc = "select which inputs from P0 port can trigger interrupt"]
540pub type WkupSelGpioP0Reg = crate::RegValueT<WkupSelGpioP0Reg_SPEC>;
541
542impl WkupSelGpioP0Reg {
543 #[doc = "0: input P0_xx is not enabled for GPIO interrupt\n1: input P0_xx is enabled for GPIO interrupt"]
544 #[inline(always)]
545 pub fn wkup_sel_gpio_p0(
546 self,
547 ) -> crate::common::RegisterField<
548 0,
549 0xffffffff,
550 1,
551 0,
552 u32,
553 u32,
554 WkupSelGpioP0Reg_SPEC,
555 crate::common::RW,
556 > {
557 crate::common::RegisterField::<
558 0,
559 0xffffffff,
560 1,
561 0,
562 u32,
563 u32,
564 WkupSelGpioP0Reg_SPEC,
565 crate::common::RW,
566 >::from_register(self, 0)
567 }
568}
569impl ::core::default::Default for WkupSelGpioP0Reg {
570 #[inline(always)]
571 fn default() -> WkupSelGpioP0Reg {
572 <crate::RegValueT<WkupSelGpioP0Reg_SPEC> as RegisterValue<_>>::new(0)
573 }
574}
575
576#[doc(hidden)]
577#[derive(Copy, Clone, Eq, PartialEq)]
578pub struct WkupSelGpioP1Reg_SPEC;
579impl crate::sealed::RegSpec for WkupSelGpioP1Reg_SPEC {
580 type DataType = u32;
581}
582
583#[doc = "select which inputs from P1 port can trigger interrupt"]
584pub type WkupSelGpioP1Reg = crate::RegValueT<WkupSelGpioP1Reg_SPEC>;
585
586impl WkupSelGpioP1Reg {
587 #[doc = "0: input P1_xx is not enabled for GPIO interrupt\n1: input P1_xx is enabled for GPIO interrupt"]
588 #[inline(always)]
589 pub fn wkup_sel_gpio_p1(
590 self,
591 ) -> crate::common::RegisterField<
592 0,
593 0x7fffff,
594 1,
595 0,
596 u32,
597 u32,
598 WkupSelGpioP1Reg_SPEC,
599 crate::common::RW,
600 > {
601 crate::common::RegisterField::<
602 0,
603 0x7fffff,
604 1,
605 0,
606 u32,
607 u32,
608 WkupSelGpioP1Reg_SPEC,
609 crate::common::RW,
610 >::from_register(self, 0)
611 }
612}
613impl ::core::default::Default for WkupSelGpioP1Reg {
614 #[inline(always)]
615 fn default() -> WkupSelGpioP1Reg {
616 <crate::RegValueT<WkupSelGpioP1Reg_SPEC> as RegisterValue<_>>::new(0)
617 }
618}
619
620#[doc(hidden)]
621#[derive(Copy, Clone, Eq, PartialEq)]
622pub struct WkupStatusP0Reg_SPEC;
623impl crate::sealed::RegSpec for WkupStatusP0Reg_SPEC {
624 type DataType = u32;
625}
626
627#[doc = "Event status register for P0"]
628pub type WkupStatusP0Reg = crate::RegValueT<WkupStatusP0Reg_SPEC>;
629
630impl WkupStatusP0Reg {
631 #[doc = "Contains the latched value of any toggle of the GPIOs Port P0. WKUP_STAT_P0\\[0\\] -> P0_00."]
632 #[inline(always)]
633 pub fn wkup_stat_p0(
634 self,
635 ) -> crate::common::RegisterField<
636 0,
637 0xffffffff,
638 1,
639 0,
640 u32,
641 u32,
642 WkupStatusP0Reg_SPEC,
643 crate::common::R,
644 > {
645 crate::common::RegisterField::<
646 0,
647 0xffffffff,
648 1,
649 0,
650 u32,
651 u32,
652 WkupStatusP0Reg_SPEC,
653 crate::common::R,
654 >::from_register(self, 0)
655 }
656}
657impl ::core::default::Default for WkupStatusP0Reg {
658 #[inline(always)]
659 fn default() -> WkupStatusP0Reg {
660 <crate::RegValueT<WkupStatusP0Reg_SPEC> as RegisterValue<_>>::new(0)
661 }
662}
663
664#[doc(hidden)]
665#[derive(Copy, Clone, Eq, PartialEq)]
666pub struct WkupStatusP1Reg_SPEC;
667impl crate::sealed::RegSpec for WkupStatusP1Reg_SPEC {
668 type DataType = u32;
669}
670
671#[doc = "Event status register for P1"]
672pub type WkupStatusP1Reg = crate::RegValueT<WkupStatusP1Reg_SPEC>;
673
674impl WkupStatusP1Reg {
675 #[doc = "Contains the latched value of any toggle of the GPIOs Port P1 WKUP_STATUS_1\\[0\\] -> P1_00."]
676 #[inline(always)]
677 pub fn wkup_stat_p1(
678 self,
679 ) -> crate::common::RegisterField<
680 0,
681 0x7fffff,
682 1,
683 0,
684 u32,
685 u32,
686 WkupStatusP1Reg_SPEC,
687 crate::common::R,
688 > {
689 crate::common::RegisterField::<
690 0,
691 0x7fffff,
692 1,
693 0,
694 u32,
695 u32,
696 WkupStatusP1Reg_SPEC,
697 crate::common::R,
698 >::from_register(self, 0)
699 }
700}
701impl ::core::default::Default for WkupStatusP1Reg {
702 #[inline(always)]
703 fn default() -> WkupStatusP1Reg {
704 <crate::RegValueT<WkupStatusP1Reg_SPEC> as RegisterValue<_>>::new(0)
705 }
706}