efm32hg309f64_pac/
lib.rs

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