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