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