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