efm32wg330_pac/
lib.rs

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