stm32f3_staging/stm32f303/mod.rs
1/*!Peripheral access API for STM32F303 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 PVD();
27 fn TAMP_STAMP();
28 fn RTC_WKUP();
29 fn FLASH();
30 fn RCC();
31 fn EXTI0();
32 fn EXTI1();
33 fn EXTI2_TSC();
34 fn EXTI3();
35 fn EXTI4();
36 fn DMA1_CH1();
37 fn DMA1_CH2();
38 fn DMA1_CH3();
39 fn DMA1_CH4();
40 fn DMA1_CH5();
41 fn DMA1_CH6();
42 fn DMA1_CH7();
43 fn ADC1_2();
44 fn USB_HP_CAN_TX();
45 fn USB_LP_CAN_RX0();
46 fn CAN_RX1();
47 fn CAN_SCE();
48 fn EXTI9_5();
49 fn TIM1_BRK_TIM15();
50 fn TIM1_UP_TIM16();
51 fn TIM1_TRG_COM_TIM17();
52 fn TIM1_CC();
53 fn TIM2();
54 fn TIM3();
55 fn TIM4();
56 fn I2C1_EV_EXTI23();
57 fn I2C1_ER();
58 fn I2C2_EV_EXTI24();
59 fn I2C2_ER();
60 fn SPI1();
61 fn SPI2();
62 fn USART1_EXTI25();
63 fn USART2_EXTI26();
64 fn USART3_EXTI28();
65 fn EXTI15_10();
66 fn RTCALARM();
67 fn USB_WKUP();
68 fn TIM8_BRK();
69 fn TIM8_UP();
70 fn TIM8_TRG_COM();
71 fn TIM8_CC();
72 fn ADC3();
73 fn FMC();
74 fn SPI3();
75 fn UART4_EXTI34();
76 fn UART5_EXTI35();
77 fn TIM6_DACUNDER();
78 fn TIM7();
79 fn DMA2_CH1();
80 fn DMA2_CH2();
81 fn DMA2_CH3();
82 fn DMA2_CH4();
83 fn DMA2_CH5();
84 fn ADC4();
85 fn COMP1_2_3();
86 fn COMP4_5_6();
87 fn COMP7();
88 fn I2C3_EV();
89 fn I2C3_ER();
90 fn USB_HP();
91 fn USB_LP();
92 fn USB_WKUP_EXTI();
93 fn TIM20_BRK();
94 fn TIM20_UP();
95 fn TIM20_TRG_COM();
96 fn TIM20_CC();
97 fn FPU();
98 fn SPI4();
99}
100#[doc(hidden)]
101#[repr(C)]
102pub union Vector {
103 _handler: unsafe extern "C" fn(),
104 _reserved: u32,
105}
106#[cfg(feature = "rt")]
107#[doc(hidden)]
108#[link_section = ".vector_table.interrupts"]
109#[no_mangle]
110pub static __INTERRUPTS: [Vector; 85] = [
111 Vector { _handler: WWDG },
112 Vector { _handler: PVD },
113 Vector { _handler: TAMP_STAMP },
114 Vector { _handler: RTC_WKUP },
115 Vector { _handler: FLASH },
116 Vector { _handler: RCC },
117 Vector { _handler: EXTI0 },
118 Vector { _handler: EXTI1 },
119 Vector { _handler: EXTI2_TSC },
120 Vector { _handler: EXTI3 },
121 Vector { _handler: EXTI4 },
122 Vector { _handler: DMA1_CH1 },
123 Vector { _handler: DMA1_CH2 },
124 Vector { _handler: DMA1_CH3 },
125 Vector { _handler: DMA1_CH4 },
126 Vector { _handler: DMA1_CH5 },
127 Vector { _handler: DMA1_CH6 },
128 Vector { _handler: DMA1_CH7 },
129 Vector { _handler: ADC1_2 },
130 Vector { _handler: USB_HP_CAN_TX },
131 Vector { _handler: USB_LP_CAN_RX0 },
132 Vector { _handler: CAN_RX1 },
133 Vector { _handler: CAN_SCE },
134 Vector { _handler: EXTI9_5 },
135 Vector { _handler: TIM1_BRK_TIM15 },
136 Vector { _handler: TIM1_UP_TIM16 },
137 Vector {
138 _handler: TIM1_TRG_COM_TIM17,
139 },
140 Vector { _handler: TIM1_CC },
141 Vector { _handler: TIM2 },
142 Vector { _handler: TIM3 },
143 Vector { _handler: TIM4 },
144 Vector { _handler: I2C1_EV_EXTI23 },
145 Vector { _handler: I2C1_ER },
146 Vector { _handler: I2C2_EV_EXTI24 },
147 Vector { _handler: I2C2_ER },
148 Vector { _handler: SPI1 },
149 Vector { _handler: SPI2 },
150 Vector { _handler: USART1_EXTI25 },
151 Vector { _handler: USART2_EXTI26 },
152 Vector { _handler: USART3_EXTI28 },
153 Vector { _handler: EXTI15_10 },
154 Vector { _handler: RTCALARM },
155 Vector { _handler: USB_WKUP },
156 Vector { _handler: TIM8_BRK },
157 Vector { _handler: TIM8_UP },
158 Vector { _handler: TIM8_TRG_COM },
159 Vector { _handler: TIM8_CC },
160 Vector { _handler: ADC3 },
161 Vector { _handler: FMC },
162 Vector { _reserved: 0 },
163 Vector { _reserved: 0 },
164 Vector { _handler: SPI3 },
165 Vector { _handler: UART4_EXTI34 },
166 Vector { _handler: UART5_EXTI35 },
167 Vector { _handler: TIM6_DACUNDER },
168 Vector { _handler: TIM7 },
169 Vector { _handler: DMA2_CH1 },
170 Vector { _handler: DMA2_CH2 },
171 Vector { _handler: DMA2_CH3 },
172 Vector { _handler: DMA2_CH4 },
173 Vector { _handler: DMA2_CH5 },
174 Vector { _handler: ADC4 },
175 Vector { _reserved: 0 },
176 Vector { _reserved: 0 },
177 Vector { _handler: COMP1_2_3 },
178 Vector { _handler: COMP4_5_6 },
179 Vector { _handler: COMP7 },
180 Vector { _reserved: 0 },
181 Vector { _reserved: 0 },
182 Vector { _reserved: 0 },
183 Vector { _reserved: 0 },
184 Vector { _reserved: 0 },
185 Vector { _handler: I2C3_EV },
186 Vector { _handler: I2C3_ER },
187 Vector { _handler: USB_HP },
188 Vector { _handler: USB_LP },
189 Vector { _handler: USB_WKUP_EXTI },
190 Vector { _handler: TIM20_BRK },
191 Vector { _handler: TIM20_UP },
192 Vector { _handler: TIM20_TRG_COM },
193 Vector { _handler: TIM20_CC },
194 Vector { _handler: FPU },
195 Vector { _reserved: 0 },
196 Vector { _reserved: 0 },
197 Vector { _handler: SPI4 },
198];
199///Enumeration of all the interrupts.
200#[cfg_attr(feature = "defmt", derive(defmt::Format))]
201#[derive(Copy, Clone, Debug, PartialEq, Eq)]
202#[repr(u16)]
203pub enum Interrupt {
204 ///0 - Window Watchdog interrupt
205 WWDG = 0,
206 ///1 - PVD through EXTI line detection interrupt
207 PVD = 1,
208 ///2 - Tamper and TimeStamp interrupts
209 TAMP_STAMP = 2,
210 ///3 - RTC Wakeup interrupt through the EXTI line
211 RTC_WKUP = 3,
212 ///4 - Flash global interrupt
213 FLASH = 4,
214 ///5 - RCC global interrupt
215 RCC = 5,
216 ///6 - EXTI Line0 interrupt
217 EXTI0 = 6,
218 ///7 - EXTI Line3 interrupt
219 EXTI1 = 7,
220 ///8 - EXTI Line2 and Touch sensing interrupts
221 EXTI2_TSC = 8,
222 ///9 - EXTI Line3 interrupt
223 EXTI3 = 9,
224 ///10 - EXTI Line4 interrupt
225 EXTI4 = 10,
226 ///11 - DMA1 channel 1 interrupt
227 DMA1_CH1 = 11,
228 ///12 - DMA1 channel 2 interrupt
229 DMA1_CH2 = 12,
230 ///13 - DMA1 channel 3 interrupt
231 DMA1_CH3 = 13,
232 ///14 - DMA1 channel 4 interrupt
233 DMA1_CH4 = 14,
234 ///15 - DMA1 channel 5 interrupt
235 DMA1_CH5 = 15,
236 ///16 - DMA1 channel 6 interrupt
237 DMA1_CH6 = 16,
238 ///17 - DMA1 channel 7interrupt
239 DMA1_CH7 = 17,
240 ///18 - ADC1 and ADC2 global interrupt
241 ADC1_2 = 18,
242 ///19 - USB High Priority/CAN_TX interrupts
243 USB_HP_CAN_TX = 19,
244 ///20 - USB Low Priority/CAN_RX0 interrupts
245 USB_LP_CAN_RX0 = 20,
246 ///21 - CAN_RX1 interrupt
247 CAN_RX1 = 21,
248 ///22 - CAN_SCE interrupt
249 CAN_SCE = 22,
250 ///23 - EXTI Line5 to Line9 interrupts
251 EXTI9_5 = 23,
252 ///24 - TIM1 Break/TIM15 global interruts
253 TIM1_BRK_TIM15 = 24,
254 ///25 - TIM1 Update/TIM16 global interrupts
255 TIM1_UP_TIM16 = 25,
256 ///26 - TIM1 trigger and commutation/TIM17 interrupts
257 TIM1_TRG_COM_TIM17 = 26,
258 ///27 - TIM1 capture compare interrupt
259 TIM1_CC = 27,
260 ///28 - TIM2 global interrupt
261 TIM2 = 28,
262 ///29 - TIM3 global interrupt
263 TIM3 = 29,
264 ///30 - TIM4 global interrupt
265 TIM4 = 30,
266 ///31 - I2C1 event interrupt and EXTI Line23 interrupt
267 I2C1_EV_EXTI23 = 31,
268 ///32 - I2C1 error interrupt
269 I2C1_ER = 32,
270 ///33 - I2C2 event interrupt & EXTI Line24 interrupt
271 I2C2_EV_EXTI24 = 33,
272 ///34 - I2C2 error interrupt
273 I2C2_ER = 34,
274 ///35 - SPI1 global interrupt
275 SPI1 = 35,
276 ///36 - SPI2 global interrupt
277 SPI2 = 36,
278 ///37 - USART1 global interrupt and EXTI Line 25 interrupt
279 USART1_EXTI25 = 37,
280 ///38 - USART2 global interrupt and EXTI Line 26 interrupt
281 USART2_EXTI26 = 38,
282 ///39 - USART3 global interrupt and EXTI Line 28 interrupt
283 USART3_EXTI28 = 39,
284 ///40 - EXTI Line15 to Line10 interrupts
285 EXTI15_10 = 40,
286 ///41 - RTC alarm interrupt
287 RTCALARM = 41,
288 ///42 - USB wakeup from Suspend
289 USB_WKUP = 42,
290 ///43 - TIM8 break interrupt
291 TIM8_BRK = 43,
292 ///44 - TIM8 update interrupt
293 TIM8_UP = 44,
294 ///45 - TIM8 Trigger and commutation interrupts
295 TIM8_TRG_COM = 45,
296 ///46 - TIM8 capture compare interrupt
297 TIM8_CC = 46,
298 ///47 - ADC3 global interrupt
299 ADC3 = 47,
300 ///48 - FSMC global interrupt
301 FMC = 48,
302 ///51 - SPI3 global interrupt
303 SPI3 = 51,
304 ///52 - UART4 global and EXTI Line 34 interrupts
305 UART4_EXTI34 = 52,
306 ///53 - UART5 global and EXTI Line 35 interrupts
307 UART5_EXTI35 = 53,
308 ///54 - TIM6 global and DAC12 underrun interrupts
309 TIM6_DACUNDER = 54,
310 ///55 - TIM7 global interrupt
311 TIM7 = 55,
312 ///56 - DMA2 channel1 global interrupt
313 DMA2_CH1 = 56,
314 ///57 - DMA2 channel2 global interrupt
315 DMA2_CH2 = 57,
316 ///58 - DMA2 channel3 global interrupt
317 DMA2_CH3 = 58,
318 ///59 - DMA2 channel4 global interrupt
319 DMA2_CH4 = 59,
320 ///60 - DMA2 channel5 global interrupt
321 DMA2_CH5 = 60,
322 ///61 - ADC4 global interrupt
323 ADC4 = 61,
324 ///64 - COMP1_2_3 interrupt combined with EXTI lines 21, 22, 29
325 COMP1_2_3 = 64,
326 ///65 - COMP4_5_6 interrupt combined with EXTI lines 30, 31, 32
327 COMP4_5_6 = 65,
328 ///66 - COMP7 interrupt combined with EXTI line 33
329 COMP7 = 66,
330 ///72 - I2C3 Event interrupt
331 I2C3_EV = 72,
332 ///73 - I2C3 Error interrupt
333 I2C3_ER = 73,
334 ///74 - USB High priority interrupt
335 USB_HP = 74,
336 ///75 - USB Low priority interrupt
337 USB_LP = 75,
338 ///76 - USB wakeup from Suspend and EXTI Line 18
339 USB_WKUP_EXTI = 76,
340 ///77 - TIM20 Break interrupt
341 TIM20_BRK = 77,
342 ///78 - TIM20 Upgrade interrupt
343 TIM20_UP = 78,
344 ///79 - TIM20 Trigger and Commutation interrupt
345 TIM20_TRG_COM = 79,
346 ///80 - TIM20 Capture Compare interrupt
347 TIM20_CC = 80,
348 ///81 - Floating point unit interrupt
349 FPU = 81,
350 ///84 - SPI4 Global interrupt
351 SPI4 = 84,
352}
353unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
354 #[inline(always)]
355 fn number(self) -> u16 {
356 self as u16
357 }
358}
359///General-purpose I/Os
360///
361///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#GPIOA)
362pub struct GPIOA {
363 _marker: PhantomData<*const ()>,
364}
365unsafe impl Send for GPIOA {}
366impl GPIOA {
367 ///Pointer to the register block
368 pub const PTR: *const gpioa::RegisterBlock = 0x4800_0000 as *const _;
369 ///Return the pointer to the register block
370 #[inline(always)]
371 pub const fn ptr() -> *const gpioa::RegisterBlock {
372 Self::PTR
373 }
374 /// Steal an instance of this peripheral
375 ///
376 /// # Safety
377 ///
378 /// Ensure that the new instance of the peripheral cannot be used in a way
379 /// that may race with any existing instances, for example by only
380 /// accessing read-only or write-only registers, or by consuming the
381 /// original peripheral and using critical sections to coordinate
382 /// access between multiple new instances.
383 ///
384 /// Additionally, other software such as HALs may rely on only one
385 /// peripheral instance existing to ensure memory safety; ensure
386 /// no stolen instances are passed to such software.
387 pub unsafe fn steal() -> Self {
388 Self { _marker: PhantomData }
389 }
390}
391impl Deref for GPIOA {
392 type Target = gpioa::RegisterBlock;
393 #[inline(always)]
394 fn deref(&self) -> &Self::Target {
395 unsafe { &*Self::PTR }
396 }
397}
398impl core::fmt::Debug for GPIOA {
399 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
400 f.debug_struct("GPIOA").finish()
401 }
402}
403///General-purpose I/Os
404pub mod gpioa;
405///General-purpose I/Os
406///
407///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#GPIOB)
408pub struct GPIOB {
409 _marker: PhantomData<*const ()>,
410}
411unsafe impl Send for GPIOB {}
412impl GPIOB {
413 ///Pointer to the register block
414 pub const PTR: *const gpiob::RegisterBlock = 0x4800_0400 as *const _;
415 ///Return the pointer to the register block
416 #[inline(always)]
417 pub const fn ptr() -> *const gpiob::RegisterBlock {
418 Self::PTR
419 }
420 /// Steal an instance of this peripheral
421 ///
422 /// # Safety
423 ///
424 /// Ensure that the new instance of the peripheral cannot be used in a way
425 /// that may race with any existing instances, for example by only
426 /// accessing read-only or write-only registers, or by consuming the
427 /// original peripheral and using critical sections to coordinate
428 /// access between multiple new instances.
429 ///
430 /// Additionally, other software such as HALs may rely on only one
431 /// peripheral instance existing to ensure memory safety; ensure
432 /// no stolen instances are passed to such software.
433 pub unsafe fn steal() -> Self {
434 Self { _marker: PhantomData }
435 }
436}
437impl Deref for GPIOB {
438 type Target = gpiob::RegisterBlock;
439 #[inline(always)]
440 fn deref(&self) -> &Self::Target {
441 unsafe { &*Self::PTR }
442 }
443}
444impl core::fmt::Debug for GPIOB {
445 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
446 f.debug_struct("GPIOB").finish()
447 }
448}
449///General-purpose I/Os
450pub mod gpiob;
451///General-purpose I/Os
452///
453///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#GPIOC)
454pub struct GPIOC {
455 _marker: PhantomData<*const ()>,
456}
457unsafe impl Send for GPIOC {}
458impl GPIOC {
459 ///Pointer to the register block
460 pub const PTR: *const gpioc::RegisterBlock = 0x4800_0800 as *const _;
461 ///Return the pointer to the register block
462 #[inline(always)]
463 pub const fn ptr() -> *const gpioc::RegisterBlock {
464 Self::PTR
465 }
466 /// Steal an instance of this peripheral
467 ///
468 /// # Safety
469 ///
470 /// Ensure that the new instance of the peripheral cannot be used in a way
471 /// that may race with any existing instances, for example by only
472 /// accessing read-only or write-only registers, or by consuming the
473 /// original peripheral and using critical sections to coordinate
474 /// access between multiple new instances.
475 ///
476 /// Additionally, other software such as HALs may rely on only one
477 /// peripheral instance existing to ensure memory safety; ensure
478 /// no stolen instances are passed to such software.
479 pub unsafe fn steal() -> Self {
480 Self { _marker: PhantomData }
481 }
482}
483impl Deref for GPIOC {
484 type Target = gpioc::RegisterBlock;
485 #[inline(always)]
486 fn deref(&self) -> &Self::Target {
487 unsafe { &*Self::PTR }
488 }
489}
490impl core::fmt::Debug for GPIOC {
491 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
492 f.debug_struct("GPIOC").finish()
493 }
494}
495///General-purpose I/Os
496pub mod gpioc;
497///General-purpose I/Os
498///
499///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#GPIOC)
500pub struct GPIOD {
501 _marker: PhantomData<*const ()>,
502}
503unsafe impl Send for GPIOD {}
504impl GPIOD {
505 ///Pointer to the register block
506 pub const PTR: *const gpioc::RegisterBlock = 0x4800_0c00 as *const _;
507 ///Return the pointer to the register block
508 #[inline(always)]
509 pub const fn ptr() -> *const gpioc::RegisterBlock {
510 Self::PTR
511 }
512 /// Steal an instance of this peripheral
513 ///
514 /// # Safety
515 ///
516 /// Ensure that the new instance of the peripheral cannot be used in a way
517 /// that may race with any existing instances, for example by only
518 /// accessing read-only or write-only registers, or by consuming the
519 /// original peripheral and using critical sections to coordinate
520 /// access between multiple new instances.
521 ///
522 /// Additionally, other software such as HALs may rely on only one
523 /// peripheral instance existing to ensure memory safety; ensure
524 /// no stolen instances are passed to such software.
525 pub unsafe fn steal() -> Self {
526 Self { _marker: PhantomData }
527 }
528}
529impl Deref for GPIOD {
530 type Target = gpioc::RegisterBlock;
531 #[inline(always)]
532 fn deref(&self) -> &Self::Target {
533 unsafe { &*Self::PTR }
534 }
535}
536impl core::fmt::Debug for GPIOD {
537 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
538 f.debug_struct("GPIOD").finish()
539 }
540}
541///General-purpose I/Os
542pub use self::gpioc as gpiod;
543///General-purpose I/Os
544///
545///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#GPIOC)
546pub struct GPIOE {
547 _marker: PhantomData<*const ()>,
548}
549unsafe impl Send for GPIOE {}
550impl GPIOE {
551 ///Pointer to the register block
552 pub const PTR: *const gpioc::RegisterBlock = 0x4800_1000 as *const _;
553 ///Return the pointer to the register block
554 #[inline(always)]
555 pub const fn ptr() -> *const gpioc::RegisterBlock {
556 Self::PTR
557 }
558 /// Steal an instance of this peripheral
559 ///
560 /// # Safety
561 ///
562 /// Ensure that the new instance of the peripheral cannot be used in a way
563 /// that may race with any existing instances, for example by only
564 /// accessing read-only or write-only registers, or by consuming the
565 /// original peripheral and using critical sections to coordinate
566 /// access between multiple new instances.
567 ///
568 /// Additionally, other software such as HALs may rely on only one
569 /// peripheral instance existing to ensure memory safety; ensure
570 /// no stolen instances are passed to such software.
571 pub unsafe fn steal() -> Self {
572 Self { _marker: PhantomData }
573 }
574}
575impl Deref for GPIOE {
576 type Target = gpioc::RegisterBlock;
577 #[inline(always)]
578 fn deref(&self) -> &Self::Target {
579 unsafe { &*Self::PTR }
580 }
581}
582impl core::fmt::Debug for GPIOE {
583 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
584 f.debug_struct("GPIOE").finish()
585 }
586}
587///General-purpose I/Os
588pub use self::gpioc as gpioe;
589///General-purpose I/Os
590///
591///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#GPIOC)
592pub struct GPIOF {
593 _marker: PhantomData<*const ()>,
594}
595unsafe impl Send for GPIOF {}
596impl GPIOF {
597 ///Pointer to the register block
598 pub const PTR: *const gpioc::RegisterBlock = 0x4800_1400 as *const _;
599 ///Return the pointer to the register block
600 #[inline(always)]
601 pub const fn ptr() -> *const gpioc::RegisterBlock {
602 Self::PTR
603 }
604 /// Steal an instance of this peripheral
605 ///
606 /// # Safety
607 ///
608 /// Ensure that the new instance of the peripheral cannot be used in a way
609 /// that may race with any existing instances, for example by only
610 /// accessing read-only or write-only registers, or by consuming the
611 /// original peripheral and using critical sections to coordinate
612 /// access between multiple new instances.
613 ///
614 /// Additionally, other software such as HALs may rely on only one
615 /// peripheral instance existing to ensure memory safety; ensure
616 /// no stolen instances are passed to such software.
617 pub unsafe fn steal() -> Self {
618 Self { _marker: PhantomData }
619 }
620}
621impl Deref for GPIOF {
622 type Target = gpioc::RegisterBlock;
623 #[inline(always)]
624 fn deref(&self) -> &Self::Target {
625 unsafe { &*Self::PTR }
626 }
627}
628impl core::fmt::Debug for GPIOF {
629 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
630 f.debug_struct("GPIOF").finish()
631 }
632}
633///General-purpose I/Os
634pub use self::gpioc as gpiof;
635///General-purpose I/Os
636///
637///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#GPIOC)
638pub struct GPIOG {
639 _marker: PhantomData<*const ()>,
640}
641unsafe impl Send for GPIOG {}
642impl GPIOG {
643 ///Pointer to the register block
644 pub const PTR: *const gpioc::RegisterBlock = 0x4800_1800 as *const _;
645 ///Return the pointer to the register block
646 #[inline(always)]
647 pub const fn ptr() -> *const gpioc::RegisterBlock {
648 Self::PTR
649 }
650 /// Steal an instance of this peripheral
651 ///
652 /// # Safety
653 ///
654 /// Ensure that the new instance of the peripheral cannot be used in a way
655 /// that may race with any existing instances, for example by only
656 /// accessing read-only or write-only registers, or by consuming the
657 /// original peripheral and using critical sections to coordinate
658 /// access between multiple new instances.
659 ///
660 /// Additionally, other software such as HALs may rely on only one
661 /// peripheral instance existing to ensure memory safety; ensure
662 /// no stolen instances are passed to such software.
663 pub unsafe fn steal() -> Self {
664 Self { _marker: PhantomData }
665 }
666}
667impl Deref for GPIOG {
668 type Target = gpioc::RegisterBlock;
669 #[inline(always)]
670 fn deref(&self) -> &Self::Target {
671 unsafe { &*Self::PTR }
672 }
673}
674impl core::fmt::Debug for GPIOG {
675 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
676 f.debug_struct("GPIOG").finish()
677 }
678}
679///General-purpose I/Os
680pub use self::gpioc as gpiog;
681///General-purpose I/Os
682///
683///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#GPIOC)
684pub struct GPIOH {
685 _marker: PhantomData<*const ()>,
686}
687unsafe impl Send for GPIOH {}
688impl GPIOH {
689 ///Pointer to the register block
690 pub const PTR: *const gpioc::RegisterBlock = 0x4800_1c00 as *const _;
691 ///Return the pointer to the register block
692 #[inline(always)]
693 pub const fn ptr() -> *const gpioc::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 GPIOH {
714 type Target = gpioc::RegisterBlock;
715 #[inline(always)]
716 fn deref(&self) -> &Self::Target {
717 unsafe { &*Self::PTR }
718 }
719}
720impl core::fmt::Debug for GPIOH {
721 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
722 f.debug_struct("GPIOH").finish()
723 }
724}
725///General-purpose I/Os
726pub use self::gpioc as gpioh;
727///Touch sensing controller
728///
729///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TSC)
730pub struct TSC {
731 _marker: PhantomData<*const ()>,
732}
733unsafe impl Send for TSC {}
734impl TSC {
735 ///Pointer to the register block
736 pub const PTR: *const tsc::RegisterBlock = 0x4002_4000 as *const _;
737 ///Return the pointer to the register block
738 #[inline(always)]
739 pub const fn ptr() -> *const tsc::RegisterBlock {
740 Self::PTR
741 }
742 /// Steal an instance of this peripheral
743 ///
744 /// # Safety
745 ///
746 /// Ensure that the new instance of the peripheral cannot be used in a way
747 /// that may race with any existing instances, for example by only
748 /// accessing read-only or write-only registers, or by consuming the
749 /// original peripheral and using critical sections to coordinate
750 /// access between multiple new instances.
751 ///
752 /// Additionally, other software such as HALs may rely on only one
753 /// peripheral instance existing to ensure memory safety; ensure
754 /// no stolen instances are passed to such software.
755 pub unsafe fn steal() -> Self {
756 Self { _marker: PhantomData }
757 }
758}
759impl Deref for TSC {
760 type Target = tsc::RegisterBlock;
761 #[inline(always)]
762 fn deref(&self) -> &Self::Target {
763 unsafe { &*Self::PTR }
764 }
765}
766impl core::fmt::Debug for TSC {
767 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
768 f.debug_struct("TSC").finish()
769 }
770}
771///Touch sensing controller
772pub mod tsc;
773///cyclic redundancy check calculation unit
774///
775///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#CRC)
776pub struct CRC {
777 _marker: PhantomData<*const ()>,
778}
779unsafe impl Send for CRC {}
780impl CRC {
781 ///Pointer to the register block
782 pub const PTR: *const crc::RegisterBlock = 0x4002_3000 as *const _;
783 ///Return the pointer to the register block
784 #[inline(always)]
785 pub const fn ptr() -> *const crc::RegisterBlock {
786 Self::PTR
787 }
788 /// Steal an instance of this peripheral
789 ///
790 /// # Safety
791 ///
792 /// Ensure that the new instance of the peripheral cannot be used in a way
793 /// that may race with any existing instances, for example by only
794 /// accessing read-only or write-only registers, or by consuming the
795 /// original peripheral and using critical sections to coordinate
796 /// access between multiple new instances.
797 ///
798 /// Additionally, other software such as HALs may rely on only one
799 /// peripheral instance existing to ensure memory safety; ensure
800 /// no stolen instances are passed to such software.
801 pub unsafe fn steal() -> Self {
802 Self { _marker: PhantomData }
803 }
804}
805impl Deref for CRC {
806 type Target = crc::RegisterBlock;
807 #[inline(always)]
808 fn deref(&self) -> &Self::Target {
809 unsafe { &*Self::PTR }
810 }
811}
812impl core::fmt::Debug for CRC {
813 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
814 f.debug_struct("CRC").finish()
815 }
816}
817///cyclic redundancy check calculation unit
818pub mod crc;
819///Flash
820///
821///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#FLASH)
822pub struct FLASH {
823 _marker: PhantomData<*const ()>,
824}
825unsafe impl Send for FLASH {}
826impl FLASH {
827 ///Pointer to the register block
828 pub const PTR: *const flash::RegisterBlock = 0x4002_2000 as *const _;
829 ///Return the pointer to the register block
830 #[inline(always)]
831 pub const fn ptr() -> *const flash::RegisterBlock {
832 Self::PTR
833 }
834 /// Steal an instance of this peripheral
835 ///
836 /// # Safety
837 ///
838 /// Ensure that the new instance of the peripheral cannot be used in a way
839 /// that may race with any existing instances, for example by only
840 /// accessing read-only or write-only registers, or by consuming the
841 /// original peripheral and using critical sections to coordinate
842 /// access between multiple new instances.
843 ///
844 /// Additionally, other software such as HALs may rely on only one
845 /// peripheral instance existing to ensure memory safety; ensure
846 /// no stolen instances are passed to such software.
847 pub unsafe fn steal() -> Self {
848 Self { _marker: PhantomData }
849 }
850}
851impl Deref for FLASH {
852 type Target = flash::RegisterBlock;
853 #[inline(always)]
854 fn deref(&self) -> &Self::Target {
855 unsafe { &*Self::PTR }
856 }
857}
858impl core::fmt::Debug for FLASH {
859 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
860 f.debug_struct("FLASH").finish()
861 }
862}
863///Flash
864pub mod flash;
865///Reset and clock control
866///
867///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RCC)
868pub struct RCC {
869 _marker: PhantomData<*const ()>,
870}
871unsafe impl Send for RCC {}
872impl RCC {
873 ///Pointer to the register block
874 pub const PTR: *const rcc::RegisterBlock = 0x4002_1000 as *const _;
875 ///Return the pointer to the register block
876 #[inline(always)]
877 pub const fn ptr() -> *const rcc::RegisterBlock {
878 Self::PTR
879 }
880 /// Steal an instance of this peripheral
881 ///
882 /// # Safety
883 ///
884 /// Ensure that the new instance of the peripheral cannot be used in a way
885 /// that may race with any existing instances, for example by only
886 /// accessing read-only or write-only registers, or by consuming the
887 /// original peripheral and using critical sections to coordinate
888 /// access between multiple new instances.
889 ///
890 /// Additionally, other software such as HALs may rely on only one
891 /// peripheral instance existing to ensure memory safety; ensure
892 /// no stolen instances are passed to such software.
893 pub unsafe fn steal() -> Self {
894 Self { _marker: PhantomData }
895 }
896}
897impl Deref for RCC {
898 type Target = rcc::RegisterBlock;
899 #[inline(always)]
900 fn deref(&self) -> &Self::Target {
901 unsafe { &*Self::PTR }
902 }
903}
904impl core::fmt::Debug for RCC {
905 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
906 f.debug_struct("RCC").finish()
907 }
908}
909///Reset and clock control
910pub mod rcc;
911///DMA controller 1
912///
913///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#DMA1)
914pub struct DMA1 {
915 _marker: PhantomData<*const ()>,
916}
917unsafe impl Send for DMA1 {}
918impl DMA1 {
919 ///Pointer to the register block
920 pub const PTR: *const dma1::RegisterBlock = 0x4002_0000 as *const _;
921 ///Return the pointer to the register block
922 #[inline(always)]
923 pub const fn ptr() -> *const dma1::RegisterBlock {
924 Self::PTR
925 }
926 /// Steal an instance of this peripheral
927 ///
928 /// # Safety
929 ///
930 /// Ensure that the new instance of the peripheral cannot be used in a way
931 /// that may race with any existing instances, for example by only
932 /// accessing read-only or write-only registers, or by consuming the
933 /// original peripheral and using critical sections to coordinate
934 /// access between multiple new instances.
935 ///
936 /// Additionally, other software such as HALs may rely on only one
937 /// peripheral instance existing to ensure memory safety; ensure
938 /// no stolen instances are passed to such software.
939 pub unsafe fn steal() -> Self {
940 Self { _marker: PhantomData }
941 }
942}
943impl Deref for DMA1 {
944 type Target = dma1::RegisterBlock;
945 #[inline(always)]
946 fn deref(&self) -> &Self::Target {
947 unsafe { &*Self::PTR }
948 }
949}
950impl core::fmt::Debug for DMA1 {
951 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
952 f.debug_struct("DMA1").finish()
953 }
954}
955///DMA controller 1
956pub mod dma1;
957///DMA controller 1
958///
959///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#DMA1)
960pub struct DMA2 {
961 _marker: PhantomData<*const ()>,
962}
963unsafe impl Send for DMA2 {}
964impl DMA2 {
965 ///Pointer to the register block
966 pub const PTR: *const dma1::RegisterBlock = 0x4002_0400 as *const _;
967 ///Return the pointer to the register block
968 #[inline(always)]
969 pub const fn ptr() -> *const dma1::RegisterBlock {
970 Self::PTR
971 }
972 /// Steal an instance of this peripheral
973 ///
974 /// # Safety
975 ///
976 /// Ensure that the new instance of the peripheral cannot be used in a way
977 /// that may race with any existing instances, for example by only
978 /// accessing read-only or write-only registers, or by consuming the
979 /// original peripheral and using critical sections to coordinate
980 /// access between multiple new instances.
981 ///
982 /// Additionally, other software such as HALs may rely on only one
983 /// peripheral instance existing to ensure memory safety; ensure
984 /// no stolen instances are passed to such software.
985 pub unsafe fn steal() -> Self {
986 Self { _marker: PhantomData }
987 }
988}
989impl Deref for DMA2 {
990 type Target = dma1::RegisterBlock;
991 #[inline(always)]
992 fn deref(&self) -> &Self::Target {
993 unsafe { &*Self::PTR }
994 }
995}
996impl core::fmt::Debug for DMA2 {
997 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
998 f.debug_struct("DMA2").finish()
999 }
1000}
1001///DMA controller 1
1002pub use self::dma1 as dma2;
1003///General purpose timer
1004///
1005///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TIM2)
1006pub struct TIM2 {
1007 _marker: PhantomData<*const ()>,
1008}
1009unsafe impl Send for TIM2 {}
1010impl TIM2 {
1011 ///Pointer to the register block
1012 pub const PTR: *const tim2::RegisterBlock = 0x4000_0000 as *const _;
1013 ///Return the pointer to the register block
1014 #[inline(always)]
1015 pub const fn ptr() -> *const tim2::RegisterBlock {
1016 Self::PTR
1017 }
1018 /// Steal an instance of this peripheral
1019 ///
1020 /// # Safety
1021 ///
1022 /// Ensure that the new instance of the peripheral cannot be used in a way
1023 /// that may race with any existing instances, for example by only
1024 /// accessing read-only or write-only registers, or by consuming the
1025 /// original peripheral and using critical sections to coordinate
1026 /// access between multiple new instances.
1027 ///
1028 /// Additionally, other software such as HALs may rely on only one
1029 /// peripheral instance existing to ensure memory safety; ensure
1030 /// no stolen instances are passed to such software.
1031 pub unsafe fn steal() -> Self {
1032 Self { _marker: PhantomData }
1033 }
1034}
1035impl Deref for TIM2 {
1036 type Target = tim2::RegisterBlock;
1037 #[inline(always)]
1038 fn deref(&self) -> &Self::Target {
1039 unsafe { &*Self::PTR }
1040 }
1041}
1042impl core::fmt::Debug for TIM2 {
1043 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1044 f.debug_struct("TIM2").finish()
1045 }
1046}
1047///General purpose timer
1048pub mod tim2;
1049///General purpose timer
1050///
1051///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TIM3)
1052pub struct TIM3 {
1053 _marker: PhantomData<*const ()>,
1054}
1055unsafe impl Send for TIM3 {}
1056impl TIM3 {
1057 ///Pointer to the register block
1058 pub const PTR: *const tim3::RegisterBlock = 0x4000_0400 as *const _;
1059 ///Return the pointer to the register block
1060 #[inline(always)]
1061 pub const fn ptr() -> *const tim3::RegisterBlock {
1062 Self::PTR
1063 }
1064 /// Steal an instance of this peripheral
1065 ///
1066 /// # Safety
1067 ///
1068 /// Ensure that the new instance of the peripheral cannot be used in a way
1069 /// that may race with any existing instances, for example by only
1070 /// accessing read-only or write-only registers, or by consuming the
1071 /// original peripheral and using critical sections to coordinate
1072 /// access between multiple new instances.
1073 ///
1074 /// Additionally, other software such as HALs may rely on only one
1075 /// peripheral instance existing to ensure memory safety; ensure
1076 /// no stolen instances are passed to such software.
1077 pub unsafe fn steal() -> Self {
1078 Self { _marker: PhantomData }
1079 }
1080}
1081impl Deref for TIM3 {
1082 type Target = tim3::RegisterBlock;
1083 #[inline(always)]
1084 fn deref(&self) -> &Self::Target {
1085 unsafe { &*Self::PTR }
1086 }
1087}
1088impl core::fmt::Debug for TIM3 {
1089 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1090 f.debug_struct("TIM3").finish()
1091 }
1092}
1093///General purpose timer
1094pub mod tim3;
1095///General purpose timer
1096///
1097///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TIM3)
1098pub struct TIM4 {
1099 _marker: PhantomData<*const ()>,
1100}
1101unsafe impl Send for TIM4 {}
1102impl TIM4 {
1103 ///Pointer to the register block
1104 pub const PTR: *const tim3::RegisterBlock = 0x4000_0800 as *const _;
1105 ///Return the pointer to the register block
1106 #[inline(always)]
1107 pub const fn ptr() -> *const tim3::RegisterBlock {
1108 Self::PTR
1109 }
1110 /// Steal an instance of this peripheral
1111 ///
1112 /// # Safety
1113 ///
1114 /// Ensure that the new instance of the peripheral cannot be used in a way
1115 /// that may race with any existing instances, for example by only
1116 /// accessing read-only or write-only registers, or by consuming the
1117 /// original peripheral and using critical sections to coordinate
1118 /// access between multiple new instances.
1119 ///
1120 /// Additionally, other software such as HALs may rely on only one
1121 /// peripheral instance existing to ensure memory safety; ensure
1122 /// no stolen instances are passed to such software.
1123 pub unsafe fn steal() -> Self {
1124 Self { _marker: PhantomData }
1125 }
1126}
1127impl Deref for TIM4 {
1128 type Target = tim3::RegisterBlock;
1129 #[inline(always)]
1130 fn deref(&self) -> &Self::Target {
1131 unsafe { &*Self::PTR }
1132 }
1133}
1134impl core::fmt::Debug for TIM4 {
1135 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1136 f.debug_struct("TIM4").finish()
1137 }
1138}
1139///General purpose timer
1140pub use self::tim3 as tim4;
1141///General purpose timers
1142///
1143///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TIM15)
1144pub struct TIM15 {
1145 _marker: PhantomData<*const ()>,
1146}
1147unsafe impl Send for TIM15 {}
1148impl TIM15 {
1149 ///Pointer to the register block
1150 pub const PTR: *const tim15::RegisterBlock = 0x4001_4000 as *const _;
1151 ///Return the pointer to the register block
1152 #[inline(always)]
1153 pub const fn ptr() -> *const tim15::RegisterBlock {
1154 Self::PTR
1155 }
1156 /// Steal an instance of this peripheral
1157 ///
1158 /// # Safety
1159 ///
1160 /// Ensure that the new instance of the peripheral cannot be used in a way
1161 /// that may race with any existing instances, for example by only
1162 /// accessing read-only or write-only registers, or by consuming the
1163 /// original peripheral and using critical sections to coordinate
1164 /// access between multiple new instances.
1165 ///
1166 /// Additionally, other software such as HALs may rely on only one
1167 /// peripheral instance existing to ensure memory safety; ensure
1168 /// no stolen instances are passed to such software.
1169 pub unsafe fn steal() -> Self {
1170 Self { _marker: PhantomData }
1171 }
1172}
1173impl Deref for TIM15 {
1174 type Target = tim15::RegisterBlock;
1175 #[inline(always)]
1176 fn deref(&self) -> &Self::Target {
1177 unsafe { &*Self::PTR }
1178 }
1179}
1180impl core::fmt::Debug for TIM15 {
1181 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1182 f.debug_struct("TIM15").finish()
1183 }
1184}
1185///General purpose timers
1186pub mod tim15;
1187///General-purpose-timers
1188///
1189///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TIM16)
1190pub struct TIM16 {
1191 _marker: PhantomData<*const ()>,
1192}
1193unsafe impl Send for TIM16 {}
1194impl TIM16 {
1195 ///Pointer to the register block
1196 pub const PTR: *const tim16::RegisterBlock = 0x4001_4400 as *const _;
1197 ///Return the pointer to the register block
1198 #[inline(always)]
1199 pub const fn ptr() -> *const tim16::RegisterBlock {
1200 Self::PTR
1201 }
1202 /// Steal an instance of this peripheral
1203 ///
1204 /// # Safety
1205 ///
1206 /// Ensure that the new instance of the peripheral cannot be used in a way
1207 /// that may race with any existing instances, for example by only
1208 /// accessing read-only or write-only registers, or by consuming the
1209 /// original peripheral and using critical sections to coordinate
1210 /// access between multiple new instances.
1211 ///
1212 /// Additionally, other software such as HALs may rely on only one
1213 /// peripheral instance existing to ensure memory safety; ensure
1214 /// no stolen instances are passed to such software.
1215 pub unsafe fn steal() -> Self {
1216 Self { _marker: PhantomData }
1217 }
1218}
1219impl Deref for TIM16 {
1220 type Target = tim16::RegisterBlock;
1221 #[inline(always)]
1222 fn deref(&self) -> &Self::Target {
1223 unsafe { &*Self::PTR }
1224 }
1225}
1226impl core::fmt::Debug for TIM16 {
1227 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1228 f.debug_struct("TIM16").finish()
1229 }
1230}
1231///General-purpose-timers
1232pub mod tim16;
1233///General purpose timer
1234///
1235///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TIM17)
1236pub struct TIM17 {
1237 _marker: PhantomData<*const ()>,
1238}
1239unsafe impl Send for TIM17 {}
1240impl TIM17 {
1241 ///Pointer to the register block
1242 pub const PTR: *const tim17::RegisterBlock = 0x4001_4800 as *const _;
1243 ///Return the pointer to the register block
1244 #[inline(always)]
1245 pub const fn ptr() -> *const tim17::RegisterBlock {
1246 Self::PTR
1247 }
1248 /// Steal an instance of this peripheral
1249 ///
1250 /// # Safety
1251 ///
1252 /// Ensure that the new instance of the peripheral cannot be used in a way
1253 /// that may race with any existing instances, for example by only
1254 /// accessing read-only or write-only registers, or by consuming the
1255 /// original peripheral and using critical sections to coordinate
1256 /// access between multiple new instances.
1257 ///
1258 /// Additionally, other software such as HALs may rely on only one
1259 /// peripheral instance existing to ensure memory safety; ensure
1260 /// no stolen instances are passed to such software.
1261 pub unsafe fn steal() -> Self {
1262 Self { _marker: PhantomData }
1263 }
1264}
1265impl Deref for TIM17 {
1266 type Target = tim17::RegisterBlock;
1267 #[inline(always)]
1268 fn deref(&self) -> &Self::Target {
1269 unsafe { &*Self::PTR }
1270 }
1271}
1272impl core::fmt::Debug for TIM17 {
1273 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1274 f.debug_struct("TIM17").finish()
1275 }
1276}
1277///General purpose timer
1278pub mod tim17;
1279///Universal synchronous asynchronous receiver transmitter
1280///
1281///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#USART1)
1282pub struct USART1 {
1283 _marker: PhantomData<*const ()>,
1284}
1285unsafe impl Send for USART1 {}
1286impl USART1 {
1287 ///Pointer to the register block
1288 pub const PTR: *const usart1::RegisterBlock = 0x4001_3800 as *const _;
1289 ///Return the pointer to the register block
1290 #[inline(always)]
1291 pub const fn ptr() -> *const usart1::RegisterBlock {
1292 Self::PTR
1293 }
1294 /// Steal an instance of this peripheral
1295 ///
1296 /// # Safety
1297 ///
1298 /// Ensure that the new instance of the peripheral cannot be used in a way
1299 /// that may race with any existing instances, for example by only
1300 /// accessing read-only or write-only registers, or by consuming the
1301 /// original peripheral and using critical sections to coordinate
1302 /// access between multiple new instances.
1303 ///
1304 /// Additionally, other software such as HALs may rely on only one
1305 /// peripheral instance existing to ensure memory safety; ensure
1306 /// no stolen instances are passed to such software.
1307 pub unsafe fn steal() -> Self {
1308 Self { _marker: PhantomData }
1309 }
1310}
1311impl Deref for USART1 {
1312 type Target = usart1::RegisterBlock;
1313 #[inline(always)]
1314 fn deref(&self) -> &Self::Target {
1315 unsafe { &*Self::PTR }
1316 }
1317}
1318impl core::fmt::Debug for USART1 {
1319 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1320 f.debug_struct("USART1").finish()
1321 }
1322}
1323///Universal synchronous asynchronous receiver transmitter
1324pub mod usart1;
1325///Universal synchronous asynchronous receiver transmitter
1326///
1327///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#USART1)
1328pub struct USART2 {
1329 _marker: PhantomData<*const ()>,
1330}
1331unsafe impl Send for USART2 {}
1332impl USART2 {
1333 ///Pointer to the register block
1334 pub const PTR: *const usart1::RegisterBlock = 0x4000_4400 as *const _;
1335 ///Return the pointer to the register block
1336 #[inline(always)]
1337 pub const fn ptr() -> *const usart1::RegisterBlock {
1338 Self::PTR
1339 }
1340 /// Steal an instance of this peripheral
1341 ///
1342 /// # Safety
1343 ///
1344 /// Ensure that the new instance of the peripheral cannot be used in a way
1345 /// that may race with any existing instances, for example by only
1346 /// accessing read-only or write-only registers, or by consuming the
1347 /// original peripheral and using critical sections to coordinate
1348 /// access between multiple new instances.
1349 ///
1350 /// Additionally, other software such as HALs may rely on only one
1351 /// peripheral instance existing to ensure memory safety; ensure
1352 /// no stolen instances are passed to such software.
1353 pub unsafe fn steal() -> Self {
1354 Self { _marker: PhantomData }
1355 }
1356}
1357impl Deref for USART2 {
1358 type Target = usart1::RegisterBlock;
1359 #[inline(always)]
1360 fn deref(&self) -> &Self::Target {
1361 unsafe { &*Self::PTR }
1362 }
1363}
1364impl core::fmt::Debug for USART2 {
1365 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1366 f.debug_struct("USART2").finish()
1367 }
1368}
1369///Universal synchronous asynchronous receiver transmitter
1370pub use self::usart1 as usart2;
1371///Universal synchronous asynchronous receiver transmitter
1372///
1373///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#USART1)
1374pub struct USART3 {
1375 _marker: PhantomData<*const ()>,
1376}
1377unsafe impl Send for USART3 {}
1378impl USART3 {
1379 ///Pointer to the register block
1380 pub const PTR: *const usart1::RegisterBlock = 0x4000_4800 as *const _;
1381 ///Return the pointer to the register block
1382 #[inline(always)]
1383 pub const fn ptr() -> *const usart1::RegisterBlock {
1384 Self::PTR
1385 }
1386 /// Steal an instance of this peripheral
1387 ///
1388 /// # Safety
1389 ///
1390 /// Ensure that the new instance of the peripheral cannot be used in a way
1391 /// that may race with any existing instances, for example by only
1392 /// accessing read-only or write-only registers, or by consuming the
1393 /// original peripheral and using critical sections to coordinate
1394 /// access between multiple new instances.
1395 ///
1396 /// Additionally, other software such as HALs may rely on only one
1397 /// peripheral instance existing to ensure memory safety; ensure
1398 /// no stolen instances are passed to such software.
1399 pub unsafe fn steal() -> Self {
1400 Self { _marker: PhantomData }
1401 }
1402}
1403impl Deref for USART3 {
1404 type Target = usart1::RegisterBlock;
1405 #[inline(always)]
1406 fn deref(&self) -> &Self::Target {
1407 unsafe { &*Self::PTR }
1408 }
1409}
1410impl core::fmt::Debug for USART3 {
1411 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1412 f.debug_struct("USART3").finish()
1413 }
1414}
1415///Universal synchronous asynchronous receiver transmitter
1416pub use self::usart1 as usart3;
1417///Universal synchronous asynchronous receiver transmitter
1418///
1419///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#USART1)
1420pub struct UART4 {
1421 _marker: PhantomData<*const ()>,
1422}
1423unsafe impl Send for UART4 {}
1424impl UART4 {
1425 ///Pointer to the register block
1426 pub const PTR: *const usart1::RegisterBlock = 0x4000_4c00 as *const _;
1427 ///Return the pointer to the register block
1428 #[inline(always)]
1429 pub const fn ptr() -> *const usart1::RegisterBlock {
1430 Self::PTR
1431 }
1432 /// Steal an instance of this peripheral
1433 ///
1434 /// # Safety
1435 ///
1436 /// Ensure that the new instance of the peripheral cannot be used in a way
1437 /// that may race with any existing instances, for example by only
1438 /// accessing read-only or write-only registers, or by consuming the
1439 /// original peripheral and using critical sections to coordinate
1440 /// access between multiple new instances.
1441 ///
1442 /// Additionally, other software such as HALs may rely on only one
1443 /// peripheral instance existing to ensure memory safety; ensure
1444 /// no stolen instances are passed to such software.
1445 pub unsafe fn steal() -> Self {
1446 Self { _marker: PhantomData }
1447 }
1448}
1449impl Deref for UART4 {
1450 type Target = usart1::RegisterBlock;
1451 #[inline(always)]
1452 fn deref(&self) -> &Self::Target {
1453 unsafe { &*Self::PTR }
1454 }
1455}
1456impl core::fmt::Debug for UART4 {
1457 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1458 f.debug_struct("UART4").finish()
1459 }
1460}
1461///Universal synchronous asynchronous receiver transmitter
1462pub use self::usart1 as uart4;
1463///Universal synchronous asynchronous receiver transmitter
1464///
1465///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#USART1)
1466pub struct UART5 {
1467 _marker: PhantomData<*const ()>,
1468}
1469unsafe impl Send for UART5 {}
1470impl UART5 {
1471 ///Pointer to the register block
1472 pub const PTR: *const usart1::RegisterBlock = 0x4000_5000 as *const _;
1473 ///Return the pointer to the register block
1474 #[inline(always)]
1475 pub const fn ptr() -> *const usart1::RegisterBlock {
1476 Self::PTR
1477 }
1478 /// Steal an instance of this peripheral
1479 ///
1480 /// # Safety
1481 ///
1482 /// Ensure that the new instance of the peripheral cannot be used in a way
1483 /// that may race with any existing instances, for example by only
1484 /// accessing read-only or write-only registers, or by consuming the
1485 /// original peripheral and using critical sections to coordinate
1486 /// access between multiple new instances.
1487 ///
1488 /// Additionally, other software such as HALs may rely on only one
1489 /// peripheral instance existing to ensure memory safety; ensure
1490 /// no stolen instances are passed to such software.
1491 pub unsafe fn steal() -> Self {
1492 Self { _marker: PhantomData }
1493 }
1494}
1495impl Deref for UART5 {
1496 type Target = usart1::RegisterBlock;
1497 #[inline(always)]
1498 fn deref(&self) -> &Self::Target {
1499 unsafe { &*Self::PTR }
1500 }
1501}
1502impl core::fmt::Debug for UART5 {
1503 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1504 f.debug_struct("UART5").finish()
1505 }
1506}
1507///Universal synchronous asynchronous receiver transmitter
1508pub use self::usart1 as uart5;
1509///Serial peripheral interface/Inter-IC sound
1510///
1511///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#SPI1)
1512pub struct SPI1 {
1513 _marker: PhantomData<*const ()>,
1514}
1515unsafe impl Send for SPI1 {}
1516impl SPI1 {
1517 ///Pointer to the register block
1518 pub const PTR: *const spi1::RegisterBlock = 0x4001_3000 as *const _;
1519 ///Return the pointer to the register block
1520 #[inline(always)]
1521 pub const fn ptr() -> *const spi1::RegisterBlock {
1522 Self::PTR
1523 }
1524 /// Steal an instance of this peripheral
1525 ///
1526 /// # Safety
1527 ///
1528 /// Ensure that the new instance of the peripheral cannot be used in a way
1529 /// that may race with any existing instances, for example by only
1530 /// accessing read-only or write-only registers, or by consuming the
1531 /// original peripheral and using critical sections to coordinate
1532 /// access between multiple new instances.
1533 ///
1534 /// Additionally, other software such as HALs may rely on only one
1535 /// peripheral instance existing to ensure memory safety; ensure
1536 /// no stolen instances are passed to such software.
1537 pub unsafe fn steal() -> Self {
1538 Self { _marker: PhantomData }
1539 }
1540}
1541impl Deref for SPI1 {
1542 type Target = spi1::RegisterBlock;
1543 #[inline(always)]
1544 fn deref(&self) -> &Self::Target {
1545 unsafe { &*Self::PTR }
1546 }
1547}
1548impl core::fmt::Debug for SPI1 {
1549 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1550 f.debug_struct("SPI1").finish()
1551 }
1552}
1553///Serial peripheral interface/Inter-IC sound
1554pub mod spi1;
1555///Serial peripheral interface/Inter-IC sound
1556///
1557///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#SPI1)
1558pub struct SPI2 {
1559 _marker: PhantomData<*const ()>,
1560}
1561unsafe impl Send for SPI2 {}
1562impl SPI2 {
1563 ///Pointer to the register block
1564 pub const PTR: *const spi1::RegisterBlock = 0x4000_3800 as *const _;
1565 ///Return the pointer to the register block
1566 #[inline(always)]
1567 pub const fn ptr() -> *const spi1::RegisterBlock {
1568 Self::PTR
1569 }
1570 /// Steal an instance of this peripheral
1571 ///
1572 /// # Safety
1573 ///
1574 /// Ensure that the new instance of the peripheral cannot be used in a way
1575 /// that may race with any existing instances, for example by only
1576 /// accessing read-only or write-only registers, or by consuming the
1577 /// original peripheral and using critical sections to coordinate
1578 /// access between multiple new instances.
1579 ///
1580 /// Additionally, other software such as HALs may rely on only one
1581 /// peripheral instance existing to ensure memory safety; ensure
1582 /// no stolen instances are passed to such software.
1583 pub unsafe fn steal() -> Self {
1584 Self { _marker: PhantomData }
1585 }
1586}
1587impl Deref for SPI2 {
1588 type Target = spi1::RegisterBlock;
1589 #[inline(always)]
1590 fn deref(&self) -> &Self::Target {
1591 unsafe { &*Self::PTR }
1592 }
1593}
1594impl core::fmt::Debug for SPI2 {
1595 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1596 f.debug_struct("SPI2").finish()
1597 }
1598}
1599///Serial peripheral interface/Inter-IC sound
1600pub use self::spi1 as spi2;
1601///Serial peripheral interface/Inter-IC sound
1602///
1603///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#SPI1)
1604pub struct SPI3 {
1605 _marker: PhantomData<*const ()>,
1606}
1607unsafe impl Send for SPI3 {}
1608impl SPI3 {
1609 ///Pointer to the register block
1610 pub const PTR: *const spi1::RegisterBlock = 0x4000_3c00 as *const _;
1611 ///Return the pointer to the register block
1612 #[inline(always)]
1613 pub const fn ptr() -> *const spi1::RegisterBlock {
1614 Self::PTR
1615 }
1616 /// Steal an instance of this peripheral
1617 ///
1618 /// # Safety
1619 ///
1620 /// Ensure that the new instance of the peripheral cannot be used in a way
1621 /// that may race with any existing instances, for example by only
1622 /// accessing read-only or write-only registers, or by consuming the
1623 /// original peripheral and using critical sections to coordinate
1624 /// access between multiple new instances.
1625 ///
1626 /// Additionally, other software such as HALs may rely on only one
1627 /// peripheral instance existing to ensure memory safety; ensure
1628 /// no stolen instances are passed to such software.
1629 pub unsafe fn steal() -> Self {
1630 Self { _marker: PhantomData }
1631 }
1632}
1633impl Deref for SPI3 {
1634 type Target = spi1::RegisterBlock;
1635 #[inline(always)]
1636 fn deref(&self) -> &Self::Target {
1637 unsafe { &*Self::PTR }
1638 }
1639}
1640impl core::fmt::Debug for SPI3 {
1641 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1642 f.debug_struct("SPI3").finish()
1643 }
1644}
1645///Serial peripheral interface/Inter-IC sound
1646pub use self::spi1 as spi3;
1647///Serial peripheral interface/Inter-IC sound
1648///
1649///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#SPI1)
1650pub struct SPI4 {
1651 _marker: PhantomData<*const ()>,
1652}
1653unsafe impl Send for SPI4 {}
1654impl SPI4 {
1655 ///Pointer to the register block
1656 pub const PTR: *const spi1::RegisterBlock = 0x4001_3c00 as *const _;
1657 ///Return the pointer to the register block
1658 #[inline(always)]
1659 pub const fn ptr() -> *const spi1::RegisterBlock {
1660 Self::PTR
1661 }
1662 /// Steal an instance of this peripheral
1663 ///
1664 /// # Safety
1665 ///
1666 /// Ensure that the new instance of the peripheral cannot be used in a way
1667 /// that may race with any existing instances, for example by only
1668 /// accessing read-only or write-only registers, or by consuming the
1669 /// original peripheral and using critical sections to coordinate
1670 /// access between multiple new instances.
1671 ///
1672 /// Additionally, other software such as HALs may rely on only one
1673 /// peripheral instance existing to ensure memory safety; ensure
1674 /// no stolen instances are passed to such software.
1675 pub unsafe fn steal() -> Self {
1676 Self { _marker: PhantomData }
1677 }
1678}
1679impl Deref for SPI4 {
1680 type Target = spi1::RegisterBlock;
1681 #[inline(always)]
1682 fn deref(&self) -> &Self::Target {
1683 unsafe { &*Self::PTR }
1684 }
1685}
1686impl core::fmt::Debug for SPI4 {
1687 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1688 f.debug_struct("SPI4").finish()
1689 }
1690}
1691///Serial peripheral interface/Inter-IC sound
1692pub use self::spi1 as spi4;
1693///Serial peripheral interface/Inter-IC sound
1694///
1695///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#I2S2ext)
1696pub struct I2S2EXT {
1697 _marker: PhantomData<*const ()>,
1698}
1699unsafe impl Send for I2S2EXT {}
1700impl I2S2EXT {
1701 ///Pointer to the register block
1702 pub const PTR: *const i2s2ext::RegisterBlock = 0x4000_3400 as *const _;
1703 ///Return the pointer to the register block
1704 #[inline(always)]
1705 pub const fn ptr() -> *const i2s2ext::RegisterBlock {
1706 Self::PTR
1707 }
1708 /// Steal an instance of this peripheral
1709 ///
1710 /// # Safety
1711 ///
1712 /// Ensure that the new instance of the peripheral cannot be used in a way
1713 /// that may race with any existing instances, for example by only
1714 /// accessing read-only or write-only registers, or by consuming the
1715 /// original peripheral and using critical sections to coordinate
1716 /// access between multiple new instances.
1717 ///
1718 /// Additionally, other software such as HALs may rely on only one
1719 /// peripheral instance existing to ensure memory safety; ensure
1720 /// no stolen instances are passed to such software.
1721 pub unsafe fn steal() -> Self {
1722 Self { _marker: PhantomData }
1723 }
1724}
1725impl Deref for I2S2EXT {
1726 type Target = i2s2ext::RegisterBlock;
1727 #[inline(always)]
1728 fn deref(&self) -> &Self::Target {
1729 unsafe { &*Self::PTR }
1730 }
1731}
1732impl core::fmt::Debug for I2S2EXT {
1733 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1734 f.debug_struct("I2S2EXT").finish()
1735 }
1736}
1737///Serial peripheral interface/Inter-IC sound
1738pub mod i2s2ext;
1739///Serial peripheral interface/Inter-IC sound
1740///
1741///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#I2S2ext)
1742pub struct I2S3EXT {
1743 _marker: PhantomData<*const ()>,
1744}
1745unsafe impl Send for I2S3EXT {}
1746impl I2S3EXT {
1747 ///Pointer to the register block
1748 pub const PTR: *const i2s2ext::RegisterBlock = 0x4000_4000 as *const _;
1749 ///Return the pointer to the register block
1750 #[inline(always)]
1751 pub const fn ptr() -> *const i2s2ext::RegisterBlock {
1752 Self::PTR
1753 }
1754 /// Steal an instance of this peripheral
1755 ///
1756 /// # Safety
1757 ///
1758 /// Ensure that the new instance of the peripheral cannot be used in a way
1759 /// that may race with any existing instances, for example by only
1760 /// accessing read-only or write-only registers, or by consuming the
1761 /// original peripheral and using critical sections to coordinate
1762 /// access between multiple new instances.
1763 ///
1764 /// Additionally, other software such as HALs may rely on only one
1765 /// peripheral instance existing to ensure memory safety; ensure
1766 /// no stolen instances are passed to such software.
1767 pub unsafe fn steal() -> Self {
1768 Self { _marker: PhantomData }
1769 }
1770}
1771impl Deref for I2S3EXT {
1772 type Target = i2s2ext::RegisterBlock;
1773 #[inline(always)]
1774 fn deref(&self) -> &Self::Target {
1775 unsafe { &*Self::PTR }
1776 }
1777}
1778impl core::fmt::Debug for I2S3EXT {
1779 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1780 f.debug_struct("I2S3EXT").finish()
1781 }
1782}
1783///Serial peripheral interface/Inter-IC sound
1784pub use self::i2s2ext as i2s3ext;
1785///External interrupt/event controller
1786///
1787///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#EXTI)
1788pub struct EXTI {
1789 _marker: PhantomData<*const ()>,
1790}
1791unsafe impl Send for EXTI {}
1792impl EXTI {
1793 ///Pointer to the register block
1794 pub const PTR: *const exti::RegisterBlock = 0x4001_0400 as *const _;
1795 ///Return the pointer to the register block
1796 #[inline(always)]
1797 pub const fn ptr() -> *const exti::RegisterBlock {
1798 Self::PTR
1799 }
1800 /// Steal an instance of this peripheral
1801 ///
1802 /// # Safety
1803 ///
1804 /// Ensure that the new instance of the peripheral cannot be used in a way
1805 /// that may race with any existing instances, for example by only
1806 /// accessing read-only or write-only registers, or by consuming the
1807 /// original peripheral and using critical sections to coordinate
1808 /// access between multiple new instances.
1809 ///
1810 /// Additionally, other software such as HALs may rely on only one
1811 /// peripheral instance existing to ensure memory safety; ensure
1812 /// no stolen instances are passed to such software.
1813 pub unsafe fn steal() -> Self {
1814 Self { _marker: PhantomData }
1815 }
1816}
1817impl Deref for EXTI {
1818 type Target = exti::RegisterBlock;
1819 #[inline(always)]
1820 fn deref(&self) -> &Self::Target {
1821 unsafe { &*Self::PTR }
1822 }
1823}
1824impl core::fmt::Debug for EXTI {
1825 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1826 f.debug_struct("EXTI").finish()
1827 }
1828}
1829///External interrupt/event controller
1830pub mod exti;
1831///Power control
1832///
1833///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#PWR)
1834pub struct PWR {
1835 _marker: PhantomData<*const ()>,
1836}
1837unsafe impl Send for PWR {}
1838impl PWR {
1839 ///Pointer to the register block
1840 pub const PTR: *const pwr::RegisterBlock = 0x4000_7000 as *const _;
1841 ///Return the pointer to the register block
1842 #[inline(always)]
1843 pub const fn ptr() -> *const pwr::RegisterBlock {
1844 Self::PTR
1845 }
1846 /// Steal an instance of this peripheral
1847 ///
1848 /// # Safety
1849 ///
1850 /// Ensure that the new instance of the peripheral cannot be used in a way
1851 /// that may race with any existing instances, for example by only
1852 /// accessing read-only or write-only registers, or by consuming the
1853 /// original peripheral and using critical sections to coordinate
1854 /// access between multiple new instances.
1855 ///
1856 /// Additionally, other software such as HALs may rely on only one
1857 /// peripheral instance existing to ensure memory safety; ensure
1858 /// no stolen instances are passed to such software.
1859 pub unsafe fn steal() -> Self {
1860 Self { _marker: PhantomData }
1861 }
1862}
1863impl Deref for PWR {
1864 type Target = pwr::RegisterBlock;
1865 #[inline(always)]
1866 fn deref(&self) -> &Self::Target {
1867 unsafe { &*Self::PTR }
1868 }
1869}
1870impl core::fmt::Debug for PWR {
1871 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1872 f.debug_struct("PWR").finish()
1873 }
1874}
1875///Power control
1876pub mod pwr;
1877///Controller area network
1878///
1879///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#CAN)
1880pub struct CAN {
1881 _marker: PhantomData<*const ()>,
1882}
1883unsafe impl Send for CAN {}
1884impl CAN {
1885 ///Pointer to the register block
1886 pub const PTR: *const can::RegisterBlock = 0x4000_6400 as *const _;
1887 ///Return the pointer to the register block
1888 #[inline(always)]
1889 pub const fn ptr() -> *const can::RegisterBlock {
1890 Self::PTR
1891 }
1892 /// Steal an instance of this peripheral
1893 ///
1894 /// # Safety
1895 ///
1896 /// Ensure that the new instance of the peripheral cannot be used in a way
1897 /// that may race with any existing instances, for example by only
1898 /// accessing read-only or write-only registers, or by consuming the
1899 /// original peripheral and using critical sections to coordinate
1900 /// access between multiple new instances.
1901 ///
1902 /// Additionally, other software such as HALs may rely on only one
1903 /// peripheral instance existing to ensure memory safety; ensure
1904 /// no stolen instances are passed to such software.
1905 pub unsafe fn steal() -> Self {
1906 Self { _marker: PhantomData }
1907 }
1908}
1909impl Deref for CAN {
1910 type Target = can::RegisterBlock;
1911 #[inline(always)]
1912 fn deref(&self) -> &Self::Target {
1913 unsafe { &*Self::PTR }
1914 }
1915}
1916impl core::fmt::Debug for CAN {
1917 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1918 f.debug_struct("CAN").finish()
1919 }
1920}
1921///Controller area network
1922pub mod can;
1923///Universal serial bus full-speed device interface
1924///
1925///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#USB)
1926pub struct USB {
1927 _marker: PhantomData<*const ()>,
1928}
1929unsafe impl Send for USB {}
1930impl USB {
1931 ///Pointer to the register block
1932 pub const PTR: *const usb::RegisterBlock = 0x4000_5c00 as *const _;
1933 ///Return the pointer to the register block
1934 #[inline(always)]
1935 pub const fn ptr() -> *const usb::RegisterBlock {
1936 Self::PTR
1937 }
1938 /// Steal an instance of this peripheral
1939 ///
1940 /// # Safety
1941 ///
1942 /// Ensure that the new instance of the peripheral cannot be used in a way
1943 /// that may race with any existing instances, for example by only
1944 /// accessing read-only or write-only registers, or by consuming the
1945 /// original peripheral and using critical sections to coordinate
1946 /// access between multiple new instances.
1947 ///
1948 /// Additionally, other software such as HALs may rely on only one
1949 /// peripheral instance existing to ensure memory safety; ensure
1950 /// no stolen instances are passed to such software.
1951 pub unsafe fn steal() -> Self {
1952 Self { _marker: PhantomData }
1953 }
1954}
1955impl Deref for USB {
1956 type Target = usb::RegisterBlock;
1957 #[inline(always)]
1958 fn deref(&self) -> &Self::Target {
1959 unsafe { &*Self::PTR }
1960 }
1961}
1962impl core::fmt::Debug for USB {
1963 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1964 f.debug_struct("USB").finish()
1965 }
1966}
1967///Universal serial bus full-speed device interface
1968pub mod usb;
1969///Inter-integrated circuit
1970///
1971///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#I2C1)
1972pub struct I2C1 {
1973 _marker: PhantomData<*const ()>,
1974}
1975unsafe impl Send for I2C1 {}
1976impl I2C1 {
1977 ///Pointer to the register block
1978 pub const PTR: *const i2c1::RegisterBlock = 0x4000_5400 as *const _;
1979 ///Return the pointer to the register block
1980 #[inline(always)]
1981 pub const fn ptr() -> *const i2c1::RegisterBlock {
1982 Self::PTR
1983 }
1984 /// Steal an instance of this peripheral
1985 ///
1986 /// # Safety
1987 ///
1988 /// Ensure that the new instance of the peripheral cannot be used in a way
1989 /// that may race with any existing instances, for example by only
1990 /// accessing read-only or write-only registers, or by consuming the
1991 /// original peripheral and using critical sections to coordinate
1992 /// access between multiple new instances.
1993 ///
1994 /// Additionally, other software such as HALs may rely on only one
1995 /// peripheral instance existing to ensure memory safety; ensure
1996 /// no stolen instances are passed to such software.
1997 pub unsafe fn steal() -> Self {
1998 Self { _marker: PhantomData }
1999 }
2000}
2001impl Deref for I2C1 {
2002 type Target = i2c1::RegisterBlock;
2003 #[inline(always)]
2004 fn deref(&self) -> &Self::Target {
2005 unsafe { &*Self::PTR }
2006 }
2007}
2008impl core::fmt::Debug for I2C1 {
2009 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2010 f.debug_struct("I2C1").finish()
2011 }
2012}
2013///Inter-integrated circuit
2014pub mod i2c1;
2015///Inter-integrated circuit
2016///
2017///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#I2C1)
2018pub struct I2C2 {
2019 _marker: PhantomData<*const ()>,
2020}
2021unsafe impl Send for I2C2 {}
2022impl I2C2 {
2023 ///Pointer to the register block
2024 pub const PTR: *const i2c1::RegisterBlock = 0x4000_5800 as *const _;
2025 ///Return the pointer to the register block
2026 #[inline(always)]
2027 pub const fn ptr() -> *const i2c1::RegisterBlock {
2028 Self::PTR
2029 }
2030 /// Steal an instance of this peripheral
2031 ///
2032 /// # Safety
2033 ///
2034 /// Ensure that the new instance of the peripheral cannot be used in a way
2035 /// that may race with any existing instances, for example by only
2036 /// accessing read-only or write-only registers, or by consuming the
2037 /// original peripheral and using critical sections to coordinate
2038 /// access between multiple new instances.
2039 ///
2040 /// Additionally, other software such as HALs may rely on only one
2041 /// peripheral instance existing to ensure memory safety; ensure
2042 /// no stolen instances are passed to such software.
2043 pub unsafe fn steal() -> Self {
2044 Self { _marker: PhantomData }
2045 }
2046}
2047impl Deref for I2C2 {
2048 type Target = i2c1::RegisterBlock;
2049 #[inline(always)]
2050 fn deref(&self) -> &Self::Target {
2051 unsafe { &*Self::PTR }
2052 }
2053}
2054impl core::fmt::Debug for I2C2 {
2055 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2056 f.debug_struct("I2C2").finish()
2057 }
2058}
2059///Inter-integrated circuit
2060pub use self::i2c1 as i2c2;
2061///Inter-integrated circuit
2062///
2063///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#I2C1)
2064pub struct I2C3 {
2065 _marker: PhantomData<*const ()>,
2066}
2067unsafe impl Send for I2C3 {}
2068impl I2C3 {
2069 ///Pointer to the register block
2070 pub const PTR: *const i2c1::RegisterBlock = 0x4000_7800 as *const _;
2071 ///Return the pointer to the register block
2072 #[inline(always)]
2073 pub const fn ptr() -> *const i2c1::RegisterBlock {
2074 Self::PTR
2075 }
2076 /// Steal an instance of this peripheral
2077 ///
2078 /// # Safety
2079 ///
2080 /// Ensure that the new instance of the peripheral cannot be used in a way
2081 /// that may race with any existing instances, for example by only
2082 /// accessing read-only or write-only registers, or by consuming the
2083 /// original peripheral and using critical sections to coordinate
2084 /// access between multiple new instances.
2085 ///
2086 /// Additionally, other software such as HALs may rely on only one
2087 /// peripheral instance existing to ensure memory safety; ensure
2088 /// no stolen instances are passed to such software.
2089 pub unsafe fn steal() -> Self {
2090 Self { _marker: PhantomData }
2091 }
2092}
2093impl Deref for I2C3 {
2094 type Target = i2c1::RegisterBlock;
2095 #[inline(always)]
2096 fn deref(&self) -> &Self::Target {
2097 unsafe { &*Self::PTR }
2098 }
2099}
2100impl core::fmt::Debug for I2C3 {
2101 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2102 f.debug_struct("I2C3").finish()
2103 }
2104}
2105///Inter-integrated circuit
2106pub use self::i2c1 as i2c3;
2107///Independent watchdog
2108///
2109///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#IWDG)
2110pub struct IWDG {
2111 _marker: PhantomData<*const ()>,
2112}
2113unsafe impl Send for IWDG {}
2114impl IWDG {
2115 ///Pointer to the register block
2116 pub const PTR: *const iwdg::RegisterBlock = 0x4000_3000 as *const _;
2117 ///Return the pointer to the register block
2118 #[inline(always)]
2119 pub const fn ptr() -> *const iwdg::RegisterBlock {
2120 Self::PTR
2121 }
2122 /// Steal an instance of this peripheral
2123 ///
2124 /// # Safety
2125 ///
2126 /// Ensure that the new instance of the peripheral cannot be used in a way
2127 /// that may race with any existing instances, for example by only
2128 /// accessing read-only or write-only registers, or by consuming the
2129 /// original peripheral and using critical sections to coordinate
2130 /// access between multiple new instances.
2131 ///
2132 /// Additionally, other software such as HALs may rely on only one
2133 /// peripheral instance existing to ensure memory safety; ensure
2134 /// no stolen instances are passed to such software.
2135 pub unsafe fn steal() -> Self {
2136 Self { _marker: PhantomData }
2137 }
2138}
2139impl Deref for IWDG {
2140 type Target = iwdg::RegisterBlock;
2141 #[inline(always)]
2142 fn deref(&self) -> &Self::Target {
2143 unsafe { &*Self::PTR }
2144 }
2145}
2146impl core::fmt::Debug for IWDG {
2147 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2148 f.debug_struct("IWDG").finish()
2149 }
2150}
2151///Independent watchdog
2152pub mod iwdg;
2153///Window watchdog
2154///
2155///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#WWDG)
2156pub struct WWDG {
2157 _marker: PhantomData<*const ()>,
2158}
2159unsafe impl Send for WWDG {}
2160impl WWDG {
2161 ///Pointer to the register block
2162 pub const PTR: *const wwdg::RegisterBlock = 0x4000_2c00 as *const _;
2163 ///Return the pointer to the register block
2164 #[inline(always)]
2165 pub const fn ptr() -> *const wwdg::RegisterBlock {
2166 Self::PTR
2167 }
2168 /// Steal an instance of this peripheral
2169 ///
2170 /// # Safety
2171 ///
2172 /// Ensure that the new instance of the peripheral cannot be used in a way
2173 /// that may race with any existing instances, for example by only
2174 /// accessing read-only or write-only registers, or by consuming the
2175 /// original peripheral and using critical sections to coordinate
2176 /// access between multiple new instances.
2177 ///
2178 /// Additionally, other software such as HALs may rely on only one
2179 /// peripheral instance existing to ensure memory safety; ensure
2180 /// no stolen instances are passed to such software.
2181 pub unsafe fn steal() -> Self {
2182 Self { _marker: PhantomData }
2183 }
2184}
2185impl Deref for WWDG {
2186 type Target = wwdg::RegisterBlock;
2187 #[inline(always)]
2188 fn deref(&self) -> &Self::Target {
2189 unsafe { &*Self::PTR }
2190 }
2191}
2192impl core::fmt::Debug for WWDG {
2193 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2194 f.debug_struct("WWDG").finish()
2195 }
2196}
2197///Window watchdog
2198pub mod wwdg;
2199///Real-time clock
2200///
2201///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC)
2202pub struct RTC {
2203 _marker: PhantomData<*const ()>,
2204}
2205unsafe impl Send for RTC {}
2206impl RTC {
2207 ///Pointer to the register block
2208 pub const PTR: *const rtc::RegisterBlock = 0x4000_2800 as *const _;
2209 ///Return the pointer to the register block
2210 #[inline(always)]
2211 pub const fn ptr() -> *const rtc::RegisterBlock {
2212 Self::PTR
2213 }
2214 /// Steal an instance of this peripheral
2215 ///
2216 /// # Safety
2217 ///
2218 /// Ensure that the new instance of the peripheral cannot be used in a way
2219 /// that may race with any existing instances, for example by only
2220 /// accessing read-only or write-only registers, or by consuming the
2221 /// original peripheral and using critical sections to coordinate
2222 /// access between multiple new instances.
2223 ///
2224 /// Additionally, other software such as HALs may rely on only one
2225 /// peripheral instance existing to ensure memory safety; ensure
2226 /// no stolen instances are passed to such software.
2227 pub unsafe fn steal() -> Self {
2228 Self { _marker: PhantomData }
2229 }
2230}
2231impl Deref for RTC {
2232 type Target = rtc::RegisterBlock;
2233 #[inline(always)]
2234 fn deref(&self) -> &Self::Target {
2235 unsafe { &*Self::PTR }
2236 }
2237}
2238impl core::fmt::Debug for RTC {
2239 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2240 f.debug_struct("RTC").finish()
2241 }
2242}
2243///Real-time clock
2244pub mod rtc;
2245///Basic timers
2246///
2247///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TIM6)
2248pub struct TIM6 {
2249 _marker: PhantomData<*const ()>,
2250}
2251unsafe impl Send for TIM6 {}
2252impl TIM6 {
2253 ///Pointer to the register block
2254 pub const PTR: *const tim6::RegisterBlock = 0x4000_1000 as *const _;
2255 ///Return the pointer to the register block
2256 #[inline(always)]
2257 pub const fn ptr() -> *const tim6::RegisterBlock {
2258 Self::PTR
2259 }
2260 /// Steal an instance of this peripheral
2261 ///
2262 /// # Safety
2263 ///
2264 /// Ensure that the new instance of the peripheral cannot be used in a way
2265 /// that may race with any existing instances, for example by only
2266 /// accessing read-only or write-only registers, or by consuming the
2267 /// original peripheral and using critical sections to coordinate
2268 /// access between multiple new instances.
2269 ///
2270 /// Additionally, other software such as HALs may rely on only one
2271 /// peripheral instance existing to ensure memory safety; ensure
2272 /// no stolen instances are passed to such software.
2273 pub unsafe fn steal() -> Self {
2274 Self { _marker: PhantomData }
2275 }
2276}
2277impl Deref for TIM6 {
2278 type Target = tim6::RegisterBlock;
2279 #[inline(always)]
2280 fn deref(&self) -> &Self::Target {
2281 unsafe { &*Self::PTR }
2282 }
2283}
2284impl core::fmt::Debug for TIM6 {
2285 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2286 f.debug_struct("TIM6").finish()
2287 }
2288}
2289///Basic timers
2290pub mod tim6;
2291///Basic timers
2292///
2293///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TIM6)
2294pub struct TIM7 {
2295 _marker: PhantomData<*const ()>,
2296}
2297unsafe impl Send for TIM7 {}
2298impl TIM7 {
2299 ///Pointer to the register block
2300 pub const PTR: *const tim6::RegisterBlock = 0x4000_1400 as *const _;
2301 ///Return the pointer to the register block
2302 #[inline(always)]
2303 pub const fn ptr() -> *const tim6::RegisterBlock {
2304 Self::PTR
2305 }
2306 /// Steal an instance of this peripheral
2307 ///
2308 /// # Safety
2309 ///
2310 /// Ensure that the new instance of the peripheral cannot be used in a way
2311 /// that may race with any existing instances, for example by only
2312 /// accessing read-only or write-only registers, or by consuming the
2313 /// original peripheral and using critical sections to coordinate
2314 /// access between multiple new instances.
2315 ///
2316 /// Additionally, other software such as HALs may rely on only one
2317 /// peripheral instance existing to ensure memory safety; ensure
2318 /// no stolen instances are passed to such software.
2319 pub unsafe fn steal() -> Self {
2320 Self { _marker: PhantomData }
2321 }
2322}
2323impl Deref for TIM7 {
2324 type Target = tim6::RegisterBlock;
2325 #[inline(always)]
2326 fn deref(&self) -> &Self::Target {
2327 unsafe { &*Self::PTR }
2328 }
2329}
2330impl core::fmt::Debug for TIM7 {
2331 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2332 f.debug_struct("TIM7").finish()
2333 }
2334}
2335///Basic timers
2336pub use self::tim6 as tim7;
2337///Digital-to-analog converter
2338///
2339///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#DAC1)
2340pub struct DAC1 {
2341 _marker: PhantomData<*const ()>,
2342}
2343unsafe impl Send for DAC1 {}
2344impl DAC1 {
2345 ///Pointer to the register block
2346 pub const PTR: *const dac1::RegisterBlock = 0x4000_7400 as *const _;
2347 ///Return the pointer to the register block
2348 #[inline(always)]
2349 pub const fn ptr() -> *const dac1::RegisterBlock {
2350 Self::PTR
2351 }
2352 /// Steal an instance of this peripheral
2353 ///
2354 /// # Safety
2355 ///
2356 /// Ensure that the new instance of the peripheral cannot be used in a way
2357 /// that may race with any existing instances, for example by only
2358 /// accessing read-only or write-only registers, or by consuming the
2359 /// original peripheral and using critical sections to coordinate
2360 /// access between multiple new instances.
2361 ///
2362 /// Additionally, other software such as HALs may rely on only one
2363 /// peripheral instance existing to ensure memory safety; ensure
2364 /// no stolen instances are passed to such software.
2365 pub unsafe fn steal() -> Self {
2366 Self { _marker: PhantomData }
2367 }
2368}
2369impl Deref for DAC1 {
2370 type Target = dac1::RegisterBlock;
2371 #[inline(always)]
2372 fn deref(&self) -> &Self::Target {
2373 unsafe { &*Self::PTR }
2374 }
2375}
2376impl core::fmt::Debug for DAC1 {
2377 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2378 f.debug_struct("DAC1").finish()
2379 }
2380}
2381///Digital-to-analog converter
2382pub mod dac1;
2383///Debug support
2384///
2385///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#DBGMCU)
2386pub struct DBGMCU {
2387 _marker: PhantomData<*const ()>,
2388}
2389unsafe impl Send for DBGMCU {}
2390impl DBGMCU {
2391 ///Pointer to the register block
2392 pub const PTR: *const dbgmcu::RegisterBlock = 0xe004_2000 as *const _;
2393 ///Return the pointer to the register block
2394 #[inline(always)]
2395 pub const fn ptr() -> *const dbgmcu::RegisterBlock {
2396 Self::PTR
2397 }
2398 /// Steal an instance of this peripheral
2399 ///
2400 /// # Safety
2401 ///
2402 /// Ensure that the new instance of the peripheral cannot be used in a way
2403 /// that may race with any existing instances, for example by only
2404 /// accessing read-only or write-only registers, or by consuming the
2405 /// original peripheral and using critical sections to coordinate
2406 /// access between multiple new instances.
2407 ///
2408 /// Additionally, other software such as HALs may rely on only one
2409 /// peripheral instance existing to ensure memory safety; ensure
2410 /// no stolen instances are passed to such software.
2411 pub unsafe fn steal() -> Self {
2412 Self { _marker: PhantomData }
2413 }
2414}
2415impl Deref for DBGMCU {
2416 type Target = dbgmcu::RegisterBlock;
2417 #[inline(always)]
2418 fn deref(&self) -> &Self::Target {
2419 unsafe { &*Self::PTR }
2420 }
2421}
2422impl core::fmt::Debug for DBGMCU {
2423 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2424 f.debug_struct("DBGMCU").finish()
2425 }
2426}
2427///Debug support
2428pub mod dbgmcu;
2429///Advanced timer
2430///
2431///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TIM1)
2432pub struct TIM1 {
2433 _marker: PhantomData<*const ()>,
2434}
2435unsafe impl Send for TIM1 {}
2436impl TIM1 {
2437 ///Pointer to the register block
2438 pub const PTR: *const tim1::RegisterBlock = 0x4001_2c00 as *const _;
2439 ///Return the pointer to the register block
2440 #[inline(always)]
2441 pub const fn ptr() -> *const tim1::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 TIM1 {
2462 type Target = tim1::RegisterBlock;
2463 #[inline(always)]
2464 fn deref(&self) -> &Self::Target {
2465 unsafe { &*Self::PTR }
2466 }
2467}
2468impl core::fmt::Debug for TIM1 {
2469 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2470 f.debug_struct("TIM1").finish()
2471 }
2472}
2473///Advanced timer
2474pub mod tim1;
2475///Advanced timer
2476///
2477///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TIM1)
2478pub struct TIM20 {
2479 _marker: PhantomData<*const ()>,
2480}
2481unsafe impl Send for TIM20 {}
2482impl TIM20 {
2483 ///Pointer to the register block
2484 pub const PTR: *const tim1::RegisterBlock = 0x4001_5000 as *const _;
2485 ///Return the pointer to the register block
2486 #[inline(always)]
2487 pub const fn ptr() -> *const tim1::RegisterBlock {
2488 Self::PTR
2489 }
2490 /// Steal an instance of this peripheral
2491 ///
2492 /// # Safety
2493 ///
2494 /// Ensure that the new instance of the peripheral cannot be used in a way
2495 /// that may race with any existing instances, for example by only
2496 /// accessing read-only or write-only registers, or by consuming the
2497 /// original peripheral and using critical sections to coordinate
2498 /// access between multiple new instances.
2499 ///
2500 /// Additionally, other software such as HALs may rely on only one
2501 /// peripheral instance existing to ensure memory safety; ensure
2502 /// no stolen instances are passed to such software.
2503 pub unsafe fn steal() -> Self {
2504 Self { _marker: PhantomData }
2505 }
2506}
2507impl Deref for TIM20 {
2508 type Target = tim1::RegisterBlock;
2509 #[inline(always)]
2510 fn deref(&self) -> &Self::Target {
2511 unsafe { &*Self::PTR }
2512 }
2513}
2514impl core::fmt::Debug for TIM20 {
2515 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2516 f.debug_struct("TIM20").finish()
2517 }
2518}
2519///Advanced timer
2520pub use self::tim1 as tim20;
2521///Advanced-timers
2522///
2523///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#TIM8)
2524pub struct TIM8 {
2525 _marker: PhantomData<*const ()>,
2526}
2527unsafe impl Send for TIM8 {}
2528impl TIM8 {
2529 ///Pointer to the register block
2530 pub const PTR: *const tim8::RegisterBlock = 0x4001_3400 as *const _;
2531 ///Return the pointer to the register block
2532 #[inline(always)]
2533 pub const fn ptr() -> *const tim8::RegisterBlock {
2534 Self::PTR
2535 }
2536 /// Steal an instance of this peripheral
2537 ///
2538 /// # Safety
2539 ///
2540 /// Ensure that the new instance of the peripheral cannot be used in a way
2541 /// that may race with any existing instances, for example by only
2542 /// accessing read-only or write-only registers, or by consuming the
2543 /// original peripheral and using critical sections to coordinate
2544 /// access between multiple new instances.
2545 ///
2546 /// Additionally, other software such as HALs may rely on only one
2547 /// peripheral instance existing to ensure memory safety; ensure
2548 /// no stolen instances are passed to such software.
2549 pub unsafe fn steal() -> Self {
2550 Self { _marker: PhantomData }
2551 }
2552}
2553impl Deref for TIM8 {
2554 type Target = tim8::RegisterBlock;
2555 #[inline(always)]
2556 fn deref(&self) -> &Self::Target {
2557 unsafe { &*Self::PTR }
2558 }
2559}
2560impl core::fmt::Debug for TIM8 {
2561 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2562 f.debug_struct("TIM8").finish()
2563 }
2564}
2565///Advanced-timers
2566pub mod tim8;
2567///Analog-to-Digital Converter
2568///
2569///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#ADC1)
2570pub struct ADC1 {
2571 _marker: PhantomData<*const ()>,
2572}
2573unsafe impl Send for ADC1 {}
2574impl ADC1 {
2575 ///Pointer to the register block
2576 pub const PTR: *const adc1::RegisterBlock = 0x5000_0000 as *const _;
2577 ///Return the pointer to the register block
2578 #[inline(always)]
2579 pub const fn ptr() -> *const adc1::RegisterBlock {
2580 Self::PTR
2581 }
2582 /// Steal an instance of this peripheral
2583 ///
2584 /// # Safety
2585 ///
2586 /// Ensure that the new instance of the peripheral cannot be used in a way
2587 /// that may race with any existing instances, for example by only
2588 /// accessing read-only or write-only registers, or by consuming the
2589 /// original peripheral and using critical sections to coordinate
2590 /// access between multiple new instances.
2591 ///
2592 /// Additionally, other software such as HALs may rely on only one
2593 /// peripheral instance existing to ensure memory safety; ensure
2594 /// no stolen instances are passed to such software.
2595 pub unsafe fn steal() -> Self {
2596 Self { _marker: PhantomData }
2597 }
2598}
2599impl Deref for ADC1 {
2600 type Target = adc1::RegisterBlock;
2601 #[inline(always)]
2602 fn deref(&self) -> &Self::Target {
2603 unsafe { &*Self::PTR }
2604 }
2605}
2606impl core::fmt::Debug for ADC1 {
2607 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2608 f.debug_struct("ADC1").finish()
2609 }
2610}
2611///Analog-to-Digital Converter
2612pub mod adc1;
2613///Analog-to-Digital Converter
2614///
2615///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#ADC1)
2616pub struct ADC2 {
2617 _marker: PhantomData<*const ()>,
2618}
2619unsafe impl Send for ADC2 {}
2620impl ADC2 {
2621 ///Pointer to the register block
2622 pub const PTR: *const adc1::RegisterBlock = 0x5000_0100 as *const _;
2623 ///Return the pointer to the register block
2624 #[inline(always)]
2625 pub const fn ptr() -> *const adc1::RegisterBlock {
2626 Self::PTR
2627 }
2628 /// Steal an instance of this peripheral
2629 ///
2630 /// # Safety
2631 ///
2632 /// Ensure that the new instance of the peripheral cannot be used in a way
2633 /// that may race with any existing instances, for example by only
2634 /// accessing read-only or write-only registers, or by consuming the
2635 /// original peripheral and using critical sections to coordinate
2636 /// access between multiple new instances.
2637 ///
2638 /// Additionally, other software such as HALs may rely on only one
2639 /// peripheral instance existing to ensure memory safety; ensure
2640 /// no stolen instances are passed to such software.
2641 pub unsafe fn steal() -> Self {
2642 Self { _marker: PhantomData }
2643 }
2644}
2645impl Deref for ADC2 {
2646 type Target = adc1::RegisterBlock;
2647 #[inline(always)]
2648 fn deref(&self) -> &Self::Target {
2649 unsafe { &*Self::PTR }
2650 }
2651}
2652impl core::fmt::Debug for ADC2 {
2653 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2654 f.debug_struct("ADC2").finish()
2655 }
2656}
2657///Analog-to-Digital Converter
2658pub use self::adc1 as adc2;
2659///Analog-to-Digital Converter
2660///
2661///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#ADC1)
2662pub struct ADC3 {
2663 _marker: PhantomData<*const ()>,
2664}
2665unsafe impl Send for ADC3 {}
2666impl ADC3 {
2667 ///Pointer to the register block
2668 pub const PTR: *const adc1::RegisterBlock = 0x5000_0400 as *const _;
2669 ///Return the pointer to the register block
2670 #[inline(always)]
2671 pub const fn ptr() -> *const adc1::RegisterBlock {
2672 Self::PTR
2673 }
2674 /// Steal an instance of this peripheral
2675 ///
2676 /// # Safety
2677 ///
2678 /// Ensure that the new instance of the peripheral cannot be used in a way
2679 /// that may race with any existing instances, for example by only
2680 /// accessing read-only or write-only registers, or by consuming the
2681 /// original peripheral and using critical sections to coordinate
2682 /// access between multiple new instances.
2683 ///
2684 /// Additionally, other software such as HALs may rely on only one
2685 /// peripheral instance existing to ensure memory safety; ensure
2686 /// no stolen instances are passed to such software.
2687 pub unsafe fn steal() -> Self {
2688 Self { _marker: PhantomData }
2689 }
2690}
2691impl Deref for ADC3 {
2692 type Target = adc1::RegisterBlock;
2693 #[inline(always)]
2694 fn deref(&self) -> &Self::Target {
2695 unsafe { &*Self::PTR }
2696 }
2697}
2698impl core::fmt::Debug for ADC3 {
2699 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2700 f.debug_struct("ADC3").finish()
2701 }
2702}
2703///Analog-to-Digital Converter
2704pub use self::adc1 as adc3;
2705///Analog-to-Digital Converter
2706///
2707///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#ADC1)
2708pub struct ADC4 {
2709 _marker: PhantomData<*const ()>,
2710}
2711unsafe impl Send for ADC4 {}
2712impl ADC4 {
2713 ///Pointer to the register block
2714 pub const PTR: *const adc1::RegisterBlock = 0x5000_0500 as *const _;
2715 ///Return the pointer to the register block
2716 #[inline(always)]
2717 pub const fn ptr() -> *const adc1::RegisterBlock {
2718 Self::PTR
2719 }
2720 /// Steal an instance of this peripheral
2721 ///
2722 /// # Safety
2723 ///
2724 /// Ensure that the new instance of the peripheral cannot be used in a way
2725 /// that may race with any existing instances, for example by only
2726 /// accessing read-only or write-only registers, or by consuming the
2727 /// original peripheral and using critical sections to coordinate
2728 /// access between multiple new instances.
2729 ///
2730 /// Additionally, other software such as HALs may rely on only one
2731 /// peripheral instance existing to ensure memory safety; ensure
2732 /// no stolen instances are passed to such software.
2733 pub unsafe fn steal() -> Self {
2734 Self { _marker: PhantomData }
2735 }
2736}
2737impl Deref for ADC4 {
2738 type Target = adc1::RegisterBlock;
2739 #[inline(always)]
2740 fn deref(&self) -> &Self::Target {
2741 unsafe { &*Self::PTR }
2742 }
2743}
2744impl core::fmt::Debug for ADC4 {
2745 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2746 f.debug_struct("ADC4").finish()
2747 }
2748}
2749///Analog-to-Digital Converter
2750pub use self::adc1 as adc4;
2751///Analog-to-Digital Converter
2752///
2753///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#ADC1_2)
2754pub struct ADC1_2 {
2755 _marker: PhantomData<*const ()>,
2756}
2757unsafe impl Send for ADC1_2 {}
2758impl ADC1_2 {
2759 ///Pointer to the register block
2760 pub const PTR: *const adc1_2::RegisterBlock = 0x5000_0300 as *const _;
2761 ///Return the pointer to the register block
2762 #[inline(always)]
2763 pub const fn ptr() -> *const adc1_2::RegisterBlock {
2764 Self::PTR
2765 }
2766 /// Steal an instance of this peripheral
2767 ///
2768 /// # Safety
2769 ///
2770 /// Ensure that the new instance of the peripheral cannot be used in a way
2771 /// that may race with any existing instances, for example by only
2772 /// accessing read-only or write-only registers, or by consuming the
2773 /// original peripheral and using critical sections to coordinate
2774 /// access between multiple new instances.
2775 ///
2776 /// Additionally, other software such as HALs may rely on only one
2777 /// peripheral instance existing to ensure memory safety; ensure
2778 /// no stolen instances are passed to such software.
2779 pub unsafe fn steal() -> Self {
2780 Self { _marker: PhantomData }
2781 }
2782}
2783impl Deref for ADC1_2 {
2784 type Target = adc1_2::RegisterBlock;
2785 #[inline(always)]
2786 fn deref(&self) -> &Self::Target {
2787 unsafe { &*Self::PTR }
2788 }
2789}
2790impl core::fmt::Debug for ADC1_2 {
2791 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2792 f.debug_struct("ADC1_2").finish()
2793 }
2794}
2795///Analog-to-Digital Converter
2796pub mod adc1_2;
2797///Analog-to-Digital Converter
2798///
2799///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#ADC1_2)
2800pub struct ADC3_4 {
2801 _marker: PhantomData<*const ()>,
2802}
2803unsafe impl Send for ADC3_4 {}
2804impl ADC3_4 {
2805 ///Pointer to the register block
2806 pub const PTR: *const adc1_2::RegisterBlock = 0x5000_0700 as *const _;
2807 ///Return the pointer to the register block
2808 #[inline(always)]
2809 pub const fn ptr() -> *const adc1_2::RegisterBlock {
2810 Self::PTR
2811 }
2812 /// Steal an instance of this peripheral
2813 ///
2814 /// # Safety
2815 ///
2816 /// Ensure that the new instance of the peripheral cannot be used in a way
2817 /// that may race with any existing instances, for example by only
2818 /// accessing read-only or write-only registers, or by consuming the
2819 /// original peripheral and using critical sections to coordinate
2820 /// access between multiple new instances.
2821 ///
2822 /// Additionally, other software such as HALs may rely on only one
2823 /// peripheral instance existing to ensure memory safety; ensure
2824 /// no stolen instances are passed to such software.
2825 pub unsafe fn steal() -> Self {
2826 Self { _marker: PhantomData }
2827 }
2828}
2829impl Deref for ADC3_4 {
2830 type Target = adc1_2::RegisterBlock;
2831 #[inline(always)]
2832 fn deref(&self) -> &Self::Target {
2833 unsafe { &*Self::PTR }
2834 }
2835}
2836impl core::fmt::Debug for ADC3_4 {
2837 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2838 f.debug_struct("ADC3_4").finish()
2839 }
2840}
2841///Analog-to-Digital Converter
2842pub use self::adc1_2 as adc3_4;
2843///System configuration controller
2844///
2845///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#SYSCFG)
2846pub struct SYSCFG {
2847 _marker: PhantomData<*const ()>,
2848}
2849unsafe impl Send for SYSCFG {}
2850impl SYSCFG {
2851 ///Pointer to the register block
2852 pub const PTR: *const syscfg::RegisterBlock = 0x4001_0000 as *const _;
2853 ///Return the pointer to the register block
2854 #[inline(always)]
2855 pub const fn ptr() -> *const syscfg::RegisterBlock {
2856 Self::PTR
2857 }
2858 /// Steal an instance of this peripheral
2859 ///
2860 /// # Safety
2861 ///
2862 /// Ensure that the new instance of the peripheral cannot be used in a way
2863 /// that may race with any existing instances, for example by only
2864 /// accessing read-only or write-only registers, or by consuming the
2865 /// original peripheral and using critical sections to coordinate
2866 /// access between multiple new instances.
2867 ///
2868 /// Additionally, other software such as HALs may rely on only one
2869 /// peripheral instance existing to ensure memory safety; ensure
2870 /// no stolen instances are passed to such software.
2871 pub unsafe fn steal() -> Self {
2872 Self { _marker: PhantomData }
2873 }
2874}
2875impl Deref for SYSCFG {
2876 type Target = syscfg::RegisterBlock;
2877 #[inline(always)]
2878 fn deref(&self) -> &Self::Target {
2879 unsafe { &*Self::PTR }
2880 }
2881}
2882impl core::fmt::Debug for SYSCFG {
2883 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2884 f.debug_struct("SYSCFG").finish()
2885 }
2886}
2887///System configuration controller
2888pub mod syscfg;
2889///Flexible memory controller
2890///
2891///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#FMC)
2892pub struct FMC {
2893 _marker: PhantomData<*const ()>,
2894}
2895unsafe impl Send for FMC {}
2896impl FMC {
2897 ///Pointer to the register block
2898 pub const PTR: *const fmc::RegisterBlock = 0xa000_0400 as *const _;
2899 ///Return the pointer to the register block
2900 #[inline(always)]
2901 pub const fn ptr() -> *const fmc::RegisterBlock {
2902 Self::PTR
2903 }
2904 /// Steal an instance of this peripheral
2905 ///
2906 /// # Safety
2907 ///
2908 /// Ensure that the new instance of the peripheral cannot be used in a way
2909 /// that may race with any existing instances, for example by only
2910 /// accessing read-only or write-only registers, or by consuming the
2911 /// original peripheral and using critical sections to coordinate
2912 /// access between multiple new instances.
2913 ///
2914 /// Additionally, other software such as HALs may rely on only one
2915 /// peripheral instance existing to ensure memory safety; ensure
2916 /// no stolen instances are passed to such software.
2917 pub unsafe fn steal() -> Self {
2918 Self { _marker: PhantomData }
2919 }
2920}
2921impl Deref for FMC {
2922 type Target = fmc::RegisterBlock;
2923 #[inline(always)]
2924 fn deref(&self) -> &Self::Target {
2925 unsafe { &*Self::PTR }
2926 }
2927}
2928impl core::fmt::Debug for FMC {
2929 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2930 f.debug_struct("FMC").finish()
2931 }
2932}
2933///Flexible memory controller
2934pub mod fmc;
2935///Digital-to-analog converter
2936///
2937///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#DAC1)
2938pub struct DAC2 {
2939 _marker: PhantomData<*const ()>,
2940}
2941unsafe impl Send for DAC2 {}
2942impl DAC2 {
2943 ///Pointer to the register block
2944 pub const PTR: *const dac1::RegisterBlock = 0x4000_9800 as *const _;
2945 ///Return the pointer to the register block
2946 #[inline(always)]
2947 pub const fn ptr() -> *const dac1::RegisterBlock {
2948 Self::PTR
2949 }
2950 /// Steal an instance of this peripheral
2951 ///
2952 /// # Safety
2953 ///
2954 /// Ensure that the new instance of the peripheral cannot be used in a way
2955 /// that may race with any existing instances, for example by only
2956 /// accessing read-only or write-only registers, or by consuming the
2957 /// original peripheral and using critical sections to coordinate
2958 /// access between multiple new instances.
2959 ///
2960 /// Additionally, other software such as HALs may rely on only one
2961 /// peripheral instance existing to ensure memory safety; ensure
2962 /// no stolen instances are passed to such software.
2963 pub unsafe fn steal() -> Self {
2964 Self { _marker: PhantomData }
2965 }
2966}
2967impl Deref for DAC2 {
2968 type Target = dac1::RegisterBlock;
2969 #[inline(always)]
2970 fn deref(&self) -> &Self::Target {
2971 unsafe { &*Self::PTR }
2972 }
2973}
2974impl core::fmt::Debug for DAC2 {
2975 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2976 f.debug_struct("DAC2").finish()
2977 }
2978}
2979///Digital-to-analog converter
2980pub use self::dac1 as dac2;
2981///Operational Amplifier
2982///
2983///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#OPAMP)
2984pub struct OPAMP {
2985 _marker: PhantomData<*const ()>,
2986}
2987unsafe impl Send for OPAMP {}
2988impl OPAMP {
2989 ///Pointer to the register block
2990 pub const PTR: *const opamp::RegisterBlock = 0x4001_0000 as *const _;
2991 ///Return the pointer to the register block
2992 #[inline(always)]
2993 pub const fn ptr() -> *const opamp::RegisterBlock {
2994 Self::PTR
2995 }
2996 /// Steal an instance of this peripheral
2997 ///
2998 /// # Safety
2999 ///
3000 /// Ensure that the new instance of the peripheral cannot be used in a way
3001 /// that may race with any existing instances, for example by only
3002 /// accessing read-only or write-only registers, or by consuming the
3003 /// original peripheral and using critical sections to coordinate
3004 /// access between multiple new instances.
3005 ///
3006 /// Additionally, other software such as HALs may rely on only one
3007 /// peripheral instance existing to ensure memory safety; ensure
3008 /// no stolen instances are passed to such software.
3009 pub unsafe fn steal() -> Self {
3010 Self { _marker: PhantomData }
3011 }
3012}
3013impl Deref for OPAMP {
3014 type Target = opamp::RegisterBlock;
3015 #[inline(always)]
3016 fn deref(&self) -> &Self::Target {
3017 unsafe { &*Self::PTR }
3018 }
3019}
3020impl core::fmt::Debug for OPAMP {
3021 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
3022 f.debug_struct("OPAMP").finish()
3023 }
3024}
3025///Operational Amplifier
3026pub mod opamp;
3027///General purpose comparators
3028///
3029///See peripheral [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#COMP)
3030pub struct COMP {
3031 _marker: PhantomData<*const ()>,
3032}
3033unsafe impl Send for COMP {}
3034impl COMP {
3035 ///Pointer to the register block
3036 pub const PTR: *const comp::RegisterBlock = 0x4001_0000 as *const _;
3037 ///Return the pointer to the register block
3038 #[inline(always)]
3039 pub const fn ptr() -> *const comp::RegisterBlock {
3040 Self::PTR
3041 }
3042 /// Steal an instance of this peripheral
3043 ///
3044 /// # Safety
3045 ///
3046 /// Ensure that the new instance of the peripheral cannot be used in a way
3047 /// that may race with any existing instances, for example by only
3048 /// accessing read-only or write-only registers, or by consuming the
3049 /// original peripheral and using critical sections to coordinate
3050 /// access between multiple new instances.
3051 ///
3052 /// Additionally, other software such as HALs may rely on only one
3053 /// peripheral instance existing to ensure memory safety; ensure
3054 /// no stolen instances are passed to such software.
3055 pub unsafe fn steal() -> Self {
3056 Self { _marker: PhantomData }
3057 }
3058}
3059impl Deref for COMP {
3060 type Target = comp::RegisterBlock;
3061 #[inline(always)]
3062 fn deref(&self) -> &Self::Target {
3063 unsafe { &*Self::PTR }
3064 }
3065}
3066impl core::fmt::Debug for COMP {
3067 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
3068 f.debug_struct("COMP").finish()
3069 }
3070}
3071///General purpose comparators
3072pub mod comp;
3073#[no_mangle]
3074static mut DEVICE_PERIPHERALS: bool = false;
3075/// All the peripherals.
3076#[allow(non_snake_case)]
3077pub struct Peripherals {
3078 ///GPIOA
3079 pub GPIOA: GPIOA,
3080 ///GPIOB
3081 pub GPIOB: GPIOB,
3082 ///GPIOC
3083 pub GPIOC: GPIOC,
3084 ///GPIOD
3085 pub GPIOD: GPIOD,
3086 ///GPIOE
3087 pub GPIOE: GPIOE,
3088 ///GPIOF
3089 pub GPIOF: GPIOF,
3090 ///GPIOG
3091 pub GPIOG: GPIOG,
3092 ///GPIOH
3093 pub GPIOH: GPIOH,
3094 ///TSC
3095 pub TSC: TSC,
3096 ///CRC
3097 pub CRC: CRC,
3098 ///FLASH
3099 pub FLASH: FLASH,
3100 ///RCC
3101 pub RCC: RCC,
3102 ///DMA1
3103 pub DMA1: DMA1,
3104 ///DMA2
3105 pub DMA2: DMA2,
3106 ///TIM2
3107 pub TIM2: TIM2,
3108 ///TIM3
3109 pub TIM3: TIM3,
3110 ///TIM4
3111 pub TIM4: TIM4,
3112 ///TIM15
3113 pub TIM15: TIM15,
3114 ///TIM16
3115 pub TIM16: TIM16,
3116 ///TIM17
3117 pub TIM17: TIM17,
3118 ///USART1
3119 pub USART1: USART1,
3120 ///USART2
3121 pub USART2: USART2,
3122 ///USART3
3123 pub USART3: USART3,
3124 ///UART4
3125 pub UART4: UART4,
3126 ///UART5
3127 pub UART5: UART5,
3128 ///SPI1
3129 pub SPI1: SPI1,
3130 ///SPI2
3131 pub SPI2: SPI2,
3132 ///SPI3
3133 pub SPI3: SPI3,
3134 ///SPI4
3135 pub SPI4: SPI4,
3136 ///I2S2ext
3137 pub I2S2EXT: I2S2EXT,
3138 ///I2S3ext
3139 pub I2S3EXT: I2S3EXT,
3140 ///EXTI
3141 pub EXTI: EXTI,
3142 ///PWR
3143 pub PWR: PWR,
3144 ///CAN
3145 pub CAN: CAN,
3146 ///USB
3147 pub USB: USB,
3148 ///I2C1
3149 pub I2C1: I2C1,
3150 ///I2C2
3151 pub I2C2: I2C2,
3152 ///I2C3
3153 pub I2C3: I2C3,
3154 ///IWDG
3155 pub IWDG: IWDG,
3156 ///WWDG
3157 pub WWDG: WWDG,
3158 ///RTC
3159 pub RTC: RTC,
3160 ///TIM6
3161 pub TIM6: TIM6,
3162 ///TIM7
3163 pub TIM7: TIM7,
3164 ///DAC1
3165 pub DAC1: DAC1,
3166 ///DBGMCU
3167 pub DBGMCU: DBGMCU,
3168 ///TIM1
3169 pub TIM1: TIM1,
3170 ///TIM20
3171 pub TIM20: TIM20,
3172 ///TIM8
3173 pub TIM8: TIM8,
3174 ///ADC1
3175 pub ADC1: ADC1,
3176 ///ADC2
3177 pub ADC2: ADC2,
3178 ///ADC3
3179 pub ADC3: ADC3,
3180 ///ADC4
3181 pub ADC4: ADC4,
3182 ///ADC1_2
3183 pub ADC1_2: ADC1_2,
3184 ///ADC3_4
3185 pub ADC3_4: ADC3_4,
3186 ///SYSCFG
3187 pub SYSCFG: SYSCFG,
3188 ///FMC
3189 pub FMC: FMC,
3190 ///DAC2
3191 pub DAC2: DAC2,
3192 ///OPAMP
3193 pub OPAMP: OPAMP,
3194 ///COMP
3195 pub COMP: COMP,
3196}
3197impl Peripherals {
3198 /// Returns all the peripherals *once*.
3199 #[cfg(feature = "critical-section")]
3200 #[inline]
3201 pub fn take() -> Option<Self> {
3202 critical_section::with(|_| {
3203 if unsafe { DEVICE_PERIPHERALS } {
3204 return None;
3205 }
3206 Some(unsafe { Peripherals::steal() })
3207 })
3208 }
3209 /// Unchecked version of `Peripherals::take`.
3210 ///
3211 /// # Safety
3212 ///
3213 /// Each of the returned peripherals must be used at most once.
3214 #[inline]
3215 pub unsafe fn steal() -> Self {
3216 DEVICE_PERIPHERALS = true;
3217 Peripherals {
3218 GPIOA: GPIOA::steal(),
3219 GPIOB: GPIOB::steal(),
3220 GPIOC: GPIOC::steal(),
3221 GPIOD: GPIOD::steal(),
3222 GPIOE: GPIOE::steal(),
3223 GPIOF: GPIOF::steal(),
3224 GPIOG: GPIOG::steal(),
3225 GPIOH: GPIOH::steal(),
3226 TSC: TSC::steal(),
3227 CRC: CRC::steal(),
3228 FLASH: FLASH::steal(),
3229 RCC: RCC::steal(),
3230 DMA1: DMA1::steal(),
3231 DMA2: DMA2::steal(),
3232 TIM2: TIM2::steal(),
3233 TIM3: TIM3::steal(),
3234 TIM4: TIM4::steal(),
3235 TIM15: TIM15::steal(),
3236 TIM16: TIM16::steal(),
3237 TIM17: TIM17::steal(),
3238 USART1: USART1::steal(),
3239 USART2: USART2::steal(),
3240 USART3: USART3::steal(),
3241 UART4: UART4::steal(),
3242 UART5: UART5::steal(),
3243 SPI1: SPI1::steal(),
3244 SPI2: SPI2::steal(),
3245 SPI3: SPI3::steal(),
3246 SPI4: SPI4::steal(),
3247 I2S2EXT: I2S2EXT::steal(),
3248 I2S3EXT: I2S3EXT::steal(),
3249 EXTI: EXTI::steal(),
3250 PWR: PWR::steal(),
3251 CAN: CAN::steal(),
3252 USB: USB::steal(),
3253 I2C1: I2C1::steal(),
3254 I2C2: I2C2::steal(),
3255 I2C3: I2C3::steal(),
3256 IWDG: IWDG::steal(),
3257 WWDG: WWDG::steal(),
3258 RTC: RTC::steal(),
3259 TIM6: TIM6::steal(),
3260 TIM7: TIM7::steal(),
3261 DAC1: DAC1::steal(),
3262 DBGMCU: DBGMCU::steal(),
3263 TIM1: TIM1::steal(),
3264 TIM20: TIM20::steal(),
3265 TIM8: TIM8::steal(),
3266 ADC1: ADC1::steal(),
3267 ADC2: ADC2::steal(),
3268 ADC3: ADC3::steal(),
3269 ADC4: ADC4::steal(),
3270 ADC1_2: ADC1_2::steal(),
3271 ADC3_4: ADC3_4::steal(),
3272 SYSCFG: SYSCFG::steal(),
3273 FMC: FMC::steal(),
3274 DAC2: DAC2::steal(),
3275 OPAMP: OPAMP::steal(),
3276 COMP: COMP::steal(),
3277 }
3278 }
3279}