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