efm32gg_pac/efm32gg230/
mod.rs

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