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