atsam3u1c/
lib.rs

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