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