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