atsam3u4e/
lib.rs

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