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