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