atsamd11d/
lib.rs

1#![doc = "Peripheral access API for ATSAMD11D microcontrollers (generated using svd2rust v0.33.5 ( ))\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.33.5/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#![allow(non_camel_case_types)]
4#![allow(non_snake_case)]
5#![allow(clippy::all)]
6#![allow(unknown_lints)]
7#![allow(mismatched_lifetime_syntaxes)]
8#![no_std]
9use core::marker::PhantomData;
10use core::ops::Deref;
11#[doc = r"Number available in the NVIC for configuring priority"]
12pub const NVIC_PRIO_BITS: u8 = 2;
13#[cfg(feature = "rt")]
14pub use self::Interrupt as interrupt;
15pub use cortex_m::peripheral::Peripherals as CorePeripherals;
16pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, ITM, MPU, NVIC, SCB, SYST, TPIU};
17#[cfg(feature = "rt")]
18pub use cortex_m_rt::interrupt;
19#[allow(unused_imports)]
20use generic::*;
21#[doc = r"Common register and bit access and modify traits"]
22pub mod generic;
23#[cfg(feature = "rt")]
24extern "C" {
25    fn PM();
26    fn SYSCTRL();
27    fn WDT();
28    fn RTC();
29    fn EIC();
30    fn NVMCTRL();
31    fn DMAC();
32    fn USB();
33    fn EVSYS();
34    fn SERCOM0();
35    fn SERCOM1();
36    fn SERCOM2();
37    fn TCC0();
38    fn TC1();
39    fn TC2();
40    fn ADC();
41    fn AC();
42    fn DAC();
43}
44#[doc(hidden)]
45#[repr(C)]
46pub union Vector {
47    _handler: unsafe extern "C" fn(),
48    _reserved: u32,
49}
50#[cfg(feature = "rt")]
51#[doc(hidden)]
52#[link_section = ".vector_table.interrupts"]
53#[no_mangle]
54pub static __INTERRUPTS: [Vector; 18] = [
55    Vector { _handler: PM },
56    Vector { _handler: SYSCTRL },
57    Vector { _handler: WDT },
58    Vector { _handler: RTC },
59    Vector { _handler: EIC },
60    Vector { _handler: NVMCTRL },
61    Vector { _handler: DMAC },
62    Vector { _handler: USB },
63    Vector { _handler: EVSYS },
64    Vector { _handler: SERCOM0 },
65    Vector { _handler: SERCOM1 },
66    Vector { _handler: SERCOM2 },
67    Vector { _handler: TCC0 },
68    Vector { _handler: TC1 },
69    Vector { _handler: TC2 },
70    Vector { _handler: ADC },
71    Vector { _handler: AC },
72    Vector { _handler: DAC },
73];
74#[doc = r"Enumeration of all the interrupts."]
75#[derive(Copy, Clone, Debug, PartialEq, Eq)]
76#[repr(u16)]
77pub enum Interrupt {
78    #[doc = "0 - PM"]
79    PM = 0,
80    #[doc = "1 - SYSCTRL"]
81    SYSCTRL = 1,
82    #[doc = "2 - WDT"]
83    WDT = 2,
84    #[doc = "3 - RTC"]
85    RTC = 3,
86    #[doc = "4 - EIC"]
87    EIC = 4,
88    #[doc = "5 - NVMCTRL"]
89    NVMCTRL = 5,
90    #[doc = "6 - DMAC"]
91    DMAC = 6,
92    #[doc = "7 - USB"]
93    USB = 7,
94    #[doc = "8 - EVSYS"]
95    EVSYS = 8,
96    #[doc = "9 - SERCOM0"]
97    SERCOM0 = 9,
98    #[doc = "10 - SERCOM1"]
99    SERCOM1 = 10,
100    #[doc = "11 - SERCOM2"]
101    SERCOM2 = 11,
102    #[doc = "12 - TCC0"]
103    TCC0 = 12,
104    #[doc = "13 - TC1"]
105    TC1 = 13,
106    #[doc = "14 - TC2"]
107    TC2 = 14,
108    #[doc = "15 - ADC"]
109    ADC = 15,
110    #[doc = "16 - AC"]
111    AC = 16,
112    #[doc = "17 - DAC"]
113    DAC = 17,
114}
115unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
116    #[inline(always)]
117    fn number(self) -> u16 {
118        self as u16
119    }
120}
121#[doc = "Analog Comparators"]
122pub struct Ac {
123    _marker: PhantomData<*const ()>,
124}
125unsafe impl Send for Ac {}
126impl Ac {
127    #[doc = r"Pointer to the register block"]
128    pub const PTR: *const ac::RegisterBlock = 0x4200_2400 as *const _;
129    #[doc = r"Return the pointer to the register block"]
130    #[inline(always)]
131    pub const fn ptr() -> *const ac::RegisterBlock {
132        Self::PTR
133    }
134    #[doc = r" Steal an instance of this peripheral"]
135    #[doc = r""]
136    #[doc = r" # Safety"]
137    #[doc = r""]
138    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
139    #[doc = r" that may race with any existing instances, for example by only"]
140    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
141    #[doc = r" original peripheral and using critical sections to coordinate"]
142    #[doc = r" access between multiple new instances."]
143    #[doc = r""]
144    #[doc = r" Additionally, other software such as HALs may rely on only one"]
145    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
146    #[doc = r" no stolen instances are passed to such software."]
147    pub unsafe fn steal() -> Self {
148        Self {
149            _marker: PhantomData,
150        }
151    }
152}
153impl Deref for Ac {
154    type Target = ac::RegisterBlock;
155    #[inline(always)]
156    fn deref(&self) -> &Self::Target {
157        unsafe { &*Self::PTR }
158    }
159}
160impl core::fmt::Debug for Ac {
161    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
162        f.debug_struct("Ac").finish()
163    }
164}
165#[doc = "Analog Comparators"]
166pub mod ac;
167#[doc = "Analog Digital Converter"]
168pub struct Adc {
169    _marker: PhantomData<*const ()>,
170}
171unsafe impl Send for Adc {}
172impl Adc {
173    #[doc = r"Pointer to the register block"]
174    pub const PTR: *const adc::RegisterBlock = 0x4200_2000 as *const _;
175    #[doc = r"Return the pointer to the register block"]
176    #[inline(always)]
177    pub const fn ptr() -> *const adc::RegisterBlock {
178        Self::PTR
179    }
180    #[doc = r" Steal an instance of this peripheral"]
181    #[doc = r""]
182    #[doc = r" # Safety"]
183    #[doc = r""]
184    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
185    #[doc = r" that may race with any existing instances, for example by only"]
186    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
187    #[doc = r" original peripheral and using critical sections to coordinate"]
188    #[doc = r" access between multiple new instances."]
189    #[doc = r""]
190    #[doc = r" Additionally, other software such as HALs may rely on only one"]
191    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
192    #[doc = r" no stolen instances are passed to such software."]
193    pub unsafe fn steal() -> Self {
194        Self {
195            _marker: PhantomData,
196        }
197    }
198}
199impl Deref for Adc {
200    type Target = adc::RegisterBlock;
201    #[inline(always)]
202    fn deref(&self) -> &Self::Target {
203        unsafe { &*Self::PTR }
204    }
205}
206impl core::fmt::Debug for Adc {
207    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
208        f.debug_struct("Adc").finish()
209    }
210}
211#[doc = "Analog Digital Converter"]
212pub mod adc;
213#[doc = "Digital Analog Converter"]
214pub struct Dac {
215    _marker: PhantomData<*const ()>,
216}
217unsafe impl Send for Dac {}
218impl Dac {
219    #[doc = r"Pointer to the register block"]
220    pub const PTR: *const dac::RegisterBlock = 0x4200_2800 as *const _;
221    #[doc = r"Return the pointer to the register block"]
222    #[inline(always)]
223    pub const fn ptr() -> *const dac::RegisterBlock {
224        Self::PTR
225    }
226    #[doc = r" Steal an instance of this peripheral"]
227    #[doc = r""]
228    #[doc = r" # Safety"]
229    #[doc = r""]
230    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
231    #[doc = r" that may race with any existing instances, for example by only"]
232    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
233    #[doc = r" original peripheral and using critical sections to coordinate"]
234    #[doc = r" access between multiple new instances."]
235    #[doc = r""]
236    #[doc = r" Additionally, other software such as HALs may rely on only one"]
237    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
238    #[doc = r" no stolen instances are passed to such software."]
239    pub unsafe fn steal() -> Self {
240        Self {
241            _marker: PhantomData,
242        }
243    }
244}
245impl Deref for Dac {
246    type Target = dac::RegisterBlock;
247    #[inline(always)]
248    fn deref(&self) -> &Self::Target {
249        unsafe { &*Self::PTR }
250    }
251}
252impl core::fmt::Debug for Dac {
253    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
254        f.debug_struct("Dac").finish()
255    }
256}
257#[doc = "Digital Analog Converter"]
258pub mod dac;
259#[doc = "Direct Memory Access Controller"]
260pub struct Dmac {
261    _marker: PhantomData<*const ()>,
262}
263unsafe impl Send for Dmac {}
264impl Dmac {
265    #[doc = r"Pointer to the register block"]
266    pub const PTR: *const dmac::RegisterBlock = 0x4100_4800 as *const _;
267    #[doc = r"Return the pointer to the register block"]
268    #[inline(always)]
269    pub const fn ptr() -> *const dmac::RegisterBlock {
270        Self::PTR
271    }
272    #[doc = r" Steal an instance of this peripheral"]
273    #[doc = r""]
274    #[doc = r" # Safety"]
275    #[doc = r""]
276    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
277    #[doc = r" that may race with any existing instances, for example by only"]
278    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
279    #[doc = r" original peripheral and using critical sections to coordinate"]
280    #[doc = r" access between multiple new instances."]
281    #[doc = r""]
282    #[doc = r" Additionally, other software such as HALs may rely on only one"]
283    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
284    #[doc = r" no stolen instances are passed to such software."]
285    pub unsafe fn steal() -> Self {
286        Self {
287            _marker: PhantomData,
288        }
289    }
290}
291impl Deref for Dmac {
292    type Target = dmac::RegisterBlock;
293    #[inline(always)]
294    fn deref(&self) -> &Self::Target {
295        unsafe { &*Self::PTR }
296    }
297}
298impl core::fmt::Debug for Dmac {
299    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
300        f.debug_struct("Dmac").finish()
301    }
302}
303#[doc = "Direct Memory Access Controller"]
304pub mod dmac;
305#[doc = "Device Service Unit"]
306pub struct Dsu {
307    _marker: PhantomData<*const ()>,
308}
309unsafe impl Send for Dsu {}
310impl Dsu {
311    #[doc = r"Pointer to the register block"]
312    pub const PTR: *const dsu::RegisterBlock = 0x4100_2000 as *const _;
313    #[doc = r"Return the pointer to the register block"]
314    #[inline(always)]
315    pub const fn ptr() -> *const dsu::RegisterBlock {
316        Self::PTR
317    }
318    #[doc = r" Steal an instance of this peripheral"]
319    #[doc = r""]
320    #[doc = r" # Safety"]
321    #[doc = r""]
322    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
323    #[doc = r" that may race with any existing instances, for example by only"]
324    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
325    #[doc = r" original peripheral and using critical sections to coordinate"]
326    #[doc = r" access between multiple new instances."]
327    #[doc = r""]
328    #[doc = r" Additionally, other software such as HALs may rely on only one"]
329    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
330    #[doc = r" no stolen instances are passed to such software."]
331    pub unsafe fn steal() -> Self {
332        Self {
333            _marker: PhantomData,
334        }
335    }
336}
337impl Deref for Dsu {
338    type Target = dsu::RegisterBlock;
339    #[inline(always)]
340    fn deref(&self) -> &Self::Target {
341        unsafe { &*Self::PTR }
342    }
343}
344impl core::fmt::Debug for Dsu {
345    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
346        f.debug_struct("Dsu").finish()
347    }
348}
349#[doc = "Device Service Unit"]
350pub mod dsu;
351#[doc = "External Interrupt Controller"]
352pub struct Eic {
353    _marker: PhantomData<*const ()>,
354}
355unsafe impl Send for Eic {}
356impl Eic {
357    #[doc = r"Pointer to the register block"]
358    pub const PTR: *const eic::RegisterBlock = 0x4000_1800 as *const _;
359    #[doc = r"Return the pointer to the register block"]
360    #[inline(always)]
361    pub const fn ptr() -> *const eic::RegisterBlock {
362        Self::PTR
363    }
364    #[doc = r" Steal an instance of this peripheral"]
365    #[doc = r""]
366    #[doc = r" # Safety"]
367    #[doc = r""]
368    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
369    #[doc = r" that may race with any existing instances, for example by only"]
370    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
371    #[doc = r" original peripheral and using critical sections to coordinate"]
372    #[doc = r" access between multiple new instances."]
373    #[doc = r""]
374    #[doc = r" Additionally, other software such as HALs may rely on only one"]
375    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
376    #[doc = r" no stolen instances are passed to such software."]
377    pub unsafe fn steal() -> Self {
378        Self {
379            _marker: PhantomData,
380        }
381    }
382}
383impl Deref for Eic {
384    type Target = eic::RegisterBlock;
385    #[inline(always)]
386    fn deref(&self) -> &Self::Target {
387        unsafe { &*Self::PTR }
388    }
389}
390impl core::fmt::Debug for Eic {
391    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
392        f.debug_struct("Eic").finish()
393    }
394}
395#[doc = "External Interrupt Controller"]
396pub mod eic;
397#[doc = "Event System Interface"]
398pub struct Evsys {
399    _marker: PhantomData<*const ()>,
400}
401unsafe impl Send for Evsys {}
402impl Evsys {
403    #[doc = r"Pointer to the register block"]
404    pub const PTR: *const evsys::RegisterBlock = 0x4200_0400 as *const _;
405    #[doc = r"Return the pointer to the register block"]
406    #[inline(always)]
407    pub const fn ptr() -> *const evsys::RegisterBlock {
408        Self::PTR
409    }
410    #[doc = r" Steal an instance of this peripheral"]
411    #[doc = r""]
412    #[doc = r" # Safety"]
413    #[doc = r""]
414    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
415    #[doc = r" that may race with any existing instances, for example by only"]
416    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
417    #[doc = r" original peripheral and using critical sections to coordinate"]
418    #[doc = r" access between multiple new instances."]
419    #[doc = r""]
420    #[doc = r" Additionally, other software such as HALs may rely on only one"]
421    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
422    #[doc = r" no stolen instances are passed to such software."]
423    pub unsafe fn steal() -> Self {
424        Self {
425            _marker: PhantomData,
426        }
427    }
428}
429impl Deref for Evsys {
430    type Target = evsys::RegisterBlock;
431    #[inline(always)]
432    fn deref(&self) -> &Self::Target {
433        unsafe { &*Self::PTR }
434    }
435}
436impl core::fmt::Debug for Evsys {
437    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
438        f.debug_struct("Evsys").finish()
439    }
440}
441#[doc = "Event System Interface"]
442pub mod evsys;
443#[doc = "Generic Clock Generator"]
444pub struct Gclk {
445    _marker: PhantomData<*const ()>,
446}
447unsafe impl Send for Gclk {}
448impl Gclk {
449    #[doc = r"Pointer to the register block"]
450    pub const PTR: *const gclk::RegisterBlock = 0x4000_0c00 as *const _;
451    #[doc = r"Return the pointer to the register block"]
452    #[inline(always)]
453    pub const fn ptr() -> *const gclk::RegisterBlock {
454        Self::PTR
455    }
456    #[doc = r" Steal an instance of this peripheral"]
457    #[doc = r""]
458    #[doc = r" # Safety"]
459    #[doc = r""]
460    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
461    #[doc = r" that may race with any existing instances, for example by only"]
462    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
463    #[doc = r" original peripheral and using critical sections to coordinate"]
464    #[doc = r" access between multiple new instances."]
465    #[doc = r""]
466    #[doc = r" Additionally, other software such as HALs may rely on only one"]
467    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
468    #[doc = r" no stolen instances are passed to such software."]
469    pub unsafe fn steal() -> Self {
470        Self {
471            _marker: PhantomData,
472        }
473    }
474}
475impl Deref for Gclk {
476    type Target = gclk::RegisterBlock;
477    #[inline(always)]
478    fn deref(&self) -> &Self::Target {
479        unsafe { &*Self::PTR }
480    }
481}
482impl core::fmt::Debug for Gclk {
483    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
484        f.debug_struct("Gclk").finish()
485    }
486}
487#[doc = "Generic Clock Generator"]
488pub mod gclk;
489#[doc = "HSB Matrix"]
490pub struct Hmatrix {
491    _marker: PhantomData<*const ()>,
492}
493unsafe impl Send for Hmatrix {}
494impl Hmatrix {
495    #[doc = r"Pointer to the register block"]
496    pub const PTR: *const hmatrix::RegisterBlock = 0x4100_7000 as *const _;
497    #[doc = r"Return the pointer to the register block"]
498    #[inline(always)]
499    pub const fn ptr() -> *const hmatrix::RegisterBlock {
500        Self::PTR
501    }
502    #[doc = r" Steal an instance of this peripheral"]
503    #[doc = r""]
504    #[doc = r" # Safety"]
505    #[doc = r""]
506    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
507    #[doc = r" that may race with any existing instances, for example by only"]
508    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
509    #[doc = r" original peripheral and using critical sections to coordinate"]
510    #[doc = r" access between multiple new instances."]
511    #[doc = r""]
512    #[doc = r" Additionally, other software such as HALs may rely on only one"]
513    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
514    #[doc = r" no stolen instances are passed to such software."]
515    pub unsafe fn steal() -> Self {
516        Self {
517            _marker: PhantomData,
518        }
519    }
520}
521impl Deref for Hmatrix {
522    type Target = hmatrix::RegisterBlock;
523    #[inline(always)]
524    fn deref(&self) -> &Self::Target {
525        unsafe { &*Self::PTR }
526    }
527}
528impl core::fmt::Debug for Hmatrix {
529    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
530        f.debug_struct("Hmatrix").finish()
531    }
532}
533#[doc = "HSB Matrix"]
534pub mod hmatrix;
535#[doc = "Cortex-M0+ Micro-Trace Buffer"]
536pub struct Mtb {
537    _marker: PhantomData<*const ()>,
538}
539unsafe impl Send for Mtb {}
540impl Mtb {
541    #[doc = r"Pointer to the register block"]
542    pub const PTR: *const mtb::RegisterBlock = 0x4100_6000 as *const _;
543    #[doc = r"Return the pointer to the register block"]
544    #[inline(always)]
545    pub const fn ptr() -> *const mtb::RegisterBlock {
546        Self::PTR
547    }
548    #[doc = r" Steal an instance of this peripheral"]
549    #[doc = r""]
550    #[doc = r" # Safety"]
551    #[doc = r""]
552    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
553    #[doc = r" that may race with any existing instances, for example by only"]
554    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
555    #[doc = r" original peripheral and using critical sections to coordinate"]
556    #[doc = r" access between multiple new instances."]
557    #[doc = r""]
558    #[doc = r" Additionally, other software such as HALs may rely on only one"]
559    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
560    #[doc = r" no stolen instances are passed to such software."]
561    pub unsafe fn steal() -> Self {
562        Self {
563            _marker: PhantomData,
564        }
565    }
566}
567impl Deref for Mtb {
568    type Target = mtb::RegisterBlock;
569    #[inline(always)]
570    fn deref(&self) -> &Self::Target {
571        unsafe { &*Self::PTR }
572    }
573}
574impl core::fmt::Debug for Mtb {
575    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
576        f.debug_struct("Mtb").finish()
577    }
578}
579#[doc = "Cortex-M0+ Micro-Trace Buffer"]
580pub mod mtb;
581#[doc = "Non-Volatile Memory Controller"]
582pub struct Nvmctrl {
583    _marker: PhantomData<*const ()>,
584}
585unsafe impl Send for Nvmctrl {}
586impl Nvmctrl {
587    #[doc = r"Pointer to the register block"]
588    pub const PTR: *const nvmctrl::RegisterBlock = 0x4100_4000 as *const _;
589    #[doc = r"Return the pointer to the register block"]
590    #[inline(always)]
591    pub const fn ptr() -> *const nvmctrl::RegisterBlock {
592        Self::PTR
593    }
594    #[doc = r" Steal an instance of this peripheral"]
595    #[doc = r""]
596    #[doc = r" # Safety"]
597    #[doc = r""]
598    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
599    #[doc = r" that may race with any existing instances, for example by only"]
600    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
601    #[doc = r" original peripheral and using critical sections to coordinate"]
602    #[doc = r" access between multiple new instances."]
603    #[doc = r""]
604    #[doc = r" Additionally, other software such as HALs may rely on only one"]
605    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
606    #[doc = r" no stolen instances are passed to such software."]
607    pub unsafe fn steal() -> Self {
608        Self {
609            _marker: PhantomData,
610        }
611    }
612}
613impl Deref for Nvmctrl {
614    type Target = nvmctrl::RegisterBlock;
615    #[inline(always)]
616    fn deref(&self) -> &Self::Target {
617        unsafe { &*Self::PTR }
618    }
619}
620impl core::fmt::Debug for Nvmctrl {
621    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
622        f.debug_struct("Nvmctrl").finish()
623    }
624}
625#[doc = "Non-Volatile Memory Controller"]
626pub mod nvmctrl;
627#[doc = "Peripheral Access Controller 0"]
628pub struct Pac0 {
629    _marker: PhantomData<*const ()>,
630}
631unsafe impl Send for Pac0 {}
632impl Pac0 {
633    #[doc = r"Pointer to the register block"]
634    pub const PTR: *const pac0::RegisterBlock = 0x4000_0000 as *const _;
635    #[doc = r"Return the pointer to the register block"]
636    #[inline(always)]
637    pub const fn ptr() -> *const pac0::RegisterBlock {
638        Self::PTR
639    }
640    #[doc = r" Steal an instance of this peripheral"]
641    #[doc = r""]
642    #[doc = r" # Safety"]
643    #[doc = r""]
644    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
645    #[doc = r" that may race with any existing instances, for example by only"]
646    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
647    #[doc = r" original peripheral and using critical sections to coordinate"]
648    #[doc = r" access between multiple new instances."]
649    #[doc = r""]
650    #[doc = r" Additionally, other software such as HALs may rely on only one"]
651    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
652    #[doc = r" no stolen instances are passed to such software."]
653    pub unsafe fn steal() -> Self {
654        Self {
655            _marker: PhantomData,
656        }
657    }
658}
659impl Deref for Pac0 {
660    type Target = pac0::RegisterBlock;
661    #[inline(always)]
662    fn deref(&self) -> &Self::Target {
663        unsafe { &*Self::PTR }
664    }
665}
666impl core::fmt::Debug for Pac0 {
667    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
668        f.debug_struct("Pac0").finish()
669    }
670}
671#[doc = "Peripheral Access Controller 0"]
672pub mod pac0;
673#[doc = "Peripheral Access Controller 1"]
674pub struct Pac1 {
675    _marker: PhantomData<*const ()>,
676}
677unsafe impl Send for Pac1 {}
678impl Pac1 {
679    #[doc = r"Pointer to the register block"]
680    pub const PTR: *const pac0::RegisterBlock = 0x4100_0000 as *const _;
681    #[doc = r"Return the pointer to the register block"]
682    #[inline(always)]
683    pub const fn ptr() -> *const pac0::RegisterBlock {
684        Self::PTR
685    }
686    #[doc = r" Steal an instance of this peripheral"]
687    #[doc = r""]
688    #[doc = r" # Safety"]
689    #[doc = r""]
690    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
691    #[doc = r" that may race with any existing instances, for example by only"]
692    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
693    #[doc = r" original peripheral and using critical sections to coordinate"]
694    #[doc = r" access between multiple new instances."]
695    #[doc = r""]
696    #[doc = r" Additionally, other software such as HALs may rely on only one"]
697    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
698    #[doc = r" no stolen instances are passed to such software."]
699    pub unsafe fn steal() -> Self {
700        Self {
701            _marker: PhantomData,
702        }
703    }
704}
705impl Deref for Pac1 {
706    type Target = pac0::RegisterBlock;
707    #[inline(always)]
708    fn deref(&self) -> &Self::Target {
709        unsafe { &*Self::PTR }
710    }
711}
712impl core::fmt::Debug for Pac1 {
713    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
714        f.debug_struct("Pac1").finish()
715    }
716}
717#[doc = "Peripheral Access Controller 1"]
718pub use self::pac0 as pac1;
719#[doc = "Peripheral Access Controller 2"]
720pub struct Pac2 {
721    _marker: PhantomData<*const ()>,
722}
723unsafe impl Send for Pac2 {}
724impl Pac2 {
725    #[doc = r"Pointer to the register block"]
726    pub const PTR: *const pac0::RegisterBlock = 0x4200_0000 as *const _;
727    #[doc = r"Return the pointer to the register block"]
728    #[inline(always)]
729    pub const fn ptr() -> *const pac0::RegisterBlock {
730        Self::PTR
731    }
732    #[doc = r" Steal an instance of this peripheral"]
733    #[doc = r""]
734    #[doc = r" # Safety"]
735    #[doc = r""]
736    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
737    #[doc = r" that may race with any existing instances, for example by only"]
738    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
739    #[doc = r" original peripheral and using critical sections to coordinate"]
740    #[doc = r" access between multiple new instances."]
741    #[doc = r""]
742    #[doc = r" Additionally, other software such as HALs may rely on only one"]
743    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
744    #[doc = r" no stolen instances are passed to such software."]
745    pub unsafe fn steal() -> Self {
746        Self {
747            _marker: PhantomData,
748        }
749    }
750}
751impl Deref for Pac2 {
752    type Target = pac0::RegisterBlock;
753    #[inline(always)]
754    fn deref(&self) -> &Self::Target {
755        unsafe { &*Self::PTR }
756    }
757}
758impl core::fmt::Debug for Pac2 {
759    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
760        f.debug_struct("Pac2").finish()
761    }
762}
763#[doc = "Peripheral Access Controller 2"]
764pub use self::pac0 as pac2;
765#[doc = "Power Manager"]
766pub struct Pm {
767    _marker: PhantomData<*const ()>,
768}
769unsafe impl Send for Pm {}
770impl Pm {
771    #[doc = r"Pointer to the register block"]
772    pub const PTR: *const pm::RegisterBlock = 0x4000_0400 as *const _;
773    #[doc = r"Return the pointer to the register block"]
774    #[inline(always)]
775    pub const fn ptr() -> *const pm::RegisterBlock {
776        Self::PTR
777    }
778    #[doc = r" Steal an instance of this peripheral"]
779    #[doc = r""]
780    #[doc = r" # Safety"]
781    #[doc = r""]
782    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
783    #[doc = r" that may race with any existing instances, for example by only"]
784    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
785    #[doc = r" original peripheral and using critical sections to coordinate"]
786    #[doc = r" access between multiple new instances."]
787    #[doc = r""]
788    #[doc = r" Additionally, other software such as HALs may rely on only one"]
789    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
790    #[doc = r" no stolen instances are passed to such software."]
791    pub unsafe fn steal() -> Self {
792        Self {
793            _marker: PhantomData,
794        }
795    }
796}
797impl Deref for Pm {
798    type Target = pm::RegisterBlock;
799    #[inline(always)]
800    fn deref(&self) -> &Self::Target {
801        unsafe { &*Self::PTR }
802    }
803}
804impl core::fmt::Debug for Pm {
805    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
806        f.debug_struct("Pm").finish()
807    }
808}
809#[doc = "Power Manager"]
810pub mod pm;
811#[doc = "Port Module"]
812pub struct Port {
813    _marker: PhantomData<*const ()>,
814}
815unsafe impl Send for Port {}
816impl Port {
817    #[doc = r"Pointer to the register block"]
818    pub const PTR: *const port::RegisterBlock = 0x4100_4400 as *const _;
819    #[doc = r"Return the pointer to the register block"]
820    #[inline(always)]
821    pub const fn ptr() -> *const port::RegisterBlock {
822        Self::PTR
823    }
824    #[doc = r" Steal an instance of this peripheral"]
825    #[doc = r""]
826    #[doc = r" # Safety"]
827    #[doc = r""]
828    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
829    #[doc = r" that may race with any existing instances, for example by only"]
830    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
831    #[doc = r" original peripheral and using critical sections to coordinate"]
832    #[doc = r" access between multiple new instances."]
833    #[doc = r""]
834    #[doc = r" Additionally, other software such as HALs may rely on only one"]
835    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
836    #[doc = r" no stolen instances are passed to such software."]
837    pub unsafe fn steal() -> Self {
838        Self {
839            _marker: PhantomData,
840        }
841    }
842}
843impl Deref for Port {
844    type Target = port::RegisterBlock;
845    #[inline(always)]
846    fn deref(&self) -> &Self::Target {
847        unsafe { &*Self::PTR }
848    }
849}
850impl core::fmt::Debug for Port {
851    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
852        f.debug_struct("Port").finish()
853    }
854}
855#[doc = "Port Module"]
856pub mod port;
857#[doc = "Port Module (IOBUS)"]
858pub struct PortIobus {
859    _marker: PhantomData<*const ()>,
860}
861unsafe impl Send for PortIobus {}
862impl PortIobus {
863    #[doc = r"Pointer to the register block"]
864    pub const PTR: *const port::RegisterBlock = 0x6000_0000 as *const _;
865    #[doc = r"Return the pointer to the register block"]
866    #[inline(always)]
867    pub const fn ptr() -> *const port::RegisterBlock {
868        Self::PTR
869    }
870    #[doc = r" Steal an instance of this peripheral"]
871    #[doc = r""]
872    #[doc = r" # Safety"]
873    #[doc = r""]
874    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
875    #[doc = r" that may race with any existing instances, for example by only"]
876    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
877    #[doc = r" original peripheral and using critical sections to coordinate"]
878    #[doc = r" access between multiple new instances."]
879    #[doc = r""]
880    #[doc = r" Additionally, other software such as HALs may rely on only one"]
881    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
882    #[doc = r" no stolen instances are passed to such software."]
883    pub unsafe fn steal() -> Self {
884        Self {
885            _marker: PhantomData,
886        }
887    }
888}
889impl Deref for PortIobus {
890    type Target = port::RegisterBlock;
891    #[inline(always)]
892    fn deref(&self) -> &Self::Target {
893        unsafe { &*Self::PTR }
894    }
895}
896impl core::fmt::Debug for PortIobus {
897    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
898        f.debug_struct("PortIobus").finish()
899    }
900}
901#[doc = "Port Module (IOBUS)"]
902pub use self::port as port_iobus;
903#[doc = "Real-Time Counter"]
904pub struct Rtc {
905    _marker: PhantomData<*const ()>,
906}
907unsafe impl Send for Rtc {}
908impl Rtc {
909    #[doc = r"Pointer to the register block"]
910    pub const PTR: *const rtc::RegisterBlock = 0x4000_1400 as *const _;
911    #[doc = r"Return the pointer to the register block"]
912    #[inline(always)]
913    pub const fn ptr() -> *const rtc::RegisterBlock {
914        Self::PTR
915    }
916    #[doc = r" Steal an instance of this peripheral"]
917    #[doc = r""]
918    #[doc = r" # Safety"]
919    #[doc = r""]
920    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
921    #[doc = r" that may race with any existing instances, for example by only"]
922    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
923    #[doc = r" original peripheral and using critical sections to coordinate"]
924    #[doc = r" access between multiple new instances."]
925    #[doc = r""]
926    #[doc = r" Additionally, other software such as HALs may rely on only one"]
927    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
928    #[doc = r" no stolen instances are passed to such software."]
929    pub unsafe fn steal() -> Self {
930        Self {
931            _marker: PhantomData,
932        }
933    }
934}
935impl Deref for Rtc {
936    type Target = rtc::RegisterBlock;
937    #[inline(always)]
938    fn deref(&self) -> &Self::Target {
939        unsafe { &*Self::PTR }
940    }
941}
942impl core::fmt::Debug for Rtc {
943    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
944        f.debug_struct("Rtc").finish()
945    }
946}
947#[doc = "Real-Time Counter"]
948pub mod rtc;
949#[doc = "Serial Communication Interface 0"]
950pub struct Sercom0 {
951    _marker: PhantomData<*const ()>,
952}
953unsafe impl Send for Sercom0 {}
954impl Sercom0 {
955    #[doc = r"Pointer to the register block"]
956    pub const PTR: *const sercom0::RegisterBlock = 0x4200_0800 as *const _;
957    #[doc = r"Return the pointer to the register block"]
958    #[inline(always)]
959    pub const fn ptr() -> *const sercom0::RegisterBlock {
960        Self::PTR
961    }
962    #[doc = r" Steal an instance of this peripheral"]
963    #[doc = r""]
964    #[doc = r" # Safety"]
965    #[doc = r""]
966    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
967    #[doc = r" that may race with any existing instances, for example by only"]
968    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
969    #[doc = r" original peripheral and using critical sections to coordinate"]
970    #[doc = r" access between multiple new instances."]
971    #[doc = r""]
972    #[doc = r" Additionally, other software such as HALs may rely on only one"]
973    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
974    #[doc = r" no stolen instances are passed to such software."]
975    pub unsafe fn steal() -> Self {
976        Self {
977            _marker: PhantomData,
978        }
979    }
980}
981impl Deref for Sercom0 {
982    type Target = sercom0::RegisterBlock;
983    #[inline(always)]
984    fn deref(&self) -> &Self::Target {
985        unsafe { &*Self::PTR }
986    }
987}
988impl core::fmt::Debug for Sercom0 {
989    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
990        f.debug_struct("Sercom0").finish()
991    }
992}
993#[doc = "Serial Communication Interface 0"]
994pub mod sercom0;
995#[doc = "Serial Communication Interface 1"]
996pub struct Sercom1 {
997    _marker: PhantomData<*const ()>,
998}
999unsafe impl Send for Sercom1 {}
1000impl Sercom1 {
1001    #[doc = r"Pointer to the register block"]
1002    pub const PTR: *const sercom0::RegisterBlock = 0x4200_0c00 as *const _;
1003    #[doc = r"Return the pointer to the register block"]
1004    #[inline(always)]
1005    pub const fn ptr() -> *const sercom0::RegisterBlock {
1006        Self::PTR
1007    }
1008    #[doc = r" Steal an instance of this peripheral"]
1009    #[doc = r""]
1010    #[doc = r" # Safety"]
1011    #[doc = r""]
1012    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1013    #[doc = r" that may race with any existing instances, for example by only"]
1014    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1015    #[doc = r" original peripheral and using critical sections to coordinate"]
1016    #[doc = r" access between multiple new instances."]
1017    #[doc = r""]
1018    #[doc = r" Additionally, other software such as HALs may rely on only one"]
1019    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1020    #[doc = r" no stolen instances are passed to such software."]
1021    pub unsafe fn steal() -> Self {
1022        Self {
1023            _marker: PhantomData,
1024        }
1025    }
1026}
1027impl Deref for Sercom1 {
1028    type Target = sercom0::RegisterBlock;
1029    #[inline(always)]
1030    fn deref(&self) -> &Self::Target {
1031        unsafe { &*Self::PTR }
1032    }
1033}
1034impl core::fmt::Debug for Sercom1 {
1035    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1036        f.debug_struct("Sercom1").finish()
1037    }
1038}
1039#[doc = "Serial Communication Interface 1"]
1040pub use self::sercom0 as sercom1;
1041#[doc = "Serial Communication Interface 2"]
1042pub struct Sercom2 {
1043    _marker: PhantomData<*const ()>,
1044}
1045unsafe impl Send for Sercom2 {}
1046impl Sercom2 {
1047    #[doc = r"Pointer to the register block"]
1048    pub const PTR: *const sercom0::RegisterBlock = 0x4200_1000 as *const _;
1049    #[doc = r"Return the pointer to the register block"]
1050    #[inline(always)]
1051    pub const fn ptr() -> *const sercom0::RegisterBlock {
1052        Self::PTR
1053    }
1054    #[doc = r" Steal an instance of this peripheral"]
1055    #[doc = r""]
1056    #[doc = r" # Safety"]
1057    #[doc = r""]
1058    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1059    #[doc = r" that may race with any existing instances, for example by only"]
1060    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1061    #[doc = r" original peripheral and using critical sections to coordinate"]
1062    #[doc = r" access between multiple new instances."]
1063    #[doc = r""]
1064    #[doc = r" Additionally, other software such as HALs may rely on only one"]
1065    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1066    #[doc = r" no stolen instances are passed to such software."]
1067    pub unsafe fn steal() -> Self {
1068        Self {
1069            _marker: PhantomData,
1070        }
1071    }
1072}
1073impl Deref for Sercom2 {
1074    type Target = sercom0::RegisterBlock;
1075    #[inline(always)]
1076    fn deref(&self) -> &Self::Target {
1077        unsafe { &*Self::PTR }
1078    }
1079}
1080impl core::fmt::Debug for Sercom2 {
1081    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1082        f.debug_struct("Sercom2").finish()
1083    }
1084}
1085#[doc = "Serial Communication Interface 2"]
1086pub use self::sercom0 as sercom2;
1087#[doc = "System Control"]
1088pub struct Sysctrl {
1089    _marker: PhantomData<*const ()>,
1090}
1091unsafe impl Send for Sysctrl {}
1092impl Sysctrl {
1093    #[doc = r"Pointer to the register block"]
1094    pub const PTR: *const sysctrl::RegisterBlock = 0x4000_0800 as *const _;
1095    #[doc = r"Return the pointer to the register block"]
1096    #[inline(always)]
1097    pub const fn ptr() -> *const sysctrl::RegisterBlock {
1098        Self::PTR
1099    }
1100    #[doc = r" Steal an instance of this peripheral"]
1101    #[doc = r""]
1102    #[doc = r" # Safety"]
1103    #[doc = r""]
1104    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1105    #[doc = r" that may race with any existing instances, for example by only"]
1106    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1107    #[doc = r" original peripheral and using critical sections to coordinate"]
1108    #[doc = r" access between multiple new instances."]
1109    #[doc = r""]
1110    #[doc = r" Additionally, other software such as HALs may rely on only one"]
1111    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1112    #[doc = r" no stolen instances are passed to such software."]
1113    pub unsafe fn steal() -> Self {
1114        Self {
1115            _marker: PhantomData,
1116        }
1117    }
1118}
1119impl Deref for Sysctrl {
1120    type Target = sysctrl::RegisterBlock;
1121    #[inline(always)]
1122    fn deref(&self) -> &Self::Target {
1123        unsafe { &*Self::PTR }
1124    }
1125}
1126impl core::fmt::Debug for Sysctrl {
1127    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1128        f.debug_struct("Sysctrl").finish()
1129    }
1130}
1131#[doc = "System Control"]
1132pub mod sysctrl;
1133#[doc = "Basic Timer Counter 1"]
1134pub struct Tc1 {
1135    _marker: PhantomData<*const ()>,
1136}
1137unsafe impl Send for Tc1 {}
1138impl Tc1 {
1139    #[doc = r"Pointer to the register block"]
1140    pub const PTR: *const tc1::RegisterBlock = 0x4200_1800 as *const _;
1141    #[doc = r"Return the pointer to the register block"]
1142    #[inline(always)]
1143    pub const fn ptr() -> *const tc1::RegisterBlock {
1144        Self::PTR
1145    }
1146    #[doc = r" Steal an instance of this peripheral"]
1147    #[doc = r""]
1148    #[doc = r" # Safety"]
1149    #[doc = r""]
1150    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1151    #[doc = r" that may race with any existing instances, for example by only"]
1152    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1153    #[doc = r" original peripheral and using critical sections to coordinate"]
1154    #[doc = r" access between multiple new instances."]
1155    #[doc = r""]
1156    #[doc = r" Additionally, other software such as HALs may rely on only one"]
1157    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1158    #[doc = r" no stolen instances are passed to such software."]
1159    pub unsafe fn steal() -> Self {
1160        Self {
1161            _marker: PhantomData,
1162        }
1163    }
1164}
1165impl Deref for Tc1 {
1166    type Target = tc1::RegisterBlock;
1167    #[inline(always)]
1168    fn deref(&self) -> &Self::Target {
1169        unsafe { &*Self::PTR }
1170    }
1171}
1172impl core::fmt::Debug for Tc1 {
1173    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1174        f.debug_struct("Tc1").finish()
1175    }
1176}
1177#[doc = "Basic Timer Counter 1"]
1178pub mod tc1;
1179#[doc = "Basic Timer Counter 2"]
1180pub struct Tc2 {
1181    _marker: PhantomData<*const ()>,
1182}
1183unsafe impl Send for Tc2 {}
1184impl Tc2 {
1185    #[doc = r"Pointer to the register block"]
1186    pub const PTR: *const tc1::RegisterBlock = 0x4200_1c00 as *const _;
1187    #[doc = r"Return the pointer to the register block"]
1188    #[inline(always)]
1189    pub const fn ptr() -> *const tc1::RegisterBlock {
1190        Self::PTR
1191    }
1192    #[doc = r" Steal an instance of this peripheral"]
1193    #[doc = r""]
1194    #[doc = r" # Safety"]
1195    #[doc = r""]
1196    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1197    #[doc = r" that may race with any existing instances, for example by only"]
1198    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1199    #[doc = r" original peripheral and using critical sections to coordinate"]
1200    #[doc = r" access between multiple new instances."]
1201    #[doc = r""]
1202    #[doc = r" Additionally, other software such as HALs may rely on only one"]
1203    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1204    #[doc = r" no stolen instances are passed to such software."]
1205    pub unsafe fn steal() -> Self {
1206        Self {
1207            _marker: PhantomData,
1208        }
1209    }
1210}
1211impl Deref for Tc2 {
1212    type Target = tc1::RegisterBlock;
1213    #[inline(always)]
1214    fn deref(&self) -> &Self::Target {
1215        unsafe { &*Self::PTR }
1216    }
1217}
1218impl core::fmt::Debug for Tc2 {
1219    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1220        f.debug_struct("Tc2").finish()
1221    }
1222}
1223#[doc = "Basic Timer Counter 2"]
1224pub use self::tc1 as tc2;
1225#[doc = "Timer Counter Control"]
1226pub struct Tcc0 {
1227    _marker: PhantomData<*const ()>,
1228}
1229unsafe impl Send for Tcc0 {}
1230impl Tcc0 {
1231    #[doc = r"Pointer to the register block"]
1232    pub const PTR: *const tcc0::RegisterBlock = 0x4200_1400 as *const _;
1233    #[doc = r"Return the pointer to the register block"]
1234    #[inline(always)]
1235    pub const fn ptr() -> *const tcc0::RegisterBlock {
1236        Self::PTR
1237    }
1238    #[doc = r" Steal an instance of this peripheral"]
1239    #[doc = r""]
1240    #[doc = r" # Safety"]
1241    #[doc = r""]
1242    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1243    #[doc = r" that may race with any existing instances, for example by only"]
1244    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1245    #[doc = r" original peripheral and using critical sections to coordinate"]
1246    #[doc = r" access between multiple new instances."]
1247    #[doc = r""]
1248    #[doc = r" Additionally, other software such as HALs may rely on only one"]
1249    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1250    #[doc = r" no stolen instances are passed to such software."]
1251    pub unsafe fn steal() -> Self {
1252        Self {
1253            _marker: PhantomData,
1254        }
1255    }
1256}
1257impl Deref for Tcc0 {
1258    type Target = tcc0::RegisterBlock;
1259    #[inline(always)]
1260    fn deref(&self) -> &Self::Target {
1261        unsafe { &*Self::PTR }
1262    }
1263}
1264impl core::fmt::Debug for Tcc0 {
1265    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1266        f.debug_struct("Tcc0").finish()
1267    }
1268}
1269#[doc = "Timer Counter Control"]
1270pub mod tcc0;
1271#[doc = "Universal Serial Bus"]
1272pub struct Usb {
1273    _marker: PhantomData<*const ()>,
1274}
1275unsafe impl Send for Usb {}
1276impl Usb {
1277    #[doc = r"Pointer to the register block"]
1278    pub const PTR: *const usb::RegisterBlock = 0x4100_5000 as *const _;
1279    #[doc = r"Return the pointer to the register block"]
1280    #[inline(always)]
1281    pub const fn ptr() -> *const usb::RegisterBlock {
1282        Self::PTR
1283    }
1284    #[doc = r" Steal an instance of this peripheral"]
1285    #[doc = r""]
1286    #[doc = r" # Safety"]
1287    #[doc = r""]
1288    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1289    #[doc = r" that may race with any existing instances, for example by only"]
1290    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1291    #[doc = r" original peripheral and using critical sections to coordinate"]
1292    #[doc = r" access between multiple new instances."]
1293    #[doc = r""]
1294    #[doc = r" Additionally, other software such as HALs may rely on only one"]
1295    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1296    #[doc = r" no stolen instances are passed to such software."]
1297    pub unsafe fn steal() -> Self {
1298        Self {
1299            _marker: PhantomData,
1300        }
1301    }
1302}
1303impl Deref for Usb {
1304    type Target = usb::RegisterBlock;
1305    #[inline(always)]
1306    fn deref(&self) -> &Self::Target {
1307        unsafe { &*Self::PTR }
1308    }
1309}
1310impl core::fmt::Debug for Usb {
1311    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1312        f.debug_struct("Usb").finish()
1313    }
1314}
1315#[doc = "Universal Serial Bus"]
1316pub mod usb;
1317#[doc = "Watchdog Timer"]
1318pub struct Wdt {
1319    _marker: PhantomData<*const ()>,
1320}
1321unsafe impl Send for Wdt {}
1322impl Wdt {
1323    #[doc = r"Pointer to the register block"]
1324    pub const PTR: *const wdt::RegisterBlock = 0x4000_1000 as *const _;
1325    #[doc = r"Return the pointer to the register block"]
1326    #[inline(always)]
1327    pub const fn ptr() -> *const wdt::RegisterBlock {
1328        Self::PTR
1329    }
1330    #[doc = r" Steal an instance of this peripheral"]
1331    #[doc = r""]
1332    #[doc = r" # Safety"]
1333    #[doc = r""]
1334    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1335    #[doc = r" that may race with any existing instances, for example by only"]
1336    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1337    #[doc = r" original peripheral and using critical sections to coordinate"]
1338    #[doc = r" access between multiple new instances."]
1339    #[doc = r""]
1340    #[doc = r" Additionally, other software such as HALs may rely on only one"]
1341    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1342    #[doc = r" no stolen instances are passed to such software."]
1343    pub unsafe fn steal() -> Self {
1344        Self {
1345            _marker: PhantomData,
1346        }
1347    }
1348}
1349impl Deref for Wdt {
1350    type Target = wdt::RegisterBlock;
1351    #[inline(always)]
1352    fn deref(&self) -> &Self::Target {
1353        unsafe { &*Self::PTR }
1354    }
1355}
1356impl core::fmt::Debug for Wdt {
1357    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1358        f.debug_struct("Wdt").finish()
1359    }
1360}
1361#[doc = "Watchdog Timer"]
1362pub mod wdt;
1363#[no_mangle]
1364static mut DEVICE_PERIPHERALS: bool = false;
1365#[doc = r" All the peripherals."]
1366#[allow(non_snake_case)]
1367pub struct Peripherals {
1368    #[doc = "AC"]
1369    pub ac: Ac,
1370    #[doc = "ADC"]
1371    pub adc: Adc,
1372    #[doc = "DAC"]
1373    pub dac: Dac,
1374    #[doc = "DMAC"]
1375    pub dmac: Dmac,
1376    #[doc = "DSU"]
1377    pub dsu: Dsu,
1378    #[doc = "EIC"]
1379    pub eic: Eic,
1380    #[doc = "EVSYS"]
1381    pub evsys: Evsys,
1382    #[doc = "GCLK"]
1383    pub gclk: Gclk,
1384    #[doc = "HMATRIX"]
1385    pub hmatrix: Hmatrix,
1386    #[doc = "MTB"]
1387    pub mtb: Mtb,
1388    #[doc = "NVMCTRL"]
1389    pub nvmctrl: Nvmctrl,
1390    #[doc = "PAC0"]
1391    pub pac0: Pac0,
1392    #[doc = "PAC1"]
1393    pub pac1: Pac1,
1394    #[doc = "PAC2"]
1395    pub pac2: Pac2,
1396    #[doc = "PM"]
1397    pub pm: Pm,
1398    #[doc = "PORT"]
1399    pub port: Port,
1400    #[doc = "PORT_IOBUS"]
1401    pub port_iobus: PortIobus,
1402    #[doc = "RTC"]
1403    pub rtc: Rtc,
1404    #[doc = "SERCOM0"]
1405    pub sercom0: Sercom0,
1406    #[doc = "SERCOM1"]
1407    pub sercom1: Sercom1,
1408    #[doc = "SERCOM2"]
1409    pub sercom2: Sercom2,
1410    #[doc = "SYSCTRL"]
1411    pub sysctrl: Sysctrl,
1412    #[doc = "TC1"]
1413    pub tc1: Tc1,
1414    #[doc = "TC2"]
1415    pub tc2: Tc2,
1416    #[doc = "TCC0"]
1417    pub tcc0: Tcc0,
1418    #[doc = "USB"]
1419    pub usb: Usb,
1420    #[doc = "WDT"]
1421    pub wdt: Wdt,
1422}
1423impl Peripherals {
1424    #[doc = r" Returns all the peripherals *once*."]
1425    #[inline]
1426    pub fn take() -> Option<Self> {
1427        critical_section::with(|_| {
1428            if unsafe { DEVICE_PERIPHERALS } {
1429                return None;
1430            }
1431            Some(unsafe { Peripherals::steal() })
1432        })
1433    }
1434    #[doc = r" Unchecked version of `Peripherals::take`."]
1435    #[doc = r""]
1436    #[doc = r" # Safety"]
1437    #[doc = r""]
1438    #[doc = r" Each of the returned peripherals must be used at most once."]
1439    #[inline]
1440    pub unsafe fn steal() -> Self {
1441        DEVICE_PERIPHERALS = true;
1442        Peripherals {
1443            ac: Ac::steal(),
1444            adc: Adc::steal(),
1445            dac: Dac::steal(),
1446            dmac: Dmac::steal(),
1447            dsu: Dsu::steal(),
1448            eic: Eic::steal(),
1449            evsys: Evsys::steal(),
1450            gclk: Gclk::steal(),
1451            hmatrix: Hmatrix::steal(),
1452            mtb: Mtb::steal(),
1453            nvmctrl: Nvmctrl::steal(),
1454            pac0: Pac0::steal(),
1455            pac1: Pac1::steal(),
1456            pac2: Pac2::steal(),
1457            pm: Pm::steal(),
1458            port: Port::steal(),
1459            port_iobus: PortIobus::steal(),
1460            rtc: Rtc::steal(),
1461            sercom0: Sercom0::steal(),
1462            sercom1: Sercom1::steal(),
1463            sercom2: Sercom2::steal(),
1464            sysctrl: Sysctrl::steal(),
1465            tc1: Tc1::steal(),
1466            tc2: Tc2::steal(),
1467            tcc0: Tcc0::steal(),
1468            usb: Usb::steal(),
1469            wdt: Wdt::steal(),
1470        }
1471    }
1472}