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