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