1#![doc = "Peripheral access API for BL808 microcontrollers (generated using svd2rust v0.26.0 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
2svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.26.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"]
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]
20use core::marker::PhantomData;
21use core::ops::Deref;
22#[allow(unused_imports)]
23use generic::*;
24#[doc = r"Common register and bit access and modify traits"]
25pub mod generic;
26#[cfg(feature = "rt")]
27extern "C" {}
28#[doc(hidden)]
29pub union Vector {
30 pub _handler: unsafe extern "C" fn(),
31 pub _reserved: usize,
32}
33#[cfg(feature = "rt")]
34#[doc(hidden)]
35#[no_mangle]
36pub static __EXTERNAL_INTERRUPTS: [Vector; 0] = [];
37#[doc = "Codec miscellaneous control"]
38pub struct CODEC {
39 _marker: PhantomData<*const ()>,
40}
41unsafe impl Send for CODEC {}
42impl CODEC {
43 #[doc = r"Pointer to the register block"]
44 pub const PTR: *const codec::RegisterBlock = 0x3002_0000 as *const _;
45 #[doc = r"Return the pointer to the register block"]
46 #[inline(always)]
47 pub const fn ptr() -> *const codec::RegisterBlock {
48 Self::PTR
49 }
50}
51impl Deref for CODEC {
52 type Target = codec::RegisterBlock;
53 #[inline(always)]
54 fn deref(&self) -> &Self::Target {
55 unsafe { &*Self::PTR }
56 }
57}
58impl core::fmt::Debug for CODEC {
59 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
60 f.debug_struct("CODEC").finish()
61 }
62}
63#[doc = "Codec miscellaneous control"]
64pub mod codec;
65#[doc = "Motion JPEG encoder"]
66pub struct MJPEG {
67 _marker: PhantomData<*const ()>,
68}
69unsafe impl Send for MJPEG {}
70impl MJPEG {
71 #[doc = r"Pointer to the register block"]
72 pub const PTR: *const mjpeg::RegisterBlock = 0x3002_1000 as *const _;
73 #[doc = r"Return the pointer to the register block"]
74 #[inline(always)]
75 pub const fn ptr() -> *const mjpeg::RegisterBlock {
76 Self::PTR
77 }
78}
79impl Deref for MJPEG {
80 type Target = mjpeg::RegisterBlock;
81 #[inline(always)]
82 fn deref(&self) -> &Self::Target {
83 unsafe { &*Self::PTR }
84 }
85}
86impl core::fmt::Debug for MJPEG {
87 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
88 f.debug_struct("MJPEG").finish()
89 }
90}
91#[doc = "Motion JPEG encoder"]
92pub mod mjpeg;
93#[doc = "H.264 video codec control"]
94pub struct H264 {
95 _marker: PhantomData<*const ()>,
96}
97unsafe impl Send for H264 {}
98impl H264 {
99 #[doc = r"Pointer to the register block"]
100 pub const PTR: *const h264::RegisterBlock = 0x3002_2000 as *const _;
101 #[doc = r"Return the pointer to the register block"]
102 #[inline(always)]
103 pub const fn ptr() -> *const h264::RegisterBlock {
104 Self::PTR
105 }
106}
107impl Deref for H264 {
108 type Target = h264::RegisterBlock;
109 #[inline(always)]
110 fn deref(&self) -> &Self::Target {
111 unsafe { &*Self::PTR }
112 }
113}
114impl core::fmt::Debug for H264 {
115 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
116 f.debug_struct("H264").finish()
117 }
118}
119#[doc = "H.264 video codec control"]
120pub mod h264;
121#[doc = "Bouffalo Convolutional Neural Network"]
122pub struct NPU {
123 _marker: PhantomData<*const ()>,
124}
125unsafe impl Send for NPU {}
126impl NPU {
127 #[doc = r"Pointer to the register block"]
128 pub const PTR: *const npu::RegisterBlock = 0x3002_4000 as *const _;
129 #[doc = r"Return the pointer to the register block"]
130 #[inline(always)]
131 pub const fn ptr() -> *const npu::RegisterBlock {
132 Self::PTR
133 }
134}
135impl Deref for NPU {
136 type Target = npu::RegisterBlock;
137 #[inline(always)]
138 fn deref(&self) -> &Self::Target {
139 unsafe { &*Self::PTR }
140 }
141}
142impl core::fmt::Debug for NPU {
143 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
144 f.debug_struct("NPU").finish()
145 }
146}
147#[doc = "Bouffalo Convolutional Neural Network"]
148pub mod npu;
149#[doc = "Multimedia Global controller"]
150pub struct MMGLB {
151 _marker: PhantomData<*const ()>,
152}
153unsafe impl Send for MMGLB {}
154impl MMGLB {
155 #[doc = r"Pointer to the register block"]
156 pub const PTR: *const mmglb::RegisterBlock = 0x3000_7000 as *const _;
157 #[doc = r"Return the pointer to the register block"]
158 #[inline(always)]
159 pub const fn ptr() -> *const mmglb::RegisterBlock {
160 Self::PTR
161 }
162}
163impl Deref for MMGLB {
164 type Target = mmglb::RegisterBlock;
165 #[inline(always)]
166 fn deref(&self) -> &Self::Target {
167 unsafe { &*Self::PTR }
168 }
169}
170impl core::fmt::Debug for MMGLB {
171 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
172 f.debug_struct("MMGLB").finish()
173 }
174}
175#[doc = "Multimedia Global controller"]
176pub mod mmglb;
177#[doc = "Packet Traffic Arbitration"]
178pub struct PTA {
179 _marker: PhantomData<*const ()>,
180}
181unsafe impl Send for PTA {}
182impl PTA {
183 #[doc = r"Pointer to the register block"]
184 pub const PTR: *const pta::RegisterBlock = 0x2492_0000 as *const _;
185 #[doc = r"Return the pointer to the register block"]
186 #[inline(always)]
187 pub const fn ptr() -> *const pta::RegisterBlock {
188 Self::PTR
189 }
190}
191impl Deref for PTA {
192 type Target = pta::RegisterBlock;
193 #[inline(always)]
194 fn deref(&self) -> &Self::Target {
195 unsafe { &*Self::PTR }
196 }
197}
198impl core::fmt::Debug for PTA {
199 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
200 f.debug_struct("PTA").finish()
201 }
202}
203#[doc = "Packet Traffic Arbitration"]
204pub mod pta;
205#[doc = "Wireless Fidelity control"]
206pub struct WIFI {
207 _marker: PhantomData<*const ()>,
208}
209unsafe impl Send for WIFI {}
210impl WIFI {
211 #[doc = r"Pointer to the register block"]
212 pub const PTR: *const wifi::RegisterBlock = 0x24b0_0000 as *const _;
213 #[doc = r"Return the pointer to the register block"]
214 #[inline(always)]
215 pub const fn ptr() -> *const wifi::RegisterBlock {
216 Self::PTR
217 }
218}
219impl Deref for WIFI {
220 type Target = wifi::RegisterBlock;
221 #[inline(always)]
222 fn deref(&self) -> &Self::Target {
223 unsafe { &*Self::PTR }
224 }
225}
226impl core::fmt::Debug for WIFI {
227 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
228 f.debug_struct("WIFI").finish()
229 }
230}
231#[doc = "Wireless Fidelity control"]
232pub mod wifi;
233#[doc = "Ethernet Media Access Control"]
234pub struct EMAC {
235 _marker: PhantomData<*const ()>,
236}
237unsafe impl Send for EMAC {}
238impl EMAC {
239 #[doc = r"Pointer to the register block"]
240 pub const PTR: *const emac::RegisterBlock = 0x2007_0000 as *const _;
241 #[doc = r"Return the pointer to the register block"]
242 #[inline(always)]
243 pub const fn ptr() -> *const emac::RegisterBlock {
244 Self::PTR
245 }
246}
247impl Deref for EMAC {
248 type Target = emac::RegisterBlock;
249 #[inline(always)]
250 fn deref(&self) -> &Self::Target {
251 unsafe { &*Self::PTR }
252 }
253}
254impl core::fmt::Debug for EMAC {
255 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
256 f.debug_struct("EMAC").finish()
257 }
258}
259#[doc = "Ethernet Media Access Control"]
260pub mod emac;
261#[doc = "Secure Digital host control"]
262pub struct SDH {
263 _marker: PhantomData<*const ()>,
264}
265unsafe impl Send for SDH {}
266impl SDH {
267 #[doc = r"Pointer to the register block"]
268 pub const PTR: *const sdh::RegisterBlock = 0x2006_0000 as *const _;
269 #[doc = r"Return the pointer to the register block"]
270 #[inline(always)]
271 pub const fn ptr() -> *const sdh::RegisterBlock {
272 Self::PTR
273 }
274}
275impl Deref for SDH {
276 type Target = sdh::RegisterBlock;
277 #[inline(always)]
278 fn deref(&self) -> &Self::Target {
279 unsafe { &*Self::PTR }
280 }
281}
282impl core::fmt::Debug for SDH {
283 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
284 f.debug_struct("SDH").finish()
285 }
286}
287#[doc = "Secure Digital host control"]
288pub mod sdh;
289#[doc = "Audio codec controller"]
290pub struct AUDIO {
291 _marker: PhantomData<*const ()>,
292}
293unsafe impl Send for AUDIO {}
294impl AUDIO {
295 #[doc = r"Pointer to the register block"]
296 pub const PTR: *const audio::RegisterBlock = 0x2005_5000 as *const _;
297 #[doc = r"Return the pointer to the register block"]
298 #[inline(always)]
299 pub const fn ptr() -> *const audio::RegisterBlock {
300 Self::PTR
301 }
302}
303impl Deref for AUDIO {
304 type Target = audio::RegisterBlock;
305 #[inline(always)]
306 fn deref(&self) -> &Self::Target {
307 unsafe { &*Self::PTR }
308 }
309}
310impl core::fmt::Debug for AUDIO {
311 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
312 f.debug_struct("AUDIO").finish()
313 }
314}
315#[doc = "Audio codec controller"]
316pub mod audio;
317#[doc = "Universal Serial Bus host"]
318pub struct USB {
319 _marker: PhantomData<*const ()>,
320}
321unsafe impl Send for USB {}
322impl USB {
323 #[doc = r"Pointer to the register block"]
324 pub const PTR: *const usb::RegisterBlock = 0x2007_2000 as *const _;
325 #[doc = r"Return the pointer to the register block"]
326 #[inline(always)]
327 pub const fn ptr() -> *const usb::RegisterBlock {
328 Self::PTR
329 }
330}
331impl Deref for USB {
332 type Target = usb::RegisterBlock;
333 #[inline(always)]
334 fn deref(&self) -> &Self::Target {
335 unsafe { &*Self::PTR }
336 }
337}
338impl core::fmt::Debug for USB {
339 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
340 f.debug_struct("USB").finish()
341 }
342}
343#[doc = "Universal Serial Bus host"]
344pub mod usb;
345#[doc = "Pseudo Static Random Access Memory control"]
346pub struct PSRAM {
347 _marker: PhantomData<*const ()>,
348}
349unsafe impl Send for PSRAM {}
350impl PSRAM {
351 #[doc = r"Pointer to the register block"]
352 pub const PTR: *const psram::RegisterBlock = 0x2005_2000 as *const _;
353 #[doc = r"Return the pointer to the register block"]
354 #[inline(always)]
355 pub const fn ptr() -> *const psram::RegisterBlock {
356 Self::PTR
357 }
358}
359impl Deref for PSRAM {
360 type Target = psram::RegisterBlock;
361 #[inline(always)]
362 fn deref(&self) -> &Self::Target {
363 unsafe { &*Self::PTR }
364 }
365}
366impl core::fmt::Debug for PSRAM {
367 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
368 f.debug_struct("PSRAM").finish()
369 }
370}
371#[doc = "Pseudo Static Random Access Memory control"]
372pub mod psram;
373#[doc = "Always-On function control"]
374pub struct AON {
375 _marker: PhantomData<*const ()>,
376}
377unsafe impl Send for AON {}
378impl AON {
379 #[doc = r"Pointer to the register block"]
380 pub const PTR: *const aon::RegisterBlock = 0x2000_f800 as *const _;
381 #[doc = r"Return the pointer to the register block"]
382 #[inline(always)]
383 pub const fn ptr() -> *const aon::RegisterBlock {
384 Self::PTR
385 }
386}
387impl Deref for AON {
388 type Target = aon::RegisterBlock;
389 #[inline(always)]
390 fn deref(&self) -> &Self::Target {
391 unsafe { &*Self::PTR }
392 }
393}
394impl core::fmt::Debug for AON {
395 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
396 f.debug_struct("AON").finish()
397 }
398}
399#[doc = "Always-On function control"]
400pub mod aon;
401#[doc = "Hibernate (Deep sleep) control"]
402pub struct HBN {
403 _marker: PhantomData<*const ()>,
404}
405unsafe impl Send for HBN {}
406impl HBN {
407 #[doc = r"Pointer to the register block"]
408 pub const PTR: *const hbn::RegisterBlock = 0x2000_f000 as *const _;
409 #[doc = r"Return the pointer to the register block"]
410 #[inline(always)]
411 pub const fn ptr() -> *const hbn::RegisterBlock {
412 Self::PTR
413 }
414}
415impl Deref for HBN {
416 type Target = hbn::RegisterBlock;
417 #[inline(always)]
418 fn deref(&self) -> &Self::Target {
419 unsafe { &*Self::PTR }
420 }
421}
422impl core::fmt::Debug for HBN {
423 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
424 f.debug_struct("HBN").finish()
425 }
426}
427#[doc = "Hibernate (Deep sleep) control"]
428pub mod hbn;
429#[doc = "Power-Down Sleep control"]
430pub struct PDS {
431 _marker: PhantomData<*const ()>,
432}
433unsafe impl Send for PDS {}
434impl PDS {
435 #[doc = r"Pointer to the register block"]
436 pub const PTR: *const pds::RegisterBlock = 0x2000_e000 as *const _;
437 #[doc = r"Return the pointer to the register block"]
438 #[inline(always)]
439 pub const fn ptr() -> *const pds::RegisterBlock {
440 Self::PTR
441 }
442}
443impl Deref for PDS {
444 type Target = pds::RegisterBlock;
445 #[inline(always)]
446 fn deref(&self) -> &Self::Target {
447 unsafe { &*Self::PTR }
448 }
449}
450impl core::fmt::Debug for PDS {
451 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
452 f.debug_struct("PDS").finish()
453 }
454}
455#[doc = "Power-Down Sleep control"]
456pub mod pds;
457#[doc = "Direct Memory Access"]
458pub struct DMA0 {
459 _marker: PhantomData<*const ()>,
460}
461unsafe impl Send for DMA0 {}
462impl DMA0 {
463 #[doc = r"Pointer to the register block"]
464 pub const PTR: *const dma::RegisterBlock = 0x2000_c000 as *const _;
465 #[doc = r"Return the pointer to the register block"]
466 #[inline(always)]
467 pub const fn ptr() -> *const dma::RegisterBlock {
468 Self::PTR
469 }
470}
471impl Deref for DMA0 {
472 type Target = dma::RegisterBlock;
473 #[inline(always)]
474 fn deref(&self) -> &Self::Target {
475 unsafe { &*Self::PTR }
476 }
477}
478impl core::fmt::Debug for DMA0 {
479 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
480 f.debug_struct("DMA0").finish()
481 }
482}
483#[doc = "Direct Memory Access"]
484pub struct DMA1 {
485 _marker: PhantomData<*const ()>,
486}
487unsafe impl Send for DMA1 {}
488impl DMA1 {
489 #[doc = r"Pointer to the register block"]
490 pub const PTR: *const dma::RegisterBlock = 0x2007_1000 as *const _;
491 #[doc = r"Return the pointer to the register block"]
492 #[inline(always)]
493 pub const fn ptr() -> *const dma::RegisterBlock {
494 Self::PTR
495 }
496}
497impl Deref for DMA1 {
498 type Target = dma::RegisterBlock;
499 #[inline(always)]
500 fn deref(&self) -> &Self::Target {
501 unsafe { &*Self::PTR }
502 }
503}
504impl core::fmt::Debug for DMA1 {
505 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
506 f.debug_struct("DMA1").finish()
507 }
508}
509#[doc = "Direct Memory Access"]
510pub mod dma;
511#[doc = "Quad Serial Flash control"]
512pub struct FLASH {
513 _marker: PhantomData<*const ()>,
514}
515unsafe impl Send for FLASH {}
516impl FLASH {
517 #[doc = r"Pointer to the register block"]
518 pub const PTR: *const flash::RegisterBlock = 0x2000_b000 as *const _;
519 #[doc = r"Return the pointer to the register block"]
520 #[inline(always)]
521 pub const fn ptr() -> *const flash::RegisterBlock {
522 Self::PTR
523 }
524}
525impl Deref for FLASH {
526 type Target = flash::RegisterBlock;
527 #[inline(always)]
528 fn deref(&self) -> &Self::Target {
529 unsafe { &*Self::PTR }
530 }
531}
532impl core::fmt::Debug for FLASH {
533 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
534 f.debug_struct("FLASH").finish()
535 }
536}
537#[doc = "Quad Serial Flash control"]
538pub mod flash;
539#[doc = "Hardware LZ4 Decompressor"]
540pub struct LZ4D {
541 _marker: PhantomData<*const ()>,
542}
543unsafe impl Send for LZ4D {}
544impl LZ4D {
545 #[doc = r"Pointer to the register block"]
546 pub const PTR: *const lz4d::RegisterBlock = 0x2000_ad00 as *const _;
547 #[doc = r"Return the pointer to the register block"]
548 #[inline(always)]
549 pub const fn ptr() -> *const lz4d::RegisterBlock {
550 Self::PTR
551 }
552}
553impl Deref for LZ4D {
554 type Target = lz4d::RegisterBlock;
555 #[inline(always)]
556 fn deref(&self) -> &Self::Target {
557 unsafe { &*Self::PTR }
558 }
559}
560impl core::fmt::Debug for LZ4D {
561 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
562 f.debug_struct("LZ4D").finish()
563 }
564}
565#[doc = "Hardware LZ4 Decompressor"]
566pub mod lz4d;
567#[doc = "Pulse Density Modulation"]
568pub struct PDM {
569 _marker: PhantomData<*const ()>,
570}
571unsafe impl Send for PDM {}
572impl PDM {
573 #[doc = r"Pointer to the register block"]
574 pub const PTR: *const pdm::RegisterBlock = 0x2000_ac00 as *const _;
575 #[doc = r"Return the pointer to the register block"]
576 #[inline(always)]
577 pub const fn ptr() -> *const pdm::RegisterBlock {
578 Self::PTR
579 }
580}
581impl Deref for PDM {
582 type Target = pdm::RegisterBlock;
583 #[inline(always)]
584 fn deref(&self) -> &Self::Target {
585 unsafe { &*Self::PTR }
586 }
587}
588impl core::fmt::Debug for PDM {
589 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
590 f.debug_struct("PDM").finish()
591 }
592}
593#[doc = "Pulse Density Modulation"]
594pub mod pdm;
595#[doc = "Inter-IC Sound controller"]
596pub struct I2S {
597 _marker: PhantomData<*const ()>,
598}
599unsafe impl Send for I2S {}
600impl I2S {
601 #[doc = r"Pointer to the register block"]
602 pub const PTR: *const i2s::RegisterBlock = 0x2000_ab00 as *const _;
603 #[doc = r"Return the pointer to the register block"]
604 #[inline(always)]
605 pub const fn ptr() -> *const i2s::RegisterBlock {
606 Self::PTR
607 }
608}
609impl Deref for I2S {
610 type Target = i2s::RegisterBlock;
611 #[inline(always)]
612 fn deref(&self) -> &Self::Target {
613 unsafe { &*Self::PTR }
614 }
615}
616impl core::fmt::Debug for I2S {
617 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
618 f.debug_struct("I2S").finish()
619 }
620}
621#[doc = "Inter-IC Sound controller"]
622pub mod i2s;
623#[doc = "ISO 11898 communication protocol"]
624pub struct ISO11898 {
625 _marker: PhantomData<*const ()>,
626}
627unsafe impl Send for ISO11898 {}
628impl ISO11898 {
629 #[doc = r"Pointer to the register block"]
630 pub const PTR: *const iso11898::RegisterBlock = 0x2000_aa00 as *const _;
631 #[doc = r"Return the pointer to the register block"]
632 #[inline(always)]
633 pub const fn ptr() -> *const iso11898::RegisterBlock {
634 Self::PTR
635 }
636}
637impl Deref for ISO11898 {
638 type Target = iso11898::RegisterBlock;
639 #[inline(always)]
640 fn deref(&self) -> &Self::Target {
641 unsafe { &*Self::PTR }
642 }
643}
644impl core::fmt::Debug for ISO11898 {
645 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
646 f.debug_struct("ISO11898").finish()
647 }
648}
649#[doc = "ISO 11898 communication protocol"]
650pub mod iso11898;
651#[doc = "Inter-processor Channel"]
652pub struct IPC {
653 _marker: PhantomData<*const ()>,
654}
655unsafe impl Send for IPC {}
656impl IPC {
657 #[doc = r"Pointer to the register block"]
658 pub const PTR: *const ipc::RegisterBlock = 0x2000_a800 as *const _;
659 #[doc = r"Return the pointer to the register block"]
660 #[inline(always)]
661 pub const fn ptr() -> *const ipc::RegisterBlock {
662 Self::PTR
663 }
664}
665impl Deref for IPC {
666 type Target = ipc::RegisterBlock;
667 #[inline(always)]
668 fn deref(&self) -> &Self::Target {
669 unsafe { &*Self::PTR }
670 }
671}
672impl core::fmt::Debug for IPC {
673 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
674 f.debug_struct("IPC").finish()
675 }
676}
677#[doc = "Inter-processor Channel"]
678pub mod ipc;
679#[doc = "Infrared Remote module"]
680pub struct IR {
681 _marker: PhantomData<*const ()>,
682}
683unsafe impl Send for IR {}
684impl IR {
685 #[doc = r"Pointer to the register block"]
686 pub const PTR: *const ir::RegisterBlock = 0x2000_a600 as *const _;
687 #[doc = r"Return the pointer to the register block"]
688 #[inline(always)]
689 pub const fn ptr() -> *const ir::RegisterBlock {
690 Self::PTR
691 }
692}
693impl Deref for IR {
694 type Target = ir::RegisterBlock;
695 #[inline(always)]
696 fn deref(&self) -> &Self::Target {
697 unsafe { &*Self::PTR }
698 }
699}
700impl core::fmt::Debug for IR {
701 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
702 f.debug_struct("IR").finish()
703 }
704}
705#[doc = "Infrared Remote module"]
706pub mod ir;
707#[doc = "Timer control"]
708pub struct TIMER {
709 _marker: PhantomData<*const ()>,
710}
711unsafe impl Send for TIMER {}
712impl TIMER {
713 #[doc = r"Pointer to the register block"]
714 pub const PTR: *const timer::RegisterBlock = 0x2000_a500 as *const _;
715 #[doc = r"Return the pointer to the register block"]
716 #[inline(always)]
717 pub const fn ptr() -> *const timer::RegisterBlock {
718 Self::PTR
719 }
720}
721impl Deref for TIMER {
722 type Target = timer::RegisterBlock;
723 #[inline(always)]
724 fn deref(&self) -> &Self::Target {
725 unsafe { &*Self::PTR }
726 }
727}
728impl core::fmt::Debug for TIMER {
729 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
730 f.debug_struct("TIMER").finish()
731 }
732}
733#[doc = "Timer control"]
734pub mod timer;
735#[doc = "Pulse-Width Modulation module"]
736pub struct PWM {
737 _marker: PhantomData<*const ()>,
738}
739unsafe impl Send for PWM {}
740impl PWM {
741 #[doc = r"Pointer to the register block"]
742 pub const PTR: *const pwm::RegisterBlock = 0x2000_a400 as *const _;
743 #[doc = r"Return the pointer to the register block"]
744 #[inline(always)]
745 pub const fn ptr() -> *const pwm::RegisterBlock {
746 Self::PTR
747 }
748}
749impl Deref for PWM {
750 type Target = pwm::RegisterBlock;
751 #[inline(always)]
752 fn deref(&self) -> &Self::Target {
753 unsafe { &*Self::PTR }
754 }
755}
756impl core::fmt::Debug for PWM {
757 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
758 f.debug_struct("PWM").finish()
759 }
760}
761#[doc = "Pulse-Width Modulation module"]
762pub mod pwm;
763#[doc = "Inter-Integrated Circuit bus"]
764pub struct I2C0 {
765 _marker: PhantomData<*const ()>,
766}
767unsafe impl Send for I2C0 {}
768impl I2C0 {
769 #[doc = r"Pointer to the register block"]
770 pub const PTR: *const i2c::RegisterBlock = 0x2000_a300 as *const _;
771 #[doc = r"Return the pointer to the register block"]
772 #[inline(always)]
773 pub const fn ptr() -> *const i2c::RegisterBlock {
774 Self::PTR
775 }
776}
777impl Deref for I2C0 {
778 type Target = i2c::RegisterBlock;
779 #[inline(always)]
780 fn deref(&self) -> &Self::Target {
781 unsafe { &*Self::PTR }
782 }
783}
784impl core::fmt::Debug for I2C0 {
785 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
786 f.debug_struct("I2C0").finish()
787 }
788}
789#[doc = "Inter-Integrated Circuit bus"]
790pub struct I2C1 {
791 _marker: PhantomData<*const ()>,
792}
793unsafe impl Send for I2C1 {}
794impl I2C1 {
795 #[doc = r"Pointer to the register block"]
796 pub const PTR: *const i2c::RegisterBlock = 0x2000_a900 as *const _;
797 #[doc = r"Return the pointer to the register block"]
798 #[inline(always)]
799 pub const fn ptr() -> *const i2c::RegisterBlock {
800 Self::PTR
801 }
802}
803impl Deref for I2C1 {
804 type Target = i2c::RegisterBlock;
805 #[inline(always)]
806 fn deref(&self) -> &Self::Target {
807 unsafe { &*Self::PTR }
808 }
809}
810impl core::fmt::Debug for I2C1 {
811 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
812 f.debug_struct("I2C1").finish()
813 }
814}
815#[doc = "Inter-Integrated Circuit bus"]
816pub mod i2c;
817#[doc = "Serial Peripheral Interface"]
818pub struct SPI0 {
819 _marker: PhantomData<*const ()>,
820}
821unsafe impl Send for SPI0 {}
822impl SPI0 {
823 #[doc = r"Pointer to the register block"]
824 pub const PTR: *const spi::RegisterBlock = 0x2000_a200 as *const _;
825 #[doc = r"Return the pointer to the register block"]
826 #[inline(always)]
827 pub const fn ptr() -> *const spi::RegisterBlock {
828 Self::PTR
829 }
830}
831impl Deref for SPI0 {
832 type Target = spi::RegisterBlock;
833 #[inline(always)]
834 fn deref(&self) -> &Self::Target {
835 unsafe { &*Self::PTR }
836 }
837}
838impl core::fmt::Debug for SPI0 {
839 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
840 f.debug_struct("SPI0").finish()
841 }
842}
843#[doc = "Serial Peripheral Interface"]
844pub mod spi;
845#[doc = "Universal Asynchronous Receiver Transmitter"]
846pub struct UART0 {
847 _marker: PhantomData<*const ()>,
848}
849unsafe impl Send for UART0 {}
850impl UART0 {
851 #[doc = r"Pointer to the register block"]
852 pub const PTR: *const uart::RegisterBlock = 0x2000_a000 as *const _;
853 #[doc = r"Return the pointer to the register block"]
854 #[inline(always)]
855 pub const fn ptr() -> *const uart::RegisterBlock {
856 Self::PTR
857 }
858}
859impl Deref for UART0 {
860 type Target = uart::RegisterBlock;
861 #[inline(always)]
862 fn deref(&self) -> &Self::Target {
863 unsafe { &*Self::PTR }
864 }
865}
866impl core::fmt::Debug for UART0 {
867 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
868 f.debug_struct("UART0").finish()
869 }
870}
871#[doc = "Universal Asynchronous Receiver Transmitter"]
872pub struct UART1 {
873 _marker: PhantomData<*const ()>,
874}
875unsafe impl Send for UART1 {}
876impl UART1 {
877 #[doc = r"Pointer to the register block"]
878 pub const PTR: *const uart::RegisterBlock = 0x2000_a100 as *const _;
879 #[doc = r"Return the pointer to the register block"]
880 #[inline(always)]
881 pub const fn ptr() -> *const uart::RegisterBlock {
882 Self::PTR
883 }
884}
885impl Deref for UART1 {
886 type Target = uart::RegisterBlock;
887 #[inline(always)]
888 fn deref(&self) -> &Self::Target {
889 unsafe { &*Self::PTR }
890 }
891}
892impl core::fmt::Debug for UART1 {
893 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
894 f.debug_struct("UART1").finish()
895 }
896}
897#[doc = "Universal Asynchronous Receiver Transmitter"]
898pub mod uart;
899#[doc = "Chip Miscellaneous control"]
900pub struct MISC {
901 _marker: PhantomData<*const ()>,
902}
903unsafe impl Send for MISC {}
904impl MISC {
905 #[doc = r"Pointer to the register block"]
906 pub const PTR: *const misc::RegisterBlock = 0x2000_9000 as *const _;
907 #[doc = r"Return the pointer to the register block"]
908 #[inline(always)]
909 pub const fn ptr() -> *const misc::RegisterBlock {
910 Self::PTR
911 }
912}
913impl Deref for MISC {
914 type Target = misc::RegisterBlock;
915 #[inline(always)]
916 fn deref(&self) -> &Self::Target {
917 unsafe { &*Self::PTR }
918 }
919}
920impl core::fmt::Debug for MISC {
921 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
922 f.debug_struct("MISC").finish()
923 }
924}
925#[doc = "Chip Miscellaneous control"]
926pub mod misc;
927#[doc = "Camera Control Interface"]
928pub struct CCI {
929 _marker: PhantomData<*const ()>,
930}
931unsafe impl Send for CCI {}
932impl CCI {
933 #[doc = r"Pointer to the register block"]
934 pub const PTR: *const cci::RegisterBlock = 0x2000_8000 as *const _;
935 #[doc = r"Return the pointer to the register block"]
936 #[inline(always)]
937 pub const fn ptr() -> *const cci::RegisterBlock {
938 Self::PTR
939 }
940}
941impl Deref for CCI {
942 type Target = cci::RegisterBlock;
943 #[inline(always)]
944 fn deref(&self) -> &Self::Target {
945 unsafe { &*Self::PTR }
946 }
947}
948impl core::fmt::Debug for CCI {
949 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
950 f.debug_struct("CCI").finish()
951 }
952}
953#[doc = "Camera Control Interface"]
954pub mod cci;
955#[doc = "eFuse memory control"]
956pub struct EFUSE {
957 _marker: PhantomData<*const ()>,
958}
959unsafe impl Send for EFUSE {}
960impl EFUSE {
961 #[doc = r"Pointer to the register block"]
962 pub const PTR: *const efuse::RegisterBlock = 0x2005_6000 as *const _;
963 #[doc = r"Return the pointer to the register block"]
964 #[inline(always)]
965 pub const fn ptr() -> *const efuse::RegisterBlock {
966 Self::PTR
967 }
968}
969impl Deref for EFUSE {
970 type Target = efuse::RegisterBlock;
971 #[inline(always)]
972 fn deref(&self) -> &Self::Target {
973 unsafe { &*Self::PTR }
974 }
975}
976impl core::fmt::Debug for EFUSE {
977 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
978 f.debug_struct("EFUSE").finish()
979 }
980}
981#[doc = "eFuse memory control"]
982pub mod efuse;
983#[doc = "Secure Engine"]
984pub struct SEC {
985 _marker: PhantomData<*const ()>,
986}
987unsafe impl Send for SEC {}
988impl SEC {
989 #[doc = r"Pointer to the register block"]
990 pub const PTR: *const sec::RegisterBlock = 0x2000_4000 as *const _;
991 #[doc = r"Return the pointer to the register block"]
992 #[inline(always)]
993 pub const fn ptr() -> *const sec::RegisterBlock {
994 Self::PTR
995 }
996}
997impl Deref for SEC {
998 type Target = sec::RegisterBlock;
999 #[inline(always)]
1000 fn deref(&self) -> &Self::Target {
1001 unsafe { &*Self::PTR }
1002 }
1003}
1004impl core::fmt::Debug for SEC {
1005 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1006 f.debug_struct("SEC").finish()
1007 }
1008}
1009#[doc = "Secure Engine"]
1010pub mod sec;
1011#[doc = "Secure debug configuration"]
1012pub struct DEBUG {
1013 _marker: PhantomData<*const ()>,
1014}
1015unsafe impl Send for DEBUG {}
1016impl DEBUG {
1017 #[doc = r"Pointer to the register block"]
1018 pub const PTR: *const debug::RegisterBlock = 0x2000_3000 as *const _;
1019 #[doc = r"Return the pointer to the register block"]
1020 #[inline(always)]
1021 pub const fn ptr() -> *const debug::RegisterBlock {
1022 Self::PTR
1023 }
1024}
1025impl Deref for DEBUG {
1026 type Target = debug::RegisterBlock;
1027 #[inline(always)]
1028 fn deref(&self) -> &Self::Target {
1029 unsafe { &*Self::PTR }
1030 }
1031}
1032impl core::fmt::Debug for DEBUG {
1033 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1034 f.debug_struct("DEBUG").finish()
1035 }
1036}
1037#[doc = "Secure debug configuration"]
1038pub mod debug;
1039#[doc = "Automatic Gain Control"]
1040pub struct AGC {
1041 _marker: PhantomData<*const ()>,
1042}
1043unsafe impl Send for AGC {}
1044impl AGC {
1045 #[doc = r"Pointer to the register block"]
1046 pub const PTR: *const agc::RegisterBlock = 0x2000_2c00 as *const _;
1047 #[doc = r"Return the pointer to the register block"]
1048 #[inline(always)]
1049 pub const fn ptr() -> *const agc::RegisterBlock {
1050 Self::PTR
1051 }
1052}
1053impl Deref for AGC {
1054 type Target = agc::RegisterBlock;
1055 #[inline(always)]
1056 fn deref(&self) -> &Self::Target {
1057 unsafe { &*Self::PTR }
1058 }
1059}
1060impl core::fmt::Debug for AGC {
1061 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1062 f.debug_struct("AGC").finish()
1063 }
1064}
1065#[doc = "Automatic Gain Control"]
1066pub mod agc;
1067#[doc = "Generic DAC, ADC and ACOMP interface control"]
1068pub struct GPIP {
1069 _marker: PhantomData<*const ()>,
1070}
1071unsafe impl Send for GPIP {}
1072impl GPIP {
1073 #[doc = r"Pointer to the register block"]
1074 pub const PTR: *const gpip::RegisterBlock = 0x2000_2000 as *const _;
1075 #[doc = r"Return the pointer to the register block"]
1076 #[inline(always)]
1077 pub const fn ptr() -> *const gpip::RegisterBlock {
1078 Self::PTR
1079 }
1080}
1081impl Deref for GPIP {
1082 type Target = gpip::RegisterBlock;
1083 #[inline(always)]
1084 fn deref(&self) -> &Self::Target {
1085 unsafe { &*Self::PTR }
1086 }
1087}
1088impl core::fmt::Debug for GPIP {
1089 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1090 f.debug_struct("GPIP").finish()
1091 }
1092}
1093#[doc = "Generic DAC, ADC and ACOMP interface control"]
1094pub mod gpip;
1095#[doc = "Global configuration register"]
1096pub struct GLB {
1097 _marker: PhantomData<*const ()>,
1098}
1099unsafe impl Send for GLB {}
1100impl GLB {
1101 #[doc = r"Pointer to the register block"]
1102 pub const PTR: *const glb::RegisterBlock = 0x2000_0000 as *const _;
1103 #[doc = r"Return the pointer to the register block"]
1104 #[inline(always)]
1105 pub const fn ptr() -> *const glb::RegisterBlock {
1106 Self::PTR
1107 }
1108}
1109impl Deref for GLB {
1110 type Target = glb::RegisterBlock;
1111 #[inline(always)]
1112 fn deref(&self) -> &Self::Target {
1113 unsafe { &*Self::PTR }
1114 }
1115}
1116impl core::fmt::Debug for GLB {
1117 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1118 f.debug_struct("GLB").finish()
1119 }
1120}
1121#[doc = "Global configuration register"]
1122pub mod glb;
1123#[no_mangle]
1124static mut DEVICE_PERIPHERALS: bool = false;
1125#[doc = r" All the peripherals."]
1126#[allow(non_snake_case)]
1127pub struct Peripherals {
1128 #[doc = "CODEC"]
1129 pub CODEC: CODEC,
1130 #[doc = "MJPEG"]
1131 pub MJPEG: MJPEG,
1132 #[doc = "H264"]
1133 pub H264: H264,
1134 #[doc = "NPU"]
1135 pub NPU: NPU,
1136 #[doc = "MMGLB"]
1137 pub MMGLB: MMGLB,
1138 #[doc = "PTA"]
1139 pub PTA: PTA,
1140 #[doc = "WIFI"]
1141 pub WIFI: WIFI,
1142 #[doc = "EMAC"]
1143 pub EMAC: EMAC,
1144 #[doc = "SDH"]
1145 pub SDH: SDH,
1146 #[doc = "AUDIO"]
1147 pub AUDIO: AUDIO,
1148 #[doc = "USB"]
1149 pub USB: USB,
1150 #[doc = "PSRAM"]
1151 pub PSRAM: PSRAM,
1152 #[doc = "AON"]
1153 pub AON: AON,
1154 #[doc = "HBN"]
1155 pub HBN: HBN,
1156 #[doc = "PDS"]
1157 pub PDS: PDS,
1158 #[doc = "DMA0"]
1159 pub DMA0: DMA0,
1160 #[doc = "DMA1"]
1161 pub DMA1: DMA1,
1162 #[doc = "FLASH"]
1163 pub FLASH: FLASH,
1164 #[doc = "LZ4D"]
1165 pub LZ4D: LZ4D,
1166 #[doc = "PDM"]
1167 pub PDM: PDM,
1168 #[doc = "I2S"]
1169 pub I2S: I2S,
1170 #[doc = "ISO11898"]
1171 pub ISO11898: ISO11898,
1172 #[doc = "IPC"]
1173 pub IPC: IPC,
1174 #[doc = "IR"]
1175 pub IR: IR,
1176 #[doc = "TIMER"]
1177 pub TIMER: TIMER,
1178 #[doc = "PWM"]
1179 pub PWM: PWM,
1180 #[doc = "I2C0"]
1181 pub I2C0: I2C0,
1182 #[doc = "I2C1"]
1183 pub I2C1: I2C1,
1184 #[doc = "SPI0"]
1185 pub SPI0: SPI0,
1186 #[doc = "UART0"]
1187 pub UART0: UART0,
1188 #[doc = "UART1"]
1189 pub UART1: UART1,
1190 #[doc = "MISC"]
1191 pub MISC: MISC,
1192 #[doc = "CCI"]
1193 pub CCI: CCI,
1194 #[doc = "EFUSE"]
1195 pub EFUSE: EFUSE,
1196 #[doc = "SEC"]
1197 pub SEC: SEC,
1198 #[doc = "DEBUG"]
1199 pub DEBUG: DEBUG,
1200 #[doc = "AGC"]
1201 pub AGC: AGC,
1202 #[doc = "GPIP"]
1203 pub GPIP: GPIP,
1204 #[doc = "GLB"]
1205 pub GLB: GLB,
1206}
1207impl Peripherals {
1208 #[doc = r" Returns all the peripherals *once*."]
1209 #[cfg(feature = "critical-section")]
1210 #[inline]
1211 pub fn take() -> Option<Self> {
1212 critical_section::with(|_| {
1213 if unsafe { DEVICE_PERIPHERALS } {
1214 return None;
1215 }
1216 Some(unsafe { Peripherals::steal() })
1217 })
1218 }
1219 #[doc = r" Unchecked version of `Peripherals::take`."]
1220 #[doc = r""]
1221 #[doc = r" # Safety"]
1222 #[doc = r""]
1223 #[doc = r" Each of the returned peripherals must be used at most once."]
1224 #[inline]
1225 pub unsafe fn steal() -> Self {
1226 DEVICE_PERIPHERALS = true;
1227 Peripherals {
1228 CODEC: CODEC {
1229 _marker: PhantomData,
1230 },
1231 MJPEG: MJPEG {
1232 _marker: PhantomData,
1233 },
1234 H264: H264 {
1235 _marker: PhantomData,
1236 },
1237 NPU: NPU {
1238 _marker: PhantomData,
1239 },
1240 MMGLB: MMGLB {
1241 _marker: PhantomData,
1242 },
1243 PTA: PTA {
1244 _marker: PhantomData,
1245 },
1246 WIFI: WIFI {
1247 _marker: PhantomData,
1248 },
1249 EMAC: EMAC {
1250 _marker: PhantomData,
1251 },
1252 SDH: SDH {
1253 _marker: PhantomData,
1254 },
1255 AUDIO: AUDIO {
1256 _marker: PhantomData,
1257 },
1258 USB: USB {
1259 _marker: PhantomData,
1260 },
1261 PSRAM: PSRAM {
1262 _marker: PhantomData,
1263 },
1264 AON: AON {
1265 _marker: PhantomData,
1266 },
1267 HBN: HBN {
1268 _marker: PhantomData,
1269 },
1270 PDS: PDS {
1271 _marker: PhantomData,
1272 },
1273 DMA0: DMA0 {
1274 _marker: PhantomData,
1275 },
1276 DMA1: DMA1 {
1277 _marker: PhantomData,
1278 },
1279 FLASH: FLASH {
1280 _marker: PhantomData,
1281 },
1282 LZ4D: LZ4D {
1283 _marker: PhantomData,
1284 },
1285 PDM: PDM {
1286 _marker: PhantomData,
1287 },
1288 I2S: I2S {
1289 _marker: PhantomData,
1290 },
1291 ISO11898: ISO11898 {
1292 _marker: PhantomData,
1293 },
1294 IPC: IPC {
1295 _marker: PhantomData,
1296 },
1297 IR: IR {
1298 _marker: PhantomData,
1299 },
1300 TIMER: TIMER {
1301 _marker: PhantomData,
1302 },
1303 PWM: PWM {
1304 _marker: PhantomData,
1305 },
1306 I2C0: I2C0 {
1307 _marker: PhantomData,
1308 },
1309 I2C1: I2C1 {
1310 _marker: PhantomData,
1311 },
1312 SPI0: SPI0 {
1313 _marker: PhantomData,
1314 },
1315 UART0: UART0 {
1316 _marker: PhantomData,
1317 },
1318 UART1: UART1 {
1319 _marker: PhantomData,
1320 },
1321 MISC: MISC {
1322 _marker: PhantomData,
1323 },
1324 CCI: CCI {
1325 _marker: PhantomData,
1326 },
1327 EFUSE: EFUSE {
1328 _marker: PhantomData,
1329 },
1330 SEC: SEC {
1331 _marker: PhantomData,
1332 },
1333 DEBUG: DEBUG {
1334 _marker: PhantomData,
1335 },
1336 AGC: AGC {
1337 _marker: PhantomData,
1338 },
1339 GPIP: GPIP {
1340 _marker: PhantomData,
1341 },
1342 GLB: GLB {
1343 _marker: PhantomData,
1344 },
1345 }
1346 }
1347}