efm32jg1b100_pac/
lib.rs

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