1#![doc = "Peripheral access API for BL602 microcontrollers (generated using svd2rust v0.28.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.28.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#![deny(dead_code)]
3#![deny(improper_ctypes)]
4#![deny(missing_docs)]
5#![deny(no_mangle_generic_items)]
6#![deny(non_shorthand_field_patterns)]
7#![deny(overflowing_literals)]
8#![deny(path_statements)]
9#![deny(patterns_in_fns_without_body)]
10#![deny(private_in_public)]
11#![deny(unconditional_recursion)]
12#![deny(unused_allocation)]
13#![deny(unused_comparisons)]
14#![deny(unused_parens)]
15#![deny(while_true)]
16#![allow(non_camel_case_types)]
17#![allow(non_snake_case)]
18#![no_std]
19use core::marker::PhantomData;
20use core::ops::Deref;
21#[allow(unused_imports)]
22use generic::*;
23#[doc = r"Common register and bit access and modify traits"]
24pub mod generic;
25#[cfg(feature = "rt")]
26extern "C" {}
27#[doc(hidden)]
28pub union Vector {
29 pub _handler: unsafe extern "C" fn(),
30 pub _reserved: usize,
31}
32#[cfg(feature = "rt")]
33#[doc(hidden)]
34#[no_mangle]
35pub static __EXTERNAL_INTERRUPTS: [Vector; 0] = [];
36#[doc = "Global register"]
37pub struct GLB {
38 _marker: PhantomData<*const ()>,
39}
40unsafe impl Send for GLB {}
41impl GLB {
42 #[doc = r"Pointer to the register block"]
43 pub const PTR: *const glb::RegisterBlock = 0x4000_0000 as *const _;
44 #[doc = r"Return the pointer to the register block"]
45 #[inline(always)]
46 pub const fn ptr() -> *const glb::RegisterBlock {
47 Self::PTR
48 }
49}
50impl Deref for GLB {
51 type Target = glb::RegisterBlock;
52 #[inline(always)]
53 fn deref(&self) -> &Self::Target {
54 unsafe { &*Self::PTR }
55 }
56}
57impl core::fmt::Debug for GLB {
58 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
59 f.debug_struct("GLB").finish()
60 }
61}
62#[doc = "Global register"]
63pub mod glb;
64#[doc = "RF control"]
65pub struct RF {
66 _marker: PhantomData<*const ()>,
67}
68unsafe impl Send for RF {}
69impl RF {
70 #[doc = r"Pointer to the register block"]
71 pub const PTR: *const rf::RegisterBlock = 0x4000_1000 as *const _;
72 #[doc = r"Return the pointer to the register block"]
73 #[inline(always)]
74 pub const fn ptr() -> *const rf::RegisterBlock {
75 Self::PTR
76 }
77}
78impl Deref for RF {
79 type Target = rf::RegisterBlock;
80 #[inline(always)]
81 fn deref(&self) -> &Self::Target {
82 unsafe { &*Self::PTR }
83 }
84}
85impl core::fmt::Debug for RF {
86 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
87 f.debug_struct("RF").finish()
88 }
89}
90#[doc = "RF control"]
91pub mod rf;
92#[doc = "Universal DAC/ADC/ACOMP interface control"]
93pub struct GPIP {
94 _marker: PhantomData<*const ()>,
95}
96unsafe impl Send for GPIP {}
97impl GPIP {
98 #[doc = r"Pointer to the register block"]
99 pub const PTR: *const gpip::RegisterBlock = 0x4000_2000 as *const _;
100 #[doc = r"Return the pointer to the register block"]
101 #[inline(always)]
102 pub const fn ptr() -> *const gpip::RegisterBlock {
103 Self::PTR
104 }
105}
106impl Deref for GPIP {
107 type Target = gpip::RegisterBlock;
108 #[inline(always)]
109 fn deref(&self) -> &Self::Target {
110 unsafe { &*Self::PTR }
111 }
112}
113impl core::fmt::Debug for GPIP {
114 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
115 f.debug_struct("GPIP").finish()
116 }
117}
118#[doc = "Universal DAC/ADC/ACOMP interface control"]
119pub mod gpip;
120#[doc = "SEC_DBG."]
121pub struct SEC_DBG {
122 _marker: PhantomData<*const ()>,
123}
124unsafe impl Send for SEC_DBG {}
125impl SEC_DBG {
126 #[doc = r"Pointer to the register block"]
127 pub const PTR: *const sec_dbg::RegisterBlock = 0x4000_3000 as *const _;
128 #[doc = r"Return the pointer to the register block"]
129 #[inline(always)]
130 pub const fn ptr() -> *const sec_dbg::RegisterBlock {
131 Self::PTR
132 }
133}
134impl Deref for SEC_DBG {
135 type Target = sec_dbg::RegisterBlock;
136 #[inline(always)]
137 fn deref(&self) -> &Self::Target {
138 unsafe { &*Self::PTR }
139 }
140}
141impl core::fmt::Debug for SEC_DBG {
142 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
143 f.debug_struct("SEC_DBG").finish()
144 }
145}
146#[doc = "SEC_DBG."]
147pub mod sec_dbg;
148#[doc = "SEC_ENG."]
149pub struct SEC_ENG {
150 _marker: PhantomData<*const ()>,
151}
152unsafe impl Send for SEC_ENG {}
153impl SEC_ENG {
154 #[doc = r"Pointer to the register block"]
155 pub const PTR: *const sec_eng::RegisterBlock = 0x4000_4000 as *const _;
156 #[doc = r"Return the pointer to the register block"]
157 #[inline(always)]
158 pub const fn ptr() -> *const sec_eng::RegisterBlock {
159 Self::PTR
160 }
161}
162impl Deref for SEC_ENG {
163 type Target = sec_eng::RegisterBlock;
164 #[inline(always)]
165 fn deref(&self) -> &Self::Target {
166 unsafe { &*Self::PTR }
167 }
168}
169impl core::fmt::Debug for SEC_ENG {
170 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
171 f.debug_struct("SEC_ENG").finish()
172 }
173}
174#[doc = "SEC_ENG."]
175pub mod sec_eng;
176#[doc = "TZC_SEC."]
177pub struct TZC_SEC {
178 _marker: PhantomData<*const ()>,
179}
180unsafe impl Send for TZC_SEC {}
181impl TZC_SEC {
182 #[doc = r"Pointer to the register block"]
183 pub const PTR: *const tzc_sec::RegisterBlock = 0x4000_5000 as *const _;
184 #[doc = r"Return the pointer to the register block"]
185 #[inline(always)]
186 pub const fn ptr() -> *const tzc_sec::RegisterBlock {
187 Self::PTR
188 }
189}
190impl Deref for TZC_SEC {
191 type Target = tzc_sec::RegisterBlock;
192 #[inline(always)]
193 fn deref(&self) -> &Self::Target {
194 unsafe { &*Self::PTR }
195 }
196}
197impl core::fmt::Debug for TZC_SEC {
198 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
199 f.debug_struct("TZC_SEC").finish()
200 }
201}
202#[doc = "TZC_SEC."]
203pub mod tzc_sec;
204#[doc = "TZC_NSEC."]
205pub struct TZC_NSEC {
206 _marker: PhantomData<*const ()>,
207}
208unsafe impl Send for TZC_NSEC {}
209impl TZC_NSEC {
210 #[doc = r"Pointer to the register block"]
211 pub const PTR: *const tzc_nsec::RegisterBlock = 0x4000_6000 as *const _;
212 #[doc = r"Return the pointer to the register block"]
213 #[inline(always)]
214 pub const fn ptr() -> *const tzc_nsec::RegisterBlock {
215 Self::PTR
216 }
217}
218impl Deref for TZC_NSEC {
219 type Target = tzc_nsec::RegisterBlock;
220 #[inline(always)]
221 fn deref(&self) -> &Self::Target {
222 unsafe { &*Self::PTR }
223 }
224}
225impl core::fmt::Debug for TZC_NSEC {
226 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
227 f.debug_struct("TZC_NSEC").finish()
228 }
229}
230#[doc = "TZC_NSEC."]
231pub mod tzc_nsec;
232#[doc = "EF_DATA_0"]
233pub struct EF_DATA_0 {
234 _marker: PhantomData<*const ()>,
235}
236unsafe impl Send for EF_DATA_0 {}
237impl EF_DATA_0 {
238 #[doc = r"Pointer to the register block"]
239 pub const PTR: *const ef_data_0::RegisterBlock = 0x4000_7000 as *const _;
240 #[doc = r"Return the pointer to the register block"]
241 #[inline(always)]
242 pub const fn ptr() -> *const ef_data_0::RegisterBlock {
243 Self::PTR
244 }
245}
246impl Deref for EF_DATA_0 {
247 type Target = ef_data_0::RegisterBlock;
248 #[inline(always)]
249 fn deref(&self) -> &Self::Target {
250 unsafe { &*Self::PTR }
251 }
252}
253impl core::fmt::Debug for EF_DATA_0 {
254 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
255 f.debug_struct("EF_DATA_0").finish()
256 }
257}
258#[doc = "EF_DATA_0"]
259pub mod ef_data_0;
260#[doc = "EF_DATA_1."]
261pub struct EF_DATA_1 {
262 _marker: PhantomData<*const ()>,
263}
264unsafe impl Send for EF_DATA_1 {}
265impl EF_DATA_1 {
266 #[doc = r"Pointer to the register block"]
267 pub const PTR: *const ef_data_1::RegisterBlock = 0x4000_7080 as *const _;
268 #[doc = r"Return the pointer to the register block"]
269 #[inline(always)]
270 pub const fn ptr() -> *const ef_data_1::RegisterBlock {
271 Self::PTR
272 }
273}
274impl Deref for EF_DATA_1 {
275 type Target = ef_data_1::RegisterBlock;
276 #[inline(always)]
277 fn deref(&self) -> &Self::Target {
278 unsafe { &*Self::PTR }
279 }
280}
281impl core::fmt::Debug for EF_DATA_1 {
282 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
283 f.debug_struct("EF_DATA_1").finish()
284 }
285}
286#[doc = "EF_DATA_1."]
287pub mod ef_data_1;
288#[doc = "eFuse memory control"]
289pub struct EF_CTRL {
290 _marker: PhantomData<*const ()>,
291}
292unsafe impl Send for EF_CTRL {}
293impl EF_CTRL {
294 #[doc = r"Pointer to the register block"]
295 pub const PTR: *const ef_ctrl::RegisterBlock = 0x4000_7800 as *const _;
296 #[doc = r"Return the pointer to the register block"]
297 #[inline(always)]
298 pub const fn ptr() -> *const ef_ctrl::RegisterBlock {
299 Self::PTR
300 }
301}
302impl Deref for EF_CTRL {
303 type Target = ef_ctrl::RegisterBlock;
304 #[inline(always)]
305 fn deref(&self) -> &Self::Target {
306 unsafe { &*Self::PTR }
307 }
308}
309impl core::fmt::Debug for EF_CTRL {
310 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
311 f.debug_struct("EF_CTRL").finish()
312 }
313}
314#[doc = "eFuse memory control"]
315pub mod ef_ctrl;
316#[doc = "CCI."]
317pub struct CCI {
318 _marker: PhantomData<*const ()>,
319}
320unsafe impl Send for CCI {}
321impl CCI {
322 #[doc = r"Pointer to the register block"]
323 pub const PTR: *const cci::RegisterBlock = 0x4000_8000 as *const _;
324 #[doc = r"Return the pointer to the register block"]
325 #[inline(always)]
326 pub const fn ptr() -> *const cci::RegisterBlock {
327 Self::PTR
328 }
329}
330impl Deref for CCI {
331 type Target = cci::RegisterBlock;
332 #[inline(always)]
333 fn deref(&self) -> &Self::Target {
334 unsafe { &*Self::PTR }
335 }
336}
337impl core::fmt::Debug for CCI {
338 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
339 f.debug_struct("CCI").finish()
340 }
341}
342#[doc = "CCI."]
343pub mod cci;
344#[doc = "Cache control"]
345pub struct L1C {
346 _marker: PhantomData<*const ()>,
347}
348unsafe impl Send for L1C {}
349impl L1C {
350 #[doc = r"Pointer to the register block"]
351 pub const PTR: *const l1c::RegisterBlock = 0x4000_9000 as *const _;
352 #[doc = r"Return the pointer to the register block"]
353 #[inline(always)]
354 pub const fn ptr() -> *const l1c::RegisterBlock {
355 Self::PTR
356 }
357}
358impl Deref for L1C {
359 type Target = l1c::RegisterBlock;
360 #[inline(always)]
361 fn deref(&self) -> &Self::Target {
362 unsafe { &*Self::PTR }
363 }
364}
365impl core::fmt::Debug for L1C {
366 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
367 f.debug_struct("L1C").finish()
368 }
369}
370#[doc = "Cache control"]
371pub mod l1c;
372#[doc = "UART control"]
373pub struct UART {
374 _marker: PhantomData<*const ()>,
375}
376unsafe impl Send for UART {}
377impl UART {
378 #[doc = r"Pointer to the register block"]
379 pub const PTR: *const uart::RegisterBlock = 0x4000_a000 as *const _;
380 #[doc = r"Return the pointer to the register block"]
381 #[inline(always)]
382 pub const fn ptr() -> *const uart::RegisterBlock {
383 Self::PTR
384 }
385}
386impl Deref for UART {
387 type Target = uart::RegisterBlock;
388 #[inline(always)]
389 fn deref(&self) -> &Self::Target {
390 unsafe { &*Self::PTR }
391 }
392}
393impl core::fmt::Debug for UART {
394 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
395 f.debug_struct("UART").finish()
396 }
397}
398#[doc = "UART control"]
399pub mod uart;
400#[doc = "SPI master / slave control"]
401pub struct SPI {
402 _marker: PhantomData<*const ()>,
403}
404unsafe impl Send for SPI {}
405impl SPI {
406 #[doc = r"Pointer to the register block"]
407 pub const PTR: *const spi::RegisterBlock = 0x4000_a200 as *const _;
408 #[doc = r"Return the pointer to the register block"]
409 #[inline(always)]
410 pub const fn ptr() -> *const spi::RegisterBlock {
411 Self::PTR
412 }
413}
414impl Deref for SPI {
415 type Target = spi::RegisterBlock;
416 #[inline(always)]
417 fn deref(&self) -> &Self::Target {
418 unsafe { &*Self::PTR }
419 }
420}
421impl core::fmt::Debug for SPI {
422 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
423 f.debug_struct("SPI").finish()
424 }
425}
426#[doc = "SPI master / slave control"]
427pub mod spi;
428#[doc = "I2C control"]
429pub struct I2C {
430 _marker: PhantomData<*const ()>,
431}
432unsafe impl Send for I2C {}
433impl I2C {
434 #[doc = r"Pointer to the register block"]
435 pub const PTR: *const i2c::RegisterBlock = 0x4000_a300 as *const _;
436 #[doc = r"Return the pointer to the register block"]
437 #[inline(always)]
438 pub const fn ptr() -> *const i2c::RegisterBlock {
439 Self::PTR
440 }
441}
442impl Deref for I2C {
443 type Target = i2c::RegisterBlock;
444 #[inline(always)]
445 fn deref(&self) -> &Self::Target {
446 unsafe { &*Self::PTR }
447 }
448}
449impl core::fmt::Debug for I2C {
450 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
451 f.debug_struct("I2C").finish()
452 }
453}
454#[doc = "I2C control"]
455pub mod i2c;
456#[doc = "Pulse width modulation control"]
457pub struct PWM {
458 _marker: PhantomData<*const ()>,
459}
460unsafe impl Send for PWM {}
461impl PWM {
462 #[doc = r"Pointer to the register block"]
463 pub const PTR: *const pwm::RegisterBlock = 0x4000_a400 as *const _;
464 #[doc = r"Return the pointer to the register block"]
465 #[inline(always)]
466 pub const fn ptr() -> *const pwm::RegisterBlock {
467 Self::PTR
468 }
469}
470impl Deref for PWM {
471 type Target = pwm::RegisterBlock;
472 #[inline(always)]
473 fn deref(&self) -> &Self::Target {
474 unsafe { &*Self::PTR }
475 }
476}
477impl core::fmt::Debug for PWM {
478 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
479 f.debug_struct("PWM").finish()
480 }
481}
482#[doc = "Pulse width modulation control"]
483pub mod pwm;
484#[doc = "Timer control"]
485pub struct TIMER {
486 _marker: PhantomData<*const ()>,
487}
488unsafe impl Send for TIMER {}
489impl TIMER {
490 #[doc = r"Pointer to the register block"]
491 pub const PTR: *const timer::RegisterBlock = 0x4000_a500 as *const _;
492 #[doc = r"Return the pointer to the register block"]
493 #[inline(always)]
494 pub const fn ptr() -> *const timer::RegisterBlock {
495 Self::PTR
496 }
497}
498impl Deref for TIMER {
499 type Target = timer::RegisterBlock;
500 #[inline(always)]
501 fn deref(&self) -> &Self::Target {
502 unsafe { &*Self::PTR }
503 }
504}
505impl core::fmt::Debug for TIMER {
506 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
507 f.debug_struct("TIMER").finish()
508 }
509}
510#[doc = "Timer control"]
511pub mod timer;
512#[doc = "Infrared remote control"]
513pub struct IR {
514 _marker: PhantomData<*const ()>,
515}
516unsafe impl Send for IR {}
517impl IR {
518 #[doc = r"Pointer to the register block"]
519 pub const PTR: *const ir::RegisterBlock = 0x4000_a600 as *const _;
520 #[doc = r"Return the pointer to the register block"]
521 #[inline(always)]
522 pub const fn ptr() -> *const ir::RegisterBlock {
523 Self::PTR
524 }
525}
526impl Deref for IR {
527 type Target = ir::RegisterBlock;
528 #[inline(always)]
529 fn deref(&self) -> &Self::Target {
530 unsafe { &*Self::PTR }
531 }
532}
533impl core::fmt::Debug for IR {
534 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
535 f.debug_struct("IR").finish()
536 }
537}
538#[doc = "Infrared remote control"]
539pub mod ir;
540#[doc = "Checksum engine"]
541pub struct CKS {
542 _marker: PhantomData<*const ()>,
543}
544unsafe impl Send for CKS {}
545impl CKS {
546 #[doc = r"Pointer to the register block"]
547 pub const PTR: *const cks::RegisterBlock = 0x4000_a700 as *const _;
548 #[doc = r"Return the pointer to the register block"]
549 #[inline(always)]
550 pub const fn ptr() -> *const cks::RegisterBlock {
551 Self::PTR
552 }
553}
554impl Deref for CKS {
555 type Target = cks::RegisterBlock;
556 #[inline(always)]
557 fn deref(&self) -> &Self::Target {
558 unsafe { &*Self::PTR }
559 }
560}
561impl core::fmt::Debug for CKS {
562 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
563 f.debug_struct("CKS").finish()
564 }
565}
566#[doc = "Checksum engine"]
567pub mod cks;
568#[doc = "Flash control"]
569pub struct SF_CTRL {
570 _marker: PhantomData<*const ()>,
571}
572unsafe impl Send for SF_CTRL {}
573impl SF_CTRL {
574 #[doc = r"Pointer to the register block"]
575 pub const PTR: *const sf_ctrl::RegisterBlock = 0x4000_b000 as *const _;
576 #[doc = r"Return the pointer to the register block"]
577 #[inline(always)]
578 pub const fn ptr() -> *const sf_ctrl::RegisterBlock {
579 Self::PTR
580 }
581}
582impl Deref for SF_CTRL {
583 type Target = sf_ctrl::RegisterBlock;
584 #[inline(always)]
585 fn deref(&self) -> &Self::Target {
586 unsafe { &*Self::PTR }
587 }
588}
589impl core::fmt::Debug for SF_CTRL {
590 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
591 f.debug_struct("SF_CTRL").finish()
592 }
593}
594#[doc = "Flash control"]
595pub mod sf_ctrl;
596#[doc = "DMA control"]
597pub struct DMA {
598 _marker: PhantomData<*const ()>,
599}
600unsafe impl Send for DMA {}
601impl DMA {
602 #[doc = r"Pointer to the register block"]
603 pub const PTR: *const dma::RegisterBlock = 0x4000_c000 as *const _;
604 #[doc = r"Return the pointer to the register block"]
605 #[inline(always)]
606 pub const fn ptr() -> *const dma::RegisterBlock {
607 Self::PTR
608 }
609}
610impl Deref for DMA {
611 type Target = dma::RegisterBlock;
612 #[inline(always)]
613 fn deref(&self) -> &Self::Target {
614 unsafe { &*Self::PTR }
615 }
616}
617impl core::fmt::Debug for DMA {
618 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
619 f.debug_struct("DMA").finish()
620 }
621}
622#[doc = "DMA control"]
623pub mod dma;
624#[doc = "Sleep control (power-down sleep)"]
625pub struct PDS {
626 _marker: PhantomData<*const ()>,
627}
628unsafe impl Send for PDS {}
629impl PDS {
630 #[doc = r"Pointer to the register block"]
631 pub const PTR: *const pds::RegisterBlock = 0x4000_e000 as *const _;
632 #[doc = r"Return the pointer to the register block"]
633 #[inline(always)]
634 pub const fn ptr() -> *const pds::RegisterBlock {
635 Self::PTR
636 }
637}
638impl Deref for PDS {
639 type Target = pds::RegisterBlock;
640 #[inline(always)]
641 fn deref(&self) -> &Self::Target {
642 unsafe { &*Self::PTR }
643 }
644}
645impl core::fmt::Debug for PDS {
646 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
647 f.debug_struct("PDS").finish()
648 }
649}
650#[doc = "Sleep control (power-down sleep)"]
651pub mod pds;
652#[doc = "Deep Sleep Control (Hibernation)"]
653pub struct HBN {
654 _marker: PhantomData<*const ()>,
655}
656unsafe impl Send for HBN {}
657impl HBN {
658 #[doc = r"Pointer to the register block"]
659 pub const PTR: *const hbn::RegisterBlock = 0x4000_f000 as *const _;
660 #[doc = r"Return the pointer to the register block"]
661 #[inline(always)]
662 pub const fn ptr() -> *const hbn::RegisterBlock {
663 Self::PTR
664 }
665}
666impl Deref for HBN {
667 type Target = hbn::RegisterBlock;
668 #[inline(always)]
669 fn deref(&self) -> &Self::Target {
670 unsafe { &*Self::PTR }
671 }
672}
673impl core::fmt::Debug for HBN {
674 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
675 f.debug_struct("HBN").finish()
676 }
677}
678#[doc = "Deep Sleep Control (Hibernation)"]
679pub mod hbn;
680#[doc = "Always-ON periherals"]
681pub struct AON {
682 _marker: PhantomData<*const ()>,
683}
684unsafe impl Send for AON {}
685impl AON {
686 #[doc = r"Pointer to the register block"]
687 pub const PTR: *const aon::RegisterBlock = 0x4001_0000 as *const _;
688 #[doc = r"Return the pointer to the register block"]
689 #[inline(always)]
690 pub const fn ptr() -> *const aon::RegisterBlock {
691 Self::PTR
692 }
693}
694impl Deref for AON {
695 type Target = aon::RegisterBlock;
696 #[inline(always)]
697 fn deref(&self) -> &Self::Target {
698 unsafe { &*Self::PTR }
699 }
700}
701impl core::fmt::Debug for AON {
702 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
703 f.debug_struct("AON").finish()
704 }
705}
706#[doc = "Always-ON periherals"]
707pub mod aon;
708#[no_mangle]
709static mut DEVICE_PERIPHERALS: bool = false;
710#[doc = r" All the peripherals."]
711#[allow(non_snake_case)]
712pub struct Peripherals {
713 #[doc = "GLB"]
714 pub GLB: GLB,
715 #[doc = "RF"]
716 pub RF: RF,
717 #[doc = "GPIP"]
718 pub GPIP: GPIP,
719 #[doc = "SEC_DBG"]
720 pub SEC_DBG: SEC_DBG,
721 #[doc = "SEC_ENG"]
722 pub SEC_ENG: SEC_ENG,
723 #[doc = "TZC_SEC"]
724 pub TZC_SEC: TZC_SEC,
725 #[doc = "TZC_NSEC"]
726 pub TZC_NSEC: TZC_NSEC,
727 #[doc = "EF_DATA_0"]
728 pub EF_DATA_0: EF_DATA_0,
729 #[doc = "EF_DATA_1"]
730 pub EF_DATA_1: EF_DATA_1,
731 #[doc = "EF_CTRL"]
732 pub EF_CTRL: EF_CTRL,
733 #[doc = "CCI"]
734 pub CCI: CCI,
735 #[doc = "L1C"]
736 pub L1C: L1C,
737 #[doc = "UART"]
738 pub UART: UART,
739 #[doc = "SPI"]
740 pub SPI: SPI,
741 #[doc = "I2C"]
742 pub I2C: I2C,
743 #[doc = "PWM"]
744 pub PWM: PWM,
745 #[doc = "TIMER"]
746 pub TIMER: TIMER,
747 #[doc = "IR"]
748 pub IR: IR,
749 #[doc = "CKS"]
750 pub CKS: CKS,
751 #[doc = "SF_CTRL"]
752 pub SF_CTRL: SF_CTRL,
753 #[doc = "DMA"]
754 pub DMA: DMA,
755 #[doc = "PDS"]
756 pub PDS: PDS,
757 #[doc = "HBN"]
758 pub HBN: HBN,
759 #[doc = "AON"]
760 pub AON: AON,
761}
762impl Peripherals {
763 #[doc = r" Returns all the peripherals *once*."]
764 #[cfg(feature = "critical-section")]
765 #[inline]
766 pub fn take() -> Option<Self> {
767 critical_section::with(|_| {
768 if unsafe { DEVICE_PERIPHERALS } {
769 return None;
770 }
771 Some(unsafe { Peripherals::steal() })
772 })
773 }
774 #[doc = r" Unchecked version of `Peripherals::take`."]
775 #[doc = r""]
776 #[doc = r" # Safety"]
777 #[doc = r""]
778 #[doc = r" Each of the returned peripherals must be used at most once."]
779 #[inline]
780 pub unsafe fn steal() -> Self {
781 DEVICE_PERIPHERALS = true;
782 Peripherals {
783 GLB: GLB {
784 _marker: PhantomData,
785 },
786 RF: RF {
787 _marker: PhantomData,
788 },
789 GPIP: GPIP {
790 _marker: PhantomData,
791 },
792 SEC_DBG: SEC_DBG {
793 _marker: PhantomData,
794 },
795 SEC_ENG: SEC_ENG {
796 _marker: PhantomData,
797 },
798 TZC_SEC: TZC_SEC {
799 _marker: PhantomData,
800 },
801 TZC_NSEC: TZC_NSEC {
802 _marker: PhantomData,
803 },
804 EF_DATA_0: EF_DATA_0 {
805 _marker: PhantomData,
806 },
807 EF_DATA_1: EF_DATA_1 {
808 _marker: PhantomData,
809 },
810 EF_CTRL: EF_CTRL {
811 _marker: PhantomData,
812 },
813 CCI: CCI {
814 _marker: PhantomData,
815 },
816 L1C: L1C {
817 _marker: PhantomData,
818 },
819 UART: UART {
820 _marker: PhantomData,
821 },
822 SPI: SPI {
823 _marker: PhantomData,
824 },
825 I2C: I2C {
826 _marker: PhantomData,
827 },
828 PWM: PWM {
829 _marker: PhantomData,
830 },
831 TIMER: TIMER {
832 _marker: PhantomData,
833 },
834 IR: IR {
835 _marker: PhantomData,
836 },
837 CKS: CKS {
838 _marker: PhantomData,
839 },
840 SF_CTRL: SF_CTRL {
841 _marker: PhantomData,
842 },
843 DMA: DMA {
844 _marker: PhantomData,
845 },
846 PDS: PDS {
847 _marker: PhantomData,
848 },
849 HBN: HBN {
850 _marker: PhantomData,
851 },
852 AON: AON {
853 _marker: PhantomData,
854 },
855 }
856 }
857}