sf32lb52_pac/lib.rs
1//!Peripheral access API for SF32LB52X microcontrollers (generated using svd2rust v0.35.0 ( ))
2//!
3//!You can find an overview of the generated API [here].
4//!
5//!API features to be included in the [next]
6//!svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.
7//!
8//![here]: https://docs.rs/svd2rust/0.35.0/svd2rust/#peripheral-api
9//![next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased
10//![repository]: https://github.com/rust-embedded/svd2rust
11#![allow(non_camel_case_types)]
12#![allow(non_snake_case)]
13#![no_std]
14use core::marker::PhantomData;
15use core::ops::Deref;
16///Number available in the NVIC for configuring priority
17pub const NVIC_PRIO_BITS: u8 = 3;
18#[cfg(feature = "rt")]
19pub use self::Interrupt as interrupt;
20pub use cortex_m::peripheral::Peripherals as CorePeripherals;
21pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, FPU, ITM, MPU, NVIC, SCB, SYST, TPIU};
22#[cfg(feature = "rt")]
23pub use cortex_m_rt::interrupt;
24#[allow(unused_imports)]
25use generic::*;
26///Common register and bit access and modify traits
27pub mod generic;
28#[cfg(feature = "rt")]
29extern "C" {}
30#[doc(hidden)]
31#[repr(C)]
32pub union Vector {
33 _handler: unsafe extern "C" fn(),
34 _reserved: u32,
35}
36#[cfg(feature = "rt")]
37#[doc(hidden)]
38#[link_section = ".vector_table.interrupts"]
39#[no_mangle]
40pub static __INTERRUPTS: [Vector; 0] = [];
41///Enumeration of all the interrupts.
42#[cfg_attr(feature = "defmt", derive(defmt::Format))]
43#[derive(Copy, Clone, Debug, PartialEq, Eq)]
44pub enum Interrupt {}
45unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
46 #[inline(always)]
47 fn number(self) -> u16 {
48 match self {}
49 }
50}
51///HPSYS_RCC
52pub struct HpsysRcc {
53 _marker: PhantomData<*const ()>,
54}
55unsafe impl Send for HpsysRcc {}
56impl HpsysRcc {
57 ///Pointer to the register block
58 pub const PTR: *const hpsys_rcc::RegisterBlock = 0x5000_0000 as *const _;
59 ///Return the pointer to the register block
60 #[inline(always)]
61 pub const fn ptr() -> *const hpsys_rcc::RegisterBlock {
62 Self::PTR
63 }
64 /// Steal an instance of this peripheral
65 ///
66 /// # Safety
67 ///
68 /// Ensure that the new instance of the peripheral cannot be used in a way
69 /// that may race with any existing instances, for example by only
70 /// accessing read-only or write-only registers, or by consuming the
71 /// original peripheral and using critical sections to coordinate
72 /// access between multiple new instances.
73 ///
74 /// Additionally, other software such as HALs may rely on only one
75 /// peripheral instance existing to ensure memory safety; ensure
76 /// no stolen instances are passed to such software.
77 pub unsafe fn steal() -> Self {
78 Self {
79 _marker: PhantomData,
80 }
81 }
82}
83impl Deref for HpsysRcc {
84 type Target = hpsys_rcc::RegisterBlock;
85 #[inline(always)]
86 fn deref(&self) -> &Self::Target {
87 unsafe { &*Self::PTR }
88 }
89}
90impl core::fmt::Debug for HpsysRcc {
91 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
92 f.debug_struct("HpsysRcc").finish()
93 }
94}
95///HPSYS_RCC
96pub mod hpsys_rcc;
97///EXTDMA
98pub struct Extdma {
99 _marker: PhantomData<*const ()>,
100}
101unsafe impl Send for Extdma {}
102impl Extdma {
103 ///Pointer to the register block
104 pub const PTR: *const extdma::RegisterBlock = 0x5000_1000 as *const _;
105 ///Return the pointer to the register block
106 #[inline(always)]
107 pub const fn ptr() -> *const extdma::RegisterBlock {
108 Self::PTR
109 }
110 /// Steal an instance of this peripheral
111 ///
112 /// # Safety
113 ///
114 /// Ensure that the new instance of the peripheral cannot be used in a way
115 /// that may race with any existing instances, for example by only
116 /// accessing read-only or write-only registers, or by consuming the
117 /// original peripheral and using critical sections to coordinate
118 /// access between multiple new instances.
119 ///
120 /// Additionally, other software such as HALs may rely on only one
121 /// peripheral instance existing to ensure memory safety; ensure
122 /// no stolen instances are passed to such software.
123 pub unsafe fn steal() -> Self {
124 Self {
125 _marker: PhantomData,
126 }
127 }
128}
129impl Deref for Extdma {
130 type Target = extdma::RegisterBlock;
131 #[inline(always)]
132 fn deref(&self) -> &Self::Target {
133 unsafe { &*Self::PTR }
134 }
135}
136impl core::fmt::Debug for Extdma {
137 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
138 f.debug_struct("Extdma").finish()
139 }
140}
141///EXTDMA
142pub mod extdma;
143///HPSYS_PINMUX
144pub struct HpsysPinmux {
145 _marker: PhantomData<*const ()>,
146}
147unsafe impl Send for HpsysPinmux {}
148impl HpsysPinmux {
149 ///Pointer to the register block
150 pub const PTR: *const hpsys_pinmux::RegisterBlock = 0x5000_3000 as *const _;
151 ///Return the pointer to the register block
152 #[inline(always)]
153 pub const fn ptr() -> *const hpsys_pinmux::RegisterBlock {
154 Self::PTR
155 }
156 /// Steal an instance of this peripheral
157 ///
158 /// # Safety
159 ///
160 /// Ensure that the new instance of the peripheral cannot be used in a way
161 /// that may race with any existing instances, for example by only
162 /// accessing read-only or write-only registers, or by consuming the
163 /// original peripheral and using critical sections to coordinate
164 /// access between multiple new instances.
165 ///
166 /// Additionally, other software such as HALs may rely on only one
167 /// peripheral instance existing to ensure memory safety; ensure
168 /// no stolen instances are passed to such software.
169 pub unsafe fn steal() -> Self {
170 Self {
171 _marker: PhantomData,
172 }
173 }
174}
175impl Deref for HpsysPinmux {
176 type Target = hpsys_pinmux::RegisterBlock;
177 #[inline(always)]
178 fn deref(&self) -> &Self::Target {
179 unsafe { &*Self::PTR }
180 }
181}
182impl core::fmt::Debug for HpsysPinmux {
183 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
184 f.debug_struct("HpsysPinmux").finish()
185 }
186}
187///HPSYS_PINMUX
188pub mod hpsys_pinmux;
189///Advanced Timer
190pub struct Atim1 {
191 _marker: PhantomData<*const ()>,
192}
193unsafe impl Send for Atim1 {}
194impl Atim1 {
195 ///Pointer to the register block
196 pub const PTR: *const atim1::RegisterBlock = 0x5000_4000 as *const _;
197 ///Return the pointer to the register block
198 #[inline(always)]
199 pub const fn ptr() -> *const atim1::RegisterBlock {
200 Self::PTR
201 }
202 /// Steal an instance of this peripheral
203 ///
204 /// # Safety
205 ///
206 /// Ensure that the new instance of the peripheral cannot be used in a way
207 /// that may race with any existing instances, for example by only
208 /// accessing read-only or write-only registers, or by consuming the
209 /// original peripheral and using critical sections to coordinate
210 /// access between multiple new instances.
211 ///
212 /// Additionally, other software such as HALs may rely on only one
213 /// peripheral instance existing to ensure memory safety; ensure
214 /// no stolen instances are passed to such software.
215 pub unsafe fn steal() -> Self {
216 Self {
217 _marker: PhantomData,
218 }
219 }
220}
221impl Deref for Atim1 {
222 type Target = atim1::RegisterBlock;
223 #[inline(always)]
224 fn deref(&self) -> &Self::Target {
225 unsafe { &*Self::PTR }
226 }
227}
228impl core::fmt::Debug for Atim1 {
229 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
230 f.debug_struct("Atim1").finish()
231 }
232}
233///Advanced Timer
234pub mod atim1;
235///Audio Process Controller
236pub struct Audprc {
237 _marker: PhantomData<*const ()>,
238}
239unsafe impl Send for Audprc {}
240impl Audprc {
241 ///Pointer to the register block
242 pub const PTR: *const audprc::RegisterBlock = 0x5000_5000 as *const _;
243 ///Return the pointer to the register block
244 #[inline(always)]
245 pub const fn ptr() -> *const audprc::RegisterBlock {
246 Self::PTR
247 }
248 /// Steal an instance of this peripheral
249 ///
250 /// # Safety
251 ///
252 /// Ensure that the new instance of the peripheral cannot be used in a way
253 /// that may race with any existing instances, for example by only
254 /// accessing read-only or write-only registers, or by consuming the
255 /// original peripheral and using critical sections to coordinate
256 /// access between multiple new instances.
257 ///
258 /// Additionally, other software such as HALs may rely on only one
259 /// peripheral instance existing to ensure memory safety; ensure
260 /// no stolen instances are passed to such software.
261 pub unsafe fn steal() -> Self {
262 Self {
263 _marker: PhantomData,
264 }
265 }
266}
267impl Deref for Audprc {
268 type Target = audprc::RegisterBlock;
269 #[inline(always)]
270 fn deref(&self) -> &Self::Target {
271 unsafe { &*Self::PTR }
272 }
273}
274impl core::fmt::Debug for Audprc {
275 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
276 f.debug_struct("Audprc").finish()
277 }
278}
279///Audio Process Controller
280pub mod audprc;
281///EZIP1
282pub struct Ezip1 {
283 _marker: PhantomData<*const ()>,
284}
285unsafe impl Send for Ezip1 {}
286impl Ezip1 {
287 ///Pointer to the register block
288 pub const PTR: *const ezip1::RegisterBlock = 0x5000_6000 as *const _;
289 ///Return the pointer to the register block
290 #[inline(always)]
291 pub const fn ptr() -> *const ezip1::RegisterBlock {
292 Self::PTR
293 }
294 /// Steal an instance of this peripheral
295 ///
296 /// # Safety
297 ///
298 /// Ensure that the new instance of the peripheral cannot be used in a way
299 /// that may race with any existing instances, for example by only
300 /// accessing read-only or write-only registers, or by consuming the
301 /// original peripheral and using critical sections to coordinate
302 /// access between multiple new instances.
303 ///
304 /// Additionally, other software such as HALs may rely on only one
305 /// peripheral instance existing to ensure memory safety; ensure
306 /// no stolen instances are passed to such software.
307 pub unsafe fn steal() -> Self {
308 Self {
309 _marker: PhantomData,
310 }
311 }
312}
313impl Deref for Ezip1 {
314 type Target = ezip1::RegisterBlock;
315 #[inline(always)]
316 fn deref(&self) -> &Self::Target {
317 unsafe { &*Self::PTR }
318 }
319}
320impl core::fmt::Debug for Ezip1 {
321 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
322 f.debug_struct("Ezip1").finish()
323 }
324}
325///EZIP1
326pub mod ezip1;
327///EPIC
328pub struct Epic {
329 _marker: PhantomData<*const ()>,
330}
331unsafe impl Send for Epic {}
332impl Epic {
333 ///Pointer to the register block
334 pub const PTR: *const epic::RegisterBlock = 0x5000_7000 as *const _;
335 ///Return the pointer to the register block
336 #[inline(always)]
337 pub const fn ptr() -> *const epic::RegisterBlock {
338 Self::PTR
339 }
340 /// Steal an instance of this peripheral
341 ///
342 /// # Safety
343 ///
344 /// Ensure that the new instance of the peripheral cannot be used in a way
345 /// that may race with any existing instances, for example by only
346 /// accessing read-only or write-only registers, or by consuming the
347 /// original peripheral and using critical sections to coordinate
348 /// access between multiple new instances.
349 ///
350 /// Additionally, other software such as HALs may rely on only one
351 /// peripheral instance existing to ensure memory safety; ensure
352 /// no stolen instances are passed to such software.
353 pub unsafe fn steal() -> Self {
354 Self {
355 _marker: PhantomData,
356 }
357 }
358}
359impl Deref for Epic {
360 type Target = epic::RegisterBlock;
361 #[inline(always)]
362 fn deref(&self) -> &Self::Target {
363 unsafe { &*Self::PTR }
364 }
365}
366impl core::fmt::Debug for Epic {
367 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
368 f.debug_struct("Epic").finish()
369 }
370}
371///EPIC
372pub mod epic;
373///LCD Controller
374pub struct Lcdc1 {
375 _marker: PhantomData<*const ()>,
376}
377unsafe impl Send for Lcdc1 {}
378impl Lcdc1 {
379 ///Pointer to the register block
380 pub const PTR: *const lcdc1::RegisterBlock = 0x5000_8000 as *const _;
381 ///Return the pointer to the register block
382 #[inline(always)]
383 pub const fn ptr() -> *const lcdc1::RegisterBlock {
384 Self::PTR
385 }
386 /// Steal an instance of this peripheral
387 ///
388 /// # Safety
389 ///
390 /// Ensure that the new instance of the peripheral cannot be used in a way
391 /// that may race with any existing instances, for example by only
392 /// accessing read-only or write-only registers, or by consuming the
393 /// original peripheral and using critical sections to coordinate
394 /// access between multiple new instances.
395 ///
396 /// Additionally, other software such as HALs may rely on only one
397 /// peripheral instance existing to ensure memory safety; ensure
398 /// no stolen instances are passed to such software.
399 pub unsafe fn steal() -> Self {
400 Self {
401 _marker: PhantomData,
402 }
403 }
404}
405impl Deref for Lcdc1 {
406 type Target = lcdc1::RegisterBlock;
407 #[inline(always)]
408 fn deref(&self) -> &Self::Target {
409 unsafe { &*Self::PTR }
410 }
411}
412impl core::fmt::Debug for Lcdc1 {
413 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
414 f.debug_struct("Lcdc1").finish()
415 }
416}
417///LCD Controller
418pub mod lcdc1;
419///Inter IC Sound
420pub struct I2s1 {
421 _marker: PhantomData<*const ()>,
422}
423unsafe impl Send for I2s1 {}
424impl I2s1 {
425 ///Pointer to the register block
426 pub const PTR: *const i2s1::RegisterBlock = 0x5000_9000 as *const _;
427 ///Return the pointer to the register block
428 #[inline(always)]
429 pub const fn ptr() -> *const i2s1::RegisterBlock {
430 Self::PTR
431 }
432 /// Steal an instance of this peripheral
433 ///
434 /// # Safety
435 ///
436 /// Ensure that the new instance of the peripheral cannot be used in a way
437 /// that may race with any existing instances, for example by only
438 /// accessing read-only or write-only registers, or by consuming the
439 /// original peripheral and using critical sections to coordinate
440 /// access between multiple new instances.
441 ///
442 /// Additionally, other software such as HALs may rely on only one
443 /// peripheral instance existing to ensure memory safety; ensure
444 /// no stolen instances are passed to such software.
445 pub unsafe fn steal() -> Self {
446 Self {
447 _marker: PhantomData,
448 }
449 }
450}
451impl Deref for I2s1 {
452 type Target = i2s1::RegisterBlock;
453 #[inline(always)]
454 fn deref(&self) -> &Self::Target {
455 unsafe { &*Self::PTR }
456 }
457}
458impl core::fmt::Debug for I2s1 {
459 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
460 f.debug_struct("I2s1").finish()
461 }
462}
463///Inter IC Sound
464pub mod i2s1;
465///HPSYS_CFG
466pub struct HpsysCfg {
467 _marker: PhantomData<*const ()>,
468}
469unsafe impl Send for HpsysCfg {}
470impl HpsysCfg {
471 ///Pointer to the register block
472 pub const PTR: *const hpsys_cfg::RegisterBlock = 0x5000_b000 as *const _;
473 ///Return the pointer to the register block
474 #[inline(always)]
475 pub const fn ptr() -> *const hpsys_cfg::RegisterBlock {
476 Self::PTR
477 }
478 /// Steal an instance of this peripheral
479 ///
480 /// # Safety
481 ///
482 /// Ensure that the new instance of the peripheral cannot be used in a way
483 /// that may race with any existing instances, for example by only
484 /// accessing read-only or write-only registers, or by consuming the
485 /// original peripheral and using critical sections to coordinate
486 /// access between multiple new instances.
487 ///
488 /// Additionally, other software such as HALs may rely on only one
489 /// peripheral instance existing to ensure memory safety; ensure
490 /// no stolen instances are passed to such software.
491 pub unsafe fn steal() -> Self {
492 Self {
493 _marker: PhantomData,
494 }
495 }
496}
497impl Deref for HpsysCfg {
498 type Target = hpsys_cfg::RegisterBlock;
499 #[inline(always)]
500 fn deref(&self) -> &Self::Target {
501 unsafe { &*Self::PTR }
502 }
503}
504impl core::fmt::Debug for HpsysCfg {
505 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
506 f.debug_struct("HpsysCfg").finish()
507 }
508}
509///HPSYS_CFG
510pub mod hpsys_cfg;
511///efuse control
512pub struct Efusec {
513 _marker: PhantomData<*const ()>,
514}
515unsafe impl Send for Efusec {}
516impl Efusec {
517 ///Pointer to the register block
518 pub const PTR: *const efusec::RegisterBlock = 0x5000_c000 as *const _;
519 ///Return the pointer to the register block
520 #[inline(always)]
521 pub const fn ptr() -> *const efusec::RegisterBlock {
522 Self::PTR
523 }
524 /// Steal an instance of this peripheral
525 ///
526 /// # Safety
527 ///
528 /// Ensure that the new instance of the peripheral cannot be used in a way
529 /// that may race with any existing instances, for example by only
530 /// accessing read-only or write-only registers, or by consuming the
531 /// original peripheral and using critical sections to coordinate
532 /// access between multiple new instances.
533 ///
534 /// Additionally, other software such as HALs may rely on only one
535 /// peripheral instance existing to ensure memory safety; ensure
536 /// no stolen instances are passed to such software.
537 pub unsafe fn steal() -> Self {
538 Self {
539 _marker: PhantomData,
540 }
541 }
542}
543impl Deref for Efusec {
544 type Target = efusec::RegisterBlock;
545 #[inline(always)]
546 fn deref(&self) -> &Self::Target {
547 unsafe { &*Self::PTR }
548 }
549}
550impl core::fmt::Debug for Efusec {
551 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
552 f.debug_struct("Efusec").finish()
553 }
554}
555///efuse control
556pub mod efusec;
557///AES
558pub struct Aes {
559 _marker: PhantomData<*const ()>,
560}
561unsafe impl Send for Aes {}
562impl Aes {
563 ///Pointer to the register block
564 pub const PTR: *const aes::RegisterBlock = 0x5000_d000 as *const _;
565 ///Return the pointer to the register block
566 #[inline(always)]
567 pub const fn ptr() -> *const aes::RegisterBlock {
568 Self::PTR
569 }
570 /// Steal an instance of this peripheral
571 ///
572 /// # Safety
573 ///
574 /// Ensure that the new instance of the peripheral cannot be used in a way
575 /// that may race with any existing instances, for example by only
576 /// accessing read-only or write-only registers, or by consuming the
577 /// original peripheral and using critical sections to coordinate
578 /// access between multiple new instances.
579 ///
580 /// Additionally, other software such as HALs may rely on only one
581 /// peripheral instance existing to ensure memory safety; ensure
582 /// no stolen instances are passed to such software.
583 pub unsafe fn steal() -> Self {
584 Self {
585 _marker: PhantomData,
586 }
587 }
588}
589impl Deref for Aes {
590 type Target = aes::RegisterBlock;
591 #[inline(always)]
592 fn deref(&self) -> &Self::Target {
593 unsafe { &*Self::PTR }
594 }
595}
596impl core::fmt::Debug for Aes {
597 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
598 f.debug_struct("Aes").finish()
599 }
600}
601///AES
602pub mod aes;
603///True Random Number Generator
604pub struct Trng {
605 _marker: PhantomData<*const ()>,
606}
607unsafe impl Send for Trng {}
608impl Trng {
609 ///Pointer to the register block
610 pub const PTR: *const trng::RegisterBlock = 0x5000_f000 as *const _;
611 ///Return the pointer to the register block
612 #[inline(always)]
613 pub const fn ptr() -> *const trng::RegisterBlock {
614 Self::PTR
615 }
616 /// Steal an instance of this peripheral
617 ///
618 /// # Safety
619 ///
620 /// Ensure that the new instance of the peripheral cannot be used in a way
621 /// that may race with any existing instances, for example by only
622 /// accessing read-only or write-only registers, or by consuming the
623 /// original peripheral and using critical sections to coordinate
624 /// access between multiple new instances.
625 ///
626 /// Additionally, other software such as HALs may rely on only one
627 /// peripheral instance existing to ensure memory safety; ensure
628 /// no stolen instances are passed to such software.
629 pub unsafe fn steal() -> Self {
630 Self {
631 _marker: PhantomData,
632 }
633 }
634}
635impl Deref for Trng {
636 type Target = trng::RegisterBlock;
637 #[inline(always)]
638 fn deref(&self) -> &Self::Target {
639 unsafe { &*Self::PTR }
640 }
641}
642impl core::fmt::Debug for Trng {
643 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
644 f.debug_struct("Trng").finish()
645 }
646}
647///True Random Number Generator
648pub mod trng;
649///Memory Peripheral Interface
650pub struct Mpi1 {
651 _marker: PhantomData<*const ()>,
652}
653unsafe impl Send for Mpi1 {}
654impl Mpi1 {
655 ///Pointer to the register block
656 pub const PTR: *const mpi1::RegisterBlock = 0x5004_1000 as *const _;
657 ///Return the pointer to the register block
658 #[inline(always)]
659 pub const fn ptr() -> *const mpi1::RegisterBlock {
660 Self::PTR
661 }
662 /// Steal an instance of this peripheral
663 ///
664 /// # Safety
665 ///
666 /// Ensure that the new instance of the peripheral cannot be used in a way
667 /// that may race with any existing instances, for example by only
668 /// accessing read-only or write-only registers, or by consuming the
669 /// original peripheral and using critical sections to coordinate
670 /// access between multiple new instances.
671 ///
672 /// Additionally, other software such as HALs may rely on only one
673 /// peripheral instance existing to ensure memory safety; ensure
674 /// no stolen instances are passed to such software.
675 pub unsafe fn steal() -> Self {
676 Self {
677 _marker: PhantomData,
678 }
679 }
680}
681impl Deref for Mpi1 {
682 type Target = mpi1::RegisterBlock;
683 #[inline(always)]
684 fn deref(&self) -> &Self::Target {
685 unsafe { &*Self::PTR }
686 }
687}
688impl core::fmt::Debug for Mpi1 {
689 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
690 f.debug_struct("Mpi1").finish()
691 }
692}
693///Memory Peripheral Interface
694pub mod mpi1;
695///Memory Peripheral Interface
696pub struct Mpi2 {
697 _marker: PhantomData<*const ()>,
698}
699unsafe impl Send for Mpi2 {}
700impl Mpi2 {
701 ///Pointer to the register block
702 pub const PTR: *const mpi1::RegisterBlock = 0x5004_2000 as *const _;
703 ///Return the pointer to the register block
704 #[inline(always)]
705 pub const fn ptr() -> *const mpi1::RegisterBlock {
706 Self::PTR
707 }
708 /// Steal an instance of this peripheral
709 ///
710 /// # Safety
711 ///
712 /// Ensure that the new instance of the peripheral cannot be used in a way
713 /// that may race with any existing instances, for example by only
714 /// accessing read-only or write-only registers, or by consuming the
715 /// original peripheral and using critical sections to coordinate
716 /// access between multiple new instances.
717 ///
718 /// Additionally, other software such as HALs may rely on only one
719 /// peripheral instance existing to ensure memory safety; ensure
720 /// no stolen instances are passed to such software.
721 pub unsafe fn steal() -> Self {
722 Self {
723 _marker: PhantomData,
724 }
725 }
726}
727impl Deref for Mpi2 {
728 type Target = mpi1::RegisterBlock;
729 #[inline(always)]
730 fn deref(&self) -> &Self::Target {
731 unsafe { &*Self::PTR }
732 }
733}
734impl core::fmt::Debug for Mpi2 {
735 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
736 f.debug_struct("Mpi2").finish()
737 }
738}
739///Memory Peripheral Interface
740pub use self::mpi1 as mpi2;
741///SDMMC1
742pub struct Sdmmc1 {
743 _marker: PhantomData<*const ()>,
744}
745unsafe impl Send for Sdmmc1 {}
746impl Sdmmc1 {
747 ///Pointer to the register block
748 pub const PTR: *const sdmmc1::RegisterBlock = 0x5004_5000 as *const _;
749 ///Return the pointer to the register block
750 #[inline(always)]
751 pub const fn ptr() -> *const sdmmc1::RegisterBlock {
752 Self::PTR
753 }
754 /// Steal an instance of this peripheral
755 ///
756 /// # Safety
757 ///
758 /// Ensure that the new instance of the peripheral cannot be used in a way
759 /// that may race with any existing instances, for example by only
760 /// accessing read-only or write-only registers, or by consuming the
761 /// original peripheral and using critical sections to coordinate
762 /// access between multiple new instances.
763 ///
764 /// Additionally, other software such as HALs may rely on only one
765 /// peripheral instance existing to ensure memory safety; ensure
766 /// no stolen instances are passed to such software.
767 pub unsafe fn steal() -> Self {
768 Self {
769 _marker: PhantomData,
770 }
771 }
772}
773impl Deref for Sdmmc1 {
774 type Target = sdmmc1::RegisterBlock;
775 #[inline(always)]
776 fn deref(&self) -> &Self::Target {
777 unsafe { &*Self::PTR }
778 }
779}
780impl core::fmt::Debug for Sdmmc1 {
781 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
782 f.debug_struct("Sdmmc1").finish()
783 }
784}
785///SDMMC1
786pub mod sdmmc1;
787///Cyclic Redundancy Check
788pub struct Crc1 {
789 _marker: PhantomData<*const ()>,
790}
791unsafe impl Send for Crc1 {}
792impl Crc1 {
793 ///Pointer to the register block
794 pub const PTR: *const crc1::RegisterBlock = 0x5004_8000 as *const _;
795 ///Return the pointer to the register block
796 #[inline(always)]
797 pub const fn ptr() -> *const crc1::RegisterBlock {
798 Self::PTR
799 }
800 /// Steal an instance of this peripheral
801 ///
802 /// # Safety
803 ///
804 /// Ensure that the new instance of the peripheral cannot be used in a way
805 /// that may race with any existing instances, for example by only
806 /// accessing read-only or write-only registers, or by consuming the
807 /// original peripheral and using critical sections to coordinate
808 /// access between multiple new instances.
809 ///
810 /// Additionally, other software such as HALs may rely on only one
811 /// peripheral instance existing to ensure memory safety; ensure
812 /// no stolen instances are passed to such software.
813 pub unsafe fn steal() -> Self {
814 Self {
815 _marker: PhantomData,
816 }
817 }
818}
819impl Deref for Crc1 {
820 type Target = crc1::RegisterBlock;
821 #[inline(always)]
822 fn deref(&self) -> &Self::Target {
823 unsafe { &*Self::PTR }
824 }
825}
826impl core::fmt::Debug for Crc1 {
827 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
828 f.debug_struct("Crc1").finish()
829 }
830}
831///Cyclic Redundancy Check
832pub mod crc1;
833///PTC1
834pub struct Ptc1 {
835 _marker: PhantomData<*const ()>,
836}
837unsafe impl Send for Ptc1 {}
838impl Ptc1 {
839 ///Pointer to the register block
840 pub const PTR: *const ptc1::RegisterBlock = 0x5008_0000 as *const _;
841 ///Return the pointer to the register block
842 #[inline(always)]
843 pub const fn ptr() -> *const ptc1::RegisterBlock {
844 Self::PTR
845 }
846 /// Steal an instance of this peripheral
847 ///
848 /// # Safety
849 ///
850 /// Ensure that the new instance of the peripheral cannot be used in a way
851 /// that may race with any existing instances, for example by only
852 /// accessing read-only or write-only registers, or by consuming the
853 /// original peripheral and using critical sections to coordinate
854 /// access between multiple new instances.
855 ///
856 /// Additionally, other software such as HALs may rely on only one
857 /// peripheral instance existing to ensure memory safety; ensure
858 /// no stolen instances are passed to such software.
859 pub unsafe fn steal() -> Self {
860 Self {
861 _marker: PhantomData,
862 }
863 }
864}
865impl Deref for Ptc1 {
866 type Target = ptc1::RegisterBlock;
867 #[inline(always)]
868 fn deref(&self) -> &Self::Target {
869 unsafe { &*Self::PTR }
870 }
871}
872impl core::fmt::Debug for Ptc1 {
873 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
874 f.debug_struct("Ptc1").finish()
875 }
876}
877///PTC1
878pub mod ptc1;
879///DMAC1
880pub struct Dmac1 {
881 _marker: PhantomData<*const ()>,
882}
883unsafe impl Send for Dmac1 {}
884impl Dmac1 {
885 ///Pointer to the register block
886 pub const PTR: *const dmac1::RegisterBlock = 0x5008_1000 as *const _;
887 ///Return the pointer to the register block
888 #[inline(always)]
889 pub const fn ptr() -> *const dmac1::RegisterBlock {
890 Self::PTR
891 }
892 /// Steal an instance of this peripheral
893 ///
894 /// # Safety
895 ///
896 /// Ensure that the new instance of the peripheral cannot be used in a way
897 /// that may race with any existing instances, for example by only
898 /// accessing read-only or write-only registers, or by consuming the
899 /// original peripheral and using critical sections to coordinate
900 /// access between multiple new instances.
901 ///
902 /// Additionally, other software such as HALs may rely on only one
903 /// peripheral instance existing to ensure memory safety; ensure
904 /// no stolen instances are passed to such software.
905 pub unsafe fn steal() -> Self {
906 Self {
907 _marker: PhantomData,
908 }
909 }
910}
911impl Deref for Dmac1 {
912 type Target = dmac1::RegisterBlock;
913 #[inline(always)]
914 fn deref(&self) -> &Self::Target {
915 unsafe { &*Self::PTR }
916 }
917}
918impl core::fmt::Debug for Dmac1 {
919 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
920 f.debug_struct("Dmac1").finish()
921 }
922}
923///DMAC1
924pub mod dmac1;
925///USART
926pub struct Usart1 {
927 _marker: PhantomData<*const ()>,
928}
929unsafe impl Send for Usart1 {}
930impl Usart1 {
931 ///Pointer to the register block
932 pub const PTR: *const usart1::RegisterBlock = 0x5008_4000 as *const _;
933 ///Return the pointer to the register block
934 #[inline(always)]
935 pub const fn ptr() -> *const usart1::RegisterBlock {
936 Self::PTR
937 }
938 /// Steal an instance of this peripheral
939 ///
940 /// # Safety
941 ///
942 /// Ensure that the new instance of the peripheral cannot be used in a way
943 /// that may race with any existing instances, for example by only
944 /// accessing read-only or write-only registers, or by consuming the
945 /// original peripheral and using critical sections to coordinate
946 /// access between multiple new instances.
947 ///
948 /// Additionally, other software such as HALs may rely on only one
949 /// peripheral instance existing to ensure memory safety; ensure
950 /// no stolen instances are passed to such software.
951 pub unsafe fn steal() -> Self {
952 Self {
953 _marker: PhantomData,
954 }
955 }
956}
957impl Deref for Usart1 {
958 type Target = usart1::RegisterBlock;
959 #[inline(always)]
960 fn deref(&self) -> &Self::Target {
961 unsafe { &*Self::PTR }
962 }
963}
964impl core::fmt::Debug for Usart1 {
965 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
966 f.debug_struct("Usart1").finish()
967 }
968}
969///USART
970pub mod usart1;
971///USART
972pub struct Usart2 {
973 _marker: PhantomData<*const ()>,
974}
975unsafe impl Send for Usart2 {}
976impl Usart2 {
977 ///Pointer to the register block
978 pub const PTR: *const usart1::RegisterBlock = 0x5008_5000 as *const _;
979 ///Return the pointer to the register block
980 #[inline(always)]
981 pub const fn ptr() -> *const usart1::RegisterBlock {
982 Self::PTR
983 }
984 /// Steal an instance of this peripheral
985 ///
986 /// # Safety
987 ///
988 /// Ensure that the new instance of the peripheral cannot be used in a way
989 /// that may race with any existing instances, for example by only
990 /// accessing read-only or write-only registers, or by consuming the
991 /// original peripheral and using critical sections to coordinate
992 /// access between multiple new instances.
993 ///
994 /// Additionally, other software such as HALs may rely on only one
995 /// peripheral instance existing to ensure memory safety; ensure
996 /// no stolen instances are passed to such software.
997 pub unsafe fn steal() -> Self {
998 Self {
999 _marker: PhantomData,
1000 }
1001 }
1002}
1003impl Deref for Usart2 {
1004 type Target = usart1::RegisterBlock;
1005 #[inline(always)]
1006 fn deref(&self) -> &Self::Target {
1007 unsafe { &*Self::PTR }
1008 }
1009}
1010impl core::fmt::Debug for Usart2 {
1011 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1012 f.debug_struct("Usart2").finish()
1013 }
1014}
1015///USART
1016pub use self::usart1 as usart2;
1017///USART
1018pub struct Usart3 {
1019 _marker: PhantomData<*const ()>,
1020}
1021unsafe impl Send for Usart3 {}
1022impl Usart3 {
1023 ///Pointer to the register block
1024 pub const PTR: *const usart1::RegisterBlock = 0x5008_6000 as *const _;
1025 ///Return the pointer to the register block
1026 #[inline(always)]
1027 pub const fn ptr() -> *const usart1::RegisterBlock {
1028 Self::PTR
1029 }
1030 /// Steal an instance of this peripheral
1031 ///
1032 /// # Safety
1033 ///
1034 /// Ensure that the new instance of the peripheral cannot be used in a way
1035 /// that may race with any existing instances, for example by only
1036 /// accessing read-only or write-only registers, or by consuming the
1037 /// original peripheral and using critical sections to coordinate
1038 /// access between multiple new instances.
1039 ///
1040 /// Additionally, other software such as HALs may rely on only one
1041 /// peripheral instance existing to ensure memory safety; ensure
1042 /// no stolen instances are passed to such software.
1043 pub unsafe fn steal() -> Self {
1044 Self {
1045 _marker: PhantomData,
1046 }
1047 }
1048}
1049impl Deref for Usart3 {
1050 type Target = usart1::RegisterBlock;
1051 #[inline(always)]
1052 fn deref(&self) -> &Self::Target {
1053 unsafe { &*Self::PTR }
1054 }
1055}
1056impl core::fmt::Debug for Usart3 {
1057 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1058 f.debug_struct("Usart3").finish()
1059 }
1060}
1061///USART
1062pub use self::usart1 as usart3;
1063///GPADC
1064pub struct Gpadc {
1065 _marker: PhantomData<*const ()>,
1066}
1067unsafe impl Send for Gpadc {}
1068impl Gpadc {
1069 ///Pointer to the register block
1070 pub const PTR: *const gpadc::RegisterBlock = 0x5008_7000 as *const _;
1071 ///Return the pointer to the register block
1072 #[inline(always)]
1073 pub const fn ptr() -> *const gpadc::RegisterBlock {
1074 Self::PTR
1075 }
1076 /// Steal an instance of this peripheral
1077 ///
1078 /// # Safety
1079 ///
1080 /// Ensure that the new instance of the peripheral cannot be used in a way
1081 /// that may race with any existing instances, for example by only
1082 /// accessing read-only or write-only registers, or by consuming the
1083 /// original peripheral and using critical sections to coordinate
1084 /// access between multiple new instances.
1085 ///
1086 /// Additionally, other software such as HALs may rely on only one
1087 /// peripheral instance existing to ensure memory safety; ensure
1088 /// no stolen instances are passed to such software.
1089 pub unsafe fn steal() -> Self {
1090 Self {
1091 _marker: PhantomData,
1092 }
1093 }
1094}
1095impl Deref for Gpadc {
1096 type Target = gpadc::RegisterBlock;
1097 #[inline(always)]
1098 fn deref(&self) -> &Self::Target {
1099 unsafe { &*Self::PTR }
1100 }
1101}
1102impl core::fmt::Debug for Gpadc {
1103 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1104 f.debug_struct("Gpadc").finish()
1105 }
1106}
1107///GPADC
1108pub mod gpadc;
1109///AUDCODEC
1110pub struct Audcodec {
1111 _marker: PhantomData<*const ()>,
1112}
1113unsafe impl Send for Audcodec {}
1114impl Audcodec {
1115 ///Pointer to the register block
1116 pub const PTR: *const audcodec::RegisterBlock = 0x5008_8000 as *const _;
1117 ///Return the pointer to the register block
1118 #[inline(always)]
1119 pub const fn ptr() -> *const audcodec::RegisterBlock {
1120 Self::PTR
1121 }
1122 /// Steal an instance of this peripheral
1123 ///
1124 /// # Safety
1125 ///
1126 /// Ensure that the new instance of the peripheral cannot be used in a way
1127 /// that may race with any existing instances, for example by only
1128 /// accessing read-only or write-only registers, or by consuming the
1129 /// original peripheral and using critical sections to coordinate
1130 /// access between multiple new instances.
1131 ///
1132 /// Additionally, other software such as HALs may rely on only one
1133 /// peripheral instance existing to ensure memory safety; ensure
1134 /// no stolen instances are passed to such software.
1135 pub unsafe fn steal() -> Self {
1136 Self {
1137 _marker: PhantomData,
1138 }
1139 }
1140}
1141impl Deref for Audcodec {
1142 type Target = audcodec::RegisterBlock;
1143 #[inline(always)]
1144 fn deref(&self) -> &Self::Target {
1145 unsafe { &*Self::PTR }
1146 }
1147}
1148impl core::fmt::Debug for Audcodec {
1149 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1150 f.debug_struct("Audcodec").finish()
1151 }
1152}
1153///AUDCODEC
1154pub mod audcodec;
1155///TSEN
1156pub struct Tsen {
1157 _marker: PhantomData<*const ()>,
1158}
1159unsafe impl Send for Tsen {}
1160impl Tsen {
1161 ///Pointer to the register block
1162 pub const PTR: *const tsen::RegisterBlock = 0x5008_9000 as *const _;
1163 ///Return the pointer to the register block
1164 #[inline(always)]
1165 pub const fn ptr() -> *const tsen::RegisterBlock {
1166 Self::PTR
1167 }
1168 /// Steal an instance of this peripheral
1169 ///
1170 /// # Safety
1171 ///
1172 /// Ensure that the new instance of the peripheral cannot be used in a way
1173 /// that may race with any existing instances, for example by only
1174 /// accessing read-only or write-only registers, or by consuming the
1175 /// original peripheral and using critical sections to coordinate
1176 /// access between multiple new instances.
1177 ///
1178 /// Additionally, other software such as HALs may rely on only one
1179 /// peripheral instance existing to ensure memory safety; ensure
1180 /// no stolen instances are passed to such software.
1181 pub unsafe fn steal() -> Self {
1182 Self {
1183 _marker: PhantomData,
1184 }
1185 }
1186}
1187impl Deref for Tsen {
1188 type Target = tsen::RegisterBlock;
1189 #[inline(always)]
1190 fn deref(&self) -> &Self::Target {
1191 unsafe { &*Self::PTR }
1192 }
1193}
1194impl core::fmt::Debug for Tsen {
1195 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1196 f.debug_struct("Tsen").finish()
1197 }
1198}
1199///TSEN
1200pub mod tsen;
1201///General Purpose Timer
1202pub struct Gptim1 {
1203 _marker: PhantomData<*const ()>,
1204}
1205unsafe impl Send for Gptim1 {}
1206impl Gptim1 {
1207 ///Pointer to the register block
1208 pub const PTR: *const gptim1::RegisterBlock = 0x5009_0000 as *const _;
1209 ///Return the pointer to the register block
1210 #[inline(always)]
1211 pub const fn ptr() -> *const gptim1::RegisterBlock {
1212 Self::PTR
1213 }
1214 /// Steal an instance of this peripheral
1215 ///
1216 /// # Safety
1217 ///
1218 /// Ensure that the new instance of the peripheral cannot be used in a way
1219 /// that may race with any existing instances, for example by only
1220 /// accessing read-only or write-only registers, or by consuming the
1221 /// original peripheral and using critical sections to coordinate
1222 /// access between multiple new instances.
1223 ///
1224 /// Additionally, other software such as HALs may rely on only one
1225 /// peripheral instance existing to ensure memory safety; ensure
1226 /// no stolen instances are passed to such software.
1227 pub unsafe fn steal() -> Self {
1228 Self {
1229 _marker: PhantomData,
1230 }
1231 }
1232}
1233impl Deref for Gptim1 {
1234 type Target = gptim1::RegisterBlock;
1235 #[inline(always)]
1236 fn deref(&self) -> &Self::Target {
1237 unsafe { &*Self::PTR }
1238 }
1239}
1240impl core::fmt::Debug for Gptim1 {
1241 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1242 f.debug_struct("Gptim1").finish()
1243 }
1244}
1245///General Purpose Timer
1246pub mod gptim1;
1247///Basic Timer
1248pub struct Btim1 {
1249 _marker: PhantomData<*const ()>,
1250}
1251unsafe impl Send for Btim1 {}
1252impl Btim1 {
1253 ///Pointer to the register block
1254 pub const PTR: *const btim1::RegisterBlock = 0x5009_2000 as *const _;
1255 ///Return the pointer to the register block
1256 #[inline(always)]
1257 pub const fn ptr() -> *const btim1::RegisterBlock {
1258 Self::PTR
1259 }
1260 /// Steal an instance of this peripheral
1261 ///
1262 /// # Safety
1263 ///
1264 /// Ensure that the new instance of the peripheral cannot be used in a way
1265 /// that may race with any existing instances, for example by only
1266 /// accessing read-only or write-only registers, or by consuming the
1267 /// original peripheral and using critical sections to coordinate
1268 /// access between multiple new instances.
1269 ///
1270 /// Additionally, other software such as HALs may rely on only one
1271 /// peripheral instance existing to ensure memory safety; ensure
1272 /// no stolen instances are passed to such software.
1273 pub unsafe fn steal() -> Self {
1274 Self {
1275 _marker: PhantomData,
1276 }
1277 }
1278}
1279impl Deref for Btim1 {
1280 type Target = btim1::RegisterBlock;
1281 #[inline(always)]
1282 fn deref(&self) -> &Self::Target {
1283 unsafe { &*Self::PTR }
1284 }
1285}
1286impl core::fmt::Debug for Btim1 {
1287 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1288 f.debug_struct("Btim1").finish()
1289 }
1290}
1291///Basic Timer
1292pub mod btim1;
1293///Watchdog 1
1294pub struct Wdt1 {
1295 _marker: PhantomData<*const ()>,
1296}
1297unsafe impl Send for Wdt1 {}
1298impl Wdt1 {
1299 ///Pointer to the register block
1300 pub const PTR: *const wdt1::RegisterBlock = 0x5009_4000 as *const _;
1301 ///Return the pointer to the register block
1302 #[inline(always)]
1303 pub const fn ptr() -> *const wdt1::RegisterBlock {
1304 Self::PTR
1305 }
1306 /// Steal an instance of this peripheral
1307 ///
1308 /// # Safety
1309 ///
1310 /// Ensure that the new instance of the peripheral cannot be used in a way
1311 /// that may race with any existing instances, for example by only
1312 /// accessing read-only or write-only registers, or by consuming the
1313 /// original peripheral and using critical sections to coordinate
1314 /// access between multiple new instances.
1315 ///
1316 /// Additionally, other software such as HALs may rely on only one
1317 /// peripheral instance existing to ensure memory safety; ensure
1318 /// no stolen instances are passed to such software.
1319 pub unsafe fn steal() -> Self {
1320 Self {
1321 _marker: PhantomData,
1322 }
1323 }
1324}
1325impl Deref for Wdt1 {
1326 type Target = wdt1::RegisterBlock;
1327 #[inline(always)]
1328 fn deref(&self) -> &Self::Target {
1329 unsafe { &*Self::PTR }
1330 }
1331}
1332impl core::fmt::Debug for Wdt1 {
1333 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1334 f.debug_struct("Wdt1").finish()
1335 }
1336}
1337///Watchdog 1
1338pub mod wdt1;
1339///SPI
1340pub struct Spi1 {
1341 _marker: PhantomData<*const ()>,
1342}
1343unsafe impl Send for Spi1 {}
1344impl Spi1 {
1345 ///Pointer to the register block
1346 pub const PTR: *const spi1::RegisterBlock = 0x5009_5000 as *const _;
1347 ///Return the pointer to the register block
1348 #[inline(always)]
1349 pub const fn ptr() -> *const spi1::RegisterBlock {
1350 Self::PTR
1351 }
1352 /// Steal an instance of this peripheral
1353 ///
1354 /// # Safety
1355 ///
1356 /// Ensure that the new instance of the peripheral cannot be used in a way
1357 /// that may race with any existing instances, for example by only
1358 /// accessing read-only or write-only registers, or by consuming the
1359 /// original peripheral and using critical sections to coordinate
1360 /// access between multiple new instances.
1361 ///
1362 /// Additionally, other software such as HALs may rely on only one
1363 /// peripheral instance existing to ensure memory safety; ensure
1364 /// no stolen instances are passed to such software.
1365 pub unsafe fn steal() -> Self {
1366 Self {
1367 _marker: PhantomData,
1368 }
1369 }
1370}
1371impl Deref for Spi1 {
1372 type Target = spi1::RegisterBlock;
1373 #[inline(always)]
1374 fn deref(&self) -> &Self::Target {
1375 unsafe { &*Self::PTR }
1376 }
1377}
1378impl core::fmt::Debug for Spi1 {
1379 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1380 f.debug_struct("Spi1").finish()
1381 }
1382}
1383///SPI
1384pub mod spi1;
1385///SPI
1386pub struct Spi2 {
1387 _marker: PhantomData<*const ()>,
1388}
1389unsafe impl Send for Spi2 {}
1390impl Spi2 {
1391 ///Pointer to the register block
1392 pub const PTR: *const spi1::RegisterBlock = 0x5009_6000 as *const _;
1393 ///Return the pointer to the register block
1394 #[inline(always)]
1395 pub const fn ptr() -> *const spi1::RegisterBlock {
1396 Self::PTR
1397 }
1398 /// Steal an instance of this peripheral
1399 ///
1400 /// # Safety
1401 ///
1402 /// Ensure that the new instance of the peripheral cannot be used in a way
1403 /// that may race with any existing instances, for example by only
1404 /// accessing read-only or write-only registers, or by consuming the
1405 /// original peripheral and using critical sections to coordinate
1406 /// access between multiple new instances.
1407 ///
1408 /// Additionally, other software such as HALs may rely on only one
1409 /// peripheral instance existing to ensure memory safety; ensure
1410 /// no stolen instances are passed to such software.
1411 pub unsafe fn steal() -> Self {
1412 Self {
1413 _marker: PhantomData,
1414 }
1415 }
1416}
1417impl Deref for Spi2 {
1418 type Target = spi1::RegisterBlock;
1419 #[inline(always)]
1420 fn deref(&self) -> &Self::Target {
1421 unsafe { &*Self::PTR }
1422 }
1423}
1424impl core::fmt::Debug for Spi2 {
1425 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1426 f.debug_struct("Spi2").finish()
1427 }
1428}
1429///SPI
1430pub use self::spi1 as spi2;
1431///Pulse Density Modulation
1432pub struct Pdm1 {
1433 _marker: PhantomData<*const ()>,
1434}
1435unsafe impl Send for Pdm1 {}
1436impl Pdm1 {
1437 ///Pointer to the register block
1438 pub const PTR: *const pdm1::RegisterBlock = 0x5009_a000 as *const _;
1439 ///Return the pointer to the register block
1440 #[inline(always)]
1441 pub const fn ptr() -> *const pdm1::RegisterBlock {
1442 Self::PTR
1443 }
1444 /// Steal an instance of this peripheral
1445 ///
1446 /// # Safety
1447 ///
1448 /// Ensure that the new instance of the peripheral cannot be used in a way
1449 /// that may race with any existing instances, for example by only
1450 /// accessing read-only or write-only registers, or by consuming the
1451 /// original peripheral and using critical sections to coordinate
1452 /// access between multiple new instances.
1453 ///
1454 /// Additionally, other software such as HALs may rely on only one
1455 /// peripheral instance existing to ensure memory safety; ensure
1456 /// no stolen instances are passed to such software.
1457 pub unsafe fn steal() -> Self {
1458 Self {
1459 _marker: PhantomData,
1460 }
1461 }
1462}
1463impl Deref for Pdm1 {
1464 type Target = pdm1::RegisterBlock;
1465 #[inline(always)]
1466 fn deref(&self) -> &Self::Target {
1467 unsafe { &*Self::PTR }
1468 }
1469}
1470impl core::fmt::Debug for Pdm1 {
1471 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1472 f.debug_struct("Pdm1").finish()
1473 }
1474}
1475///Pulse Density Modulation
1476pub mod pdm1;
1477///I2C
1478pub struct I2c1 {
1479 _marker: PhantomData<*const ()>,
1480}
1481unsafe impl Send for I2c1 {}
1482impl I2c1 {
1483 ///Pointer to the register block
1484 pub const PTR: *const i2c1::RegisterBlock = 0x5009_c000 as *const _;
1485 ///Return the pointer to the register block
1486 #[inline(always)]
1487 pub const fn ptr() -> *const i2c1::RegisterBlock {
1488 Self::PTR
1489 }
1490 /// Steal an instance of this peripheral
1491 ///
1492 /// # Safety
1493 ///
1494 /// Ensure that the new instance of the peripheral cannot be used in a way
1495 /// that may race with any existing instances, for example by only
1496 /// accessing read-only or write-only registers, or by consuming the
1497 /// original peripheral and using critical sections to coordinate
1498 /// access between multiple new instances.
1499 ///
1500 /// Additionally, other software such as HALs may rely on only one
1501 /// peripheral instance existing to ensure memory safety; ensure
1502 /// no stolen instances are passed to such software.
1503 pub unsafe fn steal() -> Self {
1504 Self {
1505 _marker: PhantomData,
1506 }
1507 }
1508}
1509impl Deref for I2c1 {
1510 type Target = i2c1::RegisterBlock;
1511 #[inline(always)]
1512 fn deref(&self) -> &Self::Target {
1513 unsafe { &*Self::PTR }
1514 }
1515}
1516impl core::fmt::Debug for I2c1 {
1517 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1518 f.debug_struct("I2c1").finish()
1519 }
1520}
1521///I2C
1522pub mod i2c1;
1523///I2C
1524pub struct I2c2 {
1525 _marker: PhantomData<*const ()>,
1526}
1527unsafe impl Send for I2c2 {}
1528impl I2c2 {
1529 ///Pointer to the register block
1530 pub const PTR: *const i2c1::RegisterBlock = 0x5009_d000 as *const _;
1531 ///Return the pointer to the register block
1532 #[inline(always)]
1533 pub const fn ptr() -> *const i2c1::RegisterBlock {
1534 Self::PTR
1535 }
1536 /// Steal an instance of this peripheral
1537 ///
1538 /// # Safety
1539 ///
1540 /// Ensure that the new instance of the peripheral cannot be used in a way
1541 /// that may race with any existing instances, for example by only
1542 /// accessing read-only or write-only registers, or by consuming the
1543 /// original peripheral and using critical sections to coordinate
1544 /// access between multiple new instances.
1545 ///
1546 /// Additionally, other software such as HALs may rely on only one
1547 /// peripheral instance existing to ensure memory safety; ensure
1548 /// no stolen instances are passed to such software.
1549 pub unsafe fn steal() -> Self {
1550 Self {
1551 _marker: PhantomData,
1552 }
1553 }
1554}
1555impl Deref for I2c2 {
1556 type Target = i2c1::RegisterBlock;
1557 #[inline(always)]
1558 fn deref(&self) -> &Self::Target {
1559 unsafe { &*Self::PTR }
1560 }
1561}
1562impl core::fmt::Debug for I2c2 {
1563 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1564 f.debug_struct("I2c2").finish()
1565 }
1566}
1567///I2C
1568pub use self::i2c1 as i2c2;
1569///I2C
1570pub struct I2c3 {
1571 _marker: PhantomData<*const ()>,
1572}
1573unsafe impl Send for I2c3 {}
1574impl I2c3 {
1575 ///Pointer to the register block
1576 pub const PTR: *const i2c1::RegisterBlock = 0x5009_e000 as *const _;
1577 ///Return the pointer to the register block
1578 #[inline(always)]
1579 pub const fn ptr() -> *const i2c1::RegisterBlock {
1580 Self::PTR
1581 }
1582 /// Steal an instance of this peripheral
1583 ///
1584 /// # Safety
1585 ///
1586 /// Ensure that the new instance of the peripheral cannot be used in a way
1587 /// that may race with any existing instances, for example by only
1588 /// accessing read-only or write-only registers, or by consuming the
1589 /// original peripheral and using critical sections to coordinate
1590 /// access between multiple new instances.
1591 ///
1592 /// Additionally, other software such as HALs may rely on only one
1593 /// peripheral instance existing to ensure memory safety; ensure
1594 /// no stolen instances are passed to such software.
1595 pub unsafe fn steal() -> Self {
1596 Self {
1597 _marker: PhantomData,
1598 }
1599 }
1600}
1601impl Deref for I2c3 {
1602 type Target = i2c1::RegisterBlock;
1603 #[inline(always)]
1604 fn deref(&self) -> &Self::Target {
1605 unsafe { &*Self::PTR }
1606 }
1607}
1608impl core::fmt::Debug for I2c3 {
1609 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1610 f.debug_struct("I2c3").finish()
1611 }
1612}
1613///I2C
1614pub use self::i2c1 as i2c3;
1615///I2C
1616pub struct I2c4 {
1617 _marker: PhantomData<*const ()>,
1618}
1619unsafe impl Send for I2c4 {}
1620impl I2c4 {
1621 ///Pointer to the register block
1622 pub const PTR: *const i2c1::RegisterBlock = 0x5009_f000 as *const _;
1623 ///Return the pointer to the register block
1624 #[inline(always)]
1625 pub const fn ptr() -> *const i2c1::RegisterBlock {
1626 Self::PTR
1627 }
1628 /// Steal an instance of this peripheral
1629 ///
1630 /// # Safety
1631 ///
1632 /// Ensure that the new instance of the peripheral cannot be used in a way
1633 /// that may race with any existing instances, for example by only
1634 /// accessing read-only or write-only registers, or by consuming the
1635 /// original peripheral and using critical sections to coordinate
1636 /// access between multiple new instances.
1637 ///
1638 /// Additionally, other software such as HALs may rely on only one
1639 /// peripheral instance existing to ensure memory safety; ensure
1640 /// no stolen instances are passed to such software.
1641 pub unsafe fn steal() -> Self {
1642 Self {
1643 _marker: PhantomData,
1644 }
1645 }
1646}
1647impl Deref for I2c4 {
1648 type Target = i2c1::RegisterBlock;
1649 #[inline(always)]
1650 fn deref(&self) -> &Self::Target {
1651 unsafe { &*Self::PTR }
1652 }
1653}
1654impl core::fmt::Debug for I2c4 {
1655 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1656 f.debug_struct("I2c4").finish()
1657 }
1658}
1659///I2C
1660pub use self::i2c1 as i2c4;
1661///HPSYS_GPIO
1662pub struct HpsysGpio {
1663 _marker: PhantomData<*const ()>,
1664}
1665unsafe impl Send for HpsysGpio {}
1666impl HpsysGpio {
1667 ///Pointer to the register block
1668 pub const PTR: *const hpsys_gpio::RegisterBlock = 0x500a_0000 as *const _;
1669 ///Return the pointer to the register block
1670 #[inline(always)]
1671 pub const fn ptr() -> *const hpsys_gpio::RegisterBlock {
1672 Self::PTR
1673 }
1674 /// Steal an instance of this peripheral
1675 ///
1676 /// # Safety
1677 ///
1678 /// Ensure that the new instance of the peripheral cannot be used in a way
1679 /// that may race with any existing instances, for example by only
1680 /// accessing read-only or write-only registers, or by consuming the
1681 /// original peripheral and using critical sections to coordinate
1682 /// access between multiple new instances.
1683 ///
1684 /// Additionally, other software such as HALs may rely on only one
1685 /// peripheral instance existing to ensure memory safety; ensure
1686 /// no stolen instances are passed to such software.
1687 pub unsafe fn steal() -> Self {
1688 Self {
1689 _marker: PhantomData,
1690 }
1691 }
1692}
1693impl Deref for HpsysGpio {
1694 type Target = hpsys_gpio::RegisterBlock;
1695 #[inline(always)]
1696 fn deref(&self) -> &Self::Target {
1697 unsafe { &*Self::PTR }
1698 }
1699}
1700impl core::fmt::Debug for HpsysGpio {
1701 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1702 f.debug_struct("HpsysGpio").finish()
1703 }
1704}
1705///HPSYS_GPIO
1706pub mod hpsys_gpio;
1707///General Purpose Timer
1708pub struct Gptim2 {
1709 _marker: PhantomData<*const ()>,
1710}
1711unsafe impl Send for Gptim2 {}
1712impl Gptim2 {
1713 ///Pointer to the register block
1714 pub const PTR: *const gptim1::RegisterBlock = 0x500b_0000 as *const _;
1715 ///Return the pointer to the register block
1716 #[inline(always)]
1717 pub const fn ptr() -> *const gptim1::RegisterBlock {
1718 Self::PTR
1719 }
1720 /// Steal an instance of this peripheral
1721 ///
1722 /// # Safety
1723 ///
1724 /// Ensure that the new instance of the peripheral cannot be used in a way
1725 /// that may race with any existing instances, for example by only
1726 /// accessing read-only or write-only registers, or by consuming the
1727 /// original peripheral and using critical sections to coordinate
1728 /// access between multiple new instances.
1729 ///
1730 /// Additionally, other software such as HALs may rely on only one
1731 /// peripheral instance existing to ensure memory safety; ensure
1732 /// no stolen instances are passed to such software.
1733 pub unsafe fn steal() -> Self {
1734 Self {
1735 _marker: PhantomData,
1736 }
1737 }
1738}
1739impl Deref for Gptim2 {
1740 type Target = gptim1::RegisterBlock;
1741 #[inline(always)]
1742 fn deref(&self) -> &Self::Target {
1743 unsafe { &*Self::PTR }
1744 }
1745}
1746impl core::fmt::Debug for Gptim2 {
1747 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1748 f.debug_struct("Gptim2").finish()
1749 }
1750}
1751///General Purpose Timer
1752pub use self::gptim1 as gptim2;
1753///Basic Timer
1754pub struct Btim2 {
1755 _marker: PhantomData<*const ()>,
1756}
1757unsafe impl Send for Btim2 {}
1758impl Btim2 {
1759 ///Pointer to the register block
1760 pub const PTR: *const btim1::RegisterBlock = 0x500b_1000 as *const _;
1761 ///Return the pointer to the register block
1762 #[inline(always)]
1763 pub const fn ptr() -> *const btim1::RegisterBlock {
1764 Self::PTR
1765 }
1766 /// Steal an instance of this peripheral
1767 ///
1768 /// # Safety
1769 ///
1770 /// Ensure that the new instance of the peripheral cannot be used in a way
1771 /// that may race with any existing instances, for example by only
1772 /// accessing read-only or write-only registers, or by consuming the
1773 /// original peripheral and using critical sections to coordinate
1774 /// access between multiple new instances.
1775 ///
1776 /// Additionally, other software such as HALs may rely on only one
1777 /// peripheral instance existing to ensure memory safety; ensure
1778 /// no stolen instances are passed to such software.
1779 pub unsafe fn steal() -> Self {
1780 Self {
1781 _marker: PhantomData,
1782 }
1783 }
1784}
1785impl Deref for Btim2 {
1786 type Target = btim1::RegisterBlock;
1787 #[inline(always)]
1788 fn deref(&self) -> &Self::Target {
1789 unsafe { &*Self::PTR }
1790 }
1791}
1792impl core::fmt::Debug for Btim2 {
1793 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1794 f.debug_struct("Btim2").finish()
1795 }
1796}
1797///Basic Timer
1798pub use self::btim1 as btim2;
1799///HPSYS_AON
1800pub struct HpsysAon {
1801 _marker: PhantomData<*const ()>,
1802}
1803unsafe impl Send for HpsysAon {}
1804impl HpsysAon {
1805 ///Pointer to the register block
1806 pub const PTR: *const hpsys_aon::RegisterBlock = 0x500c_0000 as *const _;
1807 ///Return the pointer to the register block
1808 #[inline(always)]
1809 pub const fn ptr() -> *const hpsys_aon::RegisterBlock {
1810 Self::PTR
1811 }
1812 /// Steal an instance of this peripheral
1813 ///
1814 /// # Safety
1815 ///
1816 /// Ensure that the new instance of the peripheral cannot be used in a way
1817 /// that may race with any existing instances, for example by only
1818 /// accessing read-only or write-only registers, or by consuming the
1819 /// original peripheral and using critical sections to coordinate
1820 /// access between multiple new instances.
1821 ///
1822 /// Additionally, other software such as HALs may rely on only one
1823 /// peripheral instance existing to ensure memory safety; ensure
1824 /// no stolen instances are passed to such software.
1825 pub unsafe fn steal() -> Self {
1826 Self {
1827 _marker: PhantomData,
1828 }
1829 }
1830}
1831impl Deref for HpsysAon {
1832 type Target = hpsys_aon::RegisterBlock;
1833 #[inline(always)]
1834 fn deref(&self) -> &Self::Target {
1835 unsafe { &*Self::PTR }
1836 }
1837}
1838impl core::fmt::Debug for HpsysAon {
1839 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1840 f.debug_struct("HpsysAon").finish()
1841 }
1842}
1843///HPSYS_AON
1844pub mod hpsys_aon;
1845///Low Power Timer
1846pub struct Lptim1 {
1847 _marker: PhantomData<*const ()>,
1848}
1849unsafe impl Send for Lptim1 {}
1850impl Lptim1 {
1851 ///Pointer to the register block
1852 pub const PTR: *const lptim1::RegisterBlock = 0x500c_1000 as *const _;
1853 ///Return the pointer to the register block
1854 #[inline(always)]
1855 pub const fn ptr() -> *const lptim1::RegisterBlock {
1856 Self::PTR
1857 }
1858 /// Steal an instance of this peripheral
1859 ///
1860 /// # Safety
1861 ///
1862 /// Ensure that the new instance of the peripheral cannot be used in a way
1863 /// that may race with any existing instances, for example by only
1864 /// accessing read-only or write-only registers, or by consuming the
1865 /// original peripheral and using critical sections to coordinate
1866 /// access between multiple new instances.
1867 ///
1868 /// Additionally, other software such as HALs may rely on only one
1869 /// peripheral instance existing to ensure memory safety; ensure
1870 /// no stolen instances are passed to such software.
1871 pub unsafe fn steal() -> Self {
1872 Self {
1873 _marker: PhantomData,
1874 }
1875 }
1876}
1877impl Deref for Lptim1 {
1878 type Target = lptim1::RegisterBlock;
1879 #[inline(always)]
1880 fn deref(&self) -> &Self::Target {
1881 unsafe { &*Self::PTR }
1882 }
1883}
1884impl core::fmt::Debug for Lptim1 {
1885 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1886 f.debug_struct("Lptim1").finish()
1887 }
1888}
1889///Low Power Timer
1890pub mod lptim1;
1891///Low Power Timer
1892pub struct Lptim2 {
1893 _marker: PhantomData<*const ()>,
1894}
1895unsafe impl Send for Lptim2 {}
1896impl Lptim2 {
1897 ///Pointer to the register block
1898 pub const PTR: *const lptim1::RegisterBlock = 0x500c_2000 as *const _;
1899 ///Return the pointer to the register block
1900 #[inline(always)]
1901 pub const fn ptr() -> *const lptim1::RegisterBlock {
1902 Self::PTR
1903 }
1904 /// Steal an instance of this peripheral
1905 ///
1906 /// # Safety
1907 ///
1908 /// Ensure that the new instance of the peripheral cannot be used in a way
1909 /// that may race with any existing instances, for example by only
1910 /// accessing read-only or write-only registers, or by consuming the
1911 /// original peripheral and using critical sections to coordinate
1912 /// access between multiple new instances.
1913 ///
1914 /// Additionally, other software such as HALs may rely on only one
1915 /// peripheral instance existing to ensure memory safety; ensure
1916 /// no stolen instances are passed to such software.
1917 pub unsafe fn steal() -> Self {
1918 Self {
1919 _marker: PhantomData,
1920 }
1921 }
1922}
1923impl Deref for Lptim2 {
1924 type Target = lptim1::RegisterBlock;
1925 #[inline(always)]
1926 fn deref(&self) -> &Self::Target {
1927 unsafe { &*Self::PTR }
1928 }
1929}
1930impl core::fmt::Debug for Lptim2 {
1931 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1932 f.debug_struct("Lptim2").finish()
1933 }
1934}
1935///Low Power Timer
1936pub use self::lptim1 as lptim2;
1937///PMUC
1938pub struct Pmuc {
1939 _marker: PhantomData<*const ()>,
1940}
1941unsafe impl Send for Pmuc {}
1942impl Pmuc {
1943 ///Pointer to the register block
1944 pub const PTR: *const pmuc::RegisterBlock = 0x500c_a000 as *const _;
1945 ///Return the pointer to the register block
1946 #[inline(always)]
1947 pub const fn ptr() -> *const pmuc::RegisterBlock {
1948 Self::PTR
1949 }
1950 /// Steal an instance of this peripheral
1951 ///
1952 /// # Safety
1953 ///
1954 /// Ensure that the new instance of the peripheral cannot be used in a way
1955 /// that may race with any existing instances, for example by only
1956 /// accessing read-only or write-only registers, or by consuming the
1957 /// original peripheral and using critical sections to coordinate
1958 /// access between multiple new instances.
1959 ///
1960 /// Additionally, other software such as HALs may rely on only one
1961 /// peripheral instance existing to ensure memory safety; ensure
1962 /// no stolen instances are passed to such software.
1963 pub unsafe fn steal() -> Self {
1964 Self {
1965 _marker: PhantomData,
1966 }
1967 }
1968}
1969impl Deref for Pmuc {
1970 type Target = pmuc::RegisterBlock;
1971 #[inline(always)]
1972 fn deref(&self) -> &Self::Target {
1973 unsafe { &*Self::PTR }
1974 }
1975}
1976impl core::fmt::Debug for Pmuc {
1977 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1978 f.debug_struct("Pmuc").finish()
1979 }
1980}
1981///PMUC
1982pub mod pmuc;
1983///IWatchdog
1984pub struct Iwdt {
1985 _marker: PhantomData<*const ()>,
1986}
1987unsafe impl Send for Iwdt {}
1988impl Iwdt {
1989 ///Pointer to the register block
1990 pub const PTR: *const iwdt::RegisterBlock = 0x500c_c000 as *const _;
1991 ///Return the pointer to the register block
1992 #[inline(always)]
1993 pub const fn ptr() -> *const iwdt::RegisterBlock {
1994 Self::PTR
1995 }
1996 /// Steal an instance of this peripheral
1997 ///
1998 /// # Safety
1999 ///
2000 /// Ensure that the new instance of the peripheral cannot be used in a way
2001 /// that may race with any existing instances, for example by only
2002 /// accessing read-only or write-only registers, or by consuming the
2003 /// original peripheral and using critical sections to coordinate
2004 /// access between multiple new instances.
2005 ///
2006 /// Additionally, other software such as HALs may rely on only one
2007 /// peripheral instance existing to ensure memory safety; ensure
2008 /// no stolen instances are passed to such software.
2009 pub unsafe fn steal() -> Self {
2010 Self {
2011 _marker: PhantomData,
2012 }
2013 }
2014}
2015impl Deref for Iwdt {
2016 type Target = iwdt::RegisterBlock;
2017 #[inline(always)]
2018 fn deref(&self) -> &Self::Target {
2019 unsafe { &*Self::PTR }
2020 }
2021}
2022impl core::fmt::Debug for Iwdt {
2023 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2024 f.debug_struct("Iwdt").finish()
2025 }
2026}
2027///IWatchdog
2028pub mod iwdt;
2029///LPSYS_RCC
2030pub struct LpsysRcc {
2031 _marker: PhantomData<*const ()>,
2032}
2033unsafe impl Send for LpsysRcc {}
2034impl LpsysRcc {
2035 ///Pointer to the register block
2036 pub const PTR: *const lpsys_rcc::RegisterBlock = 0x4000_0000 as *const _;
2037 ///Return the pointer to the register block
2038 #[inline(always)]
2039 pub const fn ptr() -> *const lpsys_rcc::RegisterBlock {
2040 Self::PTR
2041 }
2042 /// Steal an instance of this peripheral
2043 ///
2044 /// # Safety
2045 ///
2046 /// Ensure that the new instance of the peripheral cannot be used in a way
2047 /// that may race with any existing instances, for example by only
2048 /// accessing read-only or write-only registers, or by consuming the
2049 /// original peripheral and using critical sections to coordinate
2050 /// access between multiple new instances.
2051 ///
2052 /// Additionally, other software such as HALs may rely on only one
2053 /// peripheral instance existing to ensure memory safety; ensure
2054 /// no stolen instances are passed to such software.
2055 pub unsafe fn steal() -> Self {
2056 Self {
2057 _marker: PhantomData,
2058 }
2059 }
2060}
2061impl Deref for LpsysRcc {
2062 type Target = lpsys_rcc::RegisterBlock;
2063 #[inline(always)]
2064 fn deref(&self) -> &Self::Target {
2065 unsafe { &*Self::PTR }
2066 }
2067}
2068impl core::fmt::Debug for LpsysRcc {
2069 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2070 f.debug_struct("LpsysRcc").finish()
2071 }
2072}
2073///LPSYS_RCC
2074pub mod lpsys_rcc;
2075///DMAC2
2076pub struct Dmac2 {
2077 _marker: PhantomData<*const ()>,
2078}
2079unsafe impl Send for Dmac2 {}
2080impl Dmac2 {
2081 ///Pointer to the register block
2082 pub const PTR: *const dmac1::RegisterBlock = 0x4000_1000 as *const _;
2083 ///Return the pointer to the register block
2084 #[inline(always)]
2085 pub const fn ptr() -> *const dmac1::RegisterBlock {
2086 Self::PTR
2087 }
2088 /// Steal an instance of this peripheral
2089 ///
2090 /// # Safety
2091 ///
2092 /// Ensure that the new instance of the peripheral cannot be used in a way
2093 /// that may race with any existing instances, for example by only
2094 /// accessing read-only or write-only registers, or by consuming the
2095 /// original peripheral and using critical sections to coordinate
2096 /// access between multiple new instances.
2097 ///
2098 /// Additionally, other software such as HALs may rely on only one
2099 /// peripheral instance existing to ensure memory safety; ensure
2100 /// no stolen instances are passed to such software.
2101 pub unsafe fn steal() -> Self {
2102 Self {
2103 _marker: PhantomData,
2104 }
2105 }
2106}
2107impl Deref for Dmac2 {
2108 type Target = dmac1::RegisterBlock;
2109 #[inline(always)]
2110 fn deref(&self) -> &Self::Target {
2111 unsafe { &*Self::PTR }
2112 }
2113}
2114impl core::fmt::Debug for Dmac2 {
2115 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2116 f.debug_struct("Dmac2").finish()
2117 }
2118}
2119///DMAC2
2120pub use self::dmac1 as dmac2;
2121///LPSYS_PINMUX
2122pub struct LpsysPinmux {
2123 _marker: PhantomData<*const ()>,
2124}
2125unsafe impl Send for LpsysPinmux {}
2126impl LpsysPinmux {
2127 ///Pointer to the register block
2128 pub const PTR: *const lpsys_pinmux::RegisterBlock = 0x4000_3000 as *const _;
2129 ///Return the pointer to the register block
2130 #[inline(always)]
2131 pub const fn ptr() -> *const lpsys_pinmux::RegisterBlock {
2132 Self::PTR
2133 }
2134 /// Steal an instance of this peripheral
2135 ///
2136 /// # Safety
2137 ///
2138 /// Ensure that the new instance of the peripheral cannot be used in a way
2139 /// that may race with any existing instances, for example by only
2140 /// accessing read-only or write-only registers, or by consuming the
2141 /// original peripheral and using critical sections to coordinate
2142 /// access between multiple new instances.
2143 ///
2144 /// Additionally, other software such as HALs may rely on only one
2145 /// peripheral instance existing to ensure memory safety; ensure
2146 /// no stolen instances are passed to such software.
2147 pub unsafe fn steal() -> Self {
2148 Self {
2149 _marker: PhantomData,
2150 }
2151 }
2152}
2153impl Deref for LpsysPinmux {
2154 type Target = lpsys_pinmux::RegisterBlock;
2155 #[inline(always)]
2156 fn deref(&self) -> &Self::Target {
2157 unsafe { &*Self::PTR }
2158 }
2159}
2160impl core::fmt::Debug for LpsysPinmux {
2161 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2162 f.debug_struct("LpsysPinmux").finish()
2163 }
2164}
2165///LPSYS_PINMUX
2166pub mod lpsys_pinmux;
2167///USART
2168pub struct Usart4 {
2169 _marker: PhantomData<*const ()>,
2170}
2171unsafe impl Send for Usart4 {}
2172impl Usart4 {
2173 ///Pointer to the register block
2174 pub const PTR: *const usart1::RegisterBlock = 0x4000_5000 as *const _;
2175 ///Return the pointer to the register block
2176 #[inline(always)]
2177 pub const fn ptr() -> *const usart1::RegisterBlock {
2178 Self::PTR
2179 }
2180 /// Steal an instance of this peripheral
2181 ///
2182 /// # Safety
2183 ///
2184 /// Ensure that the new instance of the peripheral cannot be used in a way
2185 /// that may race with any existing instances, for example by only
2186 /// accessing read-only or write-only registers, or by consuming the
2187 /// original peripheral and using critical sections to coordinate
2188 /// access between multiple new instances.
2189 ///
2190 /// Additionally, other software such as HALs may rely on only one
2191 /// peripheral instance existing to ensure memory safety; ensure
2192 /// no stolen instances are passed to such software.
2193 pub unsafe fn steal() -> Self {
2194 Self {
2195 _marker: PhantomData,
2196 }
2197 }
2198}
2199impl Deref for Usart4 {
2200 type Target = usart1::RegisterBlock;
2201 #[inline(always)]
2202 fn deref(&self) -> &Self::Target {
2203 unsafe { &*Self::PTR }
2204 }
2205}
2206impl core::fmt::Debug for Usart4 {
2207 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2208 f.debug_struct("Usart4").finish()
2209 }
2210}
2211///USART
2212pub use self::usart1 as usart4;
2213///USART
2214pub struct Usart5 {
2215 _marker: PhantomData<*const ()>,
2216}
2217unsafe impl Send for Usart5 {}
2218impl Usart5 {
2219 ///Pointer to the register block
2220 pub const PTR: *const usart1::RegisterBlock = 0x4000_6000 as *const _;
2221 ///Return the pointer to the register block
2222 #[inline(always)]
2223 pub const fn ptr() -> *const usart1::RegisterBlock {
2224 Self::PTR
2225 }
2226 /// Steal an instance of this peripheral
2227 ///
2228 /// # Safety
2229 ///
2230 /// Ensure that the new instance of the peripheral cannot be used in a way
2231 /// that may race with any existing instances, for example by only
2232 /// accessing read-only or write-only registers, or by consuming the
2233 /// original peripheral and using critical sections to coordinate
2234 /// access between multiple new instances.
2235 ///
2236 /// Additionally, other software such as HALs may rely on only one
2237 /// peripheral instance existing to ensure memory safety; ensure
2238 /// no stolen instances are passed to such software.
2239 pub unsafe fn steal() -> Self {
2240 Self {
2241 _marker: PhantomData,
2242 }
2243 }
2244}
2245impl Deref for Usart5 {
2246 type Target = usart1::RegisterBlock;
2247 #[inline(always)]
2248 fn deref(&self) -> &Self::Target {
2249 unsafe { &*Self::PTR }
2250 }
2251}
2252impl core::fmt::Debug for Usart5 {
2253 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2254 f.debug_struct("Usart5").finish()
2255 }
2256}
2257///USART
2258pub use self::usart1 as usart5;
2259///Basic Timer
2260pub struct Btim3 {
2261 _marker: PhantomData<*const ()>,
2262}
2263unsafe impl Send for Btim3 {}
2264impl Btim3 {
2265 ///Pointer to the register block
2266 pub const PTR: *const btim1::RegisterBlock = 0x4000_9000 as *const _;
2267 ///Return the pointer to the register block
2268 #[inline(always)]
2269 pub const fn ptr() -> *const btim1::RegisterBlock {
2270 Self::PTR
2271 }
2272 /// Steal an instance of this peripheral
2273 ///
2274 /// # Safety
2275 ///
2276 /// Ensure that the new instance of the peripheral cannot be used in a way
2277 /// that may race with any existing instances, for example by only
2278 /// accessing read-only or write-only registers, or by consuming the
2279 /// original peripheral and using critical sections to coordinate
2280 /// access between multiple new instances.
2281 ///
2282 /// Additionally, other software such as HALs may rely on only one
2283 /// peripheral instance existing to ensure memory safety; ensure
2284 /// no stolen instances are passed to such software.
2285 pub unsafe fn steal() -> Self {
2286 Self {
2287 _marker: PhantomData,
2288 }
2289 }
2290}
2291impl Deref for Btim3 {
2292 type Target = btim1::RegisterBlock;
2293 #[inline(always)]
2294 fn deref(&self) -> &Self::Target {
2295 unsafe { &*Self::PTR }
2296 }
2297}
2298impl core::fmt::Debug for Btim3 {
2299 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2300 f.debug_struct("Btim3").finish()
2301 }
2302}
2303///Basic Timer
2304pub use self::btim1 as btim3;
2305///Basic Timer
2306pub struct Btim4 {
2307 _marker: PhantomData<*const ()>,
2308}
2309unsafe impl Send for Btim4 {}
2310impl Btim4 {
2311 ///Pointer to the register block
2312 pub const PTR: *const btim1::RegisterBlock = 0x4000_a000 as *const _;
2313 ///Return the pointer to the register block
2314 #[inline(always)]
2315 pub const fn ptr() -> *const btim1::RegisterBlock {
2316 Self::PTR
2317 }
2318 /// Steal an instance of this peripheral
2319 ///
2320 /// # Safety
2321 ///
2322 /// Ensure that the new instance of the peripheral cannot be used in a way
2323 /// that may race with any existing instances, for example by only
2324 /// accessing read-only or write-only registers, or by consuming the
2325 /// original peripheral and using critical sections to coordinate
2326 /// access between multiple new instances.
2327 ///
2328 /// Additionally, other software such as HALs may rely on only one
2329 /// peripheral instance existing to ensure memory safety; ensure
2330 /// no stolen instances are passed to such software.
2331 pub unsafe fn steal() -> Self {
2332 Self {
2333 _marker: PhantomData,
2334 }
2335 }
2336}
2337impl Deref for Btim4 {
2338 type Target = btim1::RegisterBlock;
2339 #[inline(always)]
2340 fn deref(&self) -> &Self::Target {
2341 unsafe { &*Self::PTR }
2342 }
2343}
2344impl core::fmt::Debug for Btim4 {
2345 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2346 f.debug_struct("Btim4").finish()
2347 }
2348}
2349///Basic Timer
2350pub use self::btim1 as btim4;
2351///Watchdog 2
2352pub struct Wdt2 {
2353 _marker: PhantomData<*const ()>,
2354}
2355unsafe impl Send for Wdt2 {}
2356impl Wdt2 {
2357 ///Pointer to the register block
2358 pub const PTR: *const wdt1::RegisterBlock = 0x4000_b000 as *const _;
2359 ///Return the pointer to the register block
2360 #[inline(always)]
2361 pub const fn ptr() -> *const wdt1::RegisterBlock {
2362 Self::PTR
2363 }
2364 /// Steal an instance of this peripheral
2365 ///
2366 /// # Safety
2367 ///
2368 /// Ensure that the new instance of the peripheral cannot be used in a way
2369 /// that may race with any existing instances, for example by only
2370 /// accessing read-only or write-only registers, or by consuming the
2371 /// original peripheral and using critical sections to coordinate
2372 /// access between multiple new instances.
2373 ///
2374 /// Additionally, other software such as HALs may rely on only one
2375 /// peripheral instance existing to ensure memory safety; ensure
2376 /// no stolen instances are passed to such software.
2377 pub unsafe fn steal() -> Self {
2378 Self {
2379 _marker: PhantomData,
2380 }
2381 }
2382}
2383impl Deref for Wdt2 {
2384 type Target = wdt1::RegisterBlock;
2385 #[inline(always)]
2386 fn deref(&self) -> &Self::Target {
2387 unsafe { &*Self::PTR }
2388 }
2389}
2390impl core::fmt::Debug for Wdt2 {
2391 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2392 f.debug_struct("Wdt2").finish()
2393 }
2394}
2395///Watchdog 2
2396pub use self::wdt1 as wdt2;
2397///PTC2
2398pub struct Ptc2 {
2399 _marker: PhantomData<*const ()>,
2400}
2401unsafe impl Send for Ptc2 {}
2402impl Ptc2 {
2403 ///Pointer to the register block
2404 pub const PTR: *const ptc1::RegisterBlock = 0x4000_c000 as *const _;
2405 ///Return the pointer to the register block
2406 #[inline(always)]
2407 pub const fn ptr() -> *const ptc1::RegisterBlock {
2408 Self::PTR
2409 }
2410 /// Steal an instance of this peripheral
2411 ///
2412 /// # Safety
2413 ///
2414 /// Ensure that the new instance of the peripheral cannot be used in a way
2415 /// that may race with any existing instances, for example by only
2416 /// accessing read-only or write-only registers, or by consuming the
2417 /// original peripheral and using critical sections to coordinate
2418 /// access between multiple new instances.
2419 ///
2420 /// Additionally, other software such as HALs may rely on only one
2421 /// peripheral instance existing to ensure memory safety; ensure
2422 /// no stolen instances are passed to such software.
2423 pub unsafe fn steal() -> Self {
2424 Self {
2425 _marker: PhantomData,
2426 }
2427 }
2428}
2429impl Deref for Ptc2 {
2430 type Target = ptc1::RegisterBlock;
2431 #[inline(always)]
2432 fn deref(&self) -> &Self::Target {
2433 unsafe { &*Self::PTR }
2434 }
2435}
2436impl core::fmt::Debug for Ptc2 {
2437 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2438 f.debug_struct("Ptc2").finish()
2439 }
2440}
2441///PTC2
2442pub use self::ptc1 as ptc2;
2443///LPSYS_CFG
2444pub struct LpsysCfg {
2445 _marker: PhantomData<*const ()>,
2446}
2447unsafe impl Send for LpsysCfg {}
2448impl LpsysCfg {
2449 ///Pointer to the register block
2450 pub const PTR: *const lpsys_cfg::RegisterBlock = 0x4000_f000 as *const _;
2451 ///Return the pointer to the register block
2452 #[inline(always)]
2453 pub const fn ptr() -> *const lpsys_cfg::RegisterBlock {
2454 Self::PTR
2455 }
2456 /// Steal an instance of this peripheral
2457 ///
2458 /// # Safety
2459 ///
2460 /// Ensure that the new instance of the peripheral cannot be used in a way
2461 /// that may race with any existing instances, for example by only
2462 /// accessing read-only or write-only registers, or by consuming the
2463 /// original peripheral and using critical sections to coordinate
2464 /// access between multiple new instances.
2465 ///
2466 /// Additionally, other software such as HALs may rely on only one
2467 /// peripheral instance existing to ensure memory safety; ensure
2468 /// no stolen instances are passed to such software.
2469 pub unsafe fn steal() -> Self {
2470 Self {
2471 _marker: PhantomData,
2472 }
2473 }
2474}
2475impl Deref for LpsysCfg {
2476 type Target = lpsys_cfg::RegisterBlock;
2477 #[inline(always)]
2478 fn deref(&self) -> &Self::Target {
2479 unsafe { &*Self::PTR }
2480 }
2481}
2482impl core::fmt::Debug for LpsysCfg {
2483 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2484 f.debug_struct("LpsysCfg").finish()
2485 }
2486}
2487///LPSYS_CFG
2488pub mod lpsys_cfg;
2489///LPSYS_AON
2490pub struct LpsysAon {
2491 _marker: PhantomData<*const ()>,
2492}
2493unsafe impl Send for LpsysAon {}
2494impl LpsysAon {
2495 ///Pointer to the register block
2496 pub const PTR: *const lpsys_aon::RegisterBlock = 0x4004_0000 as *const _;
2497 ///Return the pointer to the register block
2498 #[inline(always)]
2499 pub const fn ptr() -> *const lpsys_aon::RegisterBlock {
2500 Self::PTR
2501 }
2502 /// Steal an instance of this peripheral
2503 ///
2504 /// # Safety
2505 ///
2506 /// Ensure that the new instance of the peripheral cannot be used in a way
2507 /// that may race with any existing instances, for example by only
2508 /// accessing read-only or write-only registers, or by consuming the
2509 /// original peripheral and using critical sections to coordinate
2510 /// access between multiple new instances.
2511 ///
2512 /// Additionally, other software such as HALs may rely on only one
2513 /// peripheral instance existing to ensure memory safety; ensure
2514 /// no stolen instances are passed to such software.
2515 pub unsafe fn steal() -> Self {
2516 Self {
2517 _marker: PhantomData,
2518 }
2519 }
2520}
2521impl Deref for LpsysAon {
2522 type Target = lpsys_aon::RegisterBlock;
2523 #[inline(always)]
2524 fn deref(&self) -> &Self::Target {
2525 unsafe { &*Self::PTR }
2526 }
2527}
2528impl core::fmt::Debug for LpsysAon {
2529 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2530 f.debug_struct("LpsysAon").finish()
2531 }
2532}
2533///LPSYS_AON
2534pub mod lpsys_aon;
2535///Low Power Timer
2536pub struct Lptim3 {
2537 _marker: PhantomData<*const ()>,
2538}
2539unsafe impl Send for Lptim3 {}
2540impl Lptim3 {
2541 ///Pointer to the register block
2542 pub const PTR: *const lptim1::RegisterBlock = 0x4004_2000 as *const _;
2543 ///Return the pointer to the register block
2544 #[inline(always)]
2545 pub const fn ptr() -> *const lptim1::RegisterBlock {
2546 Self::PTR
2547 }
2548 /// Steal an instance of this peripheral
2549 ///
2550 /// # Safety
2551 ///
2552 /// Ensure that the new instance of the peripheral cannot be used in a way
2553 /// that may race with any existing instances, for example by only
2554 /// accessing read-only or write-only registers, or by consuming the
2555 /// original peripheral and using critical sections to coordinate
2556 /// access between multiple new instances.
2557 ///
2558 /// Additionally, other software such as HALs may rely on only one
2559 /// peripheral instance existing to ensure memory safety; ensure
2560 /// no stolen instances are passed to such software.
2561 pub unsafe fn steal() -> Self {
2562 Self {
2563 _marker: PhantomData,
2564 }
2565 }
2566}
2567impl Deref for Lptim3 {
2568 type Target = lptim1::RegisterBlock;
2569 #[inline(always)]
2570 fn deref(&self) -> &Self::Target {
2571 unsafe { &*Self::PTR }
2572 }
2573}
2574impl core::fmt::Debug for Lptim3 {
2575 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2576 f.debug_struct("Lptim3").finish()
2577 }
2578}
2579///Low Power Timer
2580pub use self::lptim1 as lptim3;
2581///Cyclic Redundancy Check
2582pub struct Crc2 {
2583 _marker: PhantomData<*const ()>,
2584}
2585unsafe impl Send for Crc2 {}
2586impl Crc2 {
2587 ///Pointer to the register block
2588 pub const PTR: *const crc1::RegisterBlock = 0x4008_5000 as *const _;
2589 ///Return the pointer to the register block
2590 #[inline(always)]
2591 pub const fn ptr() -> *const crc1::RegisterBlock {
2592 Self::PTR
2593 }
2594 /// Steal an instance of this peripheral
2595 ///
2596 /// # Safety
2597 ///
2598 /// Ensure that the new instance of the peripheral cannot be used in a way
2599 /// that may race with any existing instances, for example by only
2600 /// accessing read-only or write-only registers, or by consuming the
2601 /// original peripheral and using critical sections to coordinate
2602 /// access between multiple new instances.
2603 ///
2604 /// Additionally, other software such as HALs may rely on only one
2605 /// peripheral instance existing to ensure memory safety; ensure
2606 /// no stolen instances are passed to such software.
2607 pub unsafe fn steal() -> Self {
2608 Self {
2609 _marker: PhantomData,
2610 }
2611 }
2612}
2613impl Deref for Crc2 {
2614 type Target = crc1::RegisterBlock;
2615 #[inline(always)]
2616 fn deref(&self) -> &Self::Target {
2617 unsafe { &*Self::PTR }
2618 }
2619}
2620impl core::fmt::Debug for Crc2 {
2621 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2622 f.debug_struct("Crc2").finish()
2623 }
2624}
2625///Cyclic Redundancy Check
2626pub use self::crc1 as crc2;
2627#[no_mangle]
2628static mut DEVICE_PERIPHERALS: bool = false;
2629/// All the peripherals.
2630#[allow(non_snake_case)]
2631pub struct Peripherals {
2632 ///HPSYS_RCC
2633 pub hpsys_rcc: HpsysRcc,
2634 ///EXTDMA
2635 pub extdma: Extdma,
2636 ///HPSYS_PINMUX
2637 pub hpsys_pinmux: HpsysPinmux,
2638 ///ATIM1
2639 pub atim1: Atim1,
2640 ///AUDPRC
2641 pub audprc: Audprc,
2642 ///EZIP1
2643 pub ezip1: Ezip1,
2644 ///EPIC
2645 pub epic: Epic,
2646 ///LCDC1
2647 pub lcdc1: Lcdc1,
2648 ///I2S1
2649 pub i2s1: I2s1,
2650 ///HPSYS_CFG
2651 pub hpsys_cfg: HpsysCfg,
2652 ///EFUSEC
2653 pub efusec: Efusec,
2654 ///AES
2655 pub aes: Aes,
2656 ///TRNG
2657 pub trng: Trng,
2658 ///MPI1
2659 pub mpi1: Mpi1,
2660 ///MPI2
2661 pub mpi2: Mpi2,
2662 ///SDMMC1
2663 pub sdmmc1: Sdmmc1,
2664 ///CRC1
2665 pub crc1: Crc1,
2666 ///PTC1
2667 pub ptc1: Ptc1,
2668 ///DMAC1
2669 pub dmac1: Dmac1,
2670 ///USART1
2671 pub usart1: Usart1,
2672 ///USART2
2673 pub usart2: Usart2,
2674 ///USART3
2675 pub usart3: Usart3,
2676 ///GPADC
2677 pub gpadc: Gpadc,
2678 ///AUDCODEC
2679 pub audcodec: Audcodec,
2680 ///TSEN
2681 pub tsen: Tsen,
2682 ///GPTIM1
2683 pub gptim1: Gptim1,
2684 ///BTIM1
2685 pub btim1: Btim1,
2686 ///WDT1
2687 pub wdt1: Wdt1,
2688 ///SPI1
2689 pub spi1: Spi1,
2690 ///SPI2
2691 pub spi2: Spi2,
2692 ///PDM1
2693 pub pdm1: Pdm1,
2694 ///I2C1
2695 pub i2c1: I2c1,
2696 ///I2C2
2697 pub i2c2: I2c2,
2698 ///I2C3
2699 pub i2c3: I2c3,
2700 ///I2C4
2701 pub i2c4: I2c4,
2702 ///HPSYS_GPIO
2703 pub hpsys_gpio: HpsysGpio,
2704 ///GPTIM2
2705 pub gptim2: Gptim2,
2706 ///BTIM2
2707 pub btim2: Btim2,
2708 ///HPSYS_AON
2709 pub hpsys_aon: HpsysAon,
2710 ///LPTIM1
2711 pub lptim1: Lptim1,
2712 ///LPTIM2
2713 pub lptim2: Lptim2,
2714 ///PMUC
2715 pub pmuc: Pmuc,
2716 ///IWDT
2717 pub iwdt: Iwdt,
2718 ///LPSYS_RCC
2719 pub lpsys_rcc: LpsysRcc,
2720 ///DMAC2
2721 pub dmac2: Dmac2,
2722 ///LPSYS_PINMUX
2723 pub lpsys_pinmux: LpsysPinmux,
2724 ///USART4
2725 pub usart4: Usart4,
2726 ///USART5
2727 pub usart5: Usart5,
2728 ///BTIM3
2729 pub btim3: Btim3,
2730 ///BTIM4
2731 pub btim4: Btim4,
2732 ///WDT2
2733 pub wdt2: Wdt2,
2734 ///PTC2
2735 pub ptc2: Ptc2,
2736 ///LPSYS_CFG
2737 pub lpsys_cfg: LpsysCfg,
2738 ///LPSYS_AON
2739 pub lpsys_aon: LpsysAon,
2740 ///LPTIM3
2741 pub lptim3: Lptim3,
2742 ///CRC2
2743 pub crc2: Crc2,
2744}
2745impl Peripherals {
2746 /// Returns all the peripherals *once*.
2747 #[cfg(feature = "critical-section")]
2748 #[inline]
2749 pub fn take() -> Option<Self> {
2750 critical_section::with(|_| {
2751 if unsafe { DEVICE_PERIPHERALS } {
2752 return None;
2753 }
2754 Some(unsafe { Peripherals::steal() })
2755 })
2756 }
2757 /// Unchecked version of `Peripherals::take`.
2758 ///
2759 /// # Safety
2760 ///
2761 /// Each of the returned peripherals must be used at most once.
2762 #[inline]
2763 pub unsafe fn steal() -> Self {
2764 DEVICE_PERIPHERALS = true;
2765 Peripherals {
2766 hpsys_rcc: HpsysRcc::steal(),
2767 extdma: Extdma::steal(),
2768 hpsys_pinmux: HpsysPinmux::steal(),
2769 atim1: Atim1::steal(),
2770 audprc: Audprc::steal(),
2771 ezip1: Ezip1::steal(),
2772 epic: Epic::steal(),
2773 lcdc1: Lcdc1::steal(),
2774 i2s1: I2s1::steal(),
2775 hpsys_cfg: HpsysCfg::steal(),
2776 efusec: Efusec::steal(),
2777 aes: Aes::steal(),
2778 trng: Trng::steal(),
2779 mpi1: Mpi1::steal(),
2780 mpi2: Mpi2::steal(),
2781 sdmmc1: Sdmmc1::steal(),
2782 crc1: Crc1::steal(),
2783 ptc1: Ptc1::steal(),
2784 dmac1: Dmac1::steal(),
2785 usart1: Usart1::steal(),
2786 usart2: Usart2::steal(),
2787 usart3: Usart3::steal(),
2788 gpadc: Gpadc::steal(),
2789 audcodec: Audcodec::steal(),
2790 tsen: Tsen::steal(),
2791 gptim1: Gptim1::steal(),
2792 btim1: Btim1::steal(),
2793 wdt1: Wdt1::steal(),
2794 spi1: Spi1::steal(),
2795 spi2: Spi2::steal(),
2796 pdm1: Pdm1::steal(),
2797 i2c1: I2c1::steal(),
2798 i2c2: I2c2::steal(),
2799 i2c3: I2c3::steal(),
2800 i2c4: I2c4::steal(),
2801 hpsys_gpio: HpsysGpio::steal(),
2802 gptim2: Gptim2::steal(),
2803 btim2: Btim2::steal(),
2804 hpsys_aon: HpsysAon::steal(),
2805 lptim1: Lptim1::steal(),
2806 lptim2: Lptim2::steal(),
2807 pmuc: Pmuc::steal(),
2808 iwdt: Iwdt::steal(),
2809 lpsys_rcc: LpsysRcc::steal(),
2810 dmac2: Dmac2::steal(),
2811 lpsys_pinmux: LpsysPinmux::steal(),
2812 usart4: Usart4::steal(),
2813 usart5: Usart5::steal(),
2814 btim3: Btim3::steal(),
2815 btim4: Btim4::steal(),
2816 wdt2: Wdt2::steal(),
2817 ptc2: Ptc2::steal(),
2818 lpsys_cfg: LpsysCfg::steal(),
2819 lpsys_aon: LpsysAon::steal(),
2820 lptim3: Lptim3::steal(),
2821 crc2: Crc2::steal(),
2822 }
2823 }
2824}