atsamd11c/
lib.rs

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