1#![doc = "Peripheral access API for EFM32PG1B100F128GM32 microcontrollers (generated using svd2rust v0.24.0 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
2svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.24.0/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
3#![deny(const_err)]
4#![deny(dead_code)]
5#![deny(improper_ctypes)]
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(private_in_public)]
13#![deny(unconditional_recursion)]
14#![deny(unused_allocation)]
15#![deny(unused_comparisons)]
16#![deny(unused_parens)]
17#![deny(while_true)]
18#![allow(non_camel_case_types)]
19#![allow(non_snake_case)]
20#![no_std]
21use core::marker::PhantomData;
22use core::ops::Deref;
23#[doc = r"Number available in the NVIC for configuring priority"]
24pub const NVIC_PRIO_BITS: u8 = 3;
25#[cfg(feature = "rt")]
26pub use self::Interrupt as interrupt;
27pub use cortex_m::peripheral::Peripherals as CorePeripherals;
28pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, FPU, ITM, MPU, NVIC, SCB, SYST, TPIU};
29#[cfg(feature = "rt")]
30pub use cortex_m_rt::interrupt;
31#[allow(unused_imports)]
32use generic::*;
33#[doc = r"Common register and bit access and modify traits"]
34pub mod generic;
35#[cfg(feature = "rt")]
36extern "C" {
37 fn EMU();
38 fn WDOG0();
39 fn LDMA();
40 fn GPIO_EVEN();
41 fn TIMER0();
42 fn USART0_RX();
43 fn USART0_TX();
44 fn ACMP0();
45 fn ADC0();
46 fn IDAC0();
47 fn I2C0();
48 fn GPIO_ODD();
49 fn TIMER1();
50 fn USART1_RX();
51 fn USART1_TX();
52 fn LEUART0();
53 fn PCNT0();
54 fn CMU();
55 fn MSC();
56 fn CRYPTO();
57 fn LETIMER0();
58 fn RTCC();
59 fn CRYOTIMER();
60 fn FPUEH();
61}
62#[doc(hidden)]
63pub union Vector {
64 _handler: unsafe extern "C" fn(),
65 _reserved: u32,
66}
67#[cfg(feature = "rt")]
68#[doc(hidden)]
69#[link_section = ".vector_table.interrupts"]
70#[no_mangle]
71pub static __INTERRUPTS: [Vector; 34] = [
72 Vector { _handler: EMU },
73 Vector { _reserved: 0 },
74 Vector { _handler: WDOG0 },
75 Vector { _reserved: 0 },
76 Vector { _reserved: 0 },
77 Vector { _reserved: 0 },
78 Vector { _reserved: 0 },
79 Vector { _reserved: 0 },
80 Vector { _handler: LDMA },
81 Vector {
82 _handler: GPIO_EVEN,
83 },
84 Vector { _handler: TIMER0 },
85 Vector {
86 _handler: USART0_RX,
87 },
88 Vector {
89 _handler: USART0_TX,
90 },
91 Vector { _handler: ACMP0 },
92 Vector { _handler: ADC0 },
93 Vector { _handler: IDAC0 },
94 Vector { _handler: I2C0 },
95 Vector { _handler: GPIO_ODD },
96 Vector { _handler: TIMER1 },
97 Vector {
98 _handler: USART1_RX,
99 },
100 Vector {
101 _handler: USART1_TX,
102 },
103 Vector { _handler: LEUART0 },
104 Vector { _handler: PCNT0 },
105 Vector { _handler: CMU },
106 Vector { _handler: MSC },
107 Vector { _handler: CRYPTO },
108 Vector { _handler: LETIMER0 },
109 Vector { _reserved: 0 },
110 Vector { _reserved: 0 },
111 Vector { _handler: RTCC },
112 Vector { _reserved: 0 },
113 Vector {
114 _handler: CRYOTIMER,
115 },
116 Vector { _reserved: 0 },
117 Vector { _handler: FPUEH },
118];
119#[doc = r"Enumeration of all the interrupts."]
120#[derive(Copy, Clone, Debug, PartialEq, Eq)]
121#[repr(u16)]
122pub enum Interrupt {
123 #[doc = "0 - EMU"]
124 EMU = 0,
125 #[doc = "2 - WDOG0"]
126 WDOG0 = 2,
127 #[doc = "8 - LDMA"]
128 LDMA = 8,
129 #[doc = "9 - GPIO_EVEN"]
130 GPIO_EVEN = 9,
131 #[doc = "10 - TIMER0"]
132 TIMER0 = 10,
133 #[doc = "11 - USART0_RX"]
134 USART0_RX = 11,
135 #[doc = "12 - USART0_TX"]
136 USART0_TX = 12,
137 #[doc = "13 - ACMP0"]
138 ACMP0 = 13,
139 #[doc = "14 - ADC0"]
140 ADC0 = 14,
141 #[doc = "15 - IDAC0"]
142 IDAC0 = 15,
143 #[doc = "16 - I2C0"]
144 I2C0 = 16,
145 #[doc = "17 - GPIO_ODD"]
146 GPIO_ODD = 17,
147 #[doc = "18 - TIMER1"]
148 TIMER1 = 18,
149 #[doc = "19 - USART1_RX"]
150 USART1_RX = 19,
151 #[doc = "20 - USART1_TX"]
152 USART1_TX = 20,
153 #[doc = "21 - LEUART0"]
154 LEUART0 = 21,
155 #[doc = "22 - PCNT0"]
156 PCNT0 = 22,
157 #[doc = "23 - CMU"]
158 CMU = 23,
159 #[doc = "24 - MSC"]
160 MSC = 24,
161 #[doc = "25 - CRYPTO"]
162 CRYPTO = 25,
163 #[doc = "26 - LETIMER0"]
164 LETIMER0 = 26,
165 #[doc = "29 - RTCC"]
166 RTCC = 29,
167 #[doc = "31 - CRYOTIMER"]
168 CRYOTIMER = 31,
169 #[doc = "33 - FPUEH"]
170 FPUEH = 33,
171}
172unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
173 #[inline(always)]
174 fn number(self) -> u16 {
175 self as u16
176 }
177}
178#[doc = "MSC"]
179pub struct MSC {
180 _marker: PhantomData<*const ()>,
181}
182unsafe impl Send for MSC {}
183impl MSC {
184 #[doc = r"Pointer to the register block"]
185 pub const PTR: *const msc::RegisterBlock = 0x400e_0000 as *const _;
186 #[doc = r"Return the pointer to the register block"]
187 #[inline(always)]
188 pub const fn ptr() -> *const msc::RegisterBlock {
189 Self::PTR
190 }
191}
192impl Deref for MSC {
193 type Target = msc::RegisterBlock;
194 #[inline(always)]
195 fn deref(&self) -> &Self::Target {
196 unsafe { &*Self::PTR }
197 }
198}
199impl core::fmt::Debug for MSC {
200 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
201 f.debug_struct("MSC").finish()
202 }
203}
204#[doc = "MSC"]
205pub mod msc;
206#[doc = "EMU"]
207pub struct EMU {
208 _marker: PhantomData<*const ()>,
209}
210unsafe impl Send for EMU {}
211impl EMU {
212 #[doc = r"Pointer to the register block"]
213 pub const PTR: *const emu::RegisterBlock = 0x400e_3000 as *const _;
214 #[doc = r"Return the pointer to the register block"]
215 #[inline(always)]
216 pub const fn ptr() -> *const emu::RegisterBlock {
217 Self::PTR
218 }
219}
220impl Deref for EMU {
221 type Target = emu::RegisterBlock;
222 #[inline(always)]
223 fn deref(&self) -> &Self::Target {
224 unsafe { &*Self::PTR }
225 }
226}
227impl core::fmt::Debug for EMU {
228 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
229 f.debug_struct("EMU").finish()
230 }
231}
232#[doc = "EMU"]
233pub mod emu;
234#[doc = "RMU"]
235pub struct RMU {
236 _marker: PhantomData<*const ()>,
237}
238unsafe impl Send for RMU {}
239impl RMU {
240 #[doc = r"Pointer to the register block"]
241 pub const PTR: *const rmu::RegisterBlock = 0x400e_5000 as *const _;
242 #[doc = r"Return the pointer to the register block"]
243 #[inline(always)]
244 pub const fn ptr() -> *const rmu::RegisterBlock {
245 Self::PTR
246 }
247}
248impl Deref for RMU {
249 type Target = rmu::RegisterBlock;
250 #[inline(always)]
251 fn deref(&self) -> &Self::Target {
252 unsafe { &*Self::PTR }
253 }
254}
255impl core::fmt::Debug for RMU {
256 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
257 f.debug_struct("RMU").finish()
258 }
259}
260#[doc = "RMU"]
261pub mod rmu;
262#[doc = "CMU"]
263pub struct CMU {
264 _marker: PhantomData<*const ()>,
265}
266unsafe impl Send for CMU {}
267impl CMU {
268 #[doc = r"Pointer to the register block"]
269 pub const PTR: *const cmu::RegisterBlock = 0x400e_4000 as *const _;
270 #[doc = r"Return the pointer to the register block"]
271 #[inline(always)]
272 pub const fn ptr() -> *const cmu::RegisterBlock {
273 Self::PTR
274 }
275}
276impl Deref for CMU {
277 type Target = cmu::RegisterBlock;
278 #[inline(always)]
279 fn deref(&self) -> &Self::Target {
280 unsafe { &*Self::PTR }
281 }
282}
283impl core::fmt::Debug for CMU {
284 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
285 f.debug_struct("CMU").finish()
286 }
287}
288#[doc = "CMU"]
289pub mod cmu;
290#[doc = "CRYPTO"]
291pub struct CRYPTO {
292 _marker: PhantomData<*const ()>,
293}
294unsafe impl Send for CRYPTO {}
295impl CRYPTO {
296 #[doc = r"Pointer to the register block"]
297 pub const PTR: *const crypto::RegisterBlock = 0x400f_0000 as *const _;
298 #[doc = r"Return the pointer to the register block"]
299 #[inline(always)]
300 pub const fn ptr() -> *const crypto::RegisterBlock {
301 Self::PTR
302 }
303}
304impl Deref for CRYPTO {
305 type Target = crypto::RegisterBlock;
306 #[inline(always)]
307 fn deref(&self) -> &Self::Target {
308 unsafe { &*Self::PTR }
309 }
310}
311impl core::fmt::Debug for CRYPTO {
312 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
313 f.debug_struct("CRYPTO").finish()
314 }
315}
316#[doc = "CRYPTO"]
317pub mod crypto;
318#[doc = "GPIO"]
319pub struct GPIO {
320 _marker: PhantomData<*const ()>,
321}
322unsafe impl Send for GPIO {}
323impl GPIO {
324 #[doc = r"Pointer to the register block"]
325 pub const PTR: *const gpio::RegisterBlock = 0x4000_a000 as *const _;
326 #[doc = r"Return the pointer to the register block"]
327 #[inline(always)]
328 pub const fn ptr() -> *const gpio::RegisterBlock {
329 Self::PTR
330 }
331}
332impl Deref for GPIO {
333 type Target = gpio::RegisterBlock;
334 #[inline(always)]
335 fn deref(&self) -> &Self::Target {
336 unsafe { &*Self::PTR }
337 }
338}
339impl core::fmt::Debug for GPIO {
340 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
341 f.debug_struct("GPIO").finish()
342 }
343}
344#[doc = "GPIO"]
345pub mod gpio;
346#[doc = "PRS"]
347pub struct PRS {
348 _marker: PhantomData<*const ()>,
349}
350unsafe impl Send for PRS {}
351impl PRS {
352 #[doc = r"Pointer to the register block"]
353 pub const PTR: *const prs::RegisterBlock = 0x400e_6000 as *const _;
354 #[doc = r"Return the pointer to the register block"]
355 #[inline(always)]
356 pub const fn ptr() -> *const prs::RegisterBlock {
357 Self::PTR
358 }
359}
360impl Deref for PRS {
361 type Target = prs::RegisterBlock;
362 #[inline(always)]
363 fn deref(&self) -> &Self::Target {
364 unsafe { &*Self::PTR }
365 }
366}
367impl core::fmt::Debug for PRS {
368 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
369 f.debug_struct("PRS").finish()
370 }
371}
372#[doc = "PRS"]
373pub mod prs;
374#[doc = "LDMA"]
375pub struct LDMA {
376 _marker: PhantomData<*const ()>,
377}
378unsafe impl Send for LDMA {}
379impl LDMA {
380 #[doc = r"Pointer to the register block"]
381 pub const PTR: *const ldma::RegisterBlock = 0x400e_2000 as *const _;
382 #[doc = r"Return the pointer to the register block"]
383 #[inline(always)]
384 pub const fn ptr() -> *const ldma::RegisterBlock {
385 Self::PTR
386 }
387}
388impl Deref for LDMA {
389 type Target = ldma::RegisterBlock;
390 #[inline(always)]
391 fn deref(&self) -> &Self::Target {
392 unsafe { &*Self::PTR }
393 }
394}
395impl core::fmt::Debug for LDMA {
396 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
397 f.debug_struct("LDMA").finish()
398 }
399}
400#[doc = "LDMA"]
401pub mod ldma;
402#[doc = "FPUEH"]
403pub struct FPUEH {
404 _marker: PhantomData<*const ()>,
405}
406unsafe impl Send for FPUEH {}
407impl FPUEH {
408 #[doc = r"Pointer to the register block"]
409 pub const PTR: *const fpueh::RegisterBlock = 0x400e_1000 as *const _;
410 #[doc = r"Return the pointer to the register block"]
411 #[inline(always)]
412 pub const fn ptr() -> *const fpueh::RegisterBlock {
413 Self::PTR
414 }
415}
416impl Deref for FPUEH {
417 type Target = fpueh::RegisterBlock;
418 #[inline(always)]
419 fn deref(&self) -> &Self::Target {
420 unsafe { &*Self::PTR }
421 }
422}
423impl core::fmt::Debug for FPUEH {
424 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
425 f.debug_struct("FPUEH").finish()
426 }
427}
428#[doc = "FPUEH"]
429pub mod fpueh;
430#[doc = "GPCRC"]
431pub struct GPCRC {
432 _marker: PhantomData<*const ()>,
433}
434unsafe impl Send for GPCRC {}
435impl GPCRC {
436 #[doc = r"Pointer to the register block"]
437 pub const PTR: *const gpcrc::RegisterBlock = 0x4001_c000 as *const _;
438 #[doc = r"Return the pointer to the register block"]
439 #[inline(always)]
440 pub const fn ptr() -> *const gpcrc::RegisterBlock {
441 Self::PTR
442 }
443}
444impl Deref for GPCRC {
445 type Target = gpcrc::RegisterBlock;
446 #[inline(always)]
447 fn deref(&self) -> &Self::Target {
448 unsafe { &*Self::PTR }
449 }
450}
451impl core::fmt::Debug for GPCRC {
452 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
453 f.debug_struct("GPCRC").finish()
454 }
455}
456#[doc = "GPCRC"]
457pub mod gpcrc;
458#[doc = "TIMER0"]
459pub struct TIMER0 {
460 _marker: PhantomData<*const ()>,
461}
462unsafe impl Send for TIMER0 {}
463impl TIMER0 {
464 #[doc = r"Pointer to the register block"]
465 pub const PTR: *const timer0::RegisterBlock = 0x4001_8000 as *const _;
466 #[doc = r"Return the pointer to the register block"]
467 #[inline(always)]
468 pub const fn ptr() -> *const timer0::RegisterBlock {
469 Self::PTR
470 }
471}
472impl Deref for TIMER0 {
473 type Target = timer0::RegisterBlock;
474 #[inline(always)]
475 fn deref(&self) -> &Self::Target {
476 unsafe { &*Self::PTR }
477 }
478}
479impl core::fmt::Debug for TIMER0 {
480 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
481 f.debug_struct("TIMER0").finish()
482 }
483}
484#[doc = "TIMER0"]
485pub mod timer0;
486#[doc = "TIMER1"]
487pub struct TIMER1 {
488 _marker: PhantomData<*const ()>,
489}
490unsafe impl Send for TIMER1 {}
491impl TIMER1 {
492 #[doc = r"Pointer to the register block"]
493 pub const PTR: *const timer1::RegisterBlock = 0x4001_8400 as *const _;
494 #[doc = r"Return the pointer to the register block"]
495 #[inline(always)]
496 pub const fn ptr() -> *const timer1::RegisterBlock {
497 Self::PTR
498 }
499}
500impl Deref for TIMER1 {
501 type Target = timer1::RegisterBlock;
502 #[inline(always)]
503 fn deref(&self) -> &Self::Target {
504 unsafe { &*Self::PTR }
505 }
506}
507impl core::fmt::Debug for TIMER1 {
508 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
509 f.debug_struct("TIMER1").finish()
510 }
511}
512#[doc = "TIMER1"]
513pub mod timer1;
514#[doc = "USART0"]
515pub struct USART0 {
516 _marker: PhantomData<*const ()>,
517}
518unsafe impl Send for USART0 {}
519impl USART0 {
520 #[doc = r"Pointer to the register block"]
521 pub const PTR: *const usart0::RegisterBlock = 0x4001_0000 as *const _;
522 #[doc = r"Return the pointer to the register block"]
523 #[inline(always)]
524 pub const fn ptr() -> *const usart0::RegisterBlock {
525 Self::PTR
526 }
527}
528impl Deref for USART0 {
529 type Target = usart0::RegisterBlock;
530 #[inline(always)]
531 fn deref(&self) -> &Self::Target {
532 unsafe { &*Self::PTR }
533 }
534}
535impl core::fmt::Debug for USART0 {
536 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
537 f.debug_struct("USART0").finish()
538 }
539}
540#[doc = "USART0"]
541pub mod usart0;
542#[doc = "USART1"]
543pub struct USART1 {
544 _marker: PhantomData<*const ()>,
545}
546unsafe impl Send for USART1 {}
547impl USART1 {
548 #[doc = r"Pointer to the register block"]
549 pub const PTR: *const usart1::RegisterBlock = 0x4001_0400 as *const _;
550 #[doc = r"Return the pointer to the register block"]
551 #[inline(always)]
552 pub const fn ptr() -> *const usart1::RegisterBlock {
553 Self::PTR
554 }
555}
556impl Deref for USART1 {
557 type Target = usart1::RegisterBlock;
558 #[inline(always)]
559 fn deref(&self) -> &Self::Target {
560 unsafe { &*Self::PTR }
561 }
562}
563impl core::fmt::Debug for USART1 {
564 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
565 f.debug_struct("USART1").finish()
566 }
567}
568#[doc = "USART1"]
569pub mod usart1;
570#[doc = "LEUART0"]
571pub struct LEUART0 {
572 _marker: PhantomData<*const ()>,
573}
574unsafe impl Send for LEUART0 {}
575impl LEUART0 {
576 #[doc = r"Pointer to the register block"]
577 pub const PTR: *const leuart0::RegisterBlock = 0x4004_a000 as *const _;
578 #[doc = r"Return the pointer to the register block"]
579 #[inline(always)]
580 pub const fn ptr() -> *const leuart0::RegisterBlock {
581 Self::PTR
582 }
583}
584impl Deref for LEUART0 {
585 type Target = leuart0::RegisterBlock;
586 #[inline(always)]
587 fn deref(&self) -> &Self::Target {
588 unsafe { &*Self::PTR }
589 }
590}
591impl core::fmt::Debug for LEUART0 {
592 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
593 f.debug_struct("LEUART0").finish()
594 }
595}
596#[doc = "LEUART0"]
597pub mod leuart0;
598#[doc = "LETIMER0"]
599pub struct LETIMER0 {
600 _marker: PhantomData<*const ()>,
601}
602unsafe impl Send for LETIMER0 {}
603impl LETIMER0 {
604 #[doc = r"Pointer to the register block"]
605 pub const PTR: *const letimer0::RegisterBlock = 0x4004_6000 as *const _;
606 #[doc = r"Return the pointer to the register block"]
607 #[inline(always)]
608 pub const fn ptr() -> *const letimer0::RegisterBlock {
609 Self::PTR
610 }
611}
612impl Deref for LETIMER0 {
613 type Target = letimer0::RegisterBlock;
614 #[inline(always)]
615 fn deref(&self) -> &Self::Target {
616 unsafe { &*Self::PTR }
617 }
618}
619impl core::fmt::Debug for LETIMER0 {
620 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
621 f.debug_struct("LETIMER0").finish()
622 }
623}
624#[doc = "LETIMER0"]
625pub mod letimer0;
626#[doc = "CRYOTIMER"]
627pub struct CRYOTIMER {
628 _marker: PhantomData<*const ()>,
629}
630unsafe impl Send for CRYOTIMER {}
631impl CRYOTIMER {
632 #[doc = r"Pointer to the register block"]
633 pub const PTR: *const cryotimer::RegisterBlock = 0x4001_e000 as *const _;
634 #[doc = r"Return the pointer to the register block"]
635 #[inline(always)]
636 pub const fn ptr() -> *const cryotimer::RegisterBlock {
637 Self::PTR
638 }
639}
640impl Deref for CRYOTIMER {
641 type Target = cryotimer::RegisterBlock;
642 #[inline(always)]
643 fn deref(&self) -> &Self::Target {
644 unsafe { &*Self::PTR }
645 }
646}
647impl core::fmt::Debug for CRYOTIMER {
648 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
649 f.debug_struct("CRYOTIMER").finish()
650 }
651}
652#[doc = "CRYOTIMER"]
653pub mod cryotimer;
654#[doc = "PCNT0"]
655pub struct PCNT0 {
656 _marker: PhantomData<*const ()>,
657}
658unsafe impl Send for PCNT0 {}
659impl PCNT0 {
660 #[doc = r"Pointer to the register block"]
661 pub const PTR: *const pcnt0::RegisterBlock = 0x4004_e000 as *const _;
662 #[doc = r"Return the pointer to the register block"]
663 #[inline(always)]
664 pub const fn ptr() -> *const pcnt0::RegisterBlock {
665 Self::PTR
666 }
667}
668impl Deref for PCNT0 {
669 type Target = pcnt0::RegisterBlock;
670 #[inline(always)]
671 fn deref(&self) -> &Self::Target {
672 unsafe { &*Self::PTR }
673 }
674}
675impl core::fmt::Debug for PCNT0 {
676 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
677 f.debug_struct("PCNT0").finish()
678 }
679}
680#[doc = "PCNT0"]
681pub mod pcnt0;
682#[doc = "I2C0"]
683pub struct I2C0 {
684 _marker: PhantomData<*const ()>,
685}
686unsafe impl Send for I2C0 {}
687impl I2C0 {
688 #[doc = r"Pointer to the register block"]
689 pub const PTR: *const i2c0::RegisterBlock = 0x4000_c000 as *const _;
690 #[doc = r"Return the pointer to the register block"]
691 #[inline(always)]
692 pub const fn ptr() -> *const i2c0::RegisterBlock {
693 Self::PTR
694 }
695}
696impl Deref for I2C0 {
697 type Target = i2c0::RegisterBlock;
698 #[inline(always)]
699 fn deref(&self) -> &Self::Target {
700 unsafe { &*Self::PTR }
701 }
702}
703impl core::fmt::Debug for I2C0 {
704 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
705 f.debug_struct("I2C0").finish()
706 }
707}
708#[doc = "I2C0"]
709pub mod i2c0;
710#[doc = "ADC0"]
711pub struct ADC0 {
712 _marker: PhantomData<*const ()>,
713}
714unsafe impl Send for ADC0 {}
715impl ADC0 {
716 #[doc = r"Pointer to the register block"]
717 pub const PTR: *const adc0::RegisterBlock = 0x4000_2000 as *const _;
718 #[doc = r"Return the pointer to the register block"]
719 #[inline(always)]
720 pub const fn ptr() -> *const adc0::RegisterBlock {
721 Self::PTR
722 }
723}
724impl Deref for ADC0 {
725 type Target = adc0::RegisterBlock;
726 #[inline(always)]
727 fn deref(&self) -> &Self::Target {
728 unsafe { &*Self::PTR }
729 }
730}
731impl core::fmt::Debug for ADC0 {
732 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
733 f.debug_struct("ADC0").finish()
734 }
735}
736#[doc = "ADC0"]
737pub mod adc0;
738#[doc = "ACMP0"]
739pub struct ACMP0 {
740 _marker: PhantomData<*const ()>,
741}
742unsafe impl Send for ACMP0 {}
743impl ACMP0 {
744 #[doc = r"Pointer to the register block"]
745 pub const PTR: *const acmp0::RegisterBlock = 0x4000_0000 as *const _;
746 #[doc = r"Return the pointer to the register block"]
747 #[inline(always)]
748 pub const fn ptr() -> *const acmp0::RegisterBlock {
749 Self::PTR
750 }
751}
752impl Deref for ACMP0 {
753 type Target = acmp0::RegisterBlock;
754 #[inline(always)]
755 fn deref(&self) -> &Self::Target {
756 unsafe { &*Self::PTR }
757 }
758}
759impl core::fmt::Debug for ACMP0 {
760 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
761 f.debug_struct("ACMP0").finish()
762 }
763}
764#[doc = "ACMP0"]
765pub mod acmp0;
766#[doc = "ACMP1"]
767pub struct ACMP1 {
768 _marker: PhantomData<*const ()>,
769}
770unsafe impl Send for ACMP1 {}
771impl ACMP1 {
772 #[doc = r"Pointer to the register block"]
773 pub const PTR: *const acmp1::RegisterBlock = 0x4000_0400 as *const _;
774 #[doc = r"Return the pointer to the register block"]
775 #[inline(always)]
776 pub const fn ptr() -> *const acmp1::RegisterBlock {
777 Self::PTR
778 }
779}
780impl Deref for ACMP1 {
781 type Target = acmp1::RegisterBlock;
782 #[inline(always)]
783 fn deref(&self) -> &Self::Target {
784 unsafe { &*Self::PTR }
785 }
786}
787impl core::fmt::Debug for ACMP1 {
788 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
789 f.debug_struct("ACMP1").finish()
790 }
791}
792#[doc = "ACMP1"]
793pub mod acmp1;
794#[doc = "IDAC0"]
795pub struct IDAC0 {
796 _marker: PhantomData<*const ()>,
797}
798unsafe impl Send for IDAC0 {}
799impl IDAC0 {
800 #[doc = r"Pointer to the register block"]
801 pub const PTR: *const idac0::RegisterBlock = 0x4000_6000 as *const _;
802 #[doc = r"Return the pointer to the register block"]
803 #[inline(always)]
804 pub const fn ptr() -> *const idac0::RegisterBlock {
805 Self::PTR
806 }
807}
808impl Deref for IDAC0 {
809 type Target = idac0::RegisterBlock;
810 #[inline(always)]
811 fn deref(&self) -> &Self::Target {
812 unsafe { &*Self::PTR }
813 }
814}
815impl core::fmt::Debug for IDAC0 {
816 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
817 f.debug_struct("IDAC0").finish()
818 }
819}
820#[doc = "IDAC0"]
821pub mod idac0;
822#[doc = "RTCC"]
823pub struct RTCC {
824 _marker: PhantomData<*const ()>,
825}
826unsafe impl Send for RTCC {}
827impl RTCC {
828 #[doc = r"Pointer to the register block"]
829 pub const PTR: *const rtcc::RegisterBlock = 0x4004_2000 as *const _;
830 #[doc = r"Return the pointer to the register block"]
831 #[inline(always)]
832 pub const fn ptr() -> *const rtcc::RegisterBlock {
833 Self::PTR
834 }
835}
836impl Deref for RTCC {
837 type Target = rtcc::RegisterBlock;
838 #[inline(always)]
839 fn deref(&self) -> &Self::Target {
840 unsafe { &*Self::PTR }
841 }
842}
843impl core::fmt::Debug for RTCC {
844 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
845 f.debug_struct("RTCC").finish()
846 }
847}
848#[doc = "RTCC"]
849pub mod rtcc;
850#[doc = "WDOG0"]
851pub struct WDOG0 {
852 _marker: PhantomData<*const ()>,
853}
854unsafe impl Send for WDOG0 {}
855impl WDOG0 {
856 #[doc = r"Pointer to the register block"]
857 pub const PTR: *const wdog0::RegisterBlock = 0x4005_2000 as *const _;
858 #[doc = r"Return the pointer to the register block"]
859 #[inline(always)]
860 pub const fn ptr() -> *const wdog0::RegisterBlock {
861 Self::PTR
862 }
863}
864impl Deref for WDOG0 {
865 type Target = wdog0::RegisterBlock;
866 #[inline(always)]
867 fn deref(&self) -> &Self::Target {
868 unsafe { &*Self::PTR }
869 }
870}
871impl core::fmt::Debug for WDOG0 {
872 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
873 f.debug_struct("WDOG0").finish()
874 }
875}
876#[doc = "WDOG0"]
877pub mod wdog0;
878#[no_mangle]
879static mut DEVICE_PERIPHERALS: bool = false;
880#[doc = r"All the peripherals"]
881#[allow(non_snake_case)]
882pub struct Peripherals {
883 #[doc = "MSC"]
884 pub MSC: MSC,
885 #[doc = "EMU"]
886 pub EMU: EMU,
887 #[doc = "RMU"]
888 pub RMU: RMU,
889 #[doc = "CMU"]
890 pub CMU: CMU,
891 #[doc = "CRYPTO"]
892 pub CRYPTO: CRYPTO,
893 #[doc = "GPIO"]
894 pub GPIO: GPIO,
895 #[doc = "PRS"]
896 pub PRS: PRS,
897 #[doc = "LDMA"]
898 pub LDMA: LDMA,
899 #[doc = "FPUEH"]
900 pub FPUEH: FPUEH,
901 #[doc = "GPCRC"]
902 pub GPCRC: GPCRC,
903 #[doc = "TIMER0"]
904 pub TIMER0: TIMER0,
905 #[doc = "TIMER1"]
906 pub TIMER1: TIMER1,
907 #[doc = "USART0"]
908 pub USART0: USART0,
909 #[doc = "USART1"]
910 pub USART1: USART1,
911 #[doc = "LEUART0"]
912 pub LEUART0: LEUART0,
913 #[doc = "LETIMER0"]
914 pub LETIMER0: LETIMER0,
915 #[doc = "CRYOTIMER"]
916 pub CRYOTIMER: CRYOTIMER,
917 #[doc = "PCNT0"]
918 pub PCNT0: PCNT0,
919 #[doc = "I2C0"]
920 pub I2C0: I2C0,
921 #[doc = "ADC0"]
922 pub ADC0: ADC0,
923 #[doc = "ACMP0"]
924 pub ACMP0: ACMP0,
925 #[doc = "ACMP1"]
926 pub ACMP1: ACMP1,
927 #[doc = "IDAC0"]
928 pub IDAC0: IDAC0,
929 #[doc = "RTCC"]
930 pub RTCC: RTCC,
931 #[doc = "WDOG0"]
932 pub WDOG0: WDOG0,
933}
934impl Peripherals {
935 #[doc = r"Returns all the peripherals *once*"]
936 #[inline]
937 pub fn take() -> Option<Self> {
938 cortex_m::interrupt::free(|_| {
939 if unsafe { DEVICE_PERIPHERALS } {
940 None
941 } else {
942 Some(unsafe { Peripherals::steal() })
943 }
944 })
945 }
946 #[doc = r"Unchecked version of `Peripherals::take`"]
947 #[inline]
948 pub unsafe fn steal() -> Self {
949 DEVICE_PERIPHERALS = true;
950 Peripherals {
951 MSC: MSC {
952 _marker: PhantomData,
953 },
954 EMU: EMU {
955 _marker: PhantomData,
956 },
957 RMU: RMU {
958 _marker: PhantomData,
959 },
960 CMU: CMU {
961 _marker: PhantomData,
962 },
963 CRYPTO: CRYPTO {
964 _marker: PhantomData,
965 },
966 GPIO: GPIO {
967 _marker: PhantomData,
968 },
969 PRS: PRS {
970 _marker: PhantomData,
971 },
972 LDMA: LDMA {
973 _marker: PhantomData,
974 },
975 FPUEH: FPUEH {
976 _marker: PhantomData,
977 },
978 GPCRC: GPCRC {
979 _marker: PhantomData,
980 },
981 TIMER0: TIMER0 {
982 _marker: PhantomData,
983 },
984 TIMER1: TIMER1 {
985 _marker: PhantomData,
986 },
987 USART0: USART0 {
988 _marker: PhantomData,
989 },
990 USART1: USART1 {
991 _marker: PhantomData,
992 },
993 LEUART0: LEUART0 {
994 _marker: PhantomData,
995 },
996 LETIMER0: LETIMER0 {
997 _marker: PhantomData,
998 },
999 CRYOTIMER: CRYOTIMER {
1000 _marker: PhantomData,
1001 },
1002 PCNT0: PCNT0 {
1003 _marker: PhantomData,
1004 },
1005 I2C0: I2C0 {
1006 _marker: PhantomData,
1007 },
1008 ADC0: ADC0 {
1009 _marker: PhantomData,
1010 },
1011 ACMP0: ACMP0 {
1012 _marker: PhantomData,
1013 },
1014 ACMP1: ACMP1 {
1015 _marker: PhantomData,
1016 },
1017 IDAC0: IDAC0 {
1018 _marker: PhantomData,
1019 },
1020 RTCC: RTCC {
1021 _marker: PhantomData,
1022 },
1023 WDOG0: WDOG0 {
1024 _marker: PhantomData,
1025 },
1026 }
1027 }
1028}