1#![doc = "Peripheral access API for EFM32PG12 microcontrollers (generated using svd2rust v0.17.0)\n\nYou can find an overview of the API [here].\n\n[here]: https://docs.rs/svd2rust/0.17.0/svd2rust/#peripheral-api"]
2#![deny(const_err)]
3#![deny(dead_code)]
4#![deny(improper_ctypes)]
5#![deny(legacy_directory_ownership)]
6#![deny(missing_docs)]
7#![deny(no_mangle_generic_items)]
8#![deny(non_shorthand_field_patterns)]
9#![deny(overflowing_literals)]
10#![deny(path_statements)]
11#![deny(patterns_in_fns_without_body)]
12#![deny(plugin_as_library)]
13#![deny(private_in_public)]
14#![deny(safe_extern_statics)]
15#![deny(unconditional_recursion)]
16#![deny(unions_with_drop_fields)]
17#![deny(unused_allocation)]
18#![deny(unused_comparisons)]
19#![deny(unused_parens)]
20#![deny(while_true)]
21#![allow(non_camel_case_types)]
22#![allow(non_snake_case)]
23#![no_std]
24extern crate bare_metal;
25extern crate cortex_m;
26#[cfg(feature = "rt")]
27extern crate cortex_m_rt;
28extern crate vcell;
29use core::marker::PhantomData;
30use core::ops::Deref;
31#[doc = r"Number available in the NVIC for configuring priority"]
32pub const NVIC_PRIO_BITS: u8 = 3;
33#[cfg(feature = "rt")]
34extern "C" {
35 fn EMU();
36 fn WDOG0();
37 fn WDOG1();
38 fn LDMA();
39 fn GPIO_EVEN();
40 fn TIMER0();
41 fn USART0_RX();
42 fn USART0_TX();
43 fn ACMP0();
44 fn ADC0();
45 fn IDAC0();
46 fn I2C0();
47 fn GPIO_ODD();
48 fn TIMER1();
49 fn USART1_RX();
50 fn USART1_TX();
51 fn LEUART0();
52 fn PCNT0();
53 fn CMU();
54 fn MSC();
55 fn CRYPTO0();
56 fn LETIMER0();
57 fn RTCC();
58 fn CRYOTIMER();
59 fn FPUEH();
60 fn SMU();
61 fn WTIMER0();
62 fn WTIMER1();
63 fn PCNT1();
64 fn PCNT2();
65 fn USART2_RX();
66 fn USART2_TX();
67 fn I2C1();
68 fn USART3_RX();
69 fn USART3_TX();
70 fn VDAC0();
71 fn CSEN();
72 fn LESENSE();
73 fn CRYPTO1();
74 fn TRNG0();
75}
76#[doc(hidden)]
77pub union Vector {
78 _handler: unsafe extern "C" fn(),
79 _reserved: u32,
80}
81#[cfg(feature = "rt")]
82#[doc(hidden)]
83#[link_section = ".vector_table.interrupts"]
84#[no_mangle]
85pub static __INTERRUPTS: [Vector; 50] = [
86 Vector { _handler: EMU },
87 Vector { _reserved: 0 },
88 Vector { _handler: WDOG0 },
89 Vector { _handler: WDOG1 },
90 Vector { _reserved: 0 },
91 Vector { _reserved: 0 },
92 Vector { _reserved: 0 },
93 Vector { _reserved: 0 },
94 Vector { _reserved: 0 },
95 Vector { _handler: LDMA },
96 Vector {
97 _handler: GPIO_EVEN,
98 },
99 Vector { _handler: TIMER0 },
100 Vector {
101 _handler: USART0_RX,
102 },
103 Vector {
104 _handler: USART0_TX,
105 },
106 Vector { _handler: ACMP0 },
107 Vector { _handler: ADC0 },
108 Vector { _handler: IDAC0 },
109 Vector { _handler: I2C0 },
110 Vector { _handler: GPIO_ODD },
111 Vector { _handler: TIMER1 },
112 Vector {
113 _handler: USART1_RX,
114 },
115 Vector {
116 _handler: USART1_TX,
117 },
118 Vector { _handler: LEUART0 },
119 Vector { _handler: PCNT0 },
120 Vector { _handler: CMU },
121 Vector { _handler: MSC },
122 Vector { _handler: CRYPTO0 },
123 Vector { _handler: LETIMER0 },
124 Vector { _reserved: 0 },
125 Vector { _reserved: 0 },
126 Vector { _handler: RTCC },
127 Vector { _reserved: 0 },
128 Vector {
129 _handler: CRYOTIMER,
130 },
131 Vector { _reserved: 0 },
132 Vector { _handler: FPUEH },
133 Vector { _handler: SMU },
134 Vector { _handler: WTIMER0 },
135 Vector { _handler: WTIMER1 },
136 Vector { _handler: PCNT1 },
137 Vector { _handler: PCNT2 },
138 Vector {
139 _handler: USART2_RX,
140 },
141 Vector {
142 _handler: USART2_TX,
143 },
144 Vector { _handler: I2C1 },
145 Vector {
146 _handler: USART3_RX,
147 },
148 Vector {
149 _handler: USART3_TX,
150 },
151 Vector { _handler: VDAC0 },
152 Vector { _handler: CSEN },
153 Vector { _handler: LESENSE },
154 Vector { _handler: CRYPTO1 },
155 Vector { _handler: TRNG0 },
156];
157#[doc = r"Enumeration of all the interrupts"]
158#[derive(Copy, Clone, Debug)]
159#[repr(u8)]
160pub enum Interrupt {
161 #[doc = "0 - EMU"]
162 EMU = 0,
163 #[doc = "2 - WDOG0"]
164 WDOG0 = 2,
165 #[doc = "3 - WDOG1"]
166 WDOG1 = 3,
167 #[doc = "9 - LDMA"]
168 LDMA = 9,
169 #[doc = "10 - GPIO_EVEN"]
170 GPIO_EVEN = 10,
171 #[doc = "11 - TIMER0"]
172 TIMER0 = 11,
173 #[doc = "12 - USART0_RX"]
174 USART0_RX = 12,
175 #[doc = "13 - USART0_TX"]
176 USART0_TX = 13,
177 #[doc = "14 - ACMP0"]
178 ACMP0 = 14,
179 #[doc = "15 - ADC0"]
180 ADC0 = 15,
181 #[doc = "16 - IDAC0"]
182 IDAC0 = 16,
183 #[doc = "17 - I2C0"]
184 I2C0 = 17,
185 #[doc = "18 - GPIO_ODD"]
186 GPIO_ODD = 18,
187 #[doc = "19 - TIMER1"]
188 TIMER1 = 19,
189 #[doc = "20 - USART1_RX"]
190 USART1_RX = 20,
191 #[doc = "21 - USART1_TX"]
192 USART1_TX = 21,
193 #[doc = "22 - LEUART0"]
194 LEUART0 = 22,
195 #[doc = "23 - PCNT0"]
196 PCNT0 = 23,
197 #[doc = "24 - CMU"]
198 CMU = 24,
199 #[doc = "25 - MSC"]
200 MSC = 25,
201 #[doc = "26 - CRYPTO0"]
202 CRYPTO0 = 26,
203 #[doc = "27 - LETIMER0"]
204 LETIMER0 = 27,
205 #[doc = "30 - RTCC"]
206 RTCC = 30,
207 #[doc = "32 - CRYOTIMER"]
208 CRYOTIMER = 32,
209 #[doc = "34 - FPUEH"]
210 FPUEH = 34,
211 #[doc = "35 - SMU"]
212 SMU = 35,
213 #[doc = "36 - WTIMER0"]
214 WTIMER0 = 36,
215 #[doc = "37 - WTIMER1"]
216 WTIMER1 = 37,
217 #[doc = "38 - PCNT1"]
218 PCNT1 = 38,
219 #[doc = "39 - PCNT2"]
220 PCNT2 = 39,
221 #[doc = "40 - USART2_RX"]
222 USART2_RX = 40,
223 #[doc = "41 - USART2_TX"]
224 USART2_TX = 41,
225 #[doc = "42 - I2C1"]
226 I2C1 = 42,
227 #[doc = "43 - USART3_RX"]
228 USART3_RX = 43,
229 #[doc = "44 - USART3_TX"]
230 USART3_TX = 44,
231 #[doc = "45 - VDAC0"]
232 VDAC0 = 45,
233 #[doc = "46 - CSEN"]
234 CSEN = 46,
235 #[doc = "47 - LESENSE"]
236 LESENSE = 47,
237 #[doc = "48 - CRYPTO1"]
238 CRYPTO1 = 48,
239 #[doc = "49 - TRNG0"]
240 TRNG0 = 49,
241}
242unsafe impl bare_metal::Nr for Interrupt {
243 #[inline(always)]
244 fn nr(&self) -> u8 {
245 *self as u8
246 }
247}
248#[cfg(feature = "rt")]
249pub use self::Interrupt as interrupt;
250pub use cortex_m::peripheral::Peripherals as CorePeripherals;
251pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, FPU, ITM, MPU, NVIC, SCB, SYST, TPIU};
252#[cfg(feature = "rt")]
253pub use cortex_m_rt::interrupt;
254#[allow(unused_imports)]
255use generic::*;
256#[doc = r"Common register and bit access and modify traits"]
257pub mod generic;
258#[doc = "MSC"]
259pub struct MSC {
260 _marker: PhantomData<*const ()>,
261}
262unsafe impl Send for MSC {}
263impl MSC {
264 #[doc = r"Returns a pointer to the register block"]
265 #[inline(always)]
266 pub const fn ptr() -> *const msc::RegisterBlock {
267 0x400e_0000 as *const _
268 }
269}
270impl Deref for MSC {
271 type Target = msc::RegisterBlock;
272 #[inline(always)]
273 fn deref(&self) -> &Self::Target {
274 unsafe { &*MSC::ptr() }
275 }
276}
277#[doc = "MSC"]
278pub mod msc;
279#[doc = "EMU"]
280pub struct EMU {
281 _marker: PhantomData<*const ()>,
282}
283unsafe impl Send for EMU {}
284impl EMU {
285 #[doc = r"Returns a pointer to the register block"]
286 #[inline(always)]
287 pub const fn ptr() -> *const emu::RegisterBlock {
288 0x400e_3000 as *const _
289 }
290}
291impl Deref for EMU {
292 type Target = emu::RegisterBlock;
293 #[inline(always)]
294 fn deref(&self) -> &Self::Target {
295 unsafe { &*EMU::ptr() }
296 }
297}
298#[doc = "EMU"]
299pub mod emu;
300#[doc = "RMU"]
301pub struct RMU {
302 _marker: PhantomData<*const ()>,
303}
304unsafe impl Send for RMU {}
305impl RMU {
306 #[doc = r"Returns a pointer to the register block"]
307 #[inline(always)]
308 pub const fn ptr() -> *const rmu::RegisterBlock {
309 0x400e_5000 as *const _
310 }
311}
312impl Deref for RMU {
313 type Target = rmu::RegisterBlock;
314 #[inline(always)]
315 fn deref(&self) -> &Self::Target {
316 unsafe { &*RMU::ptr() }
317 }
318}
319#[doc = "RMU"]
320pub mod rmu;
321#[doc = "CMU"]
322pub struct CMU {
323 _marker: PhantomData<*const ()>,
324}
325unsafe impl Send for CMU {}
326impl CMU {
327 #[doc = r"Returns a pointer to the register block"]
328 #[inline(always)]
329 pub const fn ptr() -> *const cmu::RegisterBlock {
330 0x400e_4000 as *const _
331 }
332}
333impl Deref for CMU {
334 type Target = cmu::RegisterBlock;
335 #[inline(always)]
336 fn deref(&self) -> &Self::Target {
337 unsafe { &*CMU::ptr() }
338 }
339}
340#[doc = "CMU"]
341pub mod cmu;
342#[doc = "CRYPTO0"]
343pub struct CRYPTO0 {
344 _marker: PhantomData<*const ()>,
345}
346unsafe impl Send for CRYPTO0 {}
347impl CRYPTO0 {
348 #[doc = r"Returns a pointer to the register block"]
349 #[inline(always)]
350 pub const fn ptr() -> *const crypto0::RegisterBlock {
351 0x400f_0000 as *const _
352 }
353}
354impl Deref for CRYPTO0 {
355 type Target = crypto0::RegisterBlock;
356 #[inline(always)]
357 fn deref(&self) -> &Self::Target {
358 unsafe { &*CRYPTO0::ptr() }
359 }
360}
361#[doc = "CRYPTO0"]
362pub mod crypto0;
363#[doc = "CRYPTO1"]
364pub struct CRYPTO1 {
365 _marker: PhantomData<*const ()>,
366}
367unsafe impl Send for CRYPTO1 {}
368impl CRYPTO1 {
369 #[doc = r"Returns a pointer to the register block"]
370 #[inline(always)]
371 pub const fn ptr() -> *const crypto0::RegisterBlock {
372 0x400f_0400 as *const _
373 }
374}
375impl Deref for CRYPTO1 {
376 type Target = crypto0::RegisterBlock;
377 #[inline(always)]
378 fn deref(&self) -> &Self::Target {
379 unsafe { &*CRYPTO1::ptr() }
380 }
381}
382#[doc = "GPIO"]
383pub struct GPIO {
384 _marker: PhantomData<*const ()>,
385}
386unsafe impl Send for GPIO {}
387impl GPIO {
388 #[doc = r"Returns a pointer to the register block"]
389 #[inline(always)]
390 pub const fn ptr() -> *const gpio::RegisterBlock {
391 0x4000_a000 as *const _
392 }
393}
394impl Deref for GPIO {
395 type Target = gpio::RegisterBlock;
396 #[inline(always)]
397 fn deref(&self) -> &Self::Target {
398 unsafe { &*GPIO::ptr() }
399 }
400}
401#[doc = "GPIO"]
402pub mod gpio;
403#[doc = "PRS"]
404pub struct PRS {
405 _marker: PhantomData<*const ()>,
406}
407unsafe impl Send for PRS {}
408impl PRS {
409 #[doc = r"Returns a pointer to the register block"]
410 #[inline(always)]
411 pub const fn ptr() -> *const prs::RegisterBlock {
412 0x400e_6000 as *const _
413 }
414}
415impl Deref for PRS {
416 type Target = prs::RegisterBlock;
417 #[inline(always)]
418 fn deref(&self) -> &Self::Target {
419 unsafe { &*PRS::ptr() }
420 }
421}
422#[doc = "PRS"]
423pub mod prs;
424#[doc = "LDMA"]
425pub struct LDMA {
426 _marker: PhantomData<*const ()>,
427}
428unsafe impl Send for LDMA {}
429impl LDMA {
430 #[doc = r"Returns a pointer to the register block"]
431 #[inline(always)]
432 pub const fn ptr() -> *const ldma::RegisterBlock {
433 0x400e_2000 as *const _
434 }
435}
436impl Deref for LDMA {
437 type Target = ldma::RegisterBlock;
438 #[inline(always)]
439 fn deref(&self) -> &Self::Target {
440 unsafe { &*LDMA::ptr() }
441 }
442}
443#[doc = "LDMA"]
444pub mod ldma;
445#[doc = "FPUEH"]
446pub struct FPUEH {
447 _marker: PhantomData<*const ()>,
448}
449unsafe impl Send for FPUEH {}
450impl FPUEH {
451 #[doc = r"Returns a pointer to the register block"]
452 #[inline(always)]
453 pub const fn ptr() -> *const fpueh::RegisterBlock {
454 0x400e_1000 as *const _
455 }
456}
457impl Deref for FPUEH {
458 type Target = fpueh::RegisterBlock;
459 #[inline(always)]
460 fn deref(&self) -> &Self::Target {
461 unsafe { &*FPUEH::ptr() }
462 }
463}
464#[doc = "FPUEH"]
465pub mod fpueh;
466#[doc = "GPCRC"]
467pub struct GPCRC {
468 _marker: PhantomData<*const ()>,
469}
470unsafe impl Send for GPCRC {}
471impl GPCRC {
472 #[doc = r"Returns a pointer to the register block"]
473 #[inline(always)]
474 pub const fn ptr() -> *const gpcrc::RegisterBlock {
475 0x4001_c000 as *const _
476 }
477}
478impl Deref for GPCRC {
479 type Target = gpcrc::RegisterBlock;
480 #[inline(always)]
481 fn deref(&self) -> &Self::Target {
482 unsafe { &*GPCRC::ptr() }
483 }
484}
485#[doc = "GPCRC"]
486pub mod gpcrc;
487#[doc = "TIMER0"]
488pub struct TIMER0 {
489 _marker: PhantomData<*const ()>,
490}
491unsafe impl Send for TIMER0 {}
492impl TIMER0 {
493 #[doc = r"Returns a pointer to the register block"]
494 #[inline(always)]
495 pub const fn ptr() -> *const timer0::RegisterBlock {
496 0x4001_8000 as *const _
497 }
498}
499impl Deref for TIMER0 {
500 type Target = timer0::RegisterBlock;
501 #[inline(always)]
502 fn deref(&self) -> &Self::Target {
503 unsafe { &*TIMER0::ptr() }
504 }
505}
506#[doc = "TIMER0"]
507pub mod timer0;
508#[doc = "TIMER1"]
509pub struct TIMER1 {
510 _marker: PhantomData<*const ()>,
511}
512unsafe impl Send for TIMER1 {}
513impl TIMER1 {
514 #[doc = r"Returns a pointer to the register block"]
515 #[inline(always)]
516 pub const fn ptr() -> *const timer0::RegisterBlock {
517 0x4001_8400 as *const _
518 }
519}
520impl Deref for TIMER1 {
521 type Target = timer0::RegisterBlock;
522 #[inline(always)]
523 fn deref(&self) -> &Self::Target {
524 unsafe { &*TIMER1::ptr() }
525 }
526}
527#[doc = "WTIMER0"]
528pub struct WTIMER0 {
529 _marker: PhantomData<*const ()>,
530}
531unsafe impl Send for WTIMER0 {}
532impl WTIMER0 {
533 #[doc = r"Returns a pointer to the register block"]
534 #[inline(always)]
535 pub const fn ptr() -> *const wtimer0::RegisterBlock {
536 0x4001_a000 as *const _
537 }
538}
539impl Deref for WTIMER0 {
540 type Target = wtimer0::RegisterBlock;
541 #[inline(always)]
542 fn deref(&self) -> &Self::Target {
543 unsafe { &*WTIMER0::ptr() }
544 }
545}
546#[doc = "WTIMER0"]
547pub mod wtimer0;
548#[doc = "WTIMER1"]
549pub struct WTIMER1 {
550 _marker: PhantomData<*const ()>,
551}
552unsafe impl Send for WTIMER1 {}
553impl WTIMER1 {
554 #[doc = r"Returns a pointer to the register block"]
555 #[inline(always)]
556 pub const fn ptr() -> *const wtimer0::RegisterBlock {
557 0x4001_a400 as *const _
558 }
559}
560impl Deref for WTIMER1 {
561 type Target = wtimer0::RegisterBlock;
562 #[inline(always)]
563 fn deref(&self) -> &Self::Target {
564 unsafe { &*WTIMER1::ptr() }
565 }
566}
567#[doc = "USART0"]
568pub struct USART0 {
569 _marker: PhantomData<*const ()>,
570}
571unsafe impl Send for USART0 {}
572impl USART0 {
573 #[doc = r"Returns a pointer to the register block"]
574 #[inline(always)]
575 pub const fn ptr() -> *const usart0::RegisterBlock {
576 0x4001_0000 as *const _
577 }
578}
579impl Deref for USART0 {
580 type Target = usart0::RegisterBlock;
581 #[inline(always)]
582 fn deref(&self) -> &Self::Target {
583 unsafe { &*USART0::ptr() }
584 }
585}
586#[doc = "USART0"]
587pub mod usart0;
588#[doc = "USART1"]
589pub struct USART1 {
590 _marker: PhantomData<*const ()>,
591}
592unsafe impl Send for USART1 {}
593impl USART1 {
594 #[doc = r"Returns a pointer to the register block"]
595 #[inline(always)]
596 pub const fn ptr() -> *const usart0::RegisterBlock {
597 0x4001_0400 as *const _
598 }
599}
600impl Deref for USART1 {
601 type Target = usart0::RegisterBlock;
602 #[inline(always)]
603 fn deref(&self) -> &Self::Target {
604 unsafe { &*USART1::ptr() }
605 }
606}
607#[doc = "USART2"]
608pub struct USART2 {
609 _marker: PhantomData<*const ()>,
610}
611unsafe impl Send for USART2 {}
612impl USART2 {
613 #[doc = r"Returns a pointer to the register block"]
614 #[inline(always)]
615 pub const fn ptr() -> *const usart0::RegisterBlock {
616 0x4001_0800 as *const _
617 }
618}
619impl Deref for USART2 {
620 type Target = usart0::RegisterBlock;
621 #[inline(always)]
622 fn deref(&self) -> &Self::Target {
623 unsafe { &*USART2::ptr() }
624 }
625}
626#[doc = "USART3"]
627pub struct USART3 {
628 _marker: PhantomData<*const ()>,
629}
630unsafe impl Send for USART3 {}
631impl USART3 {
632 #[doc = r"Returns a pointer to the register block"]
633 #[inline(always)]
634 pub const fn ptr() -> *const usart0::RegisterBlock {
635 0x4001_0c00 as *const _
636 }
637}
638impl Deref for USART3 {
639 type Target = usart0::RegisterBlock;
640 #[inline(always)]
641 fn deref(&self) -> &Self::Target {
642 unsafe { &*USART3::ptr() }
643 }
644}
645#[doc = "LEUART0"]
646pub struct LEUART0 {
647 _marker: PhantomData<*const ()>,
648}
649unsafe impl Send for LEUART0 {}
650impl LEUART0 {
651 #[doc = r"Returns a pointer to the register block"]
652 #[inline(always)]
653 pub const fn ptr() -> *const leuart0::RegisterBlock {
654 0x4004_a000 as *const _
655 }
656}
657impl Deref for LEUART0 {
658 type Target = leuart0::RegisterBlock;
659 #[inline(always)]
660 fn deref(&self) -> &Self::Target {
661 unsafe { &*LEUART0::ptr() }
662 }
663}
664#[doc = "LEUART0"]
665pub mod leuart0;
666#[doc = "LETIMER0"]
667pub struct LETIMER0 {
668 _marker: PhantomData<*const ()>,
669}
670unsafe impl Send for LETIMER0 {}
671impl LETIMER0 {
672 #[doc = r"Returns a pointer to the register block"]
673 #[inline(always)]
674 pub const fn ptr() -> *const letimer0::RegisterBlock {
675 0x4004_6000 as *const _
676 }
677}
678impl Deref for LETIMER0 {
679 type Target = letimer0::RegisterBlock;
680 #[inline(always)]
681 fn deref(&self) -> &Self::Target {
682 unsafe { &*LETIMER0::ptr() }
683 }
684}
685#[doc = "LETIMER0"]
686pub mod letimer0;
687#[doc = "CRYOTIMER"]
688pub struct CRYOTIMER {
689 _marker: PhantomData<*const ()>,
690}
691unsafe impl Send for CRYOTIMER {}
692impl CRYOTIMER {
693 #[doc = r"Returns a pointer to the register block"]
694 #[inline(always)]
695 pub const fn ptr() -> *const cryotimer::RegisterBlock {
696 0x4001_e000 as *const _
697 }
698}
699impl Deref for CRYOTIMER {
700 type Target = cryotimer::RegisterBlock;
701 #[inline(always)]
702 fn deref(&self) -> &Self::Target {
703 unsafe { &*CRYOTIMER::ptr() }
704 }
705}
706#[doc = "CRYOTIMER"]
707pub mod cryotimer;
708#[doc = "PCNT0"]
709pub struct PCNT0 {
710 _marker: PhantomData<*const ()>,
711}
712unsafe impl Send for PCNT0 {}
713impl PCNT0 {
714 #[doc = r"Returns a pointer to the register block"]
715 #[inline(always)]
716 pub const fn ptr() -> *const pcnt0::RegisterBlock {
717 0x4004_e000 as *const _
718 }
719}
720impl Deref for PCNT0 {
721 type Target = pcnt0::RegisterBlock;
722 #[inline(always)]
723 fn deref(&self) -> &Self::Target {
724 unsafe { &*PCNT0::ptr() }
725 }
726}
727#[doc = "PCNT0"]
728pub mod pcnt0;
729#[doc = "PCNT1"]
730pub struct PCNT1 {
731 _marker: PhantomData<*const ()>,
732}
733unsafe impl Send for PCNT1 {}
734impl PCNT1 {
735 #[doc = r"Returns a pointer to the register block"]
736 #[inline(always)]
737 pub const fn ptr() -> *const pcnt0::RegisterBlock {
738 0x4004_e400 as *const _
739 }
740}
741impl Deref for PCNT1 {
742 type Target = pcnt0::RegisterBlock;
743 #[inline(always)]
744 fn deref(&self) -> &Self::Target {
745 unsafe { &*PCNT1::ptr() }
746 }
747}
748#[doc = "PCNT2"]
749pub struct PCNT2 {
750 _marker: PhantomData<*const ()>,
751}
752unsafe impl Send for PCNT2 {}
753impl PCNT2 {
754 #[doc = r"Returns a pointer to the register block"]
755 #[inline(always)]
756 pub const fn ptr() -> *const pcnt0::RegisterBlock {
757 0x4004_e800 as *const _
758 }
759}
760impl Deref for PCNT2 {
761 type Target = pcnt0::RegisterBlock;
762 #[inline(always)]
763 fn deref(&self) -> &Self::Target {
764 unsafe { &*PCNT2::ptr() }
765 }
766}
767#[doc = "I2C0"]
768pub struct I2C0 {
769 _marker: PhantomData<*const ()>,
770}
771unsafe impl Send for I2C0 {}
772impl I2C0 {
773 #[doc = r"Returns a pointer to the register block"]
774 #[inline(always)]
775 pub const fn ptr() -> *const i2c0::RegisterBlock {
776 0x4000_c000 as *const _
777 }
778}
779impl Deref for I2C0 {
780 type Target = i2c0::RegisterBlock;
781 #[inline(always)]
782 fn deref(&self) -> &Self::Target {
783 unsafe { &*I2C0::ptr() }
784 }
785}
786#[doc = "I2C0"]
787pub mod i2c0;
788#[doc = "I2C1"]
789pub struct I2C1 {
790 _marker: PhantomData<*const ()>,
791}
792unsafe impl Send for I2C1 {}
793impl I2C1 {
794 #[doc = r"Returns a pointer to the register block"]
795 #[inline(always)]
796 pub const fn ptr() -> *const i2c0::RegisterBlock {
797 0x4000_c400 as *const _
798 }
799}
800impl Deref for I2C1 {
801 type Target = i2c0::RegisterBlock;
802 #[inline(always)]
803 fn deref(&self) -> &Self::Target {
804 unsafe { &*I2C1::ptr() }
805 }
806}
807#[doc = "ADC0"]
808pub struct ADC0 {
809 _marker: PhantomData<*const ()>,
810}
811unsafe impl Send for ADC0 {}
812impl ADC0 {
813 #[doc = r"Returns a pointer to the register block"]
814 #[inline(always)]
815 pub const fn ptr() -> *const adc0::RegisterBlock {
816 0x4000_2000 as *const _
817 }
818}
819impl Deref for ADC0 {
820 type Target = adc0::RegisterBlock;
821 #[inline(always)]
822 fn deref(&self) -> &Self::Target {
823 unsafe { &*ADC0::ptr() }
824 }
825}
826#[doc = "ADC0"]
827pub mod adc0;
828#[doc = "ACMP0"]
829pub struct ACMP0 {
830 _marker: PhantomData<*const ()>,
831}
832unsafe impl Send for ACMP0 {}
833impl ACMP0 {
834 #[doc = r"Returns a pointer to the register block"]
835 #[inline(always)]
836 pub const fn ptr() -> *const acmp0::RegisterBlock {
837 0x4000_0000 as *const _
838 }
839}
840impl Deref for ACMP0 {
841 type Target = acmp0::RegisterBlock;
842 #[inline(always)]
843 fn deref(&self) -> &Self::Target {
844 unsafe { &*ACMP0::ptr() }
845 }
846}
847#[doc = "ACMP0"]
848pub mod acmp0;
849#[doc = "ACMP1"]
850pub struct ACMP1 {
851 _marker: PhantomData<*const ()>,
852}
853unsafe impl Send for ACMP1 {}
854impl ACMP1 {
855 #[doc = r"Returns a pointer to the register block"]
856 #[inline(always)]
857 pub const fn ptr() -> *const acmp0::RegisterBlock {
858 0x4000_0400 as *const _
859 }
860}
861impl Deref for ACMP1 {
862 type Target = acmp0::RegisterBlock;
863 #[inline(always)]
864 fn deref(&self) -> &Self::Target {
865 unsafe { &*ACMP1::ptr() }
866 }
867}
868#[doc = "IDAC0"]
869pub struct IDAC0 {
870 _marker: PhantomData<*const ()>,
871}
872unsafe impl Send for IDAC0 {}
873impl IDAC0 {
874 #[doc = r"Returns a pointer to the register block"]
875 #[inline(always)]
876 pub const fn ptr() -> *const idac0::RegisterBlock {
877 0x4000_6000 as *const _
878 }
879}
880impl Deref for IDAC0 {
881 type Target = idac0::RegisterBlock;
882 #[inline(always)]
883 fn deref(&self) -> &Self::Target {
884 unsafe { &*IDAC0::ptr() }
885 }
886}
887#[doc = "IDAC0"]
888pub mod idac0;
889#[doc = "VDAC0"]
890pub struct VDAC0 {
891 _marker: PhantomData<*const ()>,
892}
893unsafe impl Send for VDAC0 {}
894impl VDAC0 {
895 #[doc = r"Returns a pointer to the register block"]
896 #[inline(always)]
897 pub const fn ptr() -> *const vdac0::RegisterBlock {
898 0x4000_8000 as *const _
899 }
900}
901impl Deref for VDAC0 {
902 type Target = vdac0::RegisterBlock;
903 #[inline(always)]
904 fn deref(&self) -> &Self::Target {
905 unsafe { &*VDAC0::ptr() }
906 }
907}
908#[doc = "VDAC0"]
909pub mod vdac0;
910#[doc = "CSEN"]
911pub struct CSEN {
912 _marker: PhantomData<*const ()>,
913}
914unsafe impl Send for CSEN {}
915impl CSEN {
916 #[doc = r"Returns a pointer to the register block"]
917 #[inline(always)]
918 pub const fn ptr() -> *const csen::RegisterBlock {
919 0x4001_f000 as *const _
920 }
921}
922impl Deref for CSEN {
923 type Target = csen::RegisterBlock;
924 #[inline(always)]
925 fn deref(&self) -> &Self::Target {
926 unsafe { &*CSEN::ptr() }
927 }
928}
929#[doc = "CSEN"]
930pub mod csen;
931#[doc = "LESENSE"]
932pub struct LESENSE {
933 _marker: PhantomData<*const ()>,
934}
935unsafe impl Send for LESENSE {}
936impl LESENSE {
937 #[doc = r"Returns a pointer to the register block"]
938 #[inline(always)]
939 pub const fn ptr() -> *const lesense::RegisterBlock {
940 0x4005_5000 as *const _
941 }
942}
943impl Deref for LESENSE {
944 type Target = lesense::RegisterBlock;
945 #[inline(always)]
946 fn deref(&self) -> &Self::Target {
947 unsafe { &*LESENSE::ptr() }
948 }
949}
950#[doc = "LESENSE"]
951pub mod lesense;
952#[doc = "RTCC"]
953pub struct RTCC {
954 _marker: PhantomData<*const ()>,
955}
956unsafe impl Send for RTCC {}
957impl RTCC {
958 #[doc = r"Returns a pointer to the register block"]
959 #[inline(always)]
960 pub const fn ptr() -> *const rtcc::RegisterBlock {
961 0x4004_2000 as *const _
962 }
963}
964impl Deref for RTCC {
965 type Target = rtcc::RegisterBlock;
966 #[inline(always)]
967 fn deref(&self) -> &Self::Target {
968 unsafe { &*RTCC::ptr() }
969 }
970}
971#[doc = "RTCC"]
972pub mod rtcc;
973#[doc = "WDOG0"]
974pub struct WDOG0 {
975 _marker: PhantomData<*const ()>,
976}
977unsafe impl Send for WDOG0 {}
978impl WDOG0 {
979 #[doc = r"Returns a pointer to the register block"]
980 #[inline(always)]
981 pub const fn ptr() -> *const wdog0::RegisterBlock {
982 0x4005_2000 as *const _
983 }
984}
985impl Deref for WDOG0 {
986 type Target = wdog0::RegisterBlock;
987 #[inline(always)]
988 fn deref(&self) -> &Self::Target {
989 unsafe { &*WDOG0::ptr() }
990 }
991}
992#[doc = "WDOG0"]
993pub mod wdog0;
994#[doc = "WDOG1"]
995pub struct WDOG1 {
996 _marker: PhantomData<*const ()>,
997}
998unsafe impl Send for WDOG1 {}
999impl WDOG1 {
1000 #[doc = r"Returns a pointer to the register block"]
1001 #[inline(always)]
1002 pub const fn ptr() -> *const wdog0::RegisterBlock {
1003 0x4005_2400 as *const _
1004 }
1005}
1006impl Deref for WDOG1 {
1007 type Target = wdog0::RegisterBlock;
1008 #[inline(always)]
1009 fn deref(&self) -> &Self::Target {
1010 unsafe { &*WDOG1::ptr() }
1011 }
1012}
1013#[doc = "ETM"]
1014pub struct ETM {
1015 _marker: PhantomData<*const ()>,
1016}
1017unsafe impl Send for ETM {}
1018impl ETM {
1019 #[doc = r"Returns a pointer to the register block"]
1020 #[inline(always)]
1021 pub const fn ptr() -> *const etm::RegisterBlock {
1022 0xe004_1000 as *const _
1023 }
1024}
1025impl Deref for ETM {
1026 type Target = etm::RegisterBlock;
1027 #[inline(always)]
1028 fn deref(&self) -> &Self::Target {
1029 unsafe { &*ETM::ptr() }
1030 }
1031}
1032#[doc = "ETM"]
1033pub mod etm;
1034#[doc = "SMU"]
1035pub struct SMU {
1036 _marker: PhantomData<*const ()>,
1037}
1038unsafe impl Send for SMU {}
1039impl SMU {
1040 #[doc = r"Returns a pointer to the register block"]
1041 #[inline(always)]
1042 pub const fn ptr() -> *const smu::RegisterBlock {
1043 0x4002_2000 as *const _
1044 }
1045}
1046impl Deref for SMU {
1047 type Target = smu::RegisterBlock;
1048 #[inline(always)]
1049 fn deref(&self) -> &Self::Target {
1050 unsafe { &*SMU::ptr() }
1051 }
1052}
1053#[doc = "SMU"]
1054pub mod smu;
1055#[doc = "TRNG0"]
1056pub struct TRNG0 {
1057 _marker: PhantomData<*const ()>,
1058}
1059unsafe impl Send for TRNG0 {}
1060impl TRNG0 {
1061 #[doc = r"Returns a pointer to the register block"]
1062 #[inline(always)]
1063 pub const fn ptr() -> *const trng0::RegisterBlock {
1064 0x4001_d000 as *const _
1065 }
1066}
1067impl Deref for TRNG0 {
1068 type Target = trng0::RegisterBlock;
1069 #[inline(always)]
1070 fn deref(&self) -> &Self::Target {
1071 unsafe { &*TRNG0::ptr() }
1072 }
1073}
1074#[doc = "TRNG0"]
1075pub mod trng0;
1076#[no_mangle]
1077static mut DEVICE_PERIPHERALS: bool = false;
1078#[doc = r"All the peripherals"]
1079#[allow(non_snake_case)]
1080pub struct Peripherals {
1081 #[doc = "MSC"]
1082 pub MSC: MSC,
1083 #[doc = "EMU"]
1084 pub EMU: EMU,
1085 #[doc = "RMU"]
1086 pub RMU: RMU,
1087 #[doc = "CMU"]
1088 pub CMU: CMU,
1089 #[doc = "CRYPTO0"]
1090 pub CRYPTO0: CRYPTO0,
1091 #[doc = "CRYPTO1"]
1092 pub CRYPTO1: CRYPTO1,
1093 #[doc = "GPIO"]
1094 pub GPIO: GPIO,
1095 #[doc = "PRS"]
1096 pub PRS: PRS,
1097 #[doc = "LDMA"]
1098 pub LDMA: LDMA,
1099 #[doc = "FPUEH"]
1100 pub FPUEH: FPUEH,
1101 #[doc = "GPCRC"]
1102 pub GPCRC: GPCRC,
1103 #[doc = "TIMER0"]
1104 pub TIMER0: TIMER0,
1105 #[doc = "TIMER1"]
1106 pub TIMER1: TIMER1,
1107 #[doc = "WTIMER0"]
1108 pub WTIMER0: WTIMER0,
1109 #[doc = "WTIMER1"]
1110 pub WTIMER1: WTIMER1,
1111 #[doc = "USART0"]
1112 pub USART0: USART0,
1113 #[doc = "USART1"]
1114 pub USART1: USART1,
1115 #[doc = "USART2"]
1116 pub USART2: USART2,
1117 #[doc = "USART3"]
1118 pub USART3: USART3,
1119 #[doc = "LEUART0"]
1120 pub LEUART0: LEUART0,
1121 #[doc = "LETIMER0"]
1122 pub LETIMER0: LETIMER0,
1123 #[doc = "CRYOTIMER"]
1124 pub CRYOTIMER: CRYOTIMER,
1125 #[doc = "PCNT0"]
1126 pub PCNT0: PCNT0,
1127 #[doc = "PCNT1"]
1128 pub PCNT1: PCNT1,
1129 #[doc = "PCNT2"]
1130 pub PCNT2: PCNT2,
1131 #[doc = "I2C0"]
1132 pub I2C0: I2C0,
1133 #[doc = "I2C1"]
1134 pub I2C1: I2C1,
1135 #[doc = "ADC0"]
1136 pub ADC0: ADC0,
1137 #[doc = "ACMP0"]
1138 pub ACMP0: ACMP0,
1139 #[doc = "ACMP1"]
1140 pub ACMP1: ACMP1,
1141 #[doc = "IDAC0"]
1142 pub IDAC0: IDAC0,
1143 #[doc = "VDAC0"]
1144 pub VDAC0: VDAC0,
1145 #[doc = "CSEN"]
1146 pub CSEN: CSEN,
1147 #[doc = "LESENSE"]
1148 pub LESENSE: LESENSE,
1149 #[doc = "RTCC"]
1150 pub RTCC: RTCC,
1151 #[doc = "WDOG0"]
1152 pub WDOG0: WDOG0,
1153 #[doc = "WDOG1"]
1154 pub WDOG1: WDOG1,
1155 #[doc = "ETM"]
1156 pub ETM: ETM,
1157 #[doc = "SMU"]
1158 pub SMU: SMU,
1159 #[doc = "TRNG0"]
1160 pub TRNG0: TRNG0,
1161}
1162impl Peripherals {
1163 #[doc = r"Returns all the peripherals *once*"]
1164 #[inline]
1165 pub fn take() -> Option<Self> {
1166 cortex_m::interrupt::free(|_| {
1167 if unsafe { DEVICE_PERIPHERALS } {
1168 None
1169 } else {
1170 Some(unsafe { Peripherals::steal() })
1171 }
1172 })
1173 }
1174 #[doc = r"Unchecked version of `Peripherals::take`"]
1175 #[inline]
1176 pub unsafe fn steal() -> Self {
1177 DEVICE_PERIPHERALS = true;
1178 Peripherals {
1179 MSC: MSC {
1180 _marker: PhantomData,
1181 },
1182 EMU: EMU {
1183 _marker: PhantomData,
1184 },
1185 RMU: RMU {
1186 _marker: PhantomData,
1187 },
1188 CMU: CMU {
1189 _marker: PhantomData,
1190 },
1191 CRYPTO0: CRYPTO0 {
1192 _marker: PhantomData,
1193 },
1194 CRYPTO1: CRYPTO1 {
1195 _marker: PhantomData,
1196 },
1197 GPIO: GPIO {
1198 _marker: PhantomData,
1199 },
1200 PRS: PRS {
1201 _marker: PhantomData,
1202 },
1203 LDMA: LDMA {
1204 _marker: PhantomData,
1205 },
1206 FPUEH: FPUEH {
1207 _marker: PhantomData,
1208 },
1209 GPCRC: GPCRC {
1210 _marker: PhantomData,
1211 },
1212 TIMER0: TIMER0 {
1213 _marker: PhantomData,
1214 },
1215 TIMER1: TIMER1 {
1216 _marker: PhantomData,
1217 },
1218 WTIMER0: WTIMER0 {
1219 _marker: PhantomData,
1220 },
1221 WTIMER1: WTIMER1 {
1222 _marker: PhantomData,
1223 },
1224 USART0: USART0 {
1225 _marker: PhantomData,
1226 },
1227 USART1: USART1 {
1228 _marker: PhantomData,
1229 },
1230 USART2: USART2 {
1231 _marker: PhantomData,
1232 },
1233 USART3: USART3 {
1234 _marker: PhantomData,
1235 },
1236 LEUART0: LEUART0 {
1237 _marker: PhantomData,
1238 },
1239 LETIMER0: LETIMER0 {
1240 _marker: PhantomData,
1241 },
1242 CRYOTIMER: CRYOTIMER {
1243 _marker: PhantomData,
1244 },
1245 PCNT0: PCNT0 {
1246 _marker: PhantomData,
1247 },
1248 PCNT1: PCNT1 {
1249 _marker: PhantomData,
1250 },
1251 PCNT2: PCNT2 {
1252 _marker: PhantomData,
1253 },
1254 I2C0: I2C0 {
1255 _marker: PhantomData,
1256 },
1257 I2C1: I2C1 {
1258 _marker: PhantomData,
1259 },
1260 ADC0: ADC0 {
1261 _marker: PhantomData,
1262 },
1263 ACMP0: ACMP0 {
1264 _marker: PhantomData,
1265 },
1266 ACMP1: ACMP1 {
1267 _marker: PhantomData,
1268 },
1269 IDAC0: IDAC0 {
1270 _marker: PhantomData,
1271 },
1272 VDAC0: VDAC0 {
1273 _marker: PhantomData,
1274 },
1275 CSEN: CSEN {
1276 _marker: PhantomData,
1277 },
1278 LESENSE: LESENSE {
1279 _marker: PhantomData,
1280 },
1281 RTCC: RTCC {
1282 _marker: PhantomData,
1283 },
1284 WDOG0: WDOG0 {
1285 _marker: PhantomData,
1286 },
1287 WDOG1: WDOG1 {
1288 _marker: PhantomData,
1289 },
1290 ETM: ETM {
1291 _marker: PhantomData,
1292 },
1293 SMU: SMU {
1294 _marker: PhantomData,
1295 },
1296 TRNG0: TRNG0 {
1297 _marker: PhantomData,
1298 },
1299 }
1300 }
1301}