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