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