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