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