PY32c641xx_pac/
lib.rs

1#![doc = "Peripheral access API for PY32C6XX_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 FLASH();
38    fn RCC();
39    fn EXTI0_1();
40    fn EXTI2_3();
41    fn EXTI4_15();
42    fn ADC_COMP();
43    fn TIM1_BRK_UP_TRG_COM();
44    fn TIM1_CC();
45    fn LPTIM1_DAC();
46    fn TIM14();
47    fn I2C1();
48    fn SPI1();
49    fn USART1();
50}
51#[doc(hidden)]
52pub union Vector {
53    _handler: unsafe extern "C" fn(),
54    _reserved: u32,
55}
56#[cfg(feature = "rt")]
57#[doc(hidden)]
58#[link_section = ".vector_table.interrupts"]
59#[no_mangle]
60pub static __INTERRUPTS: [Vector; 28] = [
61    Vector { _reserved: 0 },
62    Vector { _reserved: 0 },
63    Vector { _reserved: 0 },
64    Vector { _handler: FLASH },
65    Vector { _handler: RCC },
66    Vector { _handler: EXTI0_1 },
67    Vector { _handler: EXTI2_3 },
68    Vector { _handler: EXTI4_15 },
69    Vector { _reserved: 0 },
70    Vector { _reserved: 0 },
71    Vector { _reserved: 0 },
72    Vector { _reserved: 0 },
73    Vector { _handler: ADC_COMP },
74    Vector {
75        _handler: TIM1_BRK_UP_TRG_COM,
76    },
77    Vector { _handler: TIM1_CC },
78    Vector { _reserved: 0 },
79    Vector { _reserved: 0 },
80    Vector {
81        _handler: LPTIM1_DAC,
82    },
83    Vector { _reserved: 0 },
84    Vector { _handler: TIM14 },
85    Vector { _reserved: 0 },
86    Vector { _reserved: 0 },
87    Vector { _reserved: 0 },
88    Vector { _handler: I2C1 },
89    Vector { _reserved: 0 },
90    Vector { _handler: SPI1 },
91    Vector { _reserved: 0 },
92    Vector { _handler: USART1 },
93];
94#[doc = r"Enumeration of all the interrupts."]
95#[derive(Copy, Clone, Debug, PartialEq, Eq)]
96#[repr(u16)]
97pub enum Interrupt {
98    #[doc = "3 - FLASH global Interrupt"]
99    FLASH = 3,
100    #[doc = "4 - RCC global Interrupt"]
101    RCC = 4,
102    #[doc = "5 - EXTI Line 0 and 1 Interrupt"]
103    EXTI0_1 = 5,
104    #[doc = "6 - EXTI Line 2 and 3 Interrupt"]
105    EXTI2_3 = 6,
106    #[doc = "7 - EXTI Line 4 to 15 Interrupt"]
107    EXTI4_15 = 7,
108    #[doc = "12 - ADC and COMP Interrupt"]
109    ADC_COMP = 12,
110    #[doc = "13 - TIM1 Break, Update, Trigger and Commutation Interrupt"]
111    TIM1_BRK_UP_TRG_COM = 13,
112    #[doc = "14 - TIM1 Capture Compare Interrupt"]
113    TIM1_CC = 14,
114    #[doc = "17 - LPTIM1, DAC global Interrupts"]
115    LPTIM1_DAC = 17,
116    #[doc = "19 - TIM14 global Interrupt"]
117    TIM14 = 19,
118    #[doc = "23 - I2C1 global Interrupt"]
119    I2C1 = 23,
120    #[doc = "25 - SPI1 global Interrupt"]
121    SPI1 = 25,
122    #[doc = "27 - USART1 global Interrupt"]
123    USART1 = 27,
124}
125unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
126    #[inline(always)]
127    fn number(self) -> u16 {
128        self as u16
129    }
130}
131#[doc = "Analog to Digital Converter"]
132pub struct ADC {
133    _marker: PhantomData<*const ()>,
134}
135unsafe impl Send for ADC {}
136impl ADC {
137    #[doc = r"Pointer to the register block"]
138    pub const PTR: *const adc::RegisterBlock = 0x4001_2400 as *const _;
139    #[doc = r"Return the pointer to the register block"]
140    #[inline(always)]
141    pub const fn ptr() -> *const adc::RegisterBlock {
142        Self::PTR
143    }
144}
145impl Deref for ADC {
146    type Target = adc::RegisterBlock;
147    #[inline(always)]
148    fn deref(&self) -> &Self::Target {
149        unsafe { &*Self::PTR }
150    }
151}
152impl core::fmt::Debug for ADC {
153    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
154        f.debug_struct("ADC").finish()
155    }
156}
157#[doc = "Analog to Digital Converter"]
158pub mod adc;
159#[doc = "Comparator 1"]
160pub struct COMP1 {
161    _marker: PhantomData<*const ()>,
162}
163unsafe impl Send for COMP1 {}
164impl COMP1 {
165    #[doc = r"Pointer to the register block"]
166    pub const PTR: *const comp1::RegisterBlock = 0x4001_0200 as *const _;
167    #[doc = r"Return the pointer to the register block"]
168    #[inline(always)]
169    pub const fn ptr() -> *const comp1::RegisterBlock {
170        Self::PTR
171    }
172}
173impl Deref for COMP1 {
174    type Target = comp1::RegisterBlock;
175    #[inline(always)]
176    fn deref(&self) -> &Self::Target {
177        unsafe { &*Self::PTR }
178    }
179}
180impl core::fmt::Debug for COMP1 {
181    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
182        f.debug_struct("COMP1").finish()
183    }
184}
185#[doc = "Comparator 1"]
186pub mod comp1;
187#[doc = "Comparator2"]
188pub struct COMP2 {
189    _marker: PhantomData<*const ()>,
190}
191unsafe impl Send for COMP2 {}
192impl COMP2 {
193    #[doc = r"Pointer to the register block"]
194    pub const PTR: *const comp2::RegisterBlock = 0x4001_0210 as *const _;
195    #[doc = r"Return the pointer to the register block"]
196    #[inline(always)]
197    pub const fn ptr() -> *const comp2::RegisterBlock {
198        Self::PTR
199    }
200}
201impl Deref for COMP2 {
202    type Target = comp2::RegisterBlock;
203    #[inline(always)]
204    fn deref(&self) -> &Self::Target {
205        unsafe { &*Self::PTR }
206    }
207}
208impl core::fmt::Debug for COMP2 {
209    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
210        f.debug_struct("COMP2").finish()
211    }
212}
213#[doc = "Comparator2"]
214pub mod comp2;
215#[doc = "Reset and clock control"]
216pub struct RCC {
217    _marker: PhantomData<*const ()>,
218}
219unsafe impl Send for RCC {}
220impl RCC {
221    #[doc = r"Pointer to the register block"]
222    pub const PTR: *const rcc::RegisterBlock = 0x4002_1000 as *const _;
223    #[doc = r"Return the pointer to the register block"]
224    #[inline(always)]
225    pub const fn ptr() -> *const rcc::RegisterBlock {
226        Self::PTR
227    }
228}
229impl Deref for RCC {
230    type Target = rcc::RegisterBlock;
231    #[inline(always)]
232    fn deref(&self) -> &Self::Target {
233        unsafe { &*Self::PTR }
234    }
235}
236impl core::fmt::Debug for RCC {
237    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
238        f.debug_struct("RCC").finish()
239    }
240}
241#[doc = "Reset and clock control"]
242pub mod rcc;
243#[doc = "Power control"]
244pub struct PWR {
245    _marker: PhantomData<*const ()>,
246}
247unsafe impl Send for PWR {}
248impl PWR {
249    #[doc = r"Pointer to the register block"]
250    pub const PTR: *const pwr::RegisterBlock = 0x4000_7000 as *const _;
251    #[doc = r"Return the pointer to the register block"]
252    #[inline(always)]
253    pub const fn ptr() -> *const pwr::RegisterBlock {
254        Self::PTR
255    }
256}
257impl Deref for PWR {
258    type Target = pwr::RegisterBlock;
259    #[inline(always)]
260    fn deref(&self) -> &Self::Target {
261        unsafe { &*Self::PTR }
262    }
263}
264impl core::fmt::Debug for PWR {
265    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
266        f.debug_struct("PWR").finish()
267    }
268}
269#[doc = "Power control"]
270pub mod pwr;
271#[doc = "General-purpose I/Os"]
272pub struct GPIOA {
273    _marker: PhantomData<*const ()>,
274}
275unsafe impl Send for GPIOA {}
276impl GPIOA {
277    #[doc = r"Pointer to the register block"]
278    pub const PTR: *const gpioa::RegisterBlock = 0x5000_0000 as *const _;
279    #[doc = r"Return the pointer to the register block"]
280    #[inline(always)]
281    pub const fn ptr() -> *const gpioa::RegisterBlock {
282        Self::PTR
283    }
284}
285impl Deref for GPIOA {
286    type Target = gpioa::RegisterBlock;
287    #[inline(always)]
288    fn deref(&self) -> &Self::Target {
289        unsafe { &*Self::PTR }
290    }
291}
292impl core::fmt::Debug for GPIOA {
293    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
294        f.debug_struct("GPIOA").finish()
295    }
296}
297#[doc = "General-purpose I/Os"]
298pub mod gpioa;
299#[doc = "General-purpose I/Os"]
300pub struct GPIOB {
301    _marker: PhantomData<*const ()>,
302}
303unsafe impl Send for GPIOB {}
304impl GPIOB {
305    #[doc = r"Pointer to the register block"]
306    pub const PTR: *const gpiob::RegisterBlock = 0x5000_0400 as *const _;
307    #[doc = r"Return the pointer to the register block"]
308    #[inline(always)]
309    pub const fn ptr() -> *const gpiob::RegisterBlock {
310        Self::PTR
311    }
312}
313impl Deref for GPIOB {
314    type Target = gpiob::RegisterBlock;
315    #[inline(always)]
316    fn deref(&self) -> &Self::Target {
317        unsafe { &*Self::PTR }
318    }
319}
320impl core::fmt::Debug for GPIOB {
321    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
322        f.debug_struct("GPIOB").finish()
323    }
324}
325#[doc = "General-purpose I/Os"]
326pub mod gpiob;
327#[doc = "General-purpose I/Os"]
328pub struct GPIOC {
329    _marker: PhantomData<*const ()>,
330}
331unsafe impl Send for GPIOC {}
332impl GPIOC {
333    #[doc = r"Pointer to the register block"]
334    pub const PTR: *const gpiob::RegisterBlock = 0x5000_0800 as *const _;
335    #[doc = r"Return the pointer to the register block"]
336    #[inline(always)]
337    pub const fn ptr() -> *const gpiob::RegisterBlock {
338        Self::PTR
339    }
340}
341impl Deref for GPIOC {
342    type Target = gpiob::RegisterBlock;
343    #[inline(always)]
344    fn deref(&self) -> &Self::Target {
345        unsafe { &*Self::PTR }
346    }
347}
348impl core::fmt::Debug for GPIOC {
349    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
350        f.debug_struct("GPIOC").finish()
351    }
352}
353#[doc = "General-purpose I/Os"]
354pub use gpiob as gpioc;
355#[doc = "External interrupt/event controller"]
356pub struct EXTI {
357    _marker: PhantomData<*const ()>,
358}
359unsafe impl Send for EXTI {}
360impl EXTI {
361    #[doc = r"Pointer to the register block"]
362    pub const PTR: *const exti::RegisterBlock = 0x4002_1800 as *const _;
363    #[doc = r"Return the pointer to the register block"]
364    #[inline(always)]
365    pub const fn ptr() -> *const exti::RegisterBlock {
366        Self::PTR
367    }
368}
369impl Deref for EXTI {
370    type Target = exti::RegisterBlock;
371    #[inline(always)]
372    fn deref(&self) -> &Self::Target {
373        unsafe { &*Self::PTR }
374    }
375}
376impl core::fmt::Debug for EXTI {
377    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
378        f.debug_struct("EXTI").finish()
379    }
380}
381#[doc = "External interrupt/event controller"]
382pub mod exti;
383#[doc = "Low power timer"]
384pub struct LPTIM1 {
385    _marker: PhantomData<*const ()>,
386}
387unsafe impl Send for LPTIM1 {}
388impl LPTIM1 {
389    #[doc = r"Pointer to the register block"]
390    pub const PTR: *const lptim1::RegisterBlock = 0x4000_7c00 as *const _;
391    #[doc = r"Return the pointer to the register block"]
392    #[inline(always)]
393    pub const fn ptr() -> *const lptim1::RegisterBlock {
394        Self::PTR
395    }
396}
397impl Deref for LPTIM1 {
398    type Target = lptim1::RegisterBlock;
399    #[inline(always)]
400    fn deref(&self) -> &Self::Target {
401        unsafe { &*Self::PTR }
402    }
403}
404impl core::fmt::Debug for LPTIM1 {
405    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
406        f.debug_struct("LPTIM1").finish()
407    }
408}
409#[doc = "Low power timer"]
410pub mod lptim1;
411#[doc = "Universal synchronous asynchronous receiver transmitter"]
412pub struct USART1 {
413    _marker: PhantomData<*const ()>,
414}
415unsafe impl Send for USART1 {}
416impl USART1 {
417    #[doc = r"Pointer to the register block"]
418    pub const PTR: *const usart1::RegisterBlock = 0x4001_3800 as *const _;
419    #[doc = r"Return the pointer to the register block"]
420    #[inline(always)]
421    pub const fn ptr() -> *const usart1::RegisterBlock {
422        Self::PTR
423    }
424}
425impl Deref for USART1 {
426    type Target = usart1::RegisterBlock;
427    #[inline(always)]
428    fn deref(&self) -> &Self::Target {
429        unsafe { &*Self::PTR }
430    }
431}
432impl core::fmt::Debug for USART1 {
433    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
434        f.debug_struct("USART1").finish()
435    }
436}
437#[doc = "Universal synchronous asynchronous receiver transmitter"]
438pub mod usart1;
439#[doc = "Independent watchdog"]
440pub struct IWDG {
441    _marker: PhantomData<*const ()>,
442}
443unsafe impl Send for IWDG {}
444impl IWDG {
445    #[doc = r"Pointer to the register block"]
446    pub const PTR: *const iwdg::RegisterBlock = 0x4000_3000 as *const _;
447    #[doc = r"Return the pointer to the register block"]
448    #[inline(always)]
449    pub const fn ptr() -> *const iwdg::RegisterBlock {
450        Self::PTR
451    }
452}
453impl Deref for IWDG {
454    type Target = iwdg::RegisterBlock;
455    #[inline(always)]
456    fn deref(&self) -> &Self::Target {
457        unsafe { &*Self::PTR }
458    }
459}
460impl core::fmt::Debug for IWDG {
461    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
462        f.debug_struct("IWDG").finish()
463    }
464}
465#[doc = "Independent watchdog"]
466pub mod iwdg;
467#[doc = "Advanced timer"]
468pub struct TIM1 {
469    _marker: PhantomData<*const ()>,
470}
471unsafe impl Send for TIM1 {}
472impl TIM1 {
473    #[doc = r"Pointer to the register block"]
474    pub const PTR: *const tim1::RegisterBlock = 0x4001_2c00 as *const _;
475    #[doc = r"Return the pointer to the register block"]
476    #[inline(always)]
477    pub const fn ptr() -> *const tim1::RegisterBlock {
478        Self::PTR
479    }
480}
481impl Deref for TIM1 {
482    type Target = tim1::RegisterBlock;
483    #[inline(always)]
484    fn deref(&self) -> &Self::Target {
485        unsafe { &*Self::PTR }
486    }
487}
488impl core::fmt::Debug for TIM1 {
489    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
490        f.debug_struct("TIM1").finish()
491    }
492}
493#[doc = "Advanced timer"]
494pub mod tim1;
495#[doc = "General purpose timer"]
496pub struct TIM14 {
497    _marker: PhantomData<*const ()>,
498}
499unsafe impl Send for TIM14 {}
500impl TIM14 {
501    #[doc = r"Pointer to the register block"]
502    pub const PTR: *const tim14::RegisterBlock = 0x4000_2000 as *const _;
503    #[doc = r"Return the pointer to the register block"]
504    #[inline(always)]
505    pub const fn ptr() -> *const tim14::RegisterBlock {
506        Self::PTR
507    }
508}
509impl Deref for TIM14 {
510    type Target = tim14::RegisterBlock;
511    #[inline(always)]
512    fn deref(&self) -> &Self::Target {
513        unsafe { &*Self::PTR }
514    }
515}
516impl core::fmt::Debug for TIM14 {
517    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
518        f.debug_struct("TIM14").finish()
519    }
520}
521#[doc = "General purpose timer"]
522pub mod tim14;
523#[doc = "System configuration controller"]
524pub struct SYSCFG {
525    _marker: PhantomData<*const ()>,
526}
527unsafe impl Send for SYSCFG {}
528impl SYSCFG {
529    #[doc = r"Pointer to the register block"]
530    pub const PTR: *const syscfg::RegisterBlock = 0x4001_0000 as *const _;
531    #[doc = r"Return the pointer to the register block"]
532    #[inline(always)]
533    pub const fn ptr() -> *const syscfg::RegisterBlock {
534        Self::PTR
535    }
536}
537impl Deref for SYSCFG {
538    type Target = syscfg::RegisterBlock;
539    #[inline(always)]
540    fn deref(&self) -> &Self::Target {
541        unsafe { &*Self::PTR }
542    }
543}
544impl core::fmt::Debug for SYSCFG {
545    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
546        f.debug_struct("SYSCFG").finish()
547    }
548}
549#[doc = "System configuration controller"]
550pub mod syscfg;
551#[doc = "Flash"]
552pub struct FLASH {
553    _marker: PhantomData<*const ()>,
554}
555unsafe impl Send for FLASH {}
556impl FLASH {
557    #[doc = r"Pointer to the register block"]
558    pub const PTR: *const flash::RegisterBlock = 0x4002_2000 as *const _;
559    #[doc = r"Return the pointer to the register block"]
560    #[inline(always)]
561    pub const fn ptr() -> *const flash::RegisterBlock {
562        Self::PTR
563    }
564}
565impl Deref for FLASH {
566    type Target = flash::RegisterBlock;
567    #[inline(always)]
568    fn deref(&self) -> &Self::Target {
569        unsafe { &*Self::PTR }
570    }
571}
572impl core::fmt::Debug for FLASH {
573    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
574        f.debug_struct("FLASH").finish()
575    }
576}
577#[doc = "Flash"]
578pub mod flash;
579#[doc = "CRC calculation unit"]
580pub struct CRC {
581    _marker: PhantomData<*const ()>,
582}
583unsafe impl Send for CRC {}
584impl CRC {
585    #[doc = r"Pointer to the register block"]
586    pub const PTR: *const crc::RegisterBlock = 0x4002_3000 as *const _;
587    #[doc = r"Return the pointer to the register block"]
588    #[inline(always)]
589    pub const fn ptr() -> *const crc::RegisterBlock {
590        Self::PTR
591    }
592}
593impl Deref for CRC {
594    type Target = crc::RegisterBlock;
595    #[inline(always)]
596    fn deref(&self) -> &Self::Target {
597        unsafe { &*Self::PTR }
598    }
599}
600impl core::fmt::Debug for CRC {
601    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
602        f.debug_struct("CRC").finish()
603    }
604}
605#[doc = "CRC calculation unit"]
606pub mod crc;
607#[doc = "Serial peripheral interface"]
608pub struct SPI1 {
609    _marker: PhantomData<*const ()>,
610}
611unsafe impl Send for SPI1 {}
612impl SPI1 {
613    #[doc = r"Pointer to the register block"]
614    pub const PTR: *const spi1::RegisterBlock = 0x4001_3000 as *const _;
615    #[doc = r"Return the pointer to the register block"]
616    #[inline(always)]
617    pub const fn ptr() -> *const spi1::RegisterBlock {
618        Self::PTR
619    }
620}
621impl Deref for SPI1 {
622    type Target = spi1::RegisterBlock;
623    #[inline(always)]
624    fn deref(&self) -> &Self::Target {
625        unsafe { &*Self::PTR }
626    }
627}
628impl core::fmt::Debug for SPI1 {
629    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
630        f.debug_struct("SPI1").finish()
631    }
632}
633#[doc = "Serial peripheral interface"]
634pub mod spi1;
635#[doc = "Inter integrated circuit"]
636pub struct I2C {
637    _marker: PhantomData<*const ()>,
638}
639unsafe impl Send for I2C {}
640impl I2C {
641    #[doc = r"Pointer to the register block"]
642    pub const PTR: *const i2c::RegisterBlock = 0x4000_5400 as *const _;
643    #[doc = r"Return the pointer to the register block"]
644    #[inline(always)]
645    pub const fn ptr() -> *const i2c::RegisterBlock {
646        Self::PTR
647    }
648}
649impl Deref for I2C {
650    type Target = i2c::RegisterBlock;
651    #[inline(always)]
652    fn deref(&self) -> &Self::Target {
653        unsafe { &*Self::PTR }
654    }
655}
656impl core::fmt::Debug for I2C {
657    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
658        f.debug_struct("I2C").finish()
659    }
660}
661#[doc = "Inter integrated circuit"]
662pub mod i2c;
663#[doc = "Debug support"]
664pub struct DBGMCU {
665    _marker: PhantomData<*const ()>,
666}
667unsafe impl Send for DBGMCU {}
668impl DBGMCU {
669    #[doc = r"Pointer to the register block"]
670    pub const PTR: *const dbgmcu::RegisterBlock = 0x4001_5800 as *const _;
671    #[doc = r"Return the pointer to the register block"]
672    #[inline(always)]
673    pub const fn ptr() -> *const dbgmcu::RegisterBlock {
674        Self::PTR
675    }
676}
677impl Deref for DBGMCU {
678    type Target = dbgmcu::RegisterBlock;
679    #[inline(always)]
680    fn deref(&self) -> &Self::Target {
681        unsafe { &*Self::PTR }
682    }
683}
684impl core::fmt::Debug for DBGMCU {
685    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
686        f.debug_struct("DBGMCU").finish()
687    }
688}
689#[doc = "Debug support"]
690pub mod dbgmcu;
691#[no_mangle]
692static mut DEVICE_PERIPHERALS: bool = false;
693#[doc = r"All the peripherals"]
694#[allow(non_snake_case)]
695pub struct Peripherals {
696    #[doc = "ADC"]
697    pub ADC: ADC,
698    #[doc = "COMP1"]
699    pub COMP1: COMP1,
700    #[doc = "COMP2"]
701    pub COMP2: COMP2,
702    #[doc = "RCC"]
703    pub RCC: RCC,
704    #[doc = "PWR"]
705    pub PWR: PWR,
706    #[doc = "GPIOA"]
707    pub GPIOA: GPIOA,
708    #[doc = "GPIOB"]
709    pub GPIOB: GPIOB,
710    #[doc = "GPIOC"]
711    pub GPIOC: GPIOC,
712    #[doc = "EXTI"]
713    pub EXTI: EXTI,
714    #[doc = "LPTIM1"]
715    pub LPTIM1: LPTIM1,
716    #[doc = "USART1"]
717    pub USART1: USART1,
718    #[doc = "IWDG"]
719    pub IWDG: IWDG,
720    #[doc = "TIM1"]
721    pub TIM1: TIM1,
722    #[doc = "TIM14"]
723    pub TIM14: TIM14,
724    #[doc = "SYSCFG"]
725    pub SYSCFG: SYSCFG,
726    #[doc = "FLASH"]
727    pub FLASH: FLASH,
728    #[doc = "CRC"]
729    pub CRC: CRC,
730    #[doc = "SPI1"]
731    pub SPI1: SPI1,
732    #[doc = "I2C"]
733    pub I2C: I2C,
734    #[doc = "DBGMCU"]
735    pub DBGMCU: DBGMCU,
736}
737impl Peripherals {
738    #[doc = r"Returns all the peripherals *once*"]
739    #[inline]
740    pub fn take() -> Option<Self> {
741        cortex_m::interrupt::free(|_| {
742            if unsafe { DEVICE_PERIPHERALS } {
743                None
744            } else {
745                Some(unsafe { Peripherals::steal() })
746            }
747        })
748    }
749    #[doc = r"Unchecked version of `Peripherals::take`"]
750    #[inline]
751    pub unsafe fn steal() -> Self {
752        DEVICE_PERIPHERALS = true;
753        Peripherals {
754            ADC: ADC {
755                _marker: PhantomData,
756            },
757            COMP1: COMP1 {
758                _marker: PhantomData,
759            },
760            COMP2: COMP2 {
761                _marker: PhantomData,
762            },
763            RCC: RCC {
764                _marker: PhantomData,
765            },
766            PWR: PWR {
767                _marker: PhantomData,
768            },
769            GPIOA: GPIOA {
770                _marker: PhantomData,
771            },
772            GPIOB: GPIOB {
773                _marker: PhantomData,
774            },
775            GPIOC: GPIOC {
776                _marker: PhantomData,
777            },
778            EXTI: EXTI {
779                _marker: PhantomData,
780            },
781            LPTIM1: LPTIM1 {
782                _marker: PhantomData,
783            },
784            USART1: USART1 {
785                _marker: PhantomData,
786            },
787            IWDG: IWDG {
788                _marker: PhantomData,
789            },
790            TIM1: TIM1 {
791                _marker: PhantomData,
792            },
793            TIM14: TIM14 {
794                _marker: PhantomData,
795            },
796            SYSCFG: SYSCFG {
797                _marker: PhantomData,
798            },
799            FLASH: FLASH {
800                _marker: PhantomData,
801            },
802            CRC: CRC {
803                _marker: PhantomData,
804            },
805            SPI1: SPI1 {
806                _marker: PhantomData,
807            },
808            I2C: I2C {
809                _marker: PhantomData,
810            },
811            DBGMCU: DBGMCU {
812                _marker: PhantomData,
813            },
814        }
815    }
816}