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