efm32wg230_pac/
lib.rs

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