1#![doc = "Peripheral access API for ESP32-C2 microcontrollers (generated using svd2rust v0.35.0 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next] svd2rust 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.35.0/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
2#![allow(non_camel_case_types)]
3#![allow(non_snake_case)]
4#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/46717278")]
5#![no_std]
6use core::marker::PhantomData;
7use core::ops::Deref;
8#[doc = r"Number available in the NVIC for configuring priority"]
9pub const NVIC_PRIO_BITS: u8 = 0;
10#[allow(unused_imports)]
11use generic::*;
12#[doc = r"Common register and bit access and modify traits"]
13pub mod generic;
14#[cfg(feature = "rt")]
15extern "C" {
16 fn WIFI_MAC();
17 fn WIFI_MAC_NMI();
18 fn WIFI_PWR();
19 fn WIFI_BB();
20 fn BT_MAC();
21 fn BT_BB();
22 fn BT_BB_NMI();
23 fn LP_TIMER();
24 fn COEX();
25 fn BLE_TIMER();
26 fn BLE_SEC();
27 fn I2C_MST();
28 fn APB_CTRL();
29 fn GPIO();
30 fn GPIO_NMI();
31 fn SPI1();
32 fn SPI2();
33 fn UART0();
34 fn UART1();
35 fn LEDC();
36 fn EFUSE();
37 fn RTC_CORE();
38 fn I2C_EXT0();
39 fn TG0_T0_LEVEL();
40 fn TG0_WDT_LEVEL();
41 fn CACHE_IA();
42 fn SYSTIMER_TARGET0();
43 fn SYSTIMER_TARGET1();
44 fn SYSTIMER_TARGET2();
45 fn SPI_MEM_REJECT_CACHE();
46 fn ICACHE_PRELOAD0();
47 fn ICACHE_SYNC0();
48 fn APB_ADC();
49 fn DMA_CH0();
50 fn SHA();
51 fn ECC();
52 fn FROM_CPU_INTR0();
53 fn FROM_CPU_INTR1();
54 fn FROM_CPU_INTR2();
55 fn FROM_CPU_INTR3();
56 fn ASSIST_DEBUG();
57 fn ETS_CORE0_PIF_PMS_SIZE();
58}
59#[doc(hidden)]
60#[repr(C)]
61pub union Vector {
62 pub _handler: unsafe extern "C" fn(),
63 pub _reserved: usize,
64}
65#[cfg(feature = "rt")]
66#[doc(hidden)]
67#[link_section = ".rwtext"]
68#[no_mangle]
69pub static __EXTERNAL_INTERRUPTS: [Vector; 42] = [
70 Vector { _handler: WIFI_MAC },
71 Vector {
72 _handler: WIFI_MAC_NMI,
73 },
74 Vector { _handler: WIFI_PWR },
75 Vector { _handler: WIFI_BB },
76 Vector { _handler: BT_MAC },
77 Vector { _handler: BT_BB },
78 Vector {
79 _handler: BT_BB_NMI,
80 },
81 Vector { _handler: LP_TIMER },
82 Vector { _handler: COEX },
83 Vector {
84 _handler: BLE_TIMER,
85 },
86 Vector { _handler: BLE_SEC },
87 Vector { _handler: I2C_MST },
88 Vector { _handler: APB_CTRL },
89 Vector { _handler: GPIO },
90 Vector { _handler: GPIO_NMI },
91 Vector { _handler: SPI1 },
92 Vector { _handler: SPI2 },
93 Vector { _handler: UART0 },
94 Vector { _handler: UART1 },
95 Vector { _handler: LEDC },
96 Vector { _handler: EFUSE },
97 Vector { _handler: RTC_CORE },
98 Vector { _handler: I2C_EXT0 },
99 Vector {
100 _handler: TG0_T0_LEVEL,
101 },
102 Vector {
103 _handler: TG0_WDT_LEVEL,
104 },
105 Vector { _handler: CACHE_IA },
106 Vector {
107 _handler: SYSTIMER_TARGET0,
108 },
109 Vector {
110 _handler: SYSTIMER_TARGET1,
111 },
112 Vector {
113 _handler: SYSTIMER_TARGET2,
114 },
115 Vector {
116 _handler: SPI_MEM_REJECT_CACHE,
117 },
118 Vector {
119 _handler: ICACHE_PRELOAD0,
120 },
121 Vector {
122 _handler: ICACHE_SYNC0,
123 },
124 Vector { _handler: APB_ADC },
125 Vector { _handler: DMA_CH0 },
126 Vector { _handler: SHA },
127 Vector { _handler: ECC },
128 Vector {
129 _handler: FROM_CPU_INTR0,
130 },
131 Vector {
132 _handler: FROM_CPU_INTR1,
133 },
134 Vector {
135 _handler: FROM_CPU_INTR2,
136 },
137 Vector {
138 _handler: FROM_CPU_INTR3,
139 },
140 Vector {
141 _handler: ASSIST_DEBUG,
142 },
143 Vector {
144 _handler: ETS_CORE0_PIF_PMS_SIZE,
145 },
146];
147#[doc(hidden)]
148pub mod interrupt;
149pub use self::interrupt::Interrupt;
150#[doc = "APB (Advanced Peripheral Bus) Controller"]
151pub struct APB_CTRL {
152 _marker: PhantomData<*const ()>,
153}
154unsafe impl Send for APB_CTRL {}
155impl APB_CTRL {
156 #[doc = r"Pointer to the register block"]
157 pub const PTR: *const apb_ctrl::RegisterBlock = 0x6002_6000 as *const _;
158 #[doc = r"Return the pointer to the register block"]
159 #[inline(always)]
160 pub const fn ptr() -> *const apb_ctrl::RegisterBlock {
161 Self::PTR
162 }
163 #[doc = r" Steal an instance of this peripheral"]
164 #[doc = r""]
165 #[doc = r" # Safety"]
166 #[doc = r""]
167 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
168 #[doc = r" that may race with any existing instances, for example by only"]
169 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
170 #[doc = r" original peripheral and using critical sections to coordinate"]
171 #[doc = r" access between multiple new instances."]
172 #[doc = r""]
173 #[doc = r" Additionally, other software such as HALs may rely on only one"]
174 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
175 #[doc = r" no stolen instances are passed to such software."]
176 pub unsafe fn steal() -> Self {
177 Self {
178 _marker: PhantomData,
179 }
180 }
181}
182impl Deref for APB_CTRL {
183 type Target = apb_ctrl::RegisterBlock;
184 #[inline(always)]
185 fn deref(&self) -> &Self::Target {
186 unsafe { &*Self::PTR }
187 }
188}
189impl core::fmt::Debug for APB_CTRL {
190 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
191 f.debug_struct("APB_CTRL").finish()
192 }
193}
194#[doc = "APB (Advanced Peripheral Bus) Controller"]
195pub mod apb_ctrl;
196#[doc = "SAR (Successive Approximation Register) Analog-to-Digital Converter"]
197pub struct APB_SARADC {
198 _marker: PhantomData<*const ()>,
199}
200unsafe impl Send for APB_SARADC {}
201impl APB_SARADC {
202 #[doc = r"Pointer to the register block"]
203 pub const PTR: *const apb_saradc::RegisterBlock = 0x6004_0000 as *const _;
204 #[doc = r"Return the pointer to the register block"]
205 #[inline(always)]
206 pub const fn ptr() -> *const apb_saradc::RegisterBlock {
207 Self::PTR
208 }
209 #[doc = r" Steal an instance of this peripheral"]
210 #[doc = r""]
211 #[doc = r" # Safety"]
212 #[doc = r""]
213 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
214 #[doc = r" that may race with any existing instances, for example by only"]
215 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
216 #[doc = r" original peripheral and using critical sections to coordinate"]
217 #[doc = r" access between multiple new instances."]
218 #[doc = r""]
219 #[doc = r" Additionally, other software such as HALs may rely on only one"]
220 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
221 #[doc = r" no stolen instances are passed to such software."]
222 pub unsafe fn steal() -> Self {
223 Self {
224 _marker: PhantomData,
225 }
226 }
227}
228impl Deref for APB_SARADC {
229 type Target = apb_saradc::RegisterBlock;
230 #[inline(always)]
231 fn deref(&self) -> &Self::Target {
232 unsafe { &*Self::PTR }
233 }
234}
235impl core::fmt::Debug for APB_SARADC {
236 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
237 f.debug_struct("APB_SARADC").finish()
238 }
239}
240#[doc = "SAR (Successive Approximation Register) Analog-to-Digital Converter"]
241pub mod apb_saradc;
242#[doc = "Debug Assist"]
243pub struct ASSIST_DEBUG {
244 _marker: PhantomData<*const ()>,
245}
246unsafe impl Send for ASSIST_DEBUG {}
247impl ASSIST_DEBUG {
248 #[doc = r"Pointer to the register block"]
249 pub const PTR: *const assist_debug::RegisterBlock = 0x600c_e000 as *const _;
250 #[doc = r"Return the pointer to the register block"]
251 #[inline(always)]
252 pub const fn ptr() -> *const assist_debug::RegisterBlock {
253 Self::PTR
254 }
255 #[doc = r" Steal an instance of this peripheral"]
256 #[doc = r""]
257 #[doc = r" # Safety"]
258 #[doc = r""]
259 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
260 #[doc = r" that may race with any existing instances, for example by only"]
261 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
262 #[doc = r" original peripheral and using critical sections to coordinate"]
263 #[doc = r" access between multiple new instances."]
264 #[doc = r""]
265 #[doc = r" Additionally, other software such as HALs may rely on only one"]
266 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
267 #[doc = r" no stolen instances are passed to such software."]
268 pub unsafe fn steal() -> Self {
269 Self {
270 _marker: PhantomData,
271 }
272 }
273}
274impl Deref for ASSIST_DEBUG {
275 type Target = assist_debug::RegisterBlock;
276 #[inline(always)]
277 fn deref(&self) -> &Self::Target {
278 unsafe { &*Self::PTR }
279 }
280}
281impl core::fmt::Debug for ASSIST_DEBUG {
282 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
283 f.debug_struct("ASSIST_DEBUG").finish()
284 }
285}
286#[doc = "Debug Assist"]
287pub mod assist_debug;
288#[doc = "BB Peripheral"]
289pub struct BB {
290 _marker: PhantomData<*const ()>,
291}
292unsafe impl Send for BB {}
293impl BB {
294 #[doc = r"Pointer to the register block"]
295 pub const PTR: *const bb::RegisterBlock = 0x6001_d000 as *const _;
296 #[doc = r"Return the pointer to the register block"]
297 #[inline(always)]
298 pub const fn ptr() -> *const bb::RegisterBlock {
299 Self::PTR
300 }
301 #[doc = r" Steal an instance of this peripheral"]
302 #[doc = r""]
303 #[doc = r" # Safety"]
304 #[doc = r""]
305 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
306 #[doc = r" that may race with any existing instances, for example by only"]
307 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
308 #[doc = r" original peripheral and using critical sections to coordinate"]
309 #[doc = r" access between multiple new instances."]
310 #[doc = r""]
311 #[doc = r" Additionally, other software such as HALs may rely on only one"]
312 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
313 #[doc = r" no stolen instances are passed to such software."]
314 pub unsafe fn steal() -> Self {
315 Self {
316 _marker: PhantomData,
317 }
318 }
319}
320impl Deref for BB {
321 type Target = bb::RegisterBlock;
322 #[inline(always)]
323 fn deref(&self) -> &Self::Target {
324 unsafe { &*Self::PTR }
325 }
326}
327impl core::fmt::Debug for BB {
328 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
329 f.debug_struct("BB").finish()
330 }
331}
332#[doc = "BB Peripheral"]
333pub mod bb;
334#[doc = "DMA (Direct Memory Access) Controller"]
335pub struct DMA {
336 _marker: PhantomData<*const ()>,
337}
338unsafe impl Send for DMA {}
339impl DMA {
340 #[doc = r"Pointer to the register block"]
341 pub const PTR: *const dma::RegisterBlock = 0x6003_f000 as *const _;
342 #[doc = r"Return the pointer to the register block"]
343 #[inline(always)]
344 pub const fn ptr() -> *const dma::RegisterBlock {
345 Self::PTR
346 }
347 #[doc = r" Steal an instance of this peripheral"]
348 #[doc = r""]
349 #[doc = r" # Safety"]
350 #[doc = r""]
351 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
352 #[doc = r" that may race with any existing instances, for example by only"]
353 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
354 #[doc = r" original peripheral and using critical sections to coordinate"]
355 #[doc = r" access between multiple new instances."]
356 #[doc = r""]
357 #[doc = r" Additionally, other software such as HALs may rely on only one"]
358 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
359 #[doc = r" no stolen instances are passed to such software."]
360 pub unsafe fn steal() -> Self {
361 Self {
362 _marker: PhantomData,
363 }
364 }
365}
366impl Deref for DMA {
367 type Target = dma::RegisterBlock;
368 #[inline(always)]
369 fn deref(&self) -> &Self::Target {
370 unsafe { &*Self::PTR }
371 }
372}
373impl core::fmt::Debug for DMA {
374 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
375 f.debug_struct("DMA").finish()
376 }
377}
378#[doc = "DMA (Direct Memory Access) Controller"]
379pub mod dma;
380#[doc = "ECC (ECC Hardware Accelerator)"]
381pub struct ECC {
382 _marker: PhantomData<*const ()>,
383}
384unsafe impl Send for ECC {}
385impl ECC {
386 #[doc = r"Pointer to the register block"]
387 pub const PTR: *const ecc::RegisterBlock = 0x6003_e000 as *const _;
388 #[doc = r"Return the pointer to the register block"]
389 #[inline(always)]
390 pub const fn ptr() -> *const ecc::RegisterBlock {
391 Self::PTR
392 }
393 #[doc = r" Steal an instance of this peripheral"]
394 #[doc = r""]
395 #[doc = r" # Safety"]
396 #[doc = r""]
397 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
398 #[doc = r" that may race with any existing instances, for example by only"]
399 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
400 #[doc = r" original peripheral and using critical sections to coordinate"]
401 #[doc = r" access between multiple new instances."]
402 #[doc = r""]
403 #[doc = r" Additionally, other software such as HALs may rely on only one"]
404 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
405 #[doc = r" no stolen instances are passed to such software."]
406 pub unsafe fn steal() -> Self {
407 Self {
408 _marker: PhantomData,
409 }
410 }
411}
412impl Deref for ECC {
413 type Target = ecc::RegisterBlock;
414 #[inline(always)]
415 fn deref(&self) -> &Self::Target {
416 unsafe { &*Self::PTR }
417 }
418}
419impl core::fmt::Debug for ECC {
420 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
421 f.debug_struct("ECC").finish()
422 }
423}
424#[doc = "ECC (ECC Hardware Accelerator)"]
425pub mod ecc;
426#[doc = "eFuse Controller"]
427pub struct EFUSE {
428 _marker: PhantomData<*const ()>,
429}
430unsafe impl Send for EFUSE {}
431impl EFUSE {
432 #[doc = r"Pointer to the register block"]
433 pub const PTR: *const efuse::RegisterBlock = 0x6000_8800 as *const _;
434 #[doc = r"Return the pointer to the register block"]
435 #[inline(always)]
436 pub const fn ptr() -> *const efuse::RegisterBlock {
437 Self::PTR
438 }
439 #[doc = r" Steal an instance of this peripheral"]
440 #[doc = r""]
441 #[doc = r" # Safety"]
442 #[doc = r""]
443 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
444 #[doc = r" that may race with any existing instances, for example by only"]
445 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
446 #[doc = r" original peripheral and using critical sections to coordinate"]
447 #[doc = r" access between multiple new instances."]
448 #[doc = r""]
449 #[doc = r" Additionally, other software such as HALs may rely on only one"]
450 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
451 #[doc = r" no stolen instances are passed to such software."]
452 pub unsafe fn steal() -> Self {
453 Self {
454 _marker: PhantomData,
455 }
456 }
457}
458impl Deref for EFUSE {
459 type Target = efuse::RegisterBlock;
460 #[inline(always)]
461 fn deref(&self) -> &Self::Target {
462 unsafe { &*Self::PTR }
463 }
464}
465impl core::fmt::Debug for EFUSE {
466 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
467 f.debug_struct("EFUSE").finish()
468 }
469}
470#[doc = "eFuse Controller"]
471pub mod efuse;
472#[doc = "External Memory"]
473pub struct EXTMEM {
474 _marker: PhantomData<*const ()>,
475}
476unsafe impl Send for EXTMEM {}
477impl EXTMEM {
478 #[doc = r"Pointer to the register block"]
479 pub const PTR: *const extmem::RegisterBlock = 0x600c_4000 as *const _;
480 #[doc = r"Return the pointer to the register block"]
481 #[inline(always)]
482 pub const fn ptr() -> *const extmem::RegisterBlock {
483 Self::PTR
484 }
485 #[doc = r" Steal an instance of this peripheral"]
486 #[doc = r""]
487 #[doc = r" # Safety"]
488 #[doc = r""]
489 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
490 #[doc = r" that may race with any existing instances, for example by only"]
491 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
492 #[doc = r" original peripheral and using critical sections to coordinate"]
493 #[doc = r" access between multiple new instances."]
494 #[doc = r""]
495 #[doc = r" Additionally, other software such as HALs may rely on only one"]
496 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
497 #[doc = r" no stolen instances are passed to such software."]
498 pub unsafe fn steal() -> Self {
499 Self {
500 _marker: PhantomData,
501 }
502 }
503}
504impl Deref for EXTMEM {
505 type Target = extmem::RegisterBlock;
506 #[inline(always)]
507 fn deref(&self) -> &Self::Target {
508 unsafe { &*Self::PTR }
509 }
510}
511impl core::fmt::Debug for EXTMEM {
512 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
513 f.debug_struct("EXTMEM").finish()
514 }
515}
516#[doc = "External Memory"]
517pub mod extmem;
518#[doc = "General Purpose Input/Output"]
519pub struct GPIO {
520 _marker: PhantomData<*const ()>,
521}
522unsafe impl Send for GPIO {}
523impl GPIO {
524 #[doc = r"Pointer to the register block"]
525 pub const PTR: *const gpio::RegisterBlock = 0x6000_4000 as *const _;
526 #[doc = r"Return the pointer to the register block"]
527 #[inline(always)]
528 pub const fn ptr() -> *const gpio::RegisterBlock {
529 Self::PTR
530 }
531 #[doc = r" Steal an instance of this peripheral"]
532 #[doc = r""]
533 #[doc = r" # Safety"]
534 #[doc = r""]
535 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
536 #[doc = r" that may race with any existing instances, for example by only"]
537 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
538 #[doc = r" original peripheral and using critical sections to coordinate"]
539 #[doc = r" access between multiple new instances."]
540 #[doc = r""]
541 #[doc = r" Additionally, other software such as HALs may rely on only one"]
542 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
543 #[doc = r" no stolen instances are passed to such software."]
544 pub unsafe fn steal() -> Self {
545 Self {
546 _marker: PhantomData,
547 }
548 }
549}
550impl Deref for GPIO {
551 type Target = gpio::RegisterBlock;
552 #[inline(always)]
553 fn deref(&self) -> &Self::Target {
554 unsafe { &*Self::PTR }
555 }
556}
557impl core::fmt::Debug for GPIO {
558 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
559 f.debug_struct("GPIO").finish()
560 }
561}
562#[doc = "General Purpose Input/Output"]
563pub mod gpio;
564#[doc = "I2C (Inter-Integrated Circuit) Controller 0"]
565pub struct I2C0 {
566 _marker: PhantomData<*const ()>,
567}
568unsafe impl Send for I2C0 {}
569impl I2C0 {
570 #[doc = r"Pointer to the register block"]
571 pub const PTR: *const i2c0::RegisterBlock = 0x6001_3000 as *const _;
572 #[doc = r"Return the pointer to the register block"]
573 #[inline(always)]
574 pub const fn ptr() -> *const i2c0::RegisterBlock {
575 Self::PTR
576 }
577 #[doc = r" Steal an instance of this peripheral"]
578 #[doc = r""]
579 #[doc = r" # Safety"]
580 #[doc = r""]
581 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
582 #[doc = r" that may race with any existing instances, for example by only"]
583 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
584 #[doc = r" original peripheral and using critical sections to coordinate"]
585 #[doc = r" access between multiple new instances."]
586 #[doc = r""]
587 #[doc = r" Additionally, other software such as HALs may rely on only one"]
588 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
589 #[doc = r" no stolen instances are passed to such software."]
590 pub unsafe fn steal() -> Self {
591 Self {
592 _marker: PhantomData,
593 }
594 }
595}
596impl Deref for I2C0 {
597 type Target = i2c0::RegisterBlock;
598 #[inline(always)]
599 fn deref(&self) -> &Self::Target {
600 unsafe { &*Self::PTR }
601 }
602}
603impl core::fmt::Debug for I2C0 {
604 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
605 f.debug_struct("I2C0").finish()
606 }
607}
608#[doc = "I2C (Inter-Integrated Circuit) Controller 0"]
609pub mod i2c0;
610#[doc = "Interrupt Controller (Core 0)"]
611pub struct INTERRUPT_CORE0 {
612 _marker: PhantomData<*const ()>,
613}
614unsafe impl Send for INTERRUPT_CORE0 {}
615impl INTERRUPT_CORE0 {
616 #[doc = r"Pointer to the register block"]
617 pub const PTR: *const interrupt_core0::RegisterBlock = 0x600c_2000 as *const _;
618 #[doc = r"Return the pointer to the register block"]
619 #[inline(always)]
620 pub const fn ptr() -> *const interrupt_core0::RegisterBlock {
621 Self::PTR
622 }
623 #[doc = r" Steal an instance of this peripheral"]
624 #[doc = r""]
625 #[doc = r" # Safety"]
626 #[doc = r""]
627 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
628 #[doc = r" that may race with any existing instances, for example by only"]
629 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
630 #[doc = r" original peripheral and using critical sections to coordinate"]
631 #[doc = r" access between multiple new instances."]
632 #[doc = r""]
633 #[doc = r" Additionally, other software such as HALs may rely on only one"]
634 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
635 #[doc = r" no stolen instances are passed to such software."]
636 pub unsafe fn steal() -> Self {
637 Self {
638 _marker: PhantomData,
639 }
640 }
641}
642impl Deref for INTERRUPT_CORE0 {
643 type Target = interrupt_core0::RegisterBlock;
644 #[inline(always)]
645 fn deref(&self) -> &Self::Target {
646 unsafe { &*Self::PTR }
647 }
648}
649impl core::fmt::Debug for INTERRUPT_CORE0 {
650 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
651 f.debug_struct("INTERRUPT_CORE0").finish()
652 }
653}
654#[doc = "Interrupt Controller (Core 0)"]
655pub mod interrupt_core0;
656#[doc = "Input/Output Multiplexer"]
657pub struct IO_MUX {
658 _marker: PhantomData<*const ()>,
659}
660unsafe impl Send for IO_MUX {}
661impl IO_MUX {
662 #[doc = r"Pointer to the register block"]
663 pub const PTR: *const io_mux::RegisterBlock = 0x6000_9000 as *const _;
664 #[doc = r"Return the pointer to the register block"]
665 #[inline(always)]
666 pub const fn ptr() -> *const io_mux::RegisterBlock {
667 Self::PTR
668 }
669 #[doc = r" Steal an instance of this peripheral"]
670 #[doc = r""]
671 #[doc = r" # Safety"]
672 #[doc = r""]
673 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
674 #[doc = r" that may race with any existing instances, for example by only"]
675 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
676 #[doc = r" original peripheral and using critical sections to coordinate"]
677 #[doc = r" access between multiple new instances."]
678 #[doc = r""]
679 #[doc = r" Additionally, other software such as HALs may rely on only one"]
680 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
681 #[doc = r" no stolen instances are passed to such software."]
682 pub unsafe fn steal() -> Self {
683 Self {
684 _marker: PhantomData,
685 }
686 }
687}
688impl Deref for IO_MUX {
689 type Target = io_mux::RegisterBlock;
690 #[inline(always)]
691 fn deref(&self) -> &Self::Target {
692 unsafe { &*Self::PTR }
693 }
694}
695impl core::fmt::Debug for IO_MUX {
696 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
697 f.debug_struct("IO_MUX").finish()
698 }
699}
700#[doc = "Input/Output Multiplexer"]
701pub mod io_mux;
702#[doc = "LED Control PWM (Pulse Width Modulation)"]
703pub struct LEDC {
704 _marker: PhantomData<*const ()>,
705}
706unsafe impl Send for LEDC {}
707impl LEDC {
708 #[doc = r"Pointer to the register block"]
709 pub const PTR: *const ledc::RegisterBlock = 0x6001_9000 as *const _;
710 #[doc = r"Return the pointer to the register block"]
711 #[inline(always)]
712 pub const fn ptr() -> *const ledc::RegisterBlock {
713 Self::PTR
714 }
715 #[doc = r" Steal an instance of this peripheral"]
716 #[doc = r""]
717 #[doc = r" # Safety"]
718 #[doc = r""]
719 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
720 #[doc = r" that may race with any existing instances, for example by only"]
721 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
722 #[doc = r" original peripheral and using critical sections to coordinate"]
723 #[doc = r" access between multiple new instances."]
724 #[doc = r""]
725 #[doc = r" Additionally, other software such as HALs may rely on only one"]
726 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
727 #[doc = r" no stolen instances are passed to such software."]
728 pub unsafe fn steal() -> Self {
729 Self {
730 _marker: PhantomData,
731 }
732 }
733}
734impl Deref for LEDC {
735 type Target = ledc::RegisterBlock;
736 #[inline(always)]
737 fn deref(&self) -> &Self::Target {
738 unsafe { &*Self::PTR }
739 }
740}
741impl core::fmt::Debug for LEDC {
742 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
743 f.debug_struct("LEDC").finish()
744 }
745}
746#[doc = "LED Control PWM (Pulse Width Modulation)"]
747pub mod ledc;
748#[doc = "MODEM_CLKRST Peripheral"]
749pub struct MODEM_CLKRST {
750 _marker: PhantomData<*const ()>,
751}
752unsafe impl Send for MODEM_CLKRST {}
753impl MODEM_CLKRST {
754 #[doc = r"Pointer to the register block"]
755 pub const PTR: *const modem_clkrst::RegisterBlock = 0x6004_d800 as *const _;
756 #[doc = r"Return the pointer to the register block"]
757 #[inline(always)]
758 pub const fn ptr() -> *const modem_clkrst::RegisterBlock {
759 Self::PTR
760 }
761 #[doc = r" Steal an instance of this peripheral"]
762 #[doc = r""]
763 #[doc = r" # Safety"]
764 #[doc = r""]
765 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
766 #[doc = r" that may race with any existing instances, for example by only"]
767 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
768 #[doc = r" original peripheral and using critical sections to coordinate"]
769 #[doc = r" access between multiple new instances."]
770 #[doc = r""]
771 #[doc = r" Additionally, other software such as HALs may rely on only one"]
772 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
773 #[doc = r" no stolen instances are passed to such software."]
774 pub unsafe fn steal() -> Self {
775 Self {
776 _marker: PhantomData,
777 }
778 }
779}
780impl Deref for MODEM_CLKRST {
781 type Target = modem_clkrst::RegisterBlock;
782 #[inline(always)]
783 fn deref(&self) -> &Self::Target {
784 unsafe { &*Self::PTR }
785 }
786}
787impl core::fmt::Debug for MODEM_CLKRST {
788 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
789 f.debug_struct("MODEM_CLKRST").finish()
790 }
791}
792#[doc = "MODEM_CLKRST Peripheral"]
793pub mod modem_clkrst;
794#[doc = "Hardware Random Number Generator"]
795pub struct RNG {
796 _marker: PhantomData<*const ()>,
797}
798unsafe impl Send for RNG {}
799impl RNG {
800 #[doc = r"Pointer to the register block"]
801 pub const PTR: *const rng::RegisterBlock = 0x6002_6000 as *const _;
802 #[doc = r"Return the pointer to the register block"]
803 #[inline(always)]
804 pub const fn ptr() -> *const rng::RegisterBlock {
805 Self::PTR
806 }
807 #[doc = r" Steal an instance of this peripheral"]
808 #[doc = r""]
809 #[doc = r" # Safety"]
810 #[doc = r""]
811 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
812 #[doc = r" that may race with any existing instances, for example by only"]
813 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
814 #[doc = r" original peripheral and using critical sections to coordinate"]
815 #[doc = r" access between multiple new instances."]
816 #[doc = r""]
817 #[doc = r" Additionally, other software such as HALs may rely on only one"]
818 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
819 #[doc = r" no stolen instances are passed to such software."]
820 pub unsafe fn steal() -> Self {
821 Self {
822 _marker: PhantomData,
823 }
824 }
825}
826impl Deref for RNG {
827 type Target = rng::RegisterBlock;
828 #[inline(always)]
829 fn deref(&self) -> &Self::Target {
830 unsafe { &*Self::PTR }
831 }
832}
833impl core::fmt::Debug for RNG {
834 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
835 f.debug_struct("RNG").finish()
836 }
837}
838#[doc = "Hardware Random Number Generator"]
839pub mod rng;
840#[doc = "Real-Time Clock Control"]
841pub struct RTC_CNTL {
842 _marker: PhantomData<*const ()>,
843}
844unsafe impl Send for RTC_CNTL {}
845impl RTC_CNTL {
846 #[doc = r"Pointer to the register block"]
847 pub const PTR: *const rtc_cntl::RegisterBlock = 0x6000_8000 as *const _;
848 #[doc = r"Return the pointer to the register block"]
849 #[inline(always)]
850 pub const fn ptr() -> *const rtc_cntl::RegisterBlock {
851 Self::PTR
852 }
853 #[doc = r" Steal an instance of this peripheral"]
854 #[doc = r""]
855 #[doc = r" # Safety"]
856 #[doc = r""]
857 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
858 #[doc = r" that may race with any existing instances, for example by only"]
859 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
860 #[doc = r" original peripheral and using critical sections to coordinate"]
861 #[doc = r" access between multiple new instances."]
862 #[doc = r""]
863 #[doc = r" Additionally, other software such as HALs may rely on only one"]
864 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
865 #[doc = r" no stolen instances are passed to such software."]
866 pub unsafe fn steal() -> Self {
867 Self {
868 _marker: PhantomData,
869 }
870 }
871}
872impl Deref for RTC_CNTL {
873 type Target = rtc_cntl::RegisterBlock;
874 #[inline(always)]
875 fn deref(&self) -> &Self::Target {
876 unsafe { &*Self::PTR }
877 }
878}
879impl core::fmt::Debug for RTC_CNTL {
880 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
881 f.debug_struct("RTC_CNTL").finish()
882 }
883}
884#[doc = "Real-Time Clock Control"]
885pub mod rtc_cntl;
886#[doc = "SENSITIVE Peripheral"]
887pub struct SENSITIVE {
888 _marker: PhantomData<*const ()>,
889}
890unsafe impl Send for SENSITIVE {}
891impl SENSITIVE {
892 #[doc = r"Pointer to the register block"]
893 pub const PTR: *const sensitive::RegisterBlock = 0x600c_1000 as *const _;
894 #[doc = r"Return the pointer to the register block"]
895 #[inline(always)]
896 pub const fn ptr() -> *const sensitive::RegisterBlock {
897 Self::PTR
898 }
899 #[doc = r" Steal an instance of this peripheral"]
900 #[doc = r""]
901 #[doc = r" # Safety"]
902 #[doc = r""]
903 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
904 #[doc = r" that may race with any existing instances, for example by only"]
905 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
906 #[doc = r" original peripheral and using critical sections to coordinate"]
907 #[doc = r" access between multiple new instances."]
908 #[doc = r""]
909 #[doc = r" Additionally, other software such as HALs may rely on only one"]
910 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
911 #[doc = r" no stolen instances are passed to such software."]
912 pub unsafe fn steal() -> Self {
913 Self {
914 _marker: PhantomData,
915 }
916 }
917}
918impl Deref for SENSITIVE {
919 type Target = sensitive::RegisterBlock;
920 #[inline(always)]
921 fn deref(&self) -> &Self::Target {
922 unsafe { &*Self::PTR }
923 }
924}
925impl core::fmt::Debug for SENSITIVE {
926 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
927 f.debug_struct("SENSITIVE").finish()
928 }
929}
930#[doc = "SENSITIVE Peripheral"]
931pub mod sensitive;
932#[doc = "SHA (Secure Hash Algorithm) Accelerator"]
933pub struct SHA {
934 _marker: PhantomData<*const ()>,
935}
936unsafe impl Send for SHA {}
937impl SHA {
938 #[doc = r"Pointer to the register block"]
939 pub const PTR: *const sha::RegisterBlock = 0x6003_b000 as *const _;
940 #[doc = r"Return the pointer to the register block"]
941 #[inline(always)]
942 pub const fn ptr() -> *const sha::RegisterBlock {
943 Self::PTR
944 }
945 #[doc = r" Steal an instance of this peripheral"]
946 #[doc = r""]
947 #[doc = r" # Safety"]
948 #[doc = r""]
949 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
950 #[doc = r" that may race with any existing instances, for example by only"]
951 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
952 #[doc = r" original peripheral and using critical sections to coordinate"]
953 #[doc = r" access between multiple new instances."]
954 #[doc = r""]
955 #[doc = r" Additionally, other software such as HALs may rely on only one"]
956 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
957 #[doc = r" no stolen instances are passed to such software."]
958 pub unsafe fn steal() -> Self {
959 Self {
960 _marker: PhantomData,
961 }
962 }
963}
964impl Deref for SHA {
965 type Target = sha::RegisterBlock;
966 #[inline(always)]
967 fn deref(&self) -> &Self::Target {
968 unsafe { &*Self::PTR }
969 }
970}
971impl core::fmt::Debug for SHA {
972 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
973 f.debug_struct("SHA").finish()
974 }
975}
976#[doc = "SHA (Secure Hash Algorithm) Accelerator"]
977pub mod sha;
978#[doc = "SPI (Serial Peripheral Interface) Controller 0"]
979pub struct SPI0 {
980 _marker: PhantomData<*const ()>,
981}
982unsafe impl Send for SPI0 {}
983impl SPI0 {
984 #[doc = r"Pointer to the register block"]
985 pub const PTR: *const spi0::RegisterBlock = 0x6000_3000 as *const _;
986 #[doc = r"Return the pointer to the register block"]
987 #[inline(always)]
988 pub const fn ptr() -> *const spi0::RegisterBlock {
989 Self::PTR
990 }
991 #[doc = r" Steal an instance of this peripheral"]
992 #[doc = r""]
993 #[doc = r" # Safety"]
994 #[doc = r""]
995 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
996 #[doc = r" that may race with any existing instances, for example by only"]
997 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
998 #[doc = r" original peripheral and using critical sections to coordinate"]
999 #[doc = r" access between multiple new instances."]
1000 #[doc = r""]
1001 #[doc = r" Additionally, other software such as HALs may rely on only one"]
1002 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1003 #[doc = r" no stolen instances are passed to such software."]
1004 pub unsafe fn steal() -> Self {
1005 Self {
1006 _marker: PhantomData,
1007 }
1008 }
1009}
1010impl Deref for SPI0 {
1011 type Target = spi0::RegisterBlock;
1012 #[inline(always)]
1013 fn deref(&self) -> &Self::Target {
1014 unsafe { &*Self::PTR }
1015 }
1016}
1017impl core::fmt::Debug for SPI0 {
1018 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1019 f.debug_struct("SPI0").finish()
1020 }
1021}
1022#[doc = "SPI (Serial Peripheral Interface) Controller 0"]
1023pub mod spi0;
1024#[doc = "SPI (Serial Peripheral Interface) Controller 1"]
1025pub struct SPI1 {
1026 _marker: PhantomData<*const ()>,
1027}
1028unsafe impl Send for SPI1 {}
1029impl SPI1 {
1030 #[doc = r"Pointer to the register block"]
1031 pub const PTR: *const spi1::RegisterBlock = 0x6000_2000 as *const _;
1032 #[doc = r"Return the pointer to the register block"]
1033 #[inline(always)]
1034 pub const fn ptr() -> *const spi1::RegisterBlock {
1035 Self::PTR
1036 }
1037 #[doc = r" Steal an instance of this peripheral"]
1038 #[doc = r""]
1039 #[doc = r" # Safety"]
1040 #[doc = r""]
1041 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1042 #[doc = r" that may race with any existing instances, for example by only"]
1043 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1044 #[doc = r" original peripheral and using critical sections to coordinate"]
1045 #[doc = r" access between multiple new instances."]
1046 #[doc = r""]
1047 #[doc = r" Additionally, other software such as HALs may rely on only one"]
1048 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1049 #[doc = r" no stolen instances are passed to such software."]
1050 pub unsafe fn steal() -> Self {
1051 Self {
1052 _marker: PhantomData,
1053 }
1054 }
1055}
1056impl Deref for SPI1 {
1057 type Target = spi1::RegisterBlock;
1058 #[inline(always)]
1059 fn deref(&self) -> &Self::Target {
1060 unsafe { &*Self::PTR }
1061 }
1062}
1063impl core::fmt::Debug for SPI1 {
1064 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1065 f.debug_struct("SPI1").finish()
1066 }
1067}
1068#[doc = "SPI (Serial Peripheral Interface) Controller 1"]
1069pub mod spi1;
1070#[doc = "SPI (Serial Peripheral Interface) Controller 2"]
1071pub struct SPI2 {
1072 _marker: PhantomData<*const ()>,
1073}
1074unsafe impl Send for SPI2 {}
1075impl SPI2 {
1076 #[doc = r"Pointer to the register block"]
1077 pub const PTR: *const spi2::RegisterBlock = 0x6002_4000 as *const _;
1078 #[doc = r"Return the pointer to the register block"]
1079 #[inline(always)]
1080 pub const fn ptr() -> *const spi2::RegisterBlock {
1081 Self::PTR
1082 }
1083 #[doc = r" Steal an instance of this peripheral"]
1084 #[doc = r""]
1085 #[doc = r" # Safety"]
1086 #[doc = r""]
1087 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1088 #[doc = r" that may race with any existing instances, for example by only"]
1089 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1090 #[doc = r" original peripheral and using critical sections to coordinate"]
1091 #[doc = r" access between multiple new instances."]
1092 #[doc = r""]
1093 #[doc = r" Additionally, other software such as HALs may rely on only one"]
1094 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1095 #[doc = r" no stolen instances are passed to such software."]
1096 pub unsafe fn steal() -> Self {
1097 Self {
1098 _marker: PhantomData,
1099 }
1100 }
1101}
1102impl Deref for SPI2 {
1103 type Target = spi2::RegisterBlock;
1104 #[inline(always)]
1105 fn deref(&self) -> &Self::Target {
1106 unsafe { &*Self::PTR }
1107 }
1108}
1109impl core::fmt::Debug for SPI2 {
1110 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1111 f.debug_struct("SPI2").finish()
1112 }
1113}
1114#[doc = "SPI (Serial Peripheral Interface) Controller 2"]
1115pub mod spi2;
1116#[doc = "System Configuration Registers"]
1117pub struct SYSTEM {
1118 _marker: PhantomData<*const ()>,
1119}
1120unsafe impl Send for SYSTEM {}
1121impl SYSTEM {
1122 #[doc = r"Pointer to the register block"]
1123 pub const PTR: *const system::RegisterBlock = 0x600c_0000 as *const _;
1124 #[doc = r"Return the pointer to the register block"]
1125 #[inline(always)]
1126 pub const fn ptr() -> *const system::RegisterBlock {
1127 Self::PTR
1128 }
1129 #[doc = r" Steal an instance of this peripheral"]
1130 #[doc = r""]
1131 #[doc = r" # Safety"]
1132 #[doc = r""]
1133 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1134 #[doc = r" that may race with any existing instances, for example by only"]
1135 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1136 #[doc = r" original peripheral and using critical sections to coordinate"]
1137 #[doc = r" access between multiple new instances."]
1138 #[doc = r""]
1139 #[doc = r" Additionally, other software such as HALs may rely on only one"]
1140 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1141 #[doc = r" no stolen instances are passed to such software."]
1142 pub unsafe fn steal() -> Self {
1143 Self {
1144 _marker: PhantomData,
1145 }
1146 }
1147}
1148impl Deref for SYSTEM {
1149 type Target = system::RegisterBlock;
1150 #[inline(always)]
1151 fn deref(&self) -> &Self::Target {
1152 unsafe { &*Self::PTR }
1153 }
1154}
1155impl core::fmt::Debug for SYSTEM {
1156 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1157 f.debug_struct("SYSTEM").finish()
1158 }
1159}
1160#[doc = "System Configuration Registers"]
1161pub mod system;
1162#[doc = "System Timer"]
1163pub struct SYSTIMER {
1164 _marker: PhantomData<*const ()>,
1165}
1166unsafe impl Send for SYSTIMER {}
1167impl SYSTIMER {
1168 #[doc = r"Pointer to the register block"]
1169 pub const PTR: *const systimer::RegisterBlock = 0x6002_3000 as *const _;
1170 #[doc = r"Return the pointer to the register block"]
1171 #[inline(always)]
1172 pub const fn ptr() -> *const systimer::RegisterBlock {
1173 Self::PTR
1174 }
1175 #[doc = r" Steal an instance of this peripheral"]
1176 #[doc = r""]
1177 #[doc = r" # Safety"]
1178 #[doc = r""]
1179 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1180 #[doc = r" that may race with any existing instances, for example by only"]
1181 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1182 #[doc = r" original peripheral and using critical sections to coordinate"]
1183 #[doc = r" access between multiple new instances."]
1184 #[doc = r""]
1185 #[doc = r" Additionally, other software such as HALs may rely on only one"]
1186 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1187 #[doc = r" no stolen instances are passed to such software."]
1188 pub unsafe fn steal() -> Self {
1189 Self {
1190 _marker: PhantomData,
1191 }
1192 }
1193}
1194impl Deref for SYSTIMER {
1195 type Target = systimer::RegisterBlock;
1196 #[inline(always)]
1197 fn deref(&self) -> &Self::Target {
1198 unsafe { &*Self::PTR }
1199 }
1200}
1201impl core::fmt::Debug for SYSTIMER {
1202 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1203 f.debug_struct("SYSTIMER").finish()
1204 }
1205}
1206#[doc = "System Timer"]
1207pub mod systimer;
1208#[doc = "Timer Group 0"]
1209pub struct TIMG0 {
1210 _marker: PhantomData<*const ()>,
1211}
1212unsafe impl Send for TIMG0 {}
1213impl TIMG0 {
1214 #[doc = r"Pointer to the register block"]
1215 pub const PTR: *const timg0::RegisterBlock = 0x6001_f000 as *const _;
1216 #[doc = r"Return the pointer to the register block"]
1217 #[inline(always)]
1218 pub const fn ptr() -> *const timg0::RegisterBlock {
1219 Self::PTR
1220 }
1221 #[doc = r" Steal an instance of this peripheral"]
1222 #[doc = r""]
1223 #[doc = r" # Safety"]
1224 #[doc = r""]
1225 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1226 #[doc = r" that may race with any existing instances, for example by only"]
1227 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1228 #[doc = r" original peripheral and using critical sections to coordinate"]
1229 #[doc = r" access between multiple new instances."]
1230 #[doc = r""]
1231 #[doc = r" Additionally, other software such as HALs may rely on only one"]
1232 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1233 #[doc = r" no stolen instances are passed to such software."]
1234 pub unsafe fn steal() -> Self {
1235 Self {
1236 _marker: PhantomData,
1237 }
1238 }
1239}
1240impl Deref for TIMG0 {
1241 type Target = timg0::RegisterBlock;
1242 #[inline(always)]
1243 fn deref(&self) -> &Self::Target {
1244 unsafe { &*Self::PTR }
1245 }
1246}
1247impl core::fmt::Debug for TIMG0 {
1248 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1249 f.debug_struct("TIMG0").finish()
1250 }
1251}
1252#[doc = "Timer Group 0"]
1253pub mod timg0;
1254#[doc = "UART (Universal Asynchronous Receiver-Transmitter) Controller 0"]
1255pub struct UART0 {
1256 _marker: PhantomData<*const ()>,
1257}
1258unsafe impl Send for UART0 {}
1259impl UART0 {
1260 #[doc = r"Pointer to the register block"]
1261 pub const PTR: *const uart0::RegisterBlock = 0x6000_0000 as *const _;
1262 #[doc = r"Return the pointer to the register block"]
1263 #[inline(always)]
1264 pub const fn ptr() -> *const uart0::RegisterBlock {
1265 Self::PTR
1266 }
1267 #[doc = r" Steal an instance of this peripheral"]
1268 #[doc = r""]
1269 #[doc = r" # Safety"]
1270 #[doc = r""]
1271 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1272 #[doc = r" that may race with any existing instances, for example by only"]
1273 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1274 #[doc = r" original peripheral and using critical sections to coordinate"]
1275 #[doc = r" access between multiple new instances."]
1276 #[doc = r""]
1277 #[doc = r" Additionally, other software such as HALs may rely on only one"]
1278 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1279 #[doc = r" no stolen instances are passed to such software."]
1280 pub unsafe fn steal() -> Self {
1281 Self {
1282 _marker: PhantomData,
1283 }
1284 }
1285}
1286impl Deref for UART0 {
1287 type Target = uart0::RegisterBlock;
1288 #[inline(always)]
1289 fn deref(&self) -> &Self::Target {
1290 unsafe { &*Self::PTR }
1291 }
1292}
1293impl core::fmt::Debug for UART0 {
1294 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1295 f.debug_struct("UART0").finish()
1296 }
1297}
1298#[doc = "UART (Universal Asynchronous Receiver-Transmitter) Controller 0"]
1299pub mod uart0;
1300#[doc = "UART (Universal Asynchronous Receiver-Transmitter) Controller 1"]
1301pub struct UART1 {
1302 _marker: PhantomData<*const ()>,
1303}
1304unsafe impl Send for UART1 {}
1305impl UART1 {
1306 #[doc = r"Pointer to the register block"]
1307 pub const PTR: *const uart0::RegisterBlock = 0x6001_0000 as *const _;
1308 #[doc = r"Return the pointer to the register block"]
1309 #[inline(always)]
1310 pub const fn ptr() -> *const uart0::RegisterBlock {
1311 Self::PTR
1312 }
1313 #[doc = r" Steal an instance of this peripheral"]
1314 #[doc = r""]
1315 #[doc = r" # Safety"]
1316 #[doc = r""]
1317 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1318 #[doc = r" that may race with any existing instances, for example by only"]
1319 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1320 #[doc = r" original peripheral and using critical sections to coordinate"]
1321 #[doc = r" access between multiple new instances."]
1322 #[doc = r""]
1323 #[doc = r" Additionally, other software such as HALs may rely on only one"]
1324 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1325 #[doc = r" no stolen instances are passed to such software."]
1326 pub unsafe fn steal() -> Self {
1327 Self {
1328 _marker: PhantomData,
1329 }
1330 }
1331}
1332impl Deref for UART1 {
1333 type Target = uart0::RegisterBlock;
1334 #[inline(always)]
1335 fn deref(&self) -> &Self::Target {
1336 unsafe { &*Self::PTR }
1337 }
1338}
1339impl core::fmt::Debug for UART1 {
1340 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1341 f.debug_struct("UART1").finish()
1342 }
1343}
1344#[doc = "UART (Universal Asynchronous Receiver-Transmitter) Controller 1"]
1345pub use self::uart0 as uart1;
1346#[doc = "XTS-AES-128 Flash Encryption"]
1347pub struct XTS_AES {
1348 _marker: PhantomData<*const ()>,
1349}
1350unsafe impl Send for XTS_AES {}
1351impl XTS_AES {
1352 #[doc = r"Pointer to the register block"]
1353 pub const PTR: *const xts_aes::RegisterBlock = 0x600c_c000 as *const _;
1354 #[doc = r"Return the pointer to the register block"]
1355 #[inline(always)]
1356 pub const fn ptr() -> *const xts_aes::RegisterBlock {
1357 Self::PTR
1358 }
1359 #[doc = r" Steal an instance of this peripheral"]
1360 #[doc = r""]
1361 #[doc = r" # Safety"]
1362 #[doc = r""]
1363 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1364 #[doc = r" that may race with any existing instances, for example by only"]
1365 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1366 #[doc = r" original peripheral and using critical sections to coordinate"]
1367 #[doc = r" access between multiple new instances."]
1368 #[doc = r""]
1369 #[doc = r" Additionally, other software such as HALs may rely on only one"]
1370 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1371 #[doc = r" no stolen instances are passed to such software."]
1372 pub unsafe fn steal() -> Self {
1373 Self {
1374 _marker: PhantomData,
1375 }
1376 }
1377}
1378impl Deref for XTS_AES {
1379 type Target = xts_aes::RegisterBlock;
1380 #[inline(always)]
1381 fn deref(&self) -> &Self::Target {
1382 unsafe { &*Self::PTR }
1383 }
1384}
1385impl core::fmt::Debug for XTS_AES {
1386 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1387 f.debug_struct("XTS_AES").finish()
1388 }
1389}
1390#[doc = "XTS-AES-128 Flash Encryption"]
1391pub mod xts_aes;
1392#[doc = "I2C_ANA_MST Peripheral"]
1393pub struct I2C_ANA_MST {
1394 _marker: PhantomData<*const ()>,
1395}
1396unsafe impl Send for I2C_ANA_MST {}
1397impl I2C_ANA_MST {
1398 #[doc = r"Pointer to the register block"]
1399 pub const PTR: *const i2c_ana_mst::RegisterBlock = 0x6004_e840 as *const _;
1400 #[doc = r"Return the pointer to the register block"]
1401 #[inline(always)]
1402 pub const fn ptr() -> *const i2c_ana_mst::RegisterBlock {
1403 Self::PTR
1404 }
1405 #[doc = r" Steal an instance of this peripheral"]
1406 #[doc = r""]
1407 #[doc = r" # Safety"]
1408 #[doc = r""]
1409 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1410 #[doc = r" that may race with any existing instances, for example by only"]
1411 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1412 #[doc = r" original peripheral and using critical sections to coordinate"]
1413 #[doc = r" access between multiple new instances."]
1414 #[doc = r""]
1415 #[doc = r" Additionally, other software such as HALs may rely on only one"]
1416 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1417 #[doc = r" no stolen instances are passed to such software."]
1418 pub unsafe fn steal() -> Self {
1419 Self {
1420 _marker: PhantomData,
1421 }
1422 }
1423}
1424impl Deref for I2C_ANA_MST {
1425 type Target = i2c_ana_mst::RegisterBlock;
1426 #[inline(always)]
1427 fn deref(&self) -> &Self::Target {
1428 unsafe { &*Self::PTR }
1429 }
1430}
1431impl core::fmt::Debug for I2C_ANA_MST {
1432 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1433 f.debug_struct("I2C_ANA_MST").finish()
1434 }
1435}
1436#[doc = "I2C_ANA_MST Peripheral"]
1437pub mod i2c_ana_mst;
1438#[no_mangle]
1439static mut DEVICE_PERIPHERALS: bool = false;
1440#[doc = r" All the peripherals."]
1441#[allow(non_snake_case)]
1442pub struct Peripherals {
1443 #[doc = "APB_CTRL"]
1444 pub APB_CTRL: APB_CTRL,
1445 #[doc = "APB_SARADC"]
1446 pub APB_SARADC: APB_SARADC,
1447 #[doc = "ASSIST_DEBUG"]
1448 pub ASSIST_DEBUG: ASSIST_DEBUG,
1449 #[doc = "BB"]
1450 pub BB: BB,
1451 #[doc = "DMA"]
1452 pub DMA: DMA,
1453 #[doc = "ECC"]
1454 pub ECC: ECC,
1455 #[doc = "EFUSE"]
1456 pub EFUSE: EFUSE,
1457 #[doc = "EXTMEM"]
1458 pub EXTMEM: EXTMEM,
1459 #[doc = "GPIO"]
1460 pub GPIO: GPIO,
1461 #[doc = "I2C0"]
1462 pub I2C0: I2C0,
1463 #[doc = "INTERRUPT_CORE0"]
1464 pub INTERRUPT_CORE0: INTERRUPT_CORE0,
1465 #[doc = "IO_MUX"]
1466 pub IO_MUX: IO_MUX,
1467 #[doc = "LEDC"]
1468 pub LEDC: LEDC,
1469 #[doc = "MODEM_CLKRST"]
1470 pub MODEM_CLKRST: MODEM_CLKRST,
1471 #[doc = "RNG"]
1472 pub RNG: RNG,
1473 #[doc = "RTC_CNTL"]
1474 pub RTC_CNTL: RTC_CNTL,
1475 #[doc = "SENSITIVE"]
1476 pub SENSITIVE: SENSITIVE,
1477 #[doc = "SHA"]
1478 pub SHA: SHA,
1479 #[doc = "SPI0"]
1480 pub SPI0: SPI0,
1481 #[doc = "SPI1"]
1482 pub SPI1: SPI1,
1483 #[doc = "SPI2"]
1484 pub SPI2: SPI2,
1485 #[doc = "SYSTEM"]
1486 pub SYSTEM: SYSTEM,
1487 #[doc = "SYSTIMER"]
1488 pub SYSTIMER: SYSTIMER,
1489 #[doc = "TIMG0"]
1490 pub TIMG0: TIMG0,
1491 #[doc = "UART0"]
1492 pub UART0: UART0,
1493 #[doc = "UART1"]
1494 pub UART1: UART1,
1495 #[doc = "XTS_AES"]
1496 pub XTS_AES: XTS_AES,
1497 #[doc = "I2C_ANA_MST"]
1498 pub I2C_ANA_MST: I2C_ANA_MST,
1499}
1500impl Peripherals {
1501 #[doc = r" Returns all the peripherals *once*."]
1502 #[cfg(feature = "critical-section")]
1503 #[inline]
1504 pub fn take() -> Option<Self> {
1505 critical_section::with(|_| {
1506 if unsafe { DEVICE_PERIPHERALS } {
1507 return None;
1508 }
1509 Some(unsafe { Peripherals::steal() })
1510 })
1511 }
1512 #[doc = r" Unchecked version of `Peripherals::take`."]
1513 #[doc = r""]
1514 #[doc = r" # Safety"]
1515 #[doc = r""]
1516 #[doc = r" Each of the returned peripherals must be used at most once."]
1517 #[inline]
1518 pub unsafe fn steal() -> Self {
1519 DEVICE_PERIPHERALS = true;
1520 Peripherals {
1521 APB_CTRL: APB_CTRL::steal(),
1522 APB_SARADC: APB_SARADC::steal(),
1523 ASSIST_DEBUG: ASSIST_DEBUG::steal(),
1524 BB: BB::steal(),
1525 DMA: DMA::steal(),
1526 ECC: ECC::steal(),
1527 EFUSE: EFUSE::steal(),
1528 EXTMEM: EXTMEM::steal(),
1529 GPIO: GPIO::steal(),
1530 I2C0: I2C0::steal(),
1531 INTERRUPT_CORE0: INTERRUPT_CORE0::steal(),
1532 IO_MUX: IO_MUX::steal(),
1533 LEDC: LEDC::steal(),
1534 MODEM_CLKRST: MODEM_CLKRST::steal(),
1535 RNG: RNG::steal(),
1536 RTC_CNTL: RTC_CNTL::steal(),
1537 SENSITIVE: SENSITIVE::steal(),
1538 SHA: SHA::steal(),
1539 SPI0: SPI0::steal(),
1540 SPI1: SPI1::steal(),
1541 SPI2: SPI2::steal(),
1542 SYSTEM: SYSTEM::steal(),
1543 SYSTIMER: SYSTIMER::steal(),
1544 TIMG0: TIMG0::steal(),
1545 UART0: UART0::steal(),
1546 UART1: UART1::steal(),
1547 XTS_AES: XTS_AES::steal(),
1548 I2C_ANA_MST: I2C_ANA_MST::steal(),
1549 }
1550 }
1551}