bcm2835_lpa/
lib.rs

1#![doc = "Peripheral access API for BCM2835_LPA microcontrollers (generated using svd2rust v0.31.5 ( ))\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.31.5/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#![allow(non_camel_case_types)]
4#![allow(non_snake_case)]
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 = 2;
10#[allow(unused_imports)]
11use generic::*;
12#[doc = r"Common register and bit access and modify traits"]
13pub mod generic;
14#[doc(hidden)]
15pub mod interrupt;
16pub use self::interrupt::Interrupt;
17#[doc = "Mailboxes for talking to/from VideoCore"]
18pub struct VCMAILBOX {
19    _marker: PhantomData<*const ()>,
20}
21unsafe impl Send for VCMAILBOX {}
22impl VCMAILBOX {
23    #[doc = r"Pointer to the register block"]
24    pub const PTR: *const vcmailbox::RegisterBlock = 0x2000_b880 as *const _;
25    #[doc = r"Return the pointer to the register block"]
26    #[inline(always)]
27    pub const fn ptr() -> *const vcmailbox::RegisterBlock {
28        Self::PTR
29    }
30    #[doc = r" Steal an instance of this peripheral"]
31    #[doc = r""]
32    #[doc = r" # Safety"]
33    #[doc = r""]
34    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
35    #[doc = r" that may race with any existing instances, for example by only"]
36    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
37    #[doc = r" original peripheral and using critical sections to coordinate"]
38    #[doc = r" access between multiple new instances."]
39    #[doc = r""]
40    #[doc = r" Additionally, other software such as HALs may rely on only one"]
41    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
42    #[doc = r" no stolen instances are passed to such software."]
43    pub unsafe fn steal() -> Self {
44        Self {
45            _marker: PhantomData,
46        }
47    }
48}
49impl Deref for VCMAILBOX {
50    type Target = vcmailbox::RegisterBlock;
51    #[inline(always)]
52    fn deref(&self) -> &Self::Target {
53        unsafe { &*Self::PTR }
54    }
55}
56impl core::fmt::Debug for VCMAILBOX {
57    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
58        f.debug_struct("VCMAILBOX").finish()
59    }
60}
61#[doc = "Mailboxes for talking to/from VideoCore"]
62pub mod vcmailbox;
63#[doc = "Broadcom Power Manager"]
64pub struct PM {
65    _marker: PhantomData<*const ()>,
66}
67unsafe impl Send for PM {}
68impl PM {
69    #[doc = r"Pointer to the register block"]
70    pub const PTR: *const pm::RegisterBlock = 0x2010_0000 as *const _;
71    #[doc = r"Return the pointer to the register block"]
72    #[inline(always)]
73    pub const fn ptr() -> *const pm::RegisterBlock {
74        Self::PTR
75    }
76    #[doc = r" Steal an instance of this peripheral"]
77    #[doc = r""]
78    #[doc = r" # Safety"]
79    #[doc = r""]
80    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
81    #[doc = r" that may race with any existing instances, for example by only"]
82    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
83    #[doc = r" original peripheral and using critical sections to coordinate"]
84    #[doc = r" access between multiple new instances."]
85    #[doc = r""]
86    #[doc = r" Additionally, other software such as HALs may rely on only one"]
87    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
88    #[doc = r" no stolen instances are passed to such software."]
89    pub unsafe fn steal() -> Self {
90        Self {
91            _marker: PhantomData,
92        }
93    }
94}
95impl Deref for PM {
96    type Target = pm::RegisterBlock;
97    #[inline(always)]
98    fn deref(&self) -> &Self::Target {
99        unsafe { &*Self::PTR }
100    }
101}
102impl core::fmt::Debug for PM {
103    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
104        f.debug_struct("PM").finish()
105    }
106}
107#[doc = "Broadcom Power Manager"]
108pub mod pm;
109#[doc = "Broadcom Clock Manager"]
110pub struct CM_PCM {
111    _marker: PhantomData<*const ()>,
112}
113unsafe impl Send for CM_PCM {}
114impl CM_PCM {
115    #[doc = r"Pointer to the register block"]
116    pub const PTR: *const cm_pcm::RegisterBlock = 0x2010_1098 as *const _;
117    #[doc = r"Return the pointer to the register block"]
118    #[inline(always)]
119    pub const fn ptr() -> *const cm_pcm::RegisterBlock {
120        Self::PTR
121    }
122    #[doc = r" Steal an instance of this peripheral"]
123    #[doc = r""]
124    #[doc = r" # Safety"]
125    #[doc = r""]
126    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
127    #[doc = r" that may race with any existing instances, for example by only"]
128    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
129    #[doc = r" original peripheral and using critical sections to coordinate"]
130    #[doc = r" access between multiple new instances."]
131    #[doc = r""]
132    #[doc = r" Additionally, other software such as HALs may rely on only one"]
133    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
134    #[doc = r" no stolen instances are passed to such software."]
135    pub unsafe fn steal() -> Self {
136        Self {
137            _marker: PhantomData,
138        }
139    }
140}
141impl Deref for CM_PCM {
142    type Target = cm_pcm::RegisterBlock;
143    #[inline(always)]
144    fn deref(&self) -> &Self::Target {
145        unsafe { &*Self::PTR }
146    }
147}
148impl core::fmt::Debug for CM_PCM {
149    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
150        f.debug_struct("CM_PCM").finish()
151    }
152}
153#[doc = "Broadcom Clock Manager"]
154pub mod cm_pcm;
155#[doc = "Broadcom Clock Manager"]
156pub struct CM_PWM {
157    _marker: PhantomData<*const ()>,
158}
159unsafe impl Send for CM_PWM {}
160impl CM_PWM {
161    #[doc = r"Pointer to the register block"]
162    pub const PTR: *const cm_pcm::RegisterBlock = 0x2010_10a0 as *const _;
163    #[doc = r"Return the pointer to the register block"]
164    #[inline(always)]
165    pub const fn ptr() -> *const cm_pcm::RegisterBlock {
166        Self::PTR
167    }
168    #[doc = r" Steal an instance of this peripheral"]
169    #[doc = r""]
170    #[doc = r" # Safety"]
171    #[doc = r""]
172    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
173    #[doc = r" that may race with any existing instances, for example by only"]
174    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
175    #[doc = r" original peripheral and using critical sections to coordinate"]
176    #[doc = r" access between multiple new instances."]
177    #[doc = r""]
178    #[doc = r" Additionally, other software such as HALs may rely on only one"]
179    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
180    #[doc = r" no stolen instances are passed to such software."]
181    pub unsafe fn steal() -> Self {
182        Self {
183            _marker: PhantomData,
184        }
185    }
186}
187impl Deref for CM_PWM {
188    type Target = cm_pcm::RegisterBlock;
189    #[inline(always)]
190    fn deref(&self) -> &Self::Target {
191        unsafe { &*Self::PTR }
192    }
193}
194impl core::fmt::Debug for CM_PWM {
195    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
196        f.debug_struct("CM_PWM").finish()
197    }
198}
199#[doc = "Broadcom Clock Manager"]
200pub use self::cm_pcm as cm_pwm;
201#[doc = "Pin level and mux control"]
202pub struct GPIO {
203    _marker: PhantomData<*const ()>,
204}
205unsafe impl Send for GPIO {}
206impl GPIO {
207    #[doc = r"Pointer to the register block"]
208    pub const PTR: *const gpio::RegisterBlock = 0x2020_0000 as *const _;
209    #[doc = r"Return the pointer to the register block"]
210    #[inline(always)]
211    pub const fn ptr() -> *const gpio::RegisterBlock {
212        Self::PTR
213    }
214    #[doc = r" Steal an instance of this peripheral"]
215    #[doc = r""]
216    #[doc = r" # Safety"]
217    #[doc = r""]
218    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
219    #[doc = r" that may race with any existing instances, for example by only"]
220    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
221    #[doc = r" original peripheral and using critical sections to coordinate"]
222    #[doc = r" access between multiple new instances."]
223    #[doc = r""]
224    #[doc = r" Additionally, other software such as HALs may rely on only one"]
225    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
226    #[doc = r" no stolen instances are passed to such software."]
227    pub unsafe fn steal() -> Self {
228        Self {
229            _marker: PhantomData,
230        }
231    }
232}
233impl Deref for GPIO {
234    type Target = gpio::RegisterBlock;
235    #[inline(always)]
236    fn deref(&self) -> &Self::Target {
237        unsafe { &*Self::PTR }
238    }
239}
240impl core::fmt::Debug for GPIO {
241    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
242        f.debug_struct("GPIO").finish()
243    }
244}
245#[doc = "Pin level and mux control"]
246pub mod gpio;
247#[doc = "Broadcom System Timer"]
248pub struct SYSTMR {
249    _marker: PhantomData<*const ()>,
250}
251unsafe impl Send for SYSTMR {}
252impl SYSTMR {
253    #[doc = r"Pointer to the register block"]
254    pub const PTR: *const systmr::RegisterBlock = 0x2000_3000 as *const _;
255    #[doc = r"Return the pointer to the register block"]
256    #[inline(always)]
257    pub const fn ptr() -> *const systmr::RegisterBlock {
258        Self::PTR
259    }
260    #[doc = r" Steal an instance of this peripheral"]
261    #[doc = r""]
262    #[doc = r" # Safety"]
263    #[doc = r""]
264    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
265    #[doc = r" that may race with any existing instances, for example by only"]
266    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
267    #[doc = r" original peripheral and using critical sections to coordinate"]
268    #[doc = r" access between multiple new instances."]
269    #[doc = r""]
270    #[doc = r" Additionally, other software such as HALs may rely on only one"]
271    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
272    #[doc = r" no stolen instances are passed to such software."]
273    pub unsafe fn steal() -> Self {
274        Self {
275            _marker: PhantomData,
276        }
277    }
278}
279impl Deref for SYSTMR {
280    type Target = systmr::RegisterBlock;
281    #[inline(always)]
282    fn deref(&self) -> &Self::Target {
283        unsafe { &*Self::PTR }
284    }
285}
286impl core::fmt::Debug for SYSTMR {
287    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
288        f.debug_struct("SYSTMR").finish()
289    }
290}
291#[doc = "Broadcom System Timer"]
292pub mod systmr;
293#[doc = "ARM Prime Cell PL011"]
294pub struct UART0 {
295    _marker: PhantomData<*const ()>,
296}
297unsafe impl Send for UART0 {}
298impl UART0 {
299    #[doc = r"Pointer to the register block"]
300    pub const PTR: *const uart0::RegisterBlock = 0x2020_1000 as *const _;
301    #[doc = r"Return the pointer to the register block"]
302    #[inline(always)]
303    pub const fn ptr() -> *const uart0::RegisterBlock {
304        Self::PTR
305    }
306    #[doc = r" Steal an instance of this peripheral"]
307    #[doc = r""]
308    #[doc = r" # Safety"]
309    #[doc = r""]
310    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
311    #[doc = r" that may race with any existing instances, for example by only"]
312    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
313    #[doc = r" original peripheral and using critical sections to coordinate"]
314    #[doc = r" access between multiple new instances."]
315    #[doc = r""]
316    #[doc = r" Additionally, other software such as HALs may rely on only one"]
317    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
318    #[doc = r" no stolen instances are passed to such software."]
319    pub unsafe fn steal() -> Self {
320        Self {
321            _marker: PhantomData,
322        }
323    }
324}
325impl Deref for UART0 {
326    type Target = uart0::RegisterBlock;
327    #[inline(always)]
328    fn deref(&self) -> &Self::Target {
329        unsafe { &*Self::PTR }
330    }
331}
332impl core::fmt::Debug for UART0 {
333    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
334        f.debug_struct("UART0").finish()
335    }
336}
337#[doc = "ARM Prime Cell PL011"]
338pub mod uart0;
339#[doc = "Broadcom SPI Controller"]
340pub struct SPI0 {
341    _marker: PhantomData<*const ()>,
342}
343unsafe impl Send for SPI0 {}
344impl SPI0 {
345    #[doc = r"Pointer to the register block"]
346    pub const PTR: *const spi0::RegisterBlock = 0x2020_4000 as *const _;
347    #[doc = r"Return the pointer to the register block"]
348    #[inline(always)]
349    pub const fn ptr() -> *const spi0::RegisterBlock {
350        Self::PTR
351    }
352    #[doc = r" Steal an instance of this peripheral"]
353    #[doc = r""]
354    #[doc = r" # Safety"]
355    #[doc = r""]
356    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
357    #[doc = r" that may race with any existing instances, for example by only"]
358    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
359    #[doc = r" original peripheral and using critical sections to coordinate"]
360    #[doc = r" access between multiple new instances."]
361    #[doc = r""]
362    #[doc = r" Additionally, other software such as HALs may rely on only one"]
363    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
364    #[doc = r" no stolen instances are passed to such software."]
365    pub unsafe fn steal() -> Self {
366        Self {
367            _marker: PhantomData,
368        }
369    }
370}
371impl Deref for SPI0 {
372    type Target = spi0::RegisterBlock;
373    #[inline(always)]
374    fn deref(&self) -> &Self::Target {
375        unsafe { &*Self::PTR }
376    }
377}
378impl core::fmt::Debug for SPI0 {
379    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
380        f.debug_struct("SPI0").finish()
381    }
382}
383#[doc = "Broadcom SPI Controller"]
384pub mod spi0;
385#[doc = "Broadcom Serial Controller (I2C compatible)"]
386pub struct BSC0 {
387    _marker: PhantomData<*const ()>,
388}
389unsafe impl Send for BSC0 {}
390impl BSC0 {
391    #[doc = r"Pointer to the register block"]
392    pub const PTR: *const bsc0::RegisterBlock = 0x2020_5000 as *const _;
393    #[doc = r"Return the pointer to the register block"]
394    #[inline(always)]
395    pub const fn ptr() -> *const bsc0::RegisterBlock {
396        Self::PTR
397    }
398    #[doc = r" Steal an instance of this peripheral"]
399    #[doc = r""]
400    #[doc = r" # Safety"]
401    #[doc = r""]
402    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
403    #[doc = r" that may race with any existing instances, for example by only"]
404    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
405    #[doc = r" original peripheral and using critical sections to coordinate"]
406    #[doc = r" access between multiple new instances."]
407    #[doc = r""]
408    #[doc = r" Additionally, other software such as HALs may rely on only one"]
409    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
410    #[doc = r" no stolen instances are passed to such software."]
411    pub unsafe fn steal() -> Self {
412        Self {
413            _marker: PhantomData,
414        }
415    }
416}
417impl Deref for BSC0 {
418    type Target = bsc0::RegisterBlock;
419    #[inline(always)]
420    fn deref(&self) -> &Self::Target {
421        unsafe { &*Self::PTR }
422    }
423}
424impl core::fmt::Debug for BSC0 {
425    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
426        f.debug_struct("BSC0").finish()
427    }
428}
429#[doc = "Broadcom Serial Controller (I2C compatible)"]
430pub mod bsc0;
431#[doc = "Broadcom PWM"]
432pub struct PWM0 {
433    _marker: PhantomData<*const ()>,
434}
435unsafe impl Send for PWM0 {}
436impl PWM0 {
437    #[doc = r"Pointer to the register block"]
438    pub const PTR: *const pwm0::RegisterBlock = 0x2020_c000 as *const _;
439    #[doc = r"Return the pointer to the register block"]
440    #[inline(always)]
441    pub const fn ptr() -> *const pwm0::RegisterBlock {
442        Self::PTR
443    }
444    #[doc = r" Steal an instance of this peripheral"]
445    #[doc = r""]
446    #[doc = r" # Safety"]
447    #[doc = r""]
448    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
449    #[doc = r" that may race with any existing instances, for example by only"]
450    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
451    #[doc = r" original peripheral and using critical sections to coordinate"]
452    #[doc = r" access between multiple new instances."]
453    #[doc = r""]
454    #[doc = r" Additionally, other software such as HALs may rely on only one"]
455    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
456    #[doc = r" no stolen instances are passed to such software."]
457    pub unsafe fn steal() -> Self {
458        Self {
459            _marker: PhantomData,
460        }
461    }
462}
463impl Deref for PWM0 {
464    type Target = pwm0::RegisterBlock;
465    #[inline(always)]
466    fn deref(&self) -> &Self::Target {
467        unsafe { &*Self::PTR }
468    }
469}
470impl core::fmt::Debug for PWM0 {
471    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
472        f.debug_struct("PWM0").finish()
473    }
474}
475#[doc = "Broadcom PWM"]
476pub mod pwm0;
477#[doc = "Broadcom Serial Controller (I2C compatible)"]
478pub struct BSC1 {
479    _marker: PhantomData<*const ()>,
480}
481unsafe impl Send for BSC1 {}
482impl BSC1 {
483    #[doc = r"Pointer to the register block"]
484    pub const PTR: *const bsc0::RegisterBlock = 0x2080_4000 as *const _;
485    #[doc = r"Return the pointer to the register block"]
486    #[inline(always)]
487    pub const fn ptr() -> *const bsc0::RegisterBlock {
488        Self::PTR
489    }
490    #[doc = r" Steal an instance of this peripheral"]
491    #[doc = r""]
492    #[doc = r" # Safety"]
493    #[doc = r""]
494    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
495    #[doc = r" that may race with any existing instances, for example by only"]
496    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
497    #[doc = r" original peripheral and using critical sections to coordinate"]
498    #[doc = r" access between multiple new instances."]
499    #[doc = r""]
500    #[doc = r" Additionally, other software such as HALs may rely on only one"]
501    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
502    #[doc = r" no stolen instances are passed to such software."]
503    pub unsafe fn steal() -> Self {
504        Self {
505            _marker: PhantomData,
506        }
507    }
508}
509impl Deref for BSC1 {
510    type Target = bsc0::RegisterBlock;
511    #[inline(always)]
512    fn deref(&self) -> &Self::Target {
513        unsafe { &*Self::PTR }
514    }
515}
516impl core::fmt::Debug for BSC1 {
517    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
518        f.debug_struct("BSC1").finish()
519    }
520}
521#[doc = "Broadcom Serial Controller (I2C compatible)"]
522pub use self::bsc0 as bsc1;
523#[doc = "Broadcom Serial Controller (I2C compatible)"]
524pub struct BSC2 {
525    _marker: PhantomData<*const ()>,
526}
527unsafe impl Send for BSC2 {}
528impl BSC2 {
529    #[doc = r"Pointer to the register block"]
530    pub const PTR: *const bsc0::RegisterBlock = 0x2080_5000 as *const _;
531    #[doc = r"Return the pointer to the register block"]
532    #[inline(always)]
533    pub const fn ptr() -> *const bsc0::RegisterBlock {
534        Self::PTR
535    }
536    #[doc = r" Steal an instance of this peripheral"]
537    #[doc = r""]
538    #[doc = r" # Safety"]
539    #[doc = r""]
540    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
541    #[doc = r" that may race with any existing instances, for example by only"]
542    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
543    #[doc = r" original peripheral and using critical sections to coordinate"]
544    #[doc = r" access between multiple new instances."]
545    #[doc = r""]
546    #[doc = r" Additionally, other software such as HALs may rely on only one"]
547    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
548    #[doc = r" no stolen instances are passed to such software."]
549    pub unsafe fn steal() -> Self {
550        Self {
551            _marker: PhantomData,
552        }
553    }
554}
555impl Deref for BSC2 {
556    type Target = bsc0::RegisterBlock;
557    #[inline(always)]
558    fn deref(&self) -> &Self::Target {
559        unsafe { &*Self::PTR }
560    }
561}
562impl core::fmt::Debug for BSC2 {
563    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
564        f.debug_struct("BSC2").finish()
565    }
566}
567#[doc = "Broadcom Serial Controller (I2C compatible)"]
568pub use self::bsc0 as bsc2;
569#[doc = "Three auxiliary peripherals"]
570pub struct AUX {
571    _marker: PhantomData<*const ()>,
572}
573unsafe impl Send for AUX {}
574impl AUX {
575    #[doc = r"Pointer to the register block"]
576    pub const PTR: *const aux::RegisterBlock = 0x2021_5000 as *const _;
577    #[doc = r"Return the pointer to the register block"]
578    #[inline(always)]
579    pub const fn ptr() -> *const aux::RegisterBlock {
580        Self::PTR
581    }
582    #[doc = r" Steal an instance of this peripheral"]
583    #[doc = r""]
584    #[doc = r" # Safety"]
585    #[doc = r""]
586    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
587    #[doc = r" that may race with any existing instances, for example by only"]
588    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
589    #[doc = r" original peripheral and using critical sections to coordinate"]
590    #[doc = r" access between multiple new instances."]
591    #[doc = r""]
592    #[doc = r" Additionally, other software such as HALs may rely on only one"]
593    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
594    #[doc = r" no stolen instances are passed to such software."]
595    pub unsafe fn steal() -> Self {
596        Self {
597            _marker: PhantomData,
598        }
599    }
600}
601impl Deref for AUX {
602    type Target = aux::RegisterBlock;
603    #[inline(always)]
604    fn deref(&self) -> &Self::Target {
605        unsafe { &*Self::PTR }
606    }
607}
608impl core::fmt::Debug for AUX {
609    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
610        f.debug_struct("AUX").finish()
611    }
612}
613#[doc = "Three auxiliary peripherals"]
614#[path = "aux_.rs"]
615pub mod aux;
616#[doc = "Mini UART"]
617pub struct UART1 {
618    _marker: PhantomData<*const ()>,
619}
620unsafe impl Send for UART1 {}
621impl UART1 {
622    #[doc = r"Pointer to the register block"]
623    pub const PTR: *const uart1::RegisterBlock = 0x2021_5040 as *const _;
624    #[doc = r"Return the pointer to the register block"]
625    #[inline(always)]
626    pub const fn ptr() -> *const uart1::RegisterBlock {
627        Self::PTR
628    }
629    #[doc = r" Steal an instance of this peripheral"]
630    #[doc = r""]
631    #[doc = r" # Safety"]
632    #[doc = r""]
633    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
634    #[doc = r" that may race with any existing instances, for example by only"]
635    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
636    #[doc = r" original peripheral and using critical sections to coordinate"]
637    #[doc = r" access between multiple new instances."]
638    #[doc = r""]
639    #[doc = r" Additionally, other software such as HALs may rely on only one"]
640    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
641    #[doc = r" no stolen instances are passed to such software."]
642    pub unsafe fn steal() -> Self {
643        Self {
644            _marker: PhantomData,
645        }
646    }
647}
648impl Deref for UART1 {
649    type Target = uart1::RegisterBlock;
650    #[inline(always)]
651    fn deref(&self) -> &Self::Target {
652        unsafe { &*Self::PTR }
653    }
654}
655impl core::fmt::Debug for UART1 {
656    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
657        f.debug_struct("UART1").finish()
658    }
659}
660#[doc = "Mini UART"]
661pub mod uart1;
662#[doc = "Aux SPI"]
663pub struct SPI1 {
664    _marker: PhantomData<*const ()>,
665}
666unsafe impl Send for SPI1 {}
667impl SPI1 {
668    #[doc = r"Pointer to the register block"]
669    pub const PTR: *const spi1::RegisterBlock = 0x2021_5080 as *const _;
670    #[doc = r"Return the pointer to the register block"]
671    #[inline(always)]
672    pub const fn ptr() -> *const spi1::RegisterBlock {
673        Self::PTR
674    }
675    #[doc = r" Steal an instance of this peripheral"]
676    #[doc = r""]
677    #[doc = r" # Safety"]
678    #[doc = r""]
679    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
680    #[doc = r" that may race with any existing instances, for example by only"]
681    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
682    #[doc = r" original peripheral and using critical sections to coordinate"]
683    #[doc = r" access between multiple new instances."]
684    #[doc = r""]
685    #[doc = r" Additionally, other software such as HALs may rely on only one"]
686    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
687    #[doc = r" no stolen instances are passed to such software."]
688    pub unsafe fn steal() -> Self {
689        Self {
690            _marker: PhantomData,
691        }
692    }
693}
694impl Deref for SPI1 {
695    type Target = spi1::RegisterBlock;
696    #[inline(always)]
697    fn deref(&self) -> &Self::Target {
698        unsafe { &*Self::PTR }
699    }
700}
701impl core::fmt::Debug for SPI1 {
702    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
703        f.debug_struct("SPI1").finish()
704    }
705}
706#[doc = "Aux SPI"]
707pub mod spi1;
708#[doc = "Aux SPI"]
709pub struct SPI2 {
710    _marker: PhantomData<*const ()>,
711}
712unsafe impl Send for SPI2 {}
713impl SPI2 {
714    #[doc = r"Pointer to the register block"]
715    pub const PTR: *const spi1::RegisterBlock = 0x2021_50c0 as *const _;
716    #[doc = r"Return the pointer to the register block"]
717    #[inline(always)]
718    pub const fn ptr() -> *const spi1::RegisterBlock {
719        Self::PTR
720    }
721    #[doc = r" Steal an instance of this peripheral"]
722    #[doc = r""]
723    #[doc = r" # Safety"]
724    #[doc = r""]
725    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
726    #[doc = r" that may race with any existing instances, for example by only"]
727    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
728    #[doc = r" original peripheral and using critical sections to coordinate"]
729    #[doc = r" access between multiple new instances."]
730    #[doc = r""]
731    #[doc = r" Additionally, other software such as HALs may rely on only one"]
732    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
733    #[doc = r" no stolen instances are passed to such software."]
734    pub unsafe fn steal() -> Self {
735        Self {
736            _marker: PhantomData,
737        }
738    }
739}
740impl Deref for SPI2 {
741    type Target = spi1::RegisterBlock;
742    #[inline(always)]
743    fn deref(&self) -> &Self::Target {
744        unsafe { &*Self::PTR }
745    }
746}
747impl core::fmt::Debug for SPI2 {
748    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
749        f.debug_struct("SPI2").finish()
750    }
751}
752#[doc = "Aux SPI"]
753pub use self::spi1 as spi2;
754#[doc = "Broadcom Legacy Interrupt Controller"]
755pub struct LIC {
756    _marker: PhantomData<*const ()>,
757}
758unsafe impl Send for LIC {}
759impl LIC {
760    #[doc = r"Pointer to the register block"]
761    pub const PTR: *const lic::RegisterBlock = 0x2000_b000 as *const _;
762    #[doc = r"Return the pointer to the register block"]
763    #[inline(always)]
764    pub const fn ptr() -> *const lic::RegisterBlock {
765        Self::PTR
766    }
767    #[doc = r" Steal an instance of this peripheral"]
768    #[doc = r""]
769    #[doc = r" # Safety"]
770    #[doc = r""]
771    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
772    #[doc = r" that may race with any existing instances, for example by only"]
773    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
774    #[doc = r" original peripheral and using critical sections to coordinate"]
775    #[doc = r" access between multiple new instances."]
776    #[doc = r""]
777    #[doc = r" Additionally, other software such as HALs may rely on only one"]
778    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
779    #[doc = r" no stolen instances are passed to such software."]
780    pub unsafe fn steal() -> Self {
781        Self {
782            _marker: PhantomData,
783        }
784    }
785}
786impl Deref for LIC {
787    type Target = lic::RegisterBlock;
788    #[inline(always)]
789    fn deref(&self) -> &Self::Target {
790        unsafe { &*Self::PTR }
791    }
792}
793impl core::fmt::Debug for LIC {
794    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
795        f.debug_struct("LIC").finish()
796    }
797}
798#[doc = "Broadcom Legacy Interrupt Controller"]
799pub mod lic;
800#[doc = "USB on the go high speed"]
801pub struct USB_OTG_GLOBAL {
802    _marker: PhantomData<*const ()>,
803}
804unsafe impl Send for USB_OTG_GLOBAL {}
805impl USB_OTG_GLOBAL {
806    #[doc = r"Pointer to the register block"]
807    pub const PTR: *const usb_otg_global::RegisterBlock = 0x2098_0000 as *const _;
808    #[doc = r"Return the pointer to the register block"]
809    #[inline(always)]
810    pub const fn ptr() -> *const usb_otg_global::RegisterBlock {
811        Self::PTR
812    }
813    #[doc = r" Steal an instance of this peripheral"]
814    #[doc = r""]
815    #[doc = r" # Safety"]
816    #[doc = r""]
817    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
818    #[doc = r" that may race with any existing instances, for example by only"]
819    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
820    #[doc = r" original peripheral and using critical sections to coordinate"]
821    #[doc = r" access between multiple new instances."]
822    #[doc = r""]
823    #[doc = r" Additionally, other software such as HALs may rely on only one"]
824    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
825    #[doc = r" no stolen instances are passed to such software."]
826    pub unsafe fn steal() -> Self {
827        Self {
828            _marker: PhantomData,
829        }
830    }
831}
832impl Deref for USB_OTG_GLOBAL {
833    type Target = usb_otg_global::RegisterBlock;
834    #[inline(always)]
835    fn deref(&self) -> &Self::Target {
836        unsafe { &*Self::PTR }
837    }
838}
839impl core::fmt::Debug for USB_OTG_GLOBAL {
840    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
841        f.debug_struct("USB_OTG_GLOBAL").finish()
842    }
843}
844#[doc = "USB on the go high speed"]
845pub mod usb_otg_global;
846#[doc = "USB on the go high speed"]
847pub struct USB_OTG_HOST {
848    _marker: PhantomData<*const ()>,
849}
850unsafe impl Send for USB_OTG_HOST {}
851impl USB_OTG_HOST {
852    #[doc = r"Pointer to the register block"]
853    pub const PTR: *const usb_otg_host::RegisterBlock = 0x2098_0400 as *const _;
854    #[doc = r"Return the pointer to the register block"]
855    #[inline(always)]
856    pub const fn ptr() -> *const usb_otg_host::RegisterBlock {
857        Self::PTR
858    }
859    #[doc = r" Steal an instance of this peripheral"]
860    #[doc = r""]
861    #[doc = r" # Safety"]
862    #[doc = r""]
863    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
864    #[doc = r" that may race with any existing instances, for example by only"]
865    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
866    #[doc = r" original peripheral and using critical sections to coordinate"]
867    #[doc = r" access between multiple new instances."]
868    #[doc = r""]
869    #[doc = r" Additionally, other software such as HALs may rely on only one"]
870    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
871    #[doc = r" no stolen instances are passed to such software."]
872    pub unsafe fn steal() -> Self {
873        Self {
874            _marker: PhantomData,
875        }
876    }
877}
878impl Deref for USB_OTG_HOST {
879    type Target = usb_otg_host::RegisterBlock;
880    #[inline(always)]
881    fn deref(&self) -> &Self::Target {
882        unsafe { &*Self::PTR }
883    }
884}
885impl core::fmt::Debug for USB_OTG_HOST {
886    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
887        f.debug_struct("USB_OTG_HOST").finish()
888    }
889}
890#[doc = "USB on the go high speed"]
891pub mod usb_otg_host;
892#[doc = "USB on the go high speed"]
893pub struct USB_OTG_DEVICE {
894    _marker: PhantomData<*const ()>,
895}
896unsafe impl Send for USB_OTG_DEVICE {}
897impl USB_OTG_DEVICE {
898    #[doc = r"Pointer to the register block"]
899    pub const PTR: *const usb_otg_device::RegisterBlock = 0x2098_0800 as *const _;
900    #[doc = r"Return the pointer to the register block"]
901    #[inline(always)]
902    pub const fn ptr() -> *const usb_otg_device::RegisterBlock {
903        Self::PTR
904    }
905    #[doc = r" Steal an instance of this peripheral"]
906    #[doc = r""]
907    #[doc = r" # Safety"]
908    #[doc = r""]
909    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
910    #[doc = r" that may race with any existing instances, for example by only"]
911    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
912    #[doc = r" original peripheral and using critical sections to coordinate"]
913    #[doc = r" access between multiple new instances."]
914    #[doc = r""]
915    #[doc = r" Additionally, other software such as HALs may rely on only one"]
916    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
917    #[doc = r" no stolen instances are passed to such software."]
918    pub unsafe fn steal() -> Self {
919        Self {
920            _marker: PhantomData,
921        }
922    }
923}
924impl Deref for USB_OTG_DEVICE {
925    type Target = usb_otg_device::RegisterBlock;
926    #[inline(always)]
927    fn deref(&self) -> &Self::Target {
928        unsafe { &*Self::PTR }
929    }
930}
931impl core::fmt::Debug for USB_OTG_DEVICE {
932    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
933        f.debug_struct("USB_OTG_DEVICE").finish()
934    }
935}
936#[doc = "USB on the go high speed"]
937pub mod usb_otg_device;
938#[doc = "USB on the go high speed power control"]
939pub struct USB_OTG_PWRCLK {
940    _marker: PhantomData<*const ()>,
941}
942unsafe impl Send for USB_OTG_PWRCLK {}
943impl USB_OTG_PWRCLK {
944    #[doc = r"Pointer to the register block"]
945    pub const PTR: *const usb_otg_pwrclk::RegisterBlock = 0x2098_0e00 as *const _;
946    #[doc = r"Return the pointer to the register block"]
947    #[inline(always)]
948    pub const fn ptr() -> *const usb_otg_pwrclk::RegisterBlock {
949        Self::PTR
950    }
951    #[doc = r" Steal an instance of this peripheral"]
952    #[doc = r""]
953    #[doc = r" # Safety"]
954    #[doc = r""]
955    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
956    #[doc = r" that may race with any existing instances, for example by only"]
957    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
958    #[doc = r" original peripheral and using critical sections to coordinate"]
959    #[doc = r" access between multiple new instances."]
960    #[doc = r""]
961    #[doc = r" Additionally, other software such as HALs may rely on only one"]
962    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
963    #[doc = r" no stolen instances are passed to such software."]
964    pub unsafe fn steal() -> Self {
965        Self {
966            _marker: PhantomData,
967        }
968    }
969}
970impl Deref for USB_OTG_PWRCLK {
971    type Target = usb_otg_pwrclk::RegisterBlock;
972    #[inline(always)]
973    fn deref(&self) -> &Self::Target {
974        unsafe { &*Self::PTR }
975    }
976}
977impl core::fmt::Debug for USB_OTG_PWRCLK {
978    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
979        f.debug_struct("USB_OTG_PWRCLK").finish()
980    }
981}
982#[doc = "USB on the go high speed power control"]
983pub mod usb_otg_pwrclk;
984#[doc = "Arasan SD3.0 Host AHB eMMC 4.4"]
985pub struct EMMC {
986    _marker: PhantomData<*const ()>,
987}
988unsafe impl Send for EMMC {}
989impl EMMC {
990    #[doc = r"Pointer to the register block"]
991    pub const PTR: *const emmc::RegisterBlock = 0x2030_0000 as *const _;
992    #[doc = r"Return the pointer to the register block"]
993    #[inline(always)]
994    pub const fn ptr() -> *const emmc::RegisterBlock {
995        Self::PTR
996    }
997    #[doc = r" Steal an instance of this peripheral"]
998    #[doc = r""]
999    #[doc = r" # Safety"]
1000    #[doc = r""]
1001    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
1002    #[doc = r" that may race with any existing instances, for example by only"]
1003    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
1004    #[doc = r" original peripheral and using critical sections to coordinate"]
1005    #[doc = r" access between multiple new instances."]
1006    #[doc = r""]
1007    #[doc = r" Additionally, other software such as HALs may rely on only one"]
1008    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
1009    #[doc = r" no stolen instances are passed to such software."]
1010    pub unsafe fn steal() -> Self {
1011        Self {
1012            _marker: PhantomData,
1013        }
1014    }
1015}
1016impl Deref for EMMC {
1017    type Target = emmc::RegisterBlock;
1018    #[inline(always)]
1019    fn deref(&self) -> &Self::Target {
1020        unsafe { &*Self::PTR }
1021    }
1022}
1023impl core::fmt::Debug for EMMC {
1024    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1025        f.debug_struct("EMMC").finish()
1026    }
1027}
1028#[doc = "Arasan SD3.0 Host AHB eMMC 4.4"]
1029pub mod emmc;
1030#[no_mangle]
1031static mut DEVICE_PERIPHERALS: bool = false;
1032#[doc = r" All the peripherals."]
1033#[allow(non_snake_case)]
1034pub struct Peripherals {
1035    #[doc = "VCMAILBOX"]
1036    pub VCMAILBOX: VCMAILBOX,
1037    #[doc = "PM"]
1038    pub PM: PM,
1039    #[doc = "CM_PCM"]
1040    pub CM_PCM: CM_PCM,
1041    #[doc = "CM_PWM"]
1042    pub CM_PWM: CM_PWM,
1043    #[doc = "GPIO"]
1044    pub GPIO: GPIO,
1045    #[doc = "SYSTMR"]
1046    pub SYSTMR: SYSTMR,
1047    #[doc = "UART0"]
1048    pub UART0: UART0,
1049    #[doc = "SPI0"]
1050    pub SPI0: SPI0,
1051    #[doc = "BSC0"]
1052    pub BSC0: BSC0,
1053    #[doc = "PWM0"]
1054    pub PWM0: PWM0,
1055    #[doc = "BSC1"]
1056    pub BSC1: BSC1,
1057    #[doc = "BSC2"]
1058    pub BSC2: BSC2,
1059    #[doc = "AUX"]
1060    pub AUX: AUX,
1061    #[doc = "UART1"]
1062    pub UART1: UART1,
1063    #[doc = "SPI1"]
1064    pub SPI1: SPI1,
1065    #[doc = "SPI2"]
1066    pub SPI2: SPI2,
1067    #[doc = "LIC"]
1068    pub LIC: LIC,
1069    #[doc = "USB_OTG_GLOBAL"]
1070    pub USB_OTG_GLOBAL: USB_OTG_GLOBAL,
1071    #[doc = "USB_OTG_HOST"]
1072    pub USB_OTG_HOST: USB_OTG_HOST,
1073    #[doc = "USB_OTG_DEVICE"]
1074    pub USB_OTG_DEVICE: USB_OTG_DEVICE,
1075    #[doc = "USB_OTG_PWRCLK"]
1076    pub USB_OTG_PWRCLK: USB_OTG_PWRCLK,
1077    #[doc = "EMMC"]
1078    pub EMMC: EMMC,
1079}
1080impl Peripherals {
1081    #[doc = r" Returns all the peripherals *once*."]
1082    #[cfg(feature = "critical-section")]
1083    #[inline]
1084    pub fn take() -> Option<Self> {
1085        critical_section::with(|_| {
1086            if unsafe { DEVICE_PERIPHERALS } {
1087                return None;
1088            }
1089            Some(unsafe { Peripherals::steal() })
1090        })
1091    }
1092    #[doc = r" Unchecked version of `Peripherals::take`."]
1093    #[doc = r""]
1094    #[doc = r" # Safety"]
1095    #[doc = r""]
1096    #[doc = r" Each of the returned peripherals must be used at most once."]
1097    #[inline]
1098    pub unsafe fn steal() -> Self {
1099        DEVICE_PERIPHERALS = true;
1100        Peripherals {
1101            VCMAILBOX: VCMAILBOX {
1102                _marker: PhantomData,
1103            },
1104            PM: PM {
1105                _marker: PhantomData,
1106            },
1107            CM_PCM: CM_PCM {
1108                _marker: PhantomData,
1109            },
1110            CM_PWM: CM_PWM {
1111                _marker: PhantomData,
1112            },
1113            GPIO: GPIO {
1114                _marker: PhantomData,
1115            },
1116            SYSTMR: SYSTMR {
1117                _marker: PhantomData,
1118            },
1119            UART0: UART0 {
1120                _marker: PhantomData,
1121            },
1122            SPI0: SPI0 {
1123                _marker: PhantomData,
1124            },
1125            BSC0: BSC0 {
1126                _marker: PhantomData,
1127            },
1128            PWM0: PWM0 {
1129                _marker: PhantomData,
1130            },
1131            BSC1: BSC1 {
1132                _marker: PhantomData,
1133            },
1134            BSC2: BSC2 {
1135                _marker: PhantomData,
1136            },
1137            AUX: AUX {
1138                _marker: PhantomData,
1139            },
1140            UART1: UART1 {
1141                _marker: PhantomData,
1142            },
1143            SPI1: SPI1 {
1144                _marker: PhantomData,
1145            },
1146            SPI2: SPI2 {
1147                _marker: PhantomData,
1148            },
1149            LIC: LIC {
1150                _marker: PhantomData,
1151            },
1152            USB_OTG_GLOBAL: USB_OTG_GLOBAL {
1153                _marker: PhantomData,
1154            },
1155            USB_OTG_HOST: USB_OTG_HOST {
1156                _marker: PhantomData,
1157            },
1158            USB_OTG_DEVICE: USB_OTG_DEVICE {
1159                _marker: PhantomData,
1160            },
1161            USB_OTG_PWRCLK: USB_OTG_PWRCLK {
1162                _marker: PhantomData,
1163            },
1164            EMMC: EMMC {
1165                _marker: PhantomData,
1166            },
1167        }
1168    }
1169}