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