1#![doc = "Peripheral access API for PY32F0XX_DFP microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
2svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
3#![deny(const_err)]
4#![deny(dead_code)]
5#![deny(improper_ctypes)]
6#![deny(missing_docs)]
7#![deny(no_mangle_generic_items)]
8#![deny(non_shorthand_field_patterns)]
9#![deny(overflowing_literals)]
10#![deny(path_statements)]
11#![deny(patterns_in_fns_without_body)]
12#![deny(private_in_public)]
13#![deny(unconditional_recursion)]
14#![deny(unused_allocation)]
15#![deny(unused_comparisons)]
16#![deny(unused_parens)]
17#![deny(while_true)]
18#![allow(non_camel_case_types)]
19#![allow(non_snake_case)]
20#![no_std]
21use core::marker::PhantomData;
22use core::ops::Deref;
23#[doc = r"Number available in the NVIC for configuring priority"]
24pub const NVIC_PRIO_BITS: u8 = 4;
25#[cfg(feature = "rt")]
26pub use self::Interrupt as interrupt;
27pub use cortex_m::peripheral::Peripherals as CorePeripherals;
28pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, ITM, MPU, NVIC, SCB, SYST, TPIU};
29#[cfg(feature = "rt")]
30pub use cortex_m_rt::interrupt;
31#[allow(unused_imports)]
32use generic::*;
33#[doc = r"Common register and bit access and modify traits"]
34pub mod generic;
35#[cfg(feature = "rt")]
36extern "C" {
37 fn WWDG();
38 fn PVD();
39 fn RTC();
40 fn FLASH();
41 fn RCC_CTC();
42 fn EXTI0_1();
43 fn EXTI2_3();
44 fn EXTI4_15();
45 fn LCD();
46 fn DMA1_CHANNEL1();
47 fn DMA1_CHANNEL2_3();
48 fn DMA1_CHANNEL4_5_6_7();
49 fn ADC_COMP();
50 fn TIM1_BRK_UP_TRG_COM();
51 fn TIM1_CC();
52 fn TIM2();
53 fn TIM3();
54 fn TIM6_LPTIM1_DAC();
55 fn TIM7();
56 fn TIM14();
57 fn TIM15();
58 fn TIM16();
59 fn TIM17();
60 fn I2C1();
61 fn I2C2();
62 fn SPI1();
63 fn SPI2();
64 fn USART1();
65 fn USART2();
66 fn USART3_4();
67 fn USB();
68}
69#[doc(hidden)]
70pub union Vector {
71 _handler: unsafe extern "C" fn(),
72 _reserved: u32,
73}
74#[cfg(feature = "rt")]
75#[doc(hidden)]
76#[link_section = ".vector_table.interrupts"]
77#[no_mangle]
78pub static __INTERRUPTS: [Vector; 32] = [
79 Vector { _handler: WWDG },
80 Vector { _handler: PVD },
81 Vector { _handler: RTC },
82 Vector { _handler: FLASH },
83 Vector { _handler: RCC_CTC },
84 Vector { _handler: EXTI0_1 },
85 Vector { _handler: EXTI2_3 },
86 Vector { _handler: EXTI4_15 },
87 Vector { _handler: LCD },
88 Vector {
89 _handler: DMA1_CHANNEL1,
90 },
91 Vector {
92 _handler: DMA1_CHANNEL2_3,
93 },
94 Vector {
95 _handler: DMA1_CHANNEL4_5_6_7,
96 },
97 Vector { _handler: ADC_COMP },
98 Vector {
99 _handler: TIM1_BRK_UP_TRG_COM,
100 },
101 Vector { _handler: TIM1_CC },
102 Vector { _handler: TIM2 },
103 Vector { _handler: TIM3 },
104 Vector {
105 _handler: TIM6_LPTIM1_DAC,
106 },
107 Vector { _handler: TIM7 },
108 Vector { _handler: TIM14 },
109 Vector { _handler: TIM15 },
110 Vector { _handler: TIM16 },
111 Vector { _handler: TIM17 },
112 Vector { _handler: I2C1 },
113 Vector { _handler: I2C2 },
114 Vector { _handler: SPI1 },
115 Vector { _handler: SPI2 },
116 Vector { _handler: USART1 },
117 Vector { _handler: USART2 },
118 Vector { _handler: USART3_4 },
119 Vector { _reserved: 0 },
120 Vector { _handler: USB },
121];
122#[doc = r"Enumeration of all the interrupts."]
123#[derive(Copy, Clone, Debug, PartialEq, Eq)]
124#[repr(u16)]
125pub enum Interrupt {
126 #[doc = "0 - Window WatchDog Interrupt"]
127 WWDG = 0,
128 #[doc = "1 - PVD Interrupt through EXTI Lines 16"]
129 PVD = 1,
130 #[doc = "2 - RTC Interrupt through EXTI Lines 19"]
131 RTC = 2,
132 #[doc = "3 - FLASH global Interrupt"]
133 FLASH = 3,
134 #[doc = "4 - RCC and CTC global Interrupts"]
135 RCC_CTC = 4,
136 #[doc = "5 - EXTI Line 0 and 1 Interrupt"]
137 EXTI0_1 = 5,
138 #[doc = "6 - EXTI Line 2 and 3 Interrupt"]
139 EXTI2_3 = 6,
140 #[doc = "7 - EXTI Line 4 to 15 Interrupt"]
141 EXTI4_15 = 7,
142 #[doc = "8 - LCD global Interrupt"]
143 LCD = 8,
144 #[doc = "9 - DMA1 Channel 1 Interrupt"]
145 DMA1_CHANNEL1 = 9,
146 #[doc = "10 - DMA1 Channel 2 and Channel 3 Interrupt"]
147 DMA1_CHANNEL2_3 = 10,
148 #[doc = "11 - DMA1 Channel 4, 5, 6, 7 Interrupts"]
149 DMA1_CHANNEL4_5_6_7 = 11,
150 #[doc = "12 - ADC and COMP Interrupt through EXTI Lines 17 and 18"]
151 ADC_COMP = 12,
152 #[doc = "13 - TIM1 Break, Update, Trigger and Commutation Interrupt"]
153 TIM1_BRK_UP_TRG_COM = 13,
154 #[doc = "14 - TIM1 Capture Compare Interrupt"]
155 TIM1_CC = 14,
156 #[doc = "15 - TIM2 global Interrupt"]
157 TIM2 = 15,
158 #[doc = "16 - TIM3 global Interrupt"]
159 TIM3 = 16,
160 #[doc = "17 - TIM6, LPTIM1, DAC global Interrupts"]
161 TIM6_LPTIM1_DAC = 17,
162 #[doc = "18 - TIM7 global Interrupt"]
163 TIM7 = 18,
164 #[doc = "19 - TIM14 global Interrupt"]
165 TIM14 = 19,
166 #[doc = "20 - TIM15 global Interrupt"]
167 TIM15 = 20,
168 #[doc = "21 - TIM16 global Interrupt"]
169 TIM16 = 21,
170 #[doc = "22 - TIM17 global Interrupt"]
171 TIM17 = 22,
172 #[doc = "23 - I2C1 global Interrupt"]
173 I2C1 = 23,
174 #[doc = "24 - I2C2 Event Interrupt"]
175 I2C2 = 24,
176 #[doc = "25 - SPI1 global Interrupt"]
177 SPI1 = 25,
178 #[doc = "26 - SPI2 global Interrupt"]
179 SPI2 = 26,
180 #[doc = "27 - USART1 global Interrupt"]
181 USART1 = 27,
182 #[doc = "28 - USART2 global Interrupt"]
183 USART2 = 28,
184 #[doc = "29 - USART3, 4 global Interrupts"]
185 USART3_4 = 29,
186 #[doc = "31 - USB global Interrupts"]
187 USB = 31,
188}
189unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
190 #[inline(always)]
191 fn number(self) -> u16 {
192 self as u16
193 }
194}
195#[doc = "Analog to Digital Converter"]
196pub struct ADC {
197 _marker: PhantomData<*const ()>,
198}
199unsafe impl Send for ADC {}
200impl ADC {
201 #[doc = r"Pointer to the register block"]
202 pub const PTR: *const adc::RegisterBlock = 0x4001_2400 as *const _;
203 #[doc = r"Return the pointer to the register block"]
204 #[inline(always)]
205 pub const fn ptr() -> *const adc::RegisterBlock {
206 Self::PTR
207 }
208}
209impl Deref for ADC {
210 type Target = adc::RegisterBlock;
211 #[inline(always)]
212 fn deref(&self) -> &Self::Target {
213 unsafe { &*Self::PTR }
214 }
215}
216impl core::fmt::Debug for ADC {
217 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
218 f.debug_struct("ADC").finish()
219 }
220}
221#[doc = "Analog to Digital Converter"]
222pub mod adc;
223#[doc = "Comparator 1"]
224pub struct COMP1 {
225 _marker: PhantomData<*const ()>,
226}
227unsafe impl Send for COMP1 {}
228impl COMP1 {
229 #[doc = r"Pointer to the register block"]
230 pub const PTR: *const comp1::RegisterBlock = 0x4001_0200 as *const _;
231 #[doc = r"Return the pointer to the register block"]
232 #[inline(always)]
233 pub const fn ptr() -> *const comp1::RegisterBlock {
234 Self::PTR
235 }
236}
237impl Deref for COMP1 {
238 type Target = comp1::RegisterBlock;
239 #[inline(always)]
240 fn deref(&self) -> &Self::Target {
241 unsafe { &*Self::PTR }
242 }
243}
244impl core::fmt::Debug for COMP1 {
245 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
246 f.debug_struct("COMP1").finish()
247 }
248}
249#[doc = "Comparator 1"]
250pub mod comp1;
251#[doc = "Comparator2"]
252pub struct COMP2 {
253 _marker: PhantomData<*const ()>,
254}
255unsafe impl Send for COMP2 {}
256impl COMP2 {
257 #[doc = r"Pointer to the register block"]
258 pub const PTR: *const comp2::RegisterBlock = 0x4001_0210 as *const _;
259 #[doc = r"Return the pointer to the register block"]
260 #[inline(always)]
261 pub const fn ptr() -> *const comp2::RegisterBlock {
262 Self::PTR
263 }
264}
265impl Deref for COMP2 {
266 type Target = comp2::RegisterBlock;
267 #[inline(always)]
268 fn deref(&self) -> &Self::Target {
269 unsafe { &*Self::PTR }
270 }
271}
272impl core::fmt::Debug for COMP2 {
273 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
274 f.debug_struct("COMP2").finish()
275 }
276}
277#[doc = "Comparator2"]
278pub mod comp2;
279#[doc = "Comparator3"]
280pub struct COMP3 {
281 _marker: PhantomData<*const ()>,
282}
283unsafe impl Send for COMP3 {}
284impl COMP3 {
285 #[doc = r"Pointer to the register block"]
286 pub const PTR: *const comp3::RegisterBlock = 0x4001_0220 as *const _;
287 #[doc = r"Return the pointer to the register block"]
288 #[inline(always)]
289 pub const fn ptr() -> *const comp3::RegisterBlock {
290 Self::PTR
291 }
292}
293impl Deref for COMP3 {
294 type Target = comp3::RegisterBlock;
295 #[inline(always)]
296 fn deref(&self) -> &Self::Target {
297 unsafe { &*Self::PTR }
298 }
299}
300impl core::fmt::Debug for COMP3 {
301 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
302 f.debug_struct("COMP3").finish()
303 }
304}
305#[doc = "Comparator3"]
306pub mod comp3;
307#[doc = "CRC calculation unit"]
308pub struct CRC {
309 _marker: PhantomData<*const ()>,
310}
311unsafe impl Send for CRC {}
312impl CRC {
313 #[doc = r"Pointer to the register block"]
314 pub const PTR: *const crc::RegisterBlock = 0x4002_3000 as *const _;
315 #[doc = r"Return the pointer to the register block"]
316 #[inline(always)]
317 pub const fn ptr() -> *const crc::RegisterBlock {
318 Self::PTR
319 }
320}
321impl Deref for CRC {
322 type Target = crc::RegisterBlock;
323 #[inline(always)]
324 fn deref(&self) -> &Self::Target {
325 unsafe { &*Self::PTR }
326 }
327}
328impl core::fmt::Debug for CRC {
329 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
330 f.debug_struct("CRC").finish()
331 }
332}
333#[doc = "CRC calculation unit"]
334pub mod crc;
335#[doc = "desc CTC"]
336pub struct CTC {
337 _marker: PhantomData<*const ()>,
338}
339unsafe impl Send for CTC {}
340impl CTC {
341 #[doc = r"Pointer to the register block"]
342 pub const PTR: *const ctc::RegisterBlock = 0x4000_6c00 as *const _;
343 #[doc = r"Return the pointer to the register block"]
344 #[inline(always)]
345 pub const fn ptr() -> *const ctc::RegisterBlock {
346 Self::PTR
347 }
348}
349impl Deref for CTC {
350 type Target = ctc::RegisterBlock;
351 #[inline(always)]
352 fn deref(&self) -> &Self::Target {
353 unsafe { &*Self::PTR }
354 }
355}
356impl core::fmt::Debug for CTC {
357 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
358 f.debug_struct("CTC").finish()
359 }
360}
361#[doc = "desc CTC"]
362pub mod ctc;
363#[doc = "desc DAC"]
364pub struct DAC {
365 _marker: PhantomData<*const ()>,
366}
367unsafe impl Send for DAC {}
368impl DAC {
369 #[doc = r"Pointer to the register block"]
370 pub const PTR: *const dac::RegisterBlock = 0x4000_7400 as *const _;
371 #[doc = r"Return the pointer to the register block"]
372 #[inline(always)]
373 pub const fn ptr() -> *const dac::RegisterBlock {
374 Self::PTR
375 }
376}
377impl Deref for DAC {
378 type Target = dac::RegisterBlock;
379 #[inline(always)]
380 fn deref(&self) -> &Self::Target {
381 unsafe { &*Self::PTR }
382 }
383}
384impl core::fmt::Debug for DAC {
385 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
386 f.debug_struct("DAC").finish()
387 }
388}
389#[doc = "desc DAC"]
390pub mod dac;
391#[doc = "Debug support"]
392pub struct DBGMCU {
393 _marker: PhantomData<*const ()>,
394}
395unsafe impl Send for DBGMCU {}
396impl DBGMCU {
397 #[doc = r"Pointer to the register block"]
398 pub const PTR: *const dbgmcu::RegisterBlock = 0x4001_5800 as *const _;
399 #[doc = r"Return the pointer to the register block"]
400 #[inline(always)]
401 pub const fn ptr() -> *const dbgmcu::RegisterBlock {
402 Self::PTR
403 }
404}
405impl Deref for DBGMCU {
406 type Target = dbgmcu::RegisterBlock;
407 #[inline(always)]
408 fn deref(&self) -> &Self::Target {
409 unsafe { &*Self::PTR }
410 }
411}
412impl core::fmt::Debug for DBGMCU {
413 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
414 f.debug_struct("DBGMCU").finish()
415 }
416}
417#[doc = "Debug support"]
418pub mod dbgmcu;
419#[doc = "Direct memory access"]
420pub struct DMA {
421 _marker: PhantomData<*const ()>,
422}
423unsafe impl Send for DMA {}
424impl DMA {
425 #[doc = r"Pointer to the register block"]
426 pub const PTR: *const dma::RegisterBlock = 0x4002_0000 as *const _;
427 #[doc = r"Return the pointer to the register block"]
428 #[inline(always)]
429 pub const fn ptr() -> *const dma::RegisterBlock {
430 Self::PTR
431 }
432}
433impl Deref for DMA {
434 type Target = dma::RegisterBlock;
435 #[inline(always)]
436 fn deref(&self) -> &Self::Target {
437 unsafe { &*Self::PTR }
438 }
439}
440impl core::fmt::Debug for DMA {
441 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
442 f.debug_struct("DMA").finish()
443 }
444}
445#[doc = "Direct memory access"]
446pub mod dma;
447#[doc = "External interrupt/event controller"]
448pub struct EXTI {
449 _marker: PhantomData<*const ()>,
450}
451unsafe impl Send for EXTI {}
452impl EXTI {
453 #[doc = r"Pointer to the register block"]
454 pub const PTR: *const exti::RegisterBlock = 0x4002_1800 as *const _;
455 #[doc = r"Return the pointer to the register block"]
456 #[inline(always)]
457 pub const fn ptr() -> *const exti::RegisterBlock {
458 Self::PTR
459 }
460}
461impl Deref for EXTI {
462 type Target = exti::RegisterBlock;
463 #[inline(always)]
464 fn deref(&self) -> &Self::Target {
465 unsafe { &*Self::PTR }
466 }
467}
468impl core::fmt::Debug for EXTI {
469 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
470 f.debug_struct("EXTI").finish()
471 }
472}
473#[doc = "External interrupt/event controller"]
474pub mod exti;
475#[doc = "desc FLASH"]
476pub struct FLASH {
477 _marker: PhantomData<*const ()>,
478}
479unsafe impl Send for FLASH {}
480impl FLASH {
481 #[doc = r"Pointer to the register block"]
482 pub const PTR: *const flash::RegisterBlock = 0x4002_2000 as *const _;
483 #[doc = r"Return the pointer to the register block"]
484 #[inline(always)]
485 pub const fn ptr() -> *const flash::RegisterBlock {
486 Self::PTR
487 }
488}
489impl Deref for FLASH {
490 type Target = flash::RegisterBlock;
491 #[inline(always)]
492 fn deref(&self) -> &Self::Target {
493 unsafe { &*Self::PTR }
494 }
495}
496impl core::fmt::Debug for FLASH {
497 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
498 f.debug_struct("FLASH").finish()
499 }
500}
501#[doc = "desc FLASH"]
502pub mod flash;
503#[doc = "General-purpose I/Os"]
504pub struct GPIOA {
505 _marker: PhantomData<*const ()>,
506}
507unsafe impl Send for GPIOA {}
508impl GPIOA {
509 #[doc = r"Pointer to the register block"]
510 pub const PTR: *const gpioa::RegisterBlock = 0x5000_0000 as *const _;
511 #[doc = r"Return the pointer to the register block"]
512 #[inline(always)]
513 pub const fn ptr() -> *const gpioa::RegisterBlock {
514 Self::PTR
515 }
516}
517impl Deref for GPIOA {
518 type Target = gpioa::RegisterBlock;
519 #[inline(always)]
520 fn deref(&self) -> &Self::Target {
521 unsafe { &*Self::PTR }
522 }
523}
524impl core::fmt::Debug for GPIOA {
525 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
526 f.debug_struct("GPIOA").finish()
527 }
528}
529#[doc = "General-purpose I/Os"]
530pub mod gpioa;
531#[doc = "General-purpose I/Os"]
532pub struct GPIOB {
533 _marker: PhantomData<*const ()>,
534}
535unsafe impl Send for GPIOB {}
536impl GPIOB {
537 #[doc = r"Pointer to the register block"]
538 pub const PTR: *const gpioa::RegisterBlock = 0x5000_0400 as *const _;
539 #[doc = r"Return the pointer to the register block"]
540 #[inline(always)]
541 pub const fn ptr() -> *const gpioa::RegisterBlock {
542 Self::PTR
543 }
544}
545impl Deref for GPIOB {
546 type Target = gpioa::RegisterBlock;
547 #[inline(always)]
548 fn deref(&self) -> &Self::Target {
549 unsafe { &*Self::PTR }
550 }
551}
552impl core::fmt::Debug for GPIOB {
553 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
554 f.debug_struct("GPIOB").finish()
555 }
556}
557#[doc = "General-purpose I/Os"]
558pub use gpioa as gpiob;
559#[doc = "General-purpose I/Os"]
560pub struct GPIOC {
561 _marker: PhantomData<*const ()>,
562}
563unsafe impl Send for GPIOC {}
564impl GPIOC {
565 #[doc = r"Pointer to the register block"]
566 pub const PTR: *const gpioa::RegisterBlock = 0x5000_0800 as *const _;
567 #[doc = r"Return the pointer to the register block"]
568 #[inline(always)]
569 pub const fn ptr() -> *const gpioa::RegisterBlock {
570 Self::PTR
571 }
572}
573impl Deref for GPIOC {
574 type Target = gpioa::RegisterBlock;
575 #[inline(always)]
576 fn deref(&self) -> &Self::Target {
577 unsafe { &*Self::PTR }
578 }
579}
580impl core::fmt::Debug for GPIOC {
581 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
582 f.debug_struct("GPIOC").finish()
583 }
584}
585#[doc = "General-purpose I/Os"]
586pub use gpioa as gpioc;
587#[doc = "General-purpose I/Os"]
588pub struct GPIOF {
589 _marker: PhantomData<*const ()>,
590}
591unsafe impl Send for GPIOF {}
592impl GPIOF {
593 #[doc = r"Pointer to the register block"]
594 pub const PTR: *const gpioa::RegisterBlock = 0x5000_1400 as *const _;
595 #[doc = r"Return the pointer to the register block"]
596 #[inline(always)]
597 pub const fn ptr() -> *const gpioa::RegisterBlock {
598 Self::PTR
599 }
600}
601impl Deref for GPIOF {
602 type Target = gpioa::RegisterBlock;
603 #[inline(always)]
604 fn deref(&self) -> &Self::Target {
605 unsafe { &*Self::PTR }
606 }
607}
608impl core::fmt::Debug for GPIOF {
609 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
610 f.debug_struct("GPIOF").finish()
611 }
612}
613#[doc = "General-purpose I/Os"]
614pub use gpioa as gpiof;
615#[doc = "Hardware Divider"]
616pub struct DIV {
617 _marker: PhantomData<*const ()>,
618}
619unsafe impl Send for DIV {}
620impl DIV {
621 #[doc = r"Pointer to the register block"]
622 pub const PTR: *const div::RegisterBlock = 0x4002_3800 as *const _;
623 #[doc = r"Return the pointer to the register block"]
624 #[inline(always)]
625 pub const fn ptr() -> *const div::RegisterBlock {
626 Self::PTR
627 }
628}
629impl Deref for DIV {
630 type Target = div::RegisterBlock;
631 #[inline(always)]
632 fn deref(&self) -> &Self::Target {
633 unsafe { &*Self::PTR }
634 }
635}
636impl core::fmt::Debug for DIV {
637 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
638 f.debug_struct("DIV").finish()
639 }
640}
641#[doc = "Hardware Divider"]
642pub mod div;
643#[doc = "Inter integrated circuit"]
644pub struct I2C1 {
645 _marker: PhantomData<*const ()>,
646}
647unsafe impl Send for I2C1 {}
648impl I2C1 {
649 #[doc = r"Pointer to the register block"]
650 pub const PTR: *const i2c1::RegisterBlock = 0x4000_5400 as *const _;
651 #[doc = r"Return the pointer to the register block"]
652 #[inline(always)]
653 pub const fn ptr() -> *const i2c1::RegisterBlock {
654 Self::PTR
655 }
656}
657impl Deref for I2C1 {
658 type Target = i2c1::RegisterBlock;
659 #[inline(always)]
660 fn deref(&self) -> &Self::Target {
661 unsafe { &*Self::PTR }
662 }
663}
664impl core::fmt::Debug for I2C1 {
665 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
666 f.debug_struct("I2C1").finish()
667 }
668}
669#[doc = "Inter integrated circuit"]
670pub mod i2c1;
671#[doc = "desc I2C"]
672pub struct I2C2 {
673 _marker: PhantomData<*const ()>,
674}
675unsafe impl Send for I2C2 {}
676impl I2C2 {
677 #[doc = r"Pointer to the register block"]
678 pub const PTR: *const i2c1::RegisterBlock = 0x4000_5800 as *const _;
679 #[doc = r"Return the pointer to the register block"]
680 #[inline(always)]
681 pub const fn ptr() -> *const i2c1::RegisterBlock {
682 Self::PTR
683 }
684}
685impl Deref for I2C2 {
686 type Target = i2c1::RegisterBlock;
687 #[inline(always)]
688 fn deref(&self) -> &Self::Target {
689 unsafe { &*Self::PTR }
690 }
691}
692impl core::fmt::Debug for I2C2 {
693 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
694 f.debug_struct("I2C2").finish()
695 }
696}
697#[doc = "desc I2C"]
698pub use i2c1 as i2c2;
699#[doc = "Independent watchdog"]
700pub struct IWDG {
701 _marker: PhantomData<*const ()>,
702}
703unsafe impl Send for IWDG {}
704impl IWDG {
705 #[doc = r"Pointer to the register block"]
706 pub const PTR: *const iwdg::RegisterBlock = 0x4000_3000 as *const _;
707 #[doc = r"Return the pointer to the register block"]
708 #[inline(always)]
709 pub const fn ptr() -> *const iwdg::RegisterBlock {
710 Self::PTR
711 }
712}
713impl Deref for IWDG {
714 type Target = iwdg::RegisterBlock;
715 #[inline(always)]
716 fn deref(&self) -> &Self::Target {
717 unsafe { &*Self::PTR }
718 }
719}
720impl core::fmt::Debug for IWDG {
721 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
722 f.debug_struct("IWDG").finish()
723 }
724}
725#[doc = "Independent watchdog"]
726pub mod iwdg;
727#[doc = "LCD CONTROLLER"]
728pub struct LCD {
729 _marker: PhantomData<*const ()>,
730}
731unsafe impl Send for LCD {}
732impl LCD {
733 #[doc = r"Pointer to the register block"]
734 pub const PTR: *const lcd::RegisterBlock = 0x4000_2400 as *const _;
735 #[doc = r"Return the pointer to the register block"]
736 #[inline(always)]
737 pub const fn ptr() -> *const lcd::RegisterBlock {
738 Self::PTR
739 }
740}
741impl Deref for LCD {
742 type Target = lcd::RegisterBlock;
743 #[inline(always)]
744 fn deref(&self) -> &Self::Target {
745 unsafe { &*Self::PTR }
746 }
747}
748impl core::fmt::Debug for LCD {
749 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
750 f.debug_struct("LCD").finish()
751 }
752}
753#[doc = "LCD CONTROLLER"]
754pub mod lcd;
755#[doc = "Low power timer"]
756pub struct LPTIM1 {
757 _marker: PhantomData<*const ()>,
758}
759unsafe impl Send for LPTIM1 {}
760impl LPTIM1 {
761 #[doc = r"Pointer to the register block"]
762 pub const PTR: *const lptim1::RegisterBlock = 0x4000_7c00 as *const _;
763 #[doc = r"Return the pointer to the register block"]
764 #[inline(always)]
765 pub const fn ptr() -> *const lptim1::RegisterBlock {
766 Self::PTR
767 }
768}
769impl Deref for LPTIM1 {
770 type Target = lptim1::RegisterBlock;
771 #[inline(always)]
772 fn deref(&self) -> &Self::Target {
773 unsafe { &*Self::PTR }
774 }
775}
776impl core::fmt::Debug for LPTIM1 {
777 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
778 f.debug_struct("LPTIM1").finish()
779 }
780}
781#[doc = "Low power timer"]
782pub mod lptim1;
783#[doc = "des OPA"]
784pub struct OPA {
785 _marker: PhantomData<*const ()>,
786}
787unsafe impl Send for OPA {}
788impl OPA {
789 #[doc = r"Pointer to the register block"]
790 pub const PTR: *const opa::RegisterBlock = 0x4001_0300 as *const _;
791 #[doc = r"Return the pointer to the register block"]
792 #[inline(always)]
793 pub const fn ptr() -> *const opa::RegisterBlock {
794 Self::PTR
795 }
796}
797impl Deref for OPA {
798 type Target = opa::RegisterBlock;
799 #[inline(always)]
800 fn deref(&self) -> &Self::Target {
801 unsafe { &*Self::PTR }
802 }
803}
804impl core::fmt::Debug for OPA {
805 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
806 f.debug_struct("OPA").finish()
807 }
808}
809#[doc = "des OPA"]
810pub mod opa;
811#[doc = "Power control"]
812pub struct PWR {
813 _marker: PhantomData<*const ()>,
814}
815unsafe impl Send for PWR {}
816impl PWR {
817 #[doc = r"Pointer to the register block"]
818 pub const PTR: *const pwr::RegisterBlock = 0x4000_7000 as *const _;
819 #[doc = r"Return the pointer to the register block"]
820 #[inline(always)]
821 pub const fn ptr() -> *const pwr::RegisterBlock {
822 Self::PTR
823 }
824}
825impl Deref for PWR {
826 type Target = pwr::RegisterBlock;
827 #[inline(always)]
828 fn deref(&self) -> &Self::Target {
829 unsafe { &*Self::PTR }
830 }
831}
832impl core::fmt::Debug for PWR {
833 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
834 f.debug_struct("PWR").finish()
835 }
836}
837#[doc = "Power control"]
838pub mod pwr;
839#[doc = "Reset and clock control"]
840pub struct RCC {
841 _marker: PhantomData<*const ()>,
842}
843unsafe impl Send for RCC {}
844impl RCC {
845 #[doc = r"Pointer to the register block"]
846 pub const PTR: *const rcc::RegisterBlock = 0x4002_1000 as *const _;
847 #[doc = r"Return the pointer to the register block"]
848 #[inline(always)]
849 pub const fn ptr() -> *const rcc::RegisterBlock {
850 Self::PTR
851 }
852}
853impl Deref for RCC {
854 type Target = rcc::RegisterBlock;
855 #[inline(always)]
856 fn deref(&self) -> &Self::Target {
857 unsafe { &*Self::PTR }
858 }
859}
860impl core::fmt::Debug for RCC {
861 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
862 f.debug_struct("RCC").finish()
863 }
864}
865#[doc = "Reset and clock control"]
866pub mod rcc;
867#[doc = "desc RTC"]
868pub struct RTC {
869 _marker: PhantomData<*const ()>,
870}
871unsafe impl Send for RTC {}
872impl RTC {
873 #[doc = r"Pointer to the register block"]
874 pub const PTR: *const rtc::RegisterBlock = 0x4000_2800 as *const _;
875 #[doc = r"Return the pointer to the register block"]
876 #[inline(always)]
877 pub const fn ptr() -> *const rtc::RegisterBlock {
878 Self::PTR
879 }
880}
881impl Deref for RTC {
882 type Target = rtc::RegisterBlock;
883 #[inline(always)]
884 fn deref(&self) -> &Self::Target {
885 unsafe { &*Self::PTR }
886 }
887}
888impl core::fmt::Debug for RTC {
889 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
890 f.debug_struct("RTC").finish()
891 }
892}
893#[doc = "desc RTC"]
894pub mod rtc;
895#[doc = "Serial peripheral interface"]
896pub struct SPI1 {
897 _marker: PhantomData<*const ()>,
898}
899unsafe impl Send for SPI1 {}
900impl SPI1 {
901 #[doc = r"Pointer to the register block"]
902 pub const PTR: *const spi1::RegisterBlock = 0x4001_3000 as *const _;
903 #[doc = r"Return the pointer to the register block"]
904 #[inline(always)]
905 pub const fn ptr() -> *const spi1::RegisterBlock {
906 Self::PTR
907 }
908}
909impl Deref for SPI1 {
910 type Target = spi1::RegisterBlock;
911 #[inline(always)]
912 fn deref(&self) -> &Self::Target {
913 unsafe { &*Self::PTR }
914 }
915}
916impl core::fmt::Debug for SPI1 {
917 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
918 f.debug_struct("SPI1").finish()
919 }
920}
921#[doc = "Serial peripheral interface"]
922pub mod spi1;
923#[doc = "Serial peripheral interface"]
924pub struct SPI2 {
925 _marker: PhantomData<*const ()>,
926}
927unsafe impl Send for SPI2 {}
928impl SPI2 {
929 #[doc = r"Pointer to the register block"]
930 pub const PTR: *const spi1::RegisterBlock = 0x4000_3800 as *const _;
931 #[doc = r"Return the pointer to the register block"]
932 #[inline(always)]
933 pub const fn ptr() -> *const spi1::RegisterBlock {
934 Self::PTR
935 }
936}
937impl Deref for SPI2 {
938 type Target = spi1::RegisterBlock;
939 #[inline(always)]
940 fn deref(&self) -> &Self::Target {
941 unsafe { &*Self::PTR }
942 }
943}
944impl core::fmt::Debug for SPI2 {
945 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
946 f.debug_struct("SPI2").finish()
947 }
948}
949#[doc = "Serial peripheral interface"]
950pub use spi1 as spi2;
951#[doc = "desc SYSCFG"]
952pub struct SYSCFG {
953 _marker: PhantomData<*const ()>,
954}
955unsafe impl Send for SYSCFG {}
956impl SYSCFG {
957 #[doc = r"Pointer to the register block"]
958 pub const PTR: *const syscfg::RegisterBlock = 0x4001_0000 as *const _;
959 #[doc = r"Return the pointer to the register block"]
960 #[inline(always)]
961 pub const fn ptr() -> *const syscfg::RegisterBlock {
962 Self::PTR
963 }
964}
965impl Deref for SYSCFG {
966 type Target = syscfg::RegisterBlock;
967 #[inline(always)]
968 fn deref(&self) -> &Self::Target {
969 unsafe { &*Self::PTR }
970 }
971}
972impl core::fmt::Debug for SYSCFG {
973 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
974 f.debug_struct("SYSCFG").finish()
975 }
976}
977#[doc = "desc SYSCFG"]
978pub mod syscfg;
979#[doc = "Advanced timer"]
980pub struct TIM1 {
981 _marker: PhantomData<*const ()>,
982}
983unsafe impl Send for TIM1 {}
984impl TIM1 {
985 #[doc = r"Pointer to the register block"]
986 pub const PTR: *const tim1::RegisterBlock = 0x4001_2c00 as *const _;
987 #[doc = r"Return the pointer to the register block"]
988 #[inline(always)]
989 pub const fn ptr() -> *const tim1::RegisterBlock {
990 Self::PTR
991 }
992}
993impl Deref for TIM1 {
994 type Target = tim1::RegisterBlock;
995 #[inline(always)]
996 fn deref(&self) -> &Self::Target {
997 unsafe { &*Self::PTR }
998 }
999}
1000impl core::fmt::Debug for TIM1 {
1001 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1002 f.debug_struct("TIM1").finish()
1003 }
1004}
1005#[doc = "Advanced timer"]
1006pub mod tim1;
1007#[doc = "desc TIM"]
1008pub struct TIM2 {
1009 _marker: PhantomData<*const ()>,
1010}
1011unsafe impl Send for TIM2 {}
1012impl TIM2 {
1013 #[doc = r"Pointer to the register block"]
1014 pub const PTR: *const tim2::RegisterBlock = 0x4000_0000 as *const _;
1015 #[doc = r"Return the pointer to the register block"]
1016 #[inline(always)]
1017 pub const fn ptr() -> *const tim2::RegisterBlock {
1018 Self::PTR
1019 }
1020}
1021impl Deref for TIM2 {
1022 type Target = tim2::RegisterBlock;
1023 #[inline(always)]
1024 fn deref(&self) -> &Self::Target {
1025 unsafe { &*Self::PTR }
1026 }
1027}
1028impl core::fmt::Debug for TIM2 {
1029 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1030 f.debug_struct("TIM2").finish()
1031 }
1032}
1033#[doc = "desc TIM"]
1034pub mod tim2;
1035#[doc = "General purpose timer"]
1036pub struct TIM3 {
1037 _marker: PhantomData<*const ()>,
1038}
1039unsafe impl Send for TIM3 {}
1040impl TIM3 {
1041 #[doc = r"Pointer to the register block"]
1042 pub const PTR: *const tim3::RegisterBlock = 0x4000_0400 as *const _;
1043 #[doc = r"Return the pointer to the register block"]
1044 #[inline(always)]
1045 pub const fn ptr() -> *const tim3::RegisterBlock {
1046 Self::PTR
1047 }
1048}
1049impl Deref for TIM3 {
1050 type Target = tim3::RegisterBlock;
1051 #[inline(always)]
1052 fn deref(&self) -> &Self::Target {
1053 unsafe { &*Self::PTR }
1054 }
1055}
1056impl core::fmt::Debug for TIM3 {
1057 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1058 f.debug_struct("TIM3").finish()
1059 }
1060}
1061#[doc = "General purpose timer"]
1062pub mod tim3;
1063#[doc = "desc TIM"]
1064pub struct TIM6 {
1065 _marker: PhantomData<*const ()>,
1066}
1067unsafe impl Send for TIM6 {}
1068impl TIM6 {
1069 #[doc = r"Pointer to the register block"]
1070 pub const PTR: *const tim6::RegisterBlock = 0x4000_1000 as *const _;
1071 #[doc = r"Return the pointer to the register block"]
1072 #[inline(always)]
1073 pub const fn ptr() -> *const tim6::RegisterBlock {
1074 Self::PTR
1075 }
1076}
1077impl Deref for TIM6 {
1078 type Target = tim6::RegisterBlock;
1079 #[inline(always)]
1080 fn deref(&self) -> &Self::Target {
1081 unsafe { &*Self::PTR }
1082 }
1083}
1084impl core::fmt::Debug for TIM6 {
1085 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1086 f.debug_struct("TIM6").finish()
1087 }
1088}
1089#[doc = "desc TIM"]
1090pub mod tim6;
1091#[doc = "desc TIM"]
1092pub struct TIM7 {
1093 _marker: PhantomData<*const ()>,
1094}
1095unsafe impl Send for TIM7 {}
1096impl TIM7 {
1097 #[doc = r"Pointer to the register block"]
1098 pub const PTR: *const tim6::RegisterBlock = 0x4000_1400 as *const _;
1099 #[doc = r"Return the pointer to the register block"]
1100 #[inline(always)]
1101 pub const fn ptr() -> *const tim6::RegisterBlock {
1102 Self::PTR
1103 }
1104}
1105impl Deref for TIM7 {
1106 type Target = tim6::RegisterBlock;
1107 #[inline(always)]
1108 fn deref(&self) -> &Self::Target {
1109 unsafe { &*Self::PTR }
1110 }
1111}
1112impl core::fmt::Debug for TIM7 {
1113 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1114 f.debug_struct("TIM7").finish()
1115 }
1116}
1117#[doc = "desc TIM"]
1118pub use tim6 as tim7;
1119#[doc = "General purpose timer"]
1120pub struct TIM14 {
1121 _marker: PhantomData<*const ()>,
1122}
1123unsafe impl Send for TIM14 {}
1124impl TIM14 {
1125 #[doc = r"Pointer to the register block"]
1126 pub const PTR: *const tim14::RegisterBlock = 0x4000_2000 as *const _;
1127 #[doc = r"Return the pointer to the register block"]
1128 #[inline(always)]
1129 pub const fn ptr() -> *const tim14::RegisterBlock {
1130 Self::PTR
1131 }
1132}
1133impl Deref for TIM14 {
1134 type Target = tim14::RegisterBlock;
1135 #[inline(always)]
1136 fn deref(&self) -> &Self::Target {
1137 unsafe { &*Self::PTR }
1138 }
1139}
1140impl core::fmt::Debug for TIM14 {
1141 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1142 f.debug_struct("TIM14").finish()
1143 }
1144}
1145#[doc = "General purpose timer"]
1146pub mod tim14;
1147#[doc = "TIM15"]
1148pub struct TIM15 {
1149 _marker: PhantomData<*const ()>,
1150}
1151unsafe impl Send for TIM15 {}
1152impl TIM15 {
1153 #[doc = r"Pointer to the register block"]
1154 pub const PTR: *const tim15::RegisterBlock = 0x4001_4000 as *const _;
1155 #[doc = r"Return the pointer to the register block"]
1156 #[inline(always)]
1157 pub const fn ptr() -> *const tim15::RegisterBlock {
1158 Self::PTR
1159 }
1160}
1161impl Deref for TIM15 {
1162 type Target = tim15::RegisterBlock;
1163 #[inline(always)]
1164 fn deref(&self) -> &Self::Target {
1165 unsafe { &*Self::PTR }
1166 }
1167}
1168impl core::fmt::Debug for TIM15 {
1169 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1170 f.debug_struct("TIM15").finish()
1171 }
1172}
1173#[doc = "TIM15"]
1174pub mod tim15;
1175#[doc = "General purpose timer"]
1176pub struct TIM16 {
1177 _marker: PhantomData<*const ()>,
1178}
1179unsafe impl Send for TIM16 {}
1180impl TIM16 {
1181 #[doc = r"Pointer to the register block"]
1182 pub const PTR: *const tim16::RegisterBlock = 0x4001_4400 as *const _;
1183 #[doc = r"Return the pointer to the register block"]
1184 #[inline(always)]
1185 pub const fn ptr() -> *const tim16::RegisterBlock {
1186 Self::PTR
1187 }
1188}
1189impl Deref for TIM16 {
1190 type Target = tim16::RegisterBlock;
1191 #[inline(always)]
1192 fn deref(&self) -> &Self::Target {
1193 unsafe { &*Self::PTR }
1194 }
1195}
1196impl core::fmt::Debug for TIM16 {
1197 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1198 f.debug_struct("TIM16").finish()
1199 }
1200}
1201#[doc = "General purpose timer"]
1202pub mod tim16;
1203#[doc = "General purpose timer"]
1204pub struct TIM17 {
1205 _marker: PhantomData<*const ()>,
1206}
1207unsafe impl Send for TIM17 {}
1208impl TIM17 {
1209 #[doc = r"Pointer to the register block"]
1210 pub const PTR: *const tim16::RegisterBlock = 0x4001_4800 as *const _;
1211 #[doc = r"Return the pointer to the register block"]
1212 #[inline(always)]
1213 pub const fn ptr() -> *const tim16::RegisterBlock {
1214 Self::PTR
1215 }
1216}
1217impl Deref for TIM17 {
1218 type Target = tim16::RegisterBlock;
1219 #[inline(always)]
1220 fn deref(&self) -> &Self::Target {
1221 unsafe { &*Self::PTR }
1222 }
1223}
1224impl core::fmt::Debug for TIM17 {
1225 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1226 f.debug_struct("TIM17").finish()
1227 }
1228}
1229#[doc = "General purpose timer"]
1230pub use tim16 as tim17;
1231#[doc = "Universal synchronous asynchronous receiver transmitter"]
1232pub struct USART1 {
1233 _marker: PhantomData<*const ()>,
1234}
1235unsafe impl Send for USART1 {}
1236impl USART1 {
1237 #[doc = r"Pointer to the register block"]
1238 pub const PTR: *const usart1::RegisterBlock = 0x4001_3800 as *const _;
1239 #[doc = r"Return the pointer to the register block"]
1240 #[inline(always)]
1241 pub const fn ptr() -> *const usart1::RegisterBlock {
1242 Self::PTR
1243 }
1244}
1245impl Deref for USART1 {
1246 type Target = usart1::RegisterBlock;
1247 #[inline(always)]
1248 fn deref(&self) -> &Self::Target {
1249 unsafe { &*Self::PTR }
1250 }
1251}
1252impl core::fmt::Debug for USART1 {
1253 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1254 f.debug_struct("USART1").finish()
1255 }
1256}
1257#[doc = "Universal synchronous asynchronous receiver transmitter"]
1258pub mod usart1;
1259#[doc = "Universal synchronous asynchronous receiver transmitter"]
1260pub struct USART2 {
1261 _marker: PhantomData<*const ()>,
1262}
1263unsafe impl Send for USART2 {}
1264impl USART2 {
1265 #[doc = r"Pointer to the register block"]
1266 pub const PTR: *const usart1::RegisterBlock = 0x4000_4400 as *const _;
1267 #[doc = r"Return the pointer to the register block"]
1268 #[inline(always)]
1269 pub const fn ptr() -> *const usart1::RegisterBlock {
1270 Self::PTR
1271 }
1272}
1273impl Deref for USART2 {
1274 type Target = usart1::RegisterBlock;
1275 #[inline(always)]
1276 fn deref(&self) -> &Self::Target {
1277 unsafe { &*Self::PTR }
1278 }
1279}
1280impl core::fmt::Debug for USART2 {
1281 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1282 f.debug_struct("USART2").finish()
1283 }
1284}
1285#[doc = "Universal synchronous asynchronous receiver transmitter"]
1286pub use usart1 as usart2;
1287#[doc = "desc USART"]
1288pub struct USART3 {
1289 _marker: PhantomData<*const ()>,
1290}
1291unsafe impl Send for USART3 {}
1292impl USART3 {
1293 #[doc = r"Pointer to the register block"]
1294 pub const PTR: *const usart1::RegisterBlock = 0x4000_4800 as *const _;
1295 #[doc = r"Return the pointer to the register block"]
1296 #[inline(always)]
1297 pub const fn ptr() -> *const usart1::RegisterBlock {
1298 Self::PTR
1299 }
1300}
1301impl Deref for USART3 {
1302 type Target = usart1::RegisterBlock;
1303 #[inline(always)]
1304 fn deref(&self) -> &Self::Target {
1305 unsafe { &*Self::PTR }
1306 }
1307}
1308impl core::fmt::Debug for USART3 {
1309 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1310 f.debug_struct("USART3").finish()
1311 }
1312}
1313#[doc = "desc USART"]
1314pub use usart1 as usart3;
1315#[doc = "desc USART"]
1316pub struct USART4 {
1317 _marker: PhantomData<*const ()>,
1318}
1319unsafe impl Send for USART4 {}
1320impl USART4 {
1321 #[doc = r"Pointer to the register block"]
1322 pub const PTR: *const usart1::RegisterBlock = 0x4000_4c00 as *const _;
1323 #[doc = r"Return the pointer to the register block"]
1324 #[inline(always)]
1325 pub const fn ptr() -> *const usart1::RegisterBlock {
1326 Self::PTR
1327 }
1328}
1329impl Deref for USART4 {
1330 type Target = usart1::RegisterBlock;
1331 #[inline(always)]
1332 fn deref(&self) -> &Self::Target {
1333 unsafe { &*Self::PTR }
1334 }
1335}
1336impl core::fmt::Debug for USART4 {
1337 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1338 f.debug_struct("USART4").finish()
1339 }
1340}
1341#[doc = "desc USART"]
1342pub use usart1 as usart4;
1343#[doc = "USB"]
1344pub struct USB {
1345 _marker: PhantomData<*const ()>,
1346}
1347unsafe impl Send for USB {}
1348impl USB {
1349 #[doc = r"Pointer to the register block"]
1350 pub const PTR: *const usb::RegisterBlock = 0x4000_5c00 as *const _;
1351 #[doc = r"Return the pointer to the register block"]
1352 #[inline(always)]
1353 pub const fn ptr() -> *const usb::RegisterBlock {
1354 Self::PTR
1355 }
1356}
1357impl Deref for USB {
1358 type Target = usb::RegisterBlock;
1359 #[inline(always)]
1360 fn deref(&self) -> &Self::Target {
1361 unsafe { &*Self::PTR }
1362 }
1363}
1364impl core::fmt::Debug for USB {
1365 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1366 f.debug_struct("USB").finish()
1367 }
1368}
1369#[doc = "USB"]
1370pub mod usb;
1371#[doc = "Window watchdog"]
1372pub struct WWDG {
1373 _marker: PhantomData<*const ()>,
1374}
1375unsafe impl Send for WWDG {}
1376impl WWDG {
1377 #[doc = r"Pointer to the register block"]
1378 pub const PTR: *const wwdg::RegisterBlock = 0x4000_2c00 as *const _;
1379 #[doc = r"Return the pointer to the register block"]
1380 #[inline(always)]
1381 pub const fn ptr() -> *const wwdg::RegisterBlock {
1382 Self::PTR
1383 }
1384}
1385impl Deref for WWDG {
1386 type Target = wwdg::RegisterBlock;
1387 #[inline(always)]
1388 fn deref(&self) -> &Self::Target {
1389 unsafe { &*Self::PTR }
1390 }
1391}
1392impl core::fmt::Debug for WWDG {
1393 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1394 f.debug_struct("WWDG").finish()
1395 }
1396}
1397#[doc = "Window watchdog"]
1398pub mod wwdg;
1399#[no_mangle]
1400static mut DEVICE_PERIPHERALS: bool = false;
1401#[doc = r"All the peripherals"]
1402#[allow(non_snake_case)]
1403pub struct Peripherals {
1404 #[doc = "ADC"]
1405 pub ADC: ADC,
1406 #[doc = "COMP1"]
1407 pub COMP1: COMP1,
1408 #[doc = "COMP2"]
1409 pub COMP2: COMP2,
1410 #[doc = "COMP3"]
1411 pub COMP3: COMP3,
1412 #[doc = "CRC"]
1413 pub CRC: CRC,
1414 #[doc = "CTC"]
1415 pub CTC: CTC,
1416 #[doc = "DAC"]
1417 pub DAC: DAC,
1418 #[doc = "DBGMCU"]
1419 pub DBGMCU: DBGMCU,
1420 #[doc = "DMA"]
1421 pub DMA: DMA,
1422 #[doc = "EXTI"]
1423 pub EXTI: EXTI,
1424 #[doc = "FLASH"]
1425 pub FLASH: FLASH,
1426 #[doc = "GPIOA"]
1427 pub GPIOA: GPIOA,
1428 #[doc = "GPIOB"]
1429 pub GPIOB: GPIOB,
1430 #[doc = "GPIOC"]
1431 pub GPIOC: GPIOC,
1432 #[doc = "GPIOF"]
1433 pub GPIOF: GPIOF,
1434 #[doc = "DIV"]
1435 pub DIV: DIV,
1436 #[doc = "I2C1"]
1437 pub I2C1: I2C1,
1438 #[doc = "I2C2"]
1439 pub I2C2: I2C2,
1440 #[doc = "IWDG"]
1441 pub IWDG: IWDG,
1442 #[doc = "LCD"]
1443 pub LCD: LCD,
1444 #[doc = "LPTIM1"]
1445 pub LPTIM1: LPTIM1,
1446 #[doc = "OPA"]
1447 pub OPA: OPA,
1448 #[doc = "PWR"]
1449 pub PWR: PWR,
1450 #[doc = "RCC"]
1451 pub RCC: RCC,
1452 #[doc = "RTC"]
1453 pub RTC: RTC,
1454 #[doc = "SPI1"]
1455 pub SPI1: SPI1,
1456 #[doc = "SPI2"]
1457 pub SPI2: SPI2,
1458 #[doc = "SYSCFG"]
1459 pub SYSCFG: SYSCFG,
1460 #[doc = "TIM1"]
1461 pub TIM1: TIM1,
1462 #[doc = "TIM2"]
1463 pub TIM2: TIM2,
1464 #[doc = "TIM3"]
1465 pub TIM3: TIM3,
1466 #[doc = "TIM6"]
1467 pub TIM6: TIM6,
1468 #[doc = "TIM7"]
1469 pub TIM7: TIM7,
1470 #[doc = "TIM14"]
1471 pub TIM14: TIM14,
1472 #[doc = "TIM15"]
1473 pub TIM15: TIM15,
1474 #[doc = "TIM16"]
1475 pub TIM16: TIM16,
1476 #[doc = "TIM17"]
1477 pub TIM17: TIM17,
1478 #[doc = "USART1"]
1479 pub USART1: USART1,
1480 #[doc = "USART2"]
1481 pub USART2: USART2,
1482 #[doc = "USART3"]
1483 pub USART3: USART3,
1484 #[doc = "USART4"]
1485 pub USART4: USART4,
1486 #[doc = "USB"]
1487 pub USB: USB,
1488 #[doc = "WWDG"]
1489 pub WWDG: WWDG,
1490}
1491impl Peripherals {
1492 #[doc = r"Returns all the peripherals *once*"]
1493 #[inline]
1494 pub fn take() -> Option<Self> {
1495 cortex_m::interrupt::free(|_| {
1496 if unsafe { DEVICE_PERIPHERALS } {
1497 None
1498 } else {
1499 Some(unsafe { Peripherals::steal() })
1500 }
1501 })
1502 }
1503 #[doc = r"Unchecked version of `Peripherals::take`"]
1504 #[inline]
1505 pub unsafe fn steal() -> Self {
1506 DEVICE_PERIPHERALS = true;
1507 Peripherals {
1508 ADC: ADC {
1509 _marker: PhantomData,
1510 },
1511 COMP1: COMP1 {
1512 _marker: PhantomData,
1513 },
1514 COMP2: COMP2 {
1515 _marker: PhantomData,
1516 },
1517 COMP3: COMP3 {
1518 _marker: PhantomData,
1519 },
1520 CRC: CRC {
1521 _marker: PhantomData,
1522 },
1523 CTC: CTC {
1524 _marker: PhantomData,
1525 },
1526 DAC: DAC {
1527 _marker: PhantomData,
1528 },
1529 DBGMCU: DBGMCU {
1530 _marker: PhantomData,
1531 },
1532 DMA: DMA {
1533 _marker: PhantomData,
1534 },
1535 EXTI: EXTI {
1536 _marker: PhantomData,
1537 },
1538 FLASH: FLASH {
1539 _marker: PhantomData,
1540 },
1541 GPIOA: GPIOA {
1542 _marker: PhantomData,
1543 },
1544 GPIOB: GPIOB {
1545 _marker: PhantomData,
1546 },
1547 GPIOC: GPIOC {
1548 _marker: PhantomData,
1549 },
1550 GPIOF: GPIOF {
1551 _marker: PhantomData,
1552 },
1553 DIV: DIV {
1554 _marker: PhantomData,
1555 },
1556 I2C1: I2C1 {
1557 _marker: PhantomData,
1558 },
1559 I2C2: I2C2 {
1560 _marker: PhantomData,
1561 },
1562 IWDG: IWDG {
1563 _marker: PhantomData,
1564 },
1565 LCD: LCD {
1566 _marker: PhantomData,
1567 },
1568 LPTIM1: LPTIM1 {
1569 _marker: PhantomData,
1570 },
1571 OPA: OPA {
1572 _marker: PhantomData,
1573 },
1574 PWR: PWR {
1575 _marker: PhantomData,
1576 },
1577 RCC: RCC {
1578 _marker: PhantomData,
1579 },
1580 RTC: RTC {
1581 _marker: PhantomData,
1582 },
1583 SPI1: SPI1 {
1584 _marker: PhantomData,
1585 },
1586 SPI2: SPI2 {
1587 _marker: PhantomData,
1588 },
1589 SYSCFG: SYSCFG {
1590 _marker: PhantomData,
1591 },
1592 TIM1: TIM1 {
1593 _marker: PhantomData,
1594 },
1595 TIM2: TIM2 {
1596 _marker: PhantomData,
1597 },
1598 TIM3: TIM3 {
1599 _marker: PhantomData,
1600 },
1601 TIM6: TIM6 {
1602 _marker: PhantomData,
1603 },
1604 TIM7: TIM7 {
1605 _marker: PhantomData,
1606 },
1607 TIM14: TIM14 {
1608 _marker: PhantomData,
1609 },
1610 TIM15: TIM15 {
1611 _marker: PhantomData,
1612 },
1613 TIM16: TIM16 {
1614 _marker: PhantomData,
1615 },
1616 TIM17: TIM17 {
1617 _marker: PhantomData,
1618 },
1619 USART1: USART1 {
1620 _marker: PhantomData,
1621 },
1622 USART2: USART2 {
1623 _marker: PhantomData,
1624 },
1625 USART3: USART3 {
1626 _marker: PhantomData,
1627 },
1628 USART4: USART4 {
1629 _marker: PhantomData,
1630 },
1631 USB: USB {
1632 _marker: PhantomData,
1633 },
1634 WWDG: WWDG {
1635 _marker: PhantomData,
1636 },
1637 }
1638 }
1639}