1#![doc = "Peripheral access API for BCM2837_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 = 0x3f00_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 Clock Manager"]
64pub struct CM_PCM {
65 _marker: PhantomData<*const ()>,
66}
67unsafe impl Send for CM_PCM {}
68impl CM_PCM {
69 #[doc = r"Pointer to the register block"]
70 pub const PTR: *const cm_pcm::RegisterBlock = 0x3f10_1098 as *const _;
71 #[doc = r"Return the pointer to the register block"]
72 #[inline(always)]
73 pub const fn ptr() -> *const cm_pcm::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 CM_PCM {
96 type Target = cm_pcm::RegisterBlock;
97 #[inline(always)]
98 fn deref(&self) -> &Self::Target {
99 unsafe { &*Self::PTR }
100 }
101}
102impl core::fmt::Debug for CM_PCM {
103 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
104 f.debug_struct("CM_PCM").finish()
105 }
106}
107#[doc = "Broadcom Clock Manager"]
108pub mod cm_pcm;
109#[doc = "Broadcom Clock Manager"]
110pub struct CM_PWM {
111 _marker: PhantomData<*const ()>,
112}
113unsafe impl Send for CM_PWM {}
114impl CM_PWM {
115 #[doc = r"Pointer to the register block"]
116 pub const PTR: *const cm_pcm::RegisterBlock = 0x3f10_10a0 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_PWM {
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_PWM {
149 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
150 f.debug_struct("CM_PWM").finish()
151 }
152}
153#[doc = "Broadcom Clock Manager"]
154pub use self::cm_pcm as cm_pwm;
155#[doc = "Pin level and mux control"]
156pub struct GPIO {
157 _marker: PhantomData<*const ()>,
158}
159unsafe impl Send for GPIO {}
160impl GPIO {
161 #[doc = r"Pointer to the register block"]
162 pub const PTR: *const gpio::RegisterBlock = 0x3f20_0000 as *const _;
163 #[doc = r"Return the pointer to the register block"]
164 #[inline(always)]
165 pub const fn ptr() -> *const gpio::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 GPIO {
188 type Target = gpio::RegisterBlock;
189 #[inline(always)]
190 fn deref(&self) -> &Self::Target {
191 unsafe { &*Self::PTR }
192 }
193}
194impl core::fmt::Debug for GPIO {
195 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
196 f.debug_struct("GPIO").finish()
197 }
198}
199#[doc = "Pin level and mux control"]
200pub mod gpio;
201#[doc = "Broadcom System Timer"]
202pub struct SYSTMR {
203 _marker: PhantomData<*const ()>,
204}
205unsafe impl Send for SYSTMR {}
206impl SYSTMR {
207 #[doc = r"Pointer to the register block"]
208 pub const PTR: *const systmr::RegisterBlock = 0x3f00_3000 as *const _;
209 #[doc = r"Return the pointer to the register block"]
210 #[inline(always)]
211 pub const fn ptr() -> *const systmr::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 SYSTMR {
234 type Target = systmr::RegisterBlock;
235 #[inline(always)]
236 fn deref(&self) -> &Self::Target {
237 unsafe { &*Self::PTR }
238 }
239}
240impl core::fmt::Debug for SYSTMR {
241 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
242 f.debug_struct("SYSTMR").finish()
243 }
244}
245#[doc = "Broadcom System Timer"]
246pub mod systmr;
247#[doc = "ARM Prime Cell PL011"]
248pub struct UART0 {
249 _marker: PhantomData<*const ()>,
250}
251unsafe impl Send for UART0 {}
252impl UART0 {
253 #[doc = r"Pointer to the register block"]
254 pub const PTR: *const uart0::RegisterBlock = 0x3f20_1000 as *const _;
255 #[doc = r"Return the pointer to the register block"]
256 #[inline(always)]
257 pub const fn ptr() -> *const uart0::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 UART0 {
280 type Target = uart0::RegisterBlock;
281 #[inline(always)]
282 fn deref(&self) -> &Self::Target {
283 unsafe { &*Self::PTR }
284 }
285}
286impl core::fmt::Debug for UART0 {
287 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
288 f.debug_struct("UART0").finish()
289 }
290}
291#[doc = "ARM Prime Cell PL011"]
292pub mod uart0;
293#[doc = "Broadcom SPI Controller"]
294pub struct SPI0 {
295 _marker: PhantomData<*const ()>,
296}
297unsafe impl Send for SPI0 {}
298impl SPI0 {
299 #[doc = r"Pointer to the register block"]
300 pub const PTR: *const spi0::RegisterBlock = 0x3f20_4000 as *const _;
301 #[doc = r"Return the pointer to the register block"]
302 #[inline(always)]
303 pub const fn ptr() -> *const spi0::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 SPI0 {
326 type Target = spi0::RegisterBlock;
327 #[inline(always)]
328 fn deref(&self) -> &Self::Target {
329 unsafe { &*Self::PTR }
330 }
331}
332impl core::fmt::Debug for SPI0 {
333 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
334 f.debug_struct("SPI0").finish()
335 }
336}
337#[doc = "Broadcom SPI Controller"]
338pub mod spi0;
339#[doc = "Broadcom Serial Controller (I2C compatible)"]
340pub struct BSC0 {
341 _marker: PhantomData<*const ()>,
342}
343unsafe impl Send for BSC0 {}
344impl BSC0 {
345 #[doc = r"Pointer to the register block"]
346 pub const PTR: *const bsc0::RegisterBlock = 0x3f20_5000 as *const _;
347 #[doc = r"Return the pointer to the register block"]
348 #[inline(always)]
349 pub const fn ptr() -> *const bsc0::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 BSC0 {
372 type Target = bsc0::RegisterBlock;
373 #[inline(always)]
374 fn deref(&self) -> &Self::Target {
375 unsafe { &*Self::PTR }
376 }
377}
378impl core::fmt::Debug for BSC0 {
379 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
380 f.debug_struct("BSC0").finish()
381 }
382}
383#[doc = "Broadcom Serial Controller (I2C compatible)"]
384pub mod bsc0;
385#[doc = "Broadcom PWM"]
386pub struct PWM0 {
387 _marker: PhantomData<*const ()>,
388}
389unsafe impl Send for PWM0 {}
390impl PWM0 {
391 #[doc = r"Pointer to the register block"]
392 pub const PTR: *const pwm0::RegisterBlock = 0x3f20_c000 as *const _;
393 #[doc = r"Return the pointer to the register block"]
394 #[inline(always)]
395 pub const fn ptr() -> *const pwm0::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 PWM0 {
418 type Target = pwm0::RegisterBlock;
419 #[inline(always)]
420 fn deref(&self) -> &Self::Target {
421 unsafe { &*Self::PTR }
422 }
423}
424impl core::fmt::Debug for PWM0 {
425 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
426 f.debug_struct("PWM0").finish()
427 }
428}
429#[doc = "Broadcom PWM"]
430pub mod pwm0;
431#[doc = "Broadcom Serial Controller (I2C compatible)"]
432pub struct BSC1 {
433 _marker: PhantomData<*const ()>,
434}
435unsafe impl Send for BSC1 {}
436impl BSC1 {
437 #[doc = r"Pointer to the register block"]
438 pub const PTR: *const bsc0::RegisterBlock = 0x3f80_4000 as *const _;
439 #[doc = r"Return the pointer to the register block"]
440 #[inline(always)]
441 pub const fn ptr() -> *const bsc0::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 BSC1 {
464 type Target = bsc0::RegisterBlock;
465 #[inline(always)]
466 fn deref(&self) -> &Self::Target {
467 unsafe { &*Self::PTR }
468 }
469}
470impl core::fmt::Debug for BSC1 {
471 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
472 f.debug_struct("BSC1").finish()
473 }
474}
475#[doc = "Broadcom Serial Controller (I2C compatible)"]
476pub use self::bsc0 as bsc1;
477#[doc = "Broadcom Serial Controller (I2C compatible)"]
478pub struct BSC2 {
479 _marker: PhantomData<*const ()>,
480}
481unsafe impl Send for BSC2 {}
482impl BSC2 {
483 #[doc = r"Pointer to the register block"]
484 pub const PTR: *const bsc0::RegisterBlock = 0x3f80_5000 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 BSC2 {
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 BSC2 {
517 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
518 f.debug_struct("BSC2").finish()
519 }
520}
521#[doc = "Broadcom Serial Controller (I2C compatible)"]
522pub use self::bsc0 as bsc2;
523#[doc = "Three auxiliary peripherals"]
524pub struct AUX {
525 _marker: PhantomData<*const ()>,
526}
527unsafe impl Send for AUX {}
528impl AUX {
529 #[doc = r"Pointer to the register block"]
530 pub const PTR: *const aux::RegisterBlock = 0x3f21_5000 as *const _;
531 #[doc = r"Return the pointer to the register block"]
532 #[inline(always)]
533 pub const fn ptr() -> *const aux::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 AUX {
556 type Target = aux::RegisterBlock;
557 #[inline(always)]
558 fn deref(&self) -> &Self::Target {
559 unsafe { &*Self::PTR }
560 }
561}
562impl core::fmt::Debug for AUX {
563 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
564 f.debug_struct("AUX").finish()
565 }
566}
567#[doc = "Three auxiliary peripherals"]
568#[path = "aux_.rs"]
569pub mod aux;
570#[doc = "Mini UART"]
571pub struct UART1 {
572 _marker: PhantomData<*const ()>,
573}
574unsafe impl Send for UART1 {}
575impl UART1 {
576 #[doc = r"Pointer to the register block"]
577 pub const PTR: *const uart1::RegisterBlock = 0x3f21_5040 as *const _;
578 #[doc = r"Return the pointer to the register block"]
579 #[inline(always)]
580 pub const fn ptr() -> *const uart1::RegisterBlock {
581 Self::PTR
582 }
583 #[doc = r" Steal an instance of this peripheral"]
584 #[doc = r""]
585 #[doc = r" # Safety"]
586 #[doc = r""]
587 #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
588 #[doc = r" that may race with any existing instances, for example by only"]
589 #[doc = r" accessing read-only or write-only registers, or by consuming the"]
590 #[doc = r" original peripheral and using critical sections to coordinate"]
591 #[doc = r" access between multiple new instances."]
592 #[doc = r""]
593 #[doc = r" Additionally, other software such as HALs may rely on only one"]
594 #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
595 #[doc = r" no stolen instances are passed to such software."]
596 pub unsafe fn steal() -> Self {
597 Self {
598 _marker: PhantomData,
599 }
600 }
601}
602impl Deref for UART1 {
603 type Target = uart1::RegisterBlock;
604 #[inline(always)]
605 fn deref(&self) -> &Self::Target {
606 unsafe { &*Self::PTR }
607 }
608}
609impl core::fmt::Debug for UART1 {
610 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
611 f.debug_struct("UART1").finish()
612 }
613}
614#[doc = "Mini UART"]
615pub mod uart1;
616#[doc = "Aux SPI"]
617pub struct SPI1 {
618 _marker: PhantomData<*const ()>,
619}
620unsafe impl Send for SPI1 {}
621impl SPI1 {
622 #[doc = r"Pointer to the register block"]
623 pub const PTR: *const spi1::RegisterBlock = 0x3f21_5080 as *const _;
624 #[doc = r"Return the pointer to the register block"]
625 #[inline(always)]
626 pub const fn ptr() -> *const spi1::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 SPI1 {
649 type Target = spi1::RegisterBlock;
650 #[inline(always)]
651 fn deref(&self) -> &Self::Target {
652 unsafe { &*Self::PTR }
653 }
654}
655impl core::fmt::Debug for SPI1 {
656 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
657 f.debug_struct("SPI1").finish()
658 }
659}
660#[doc = "Aux SPI"]
661pub mod spi1;
662#[doc = "Aux SPI"]
663pub struct SPI2 {
664 _marker: PhantomData<*const ()>,
665}
666unsafe impl Send for SPI2 {}
667impl SPI2 {
668 #[doc = r"Pointer to the register block"]
669 pub const PTR: *const spi1::RegisterBlock = 0x3f21_50c0 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 SPI2 {
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 SPI2 {
702 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
703 f.debug_struct("SPI2").finish()
704 }
705}
706#[doc = "Aux SPI"]
707pub use self::spi1 as spi2;
708#[doc = "Broadcom Legacy Interrupt Controller"]
709pub struct LIC {
710 _marker: PhantomData<*const ()>,
711}
712unsafe impl Send for LIC {}
713impl LIC {
714 #[doc = r"Pointer to the register block"]
715 pub const PTR: *const lic::RegisterBlock = 0x3f00_b000 as *const _;
716 #[doc = r"Return the pointer to the register block"]
717 #[inline(always)]
718 pub const fn ptr() -> *const lic::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 LIC {
741 type Target = lic::RegisterBlock;
742 #[inline(always)]
743 fn deref(&self) -> &Self::Target {
744 unsafe { &*Self::PTR }
745 }
746}
747impl core::fmt::Debug for LIC {
748 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
749 f.debug_struct("LIC").finish()
750 }
751}
752#[doc = "Broadcom Legacy Interrupt Controller"]
753pub mod lic;
754#[doc = "USB on the go high speed"]
755pub struct USB_OTG_GLOBAL {
756 _marker: PhantomData<*const ()>,
757}
758unsafe impl Send for USB_OTG_GLOBAL {}
759impl USB_OTG_GLOBAL {
760 #[doc = r"Pointer to the register block"]
761 pub const PTR: *const usb_otg_global::RegisterBlock = 0x3f98_0000 as *const _;
762 #[doc = r"Return the pointer to the register block"]
763 #[inline(always)]
764 pub const fn ptr() -> *const usb_otg_global::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 USB_OTG_GLOBAL {
787 type Target = usb_otg_global::RegisterBlock;
788 #[inline(always)]
789 fn deref(&self) -> &Self::Target {
790 unsafe { &*Self::PTR }
791 }
792}
793impl core::fmt::Debug for USB_OTG_GLOBAL {
794 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
795 f.debug_struct("USB_OTG_GLOBAL").finish()
796 }
797}
798#[doc = "USB on the go high speed"]
799pub mod usb_otg_global;
800#[doc = "USB on the go high speed"]
801pub struct USB_OTG_HOST {
802 _marker: PhantomData<*const ()>,
803}
804unsafe impl Send for USB_OTG_HOST {}
805impl USB_OTG_HOST {
806 #[doc = r"Pointer to the register block"]
807 pub const PTR: *const usb_otg_host::RegisterBlock = 0x3f98_0400 as *const _;
808 #[doc = r"Return the pointer to the register block"]
809 #[inline(always)]
810 pub const fn ptr() -> *const usb_otg_host::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_HOST {
833 type Target = usb_otg_host::RegisterBlock;
834 #[inline(always)]
835 fn deref(&self) -> &Self::Target {
836 unsafe { &*Self::PTR }
837 }
838}
839impl core::fmt::Debug for USB_OTG_HOST {
840 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
841 f.debug_struct("USB_OTG_HOST").finish()
842 }
843}
844#[doc = "USB on the go high speed"]
845pub mod usb_otg_host;
846#[doc = "USB on the go high speed"]
847pub struct USB_OTG_DEVICE {
848 _marker: PhantomData<*const ()>,
849}
850unsafe impl Send for USB_OTG_DEVICE {}
851impl USB_OTG_DEVICE {
852 #[doc = r"Pointer to the register block"]
853 pub const PTR: *const usb_otg_device::RegisterBlock = 0x3f98_0800 as *const _;
854 #[doc = r"Return the pointer to the register block"]
855 #[inline(always)]
856 pub const fn ptr() -> *const usb_otg_device::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_DEVICE {
879 type Target = usb_otg_device::RegisterBlock;
880 #[inline(always)]
881 fn deref(&self) -> &Self::Target {
882 unsafe { &*Self::PTR }
883 }
884}
885impl core::fmt::Debug for USB_OTG_DEVICE {
886 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
887 f.debug_struct("USB_OTG_DEVICE").finish()
888 }
889}
890#[doc = "USB on the go high speed"]
891pub mod usb_otg_device;
892#[doc = "USB on the go high speed power control"]
893pub struct USB_OTG_PWRCLK {
894 _marker: PhantomData<*const ()>,
895}
896unsafe impl Send for USB_OTG_PWRCLK {}
897impl USB_OTG_PWRCLK {
898 #[doc = r"Pointer to the register block"]
899 pub const PTR: *const usb_otg_pwrclk::RegisterBlock = 0x3f98_0e00 as *const _;
900 #[doc = r"Return the pointer to the register block"]
901 #[inline(always)]
902 pub const fn ptr() -> *const usb_otg_pwrclk::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_PWRCLK {
925 type Target = usb_otg_pwrclk::RegisterBlock;
926 #[inline(always)]
927 fn deref(&self) -> &Self::Target {
928 unsafe { &*Self::PTR }
929 }
930}
931impl core::fmt::Debug for USB_OTG_PWRCLK {
932 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
933 f.debug_struct("USB_OTG_PWRCLK").finish()
934 }
935}
936#[doc = "USB on the go high speed power control"]
937pub mod usb_otg_pwrclk;
938#[doc = "Arasan SD3.0 Host AHB eMMC 4.4"]
939pub struct EMMC {
940 _marker: PhantomData<*const ()>,
941}
942unsafe impl Send for EMMC {}
943impl EMMC {
944 #[doc = r"Pointer to the register block"]
945 pub const PTR: *const emmc::RegisterBlock = 0x3f30_0000 as *const _;
946 #[doc = r"Return the pointer to the register block"]
947 #[inline(always)]
948 pub const fn ptr() -> *const emmc::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 EMMC {
971 type Target = emmc::RegisterBlock;
972 #[inline(always)]
973 fn deref(&self) -> &Self::Target {
974 unsafe { &*Self::PTR }
975 }
976}
977impl core::fmt::Debug for EMMC {
978 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
979 f.debug_struct("EMMC").finish()
980 }
981}
982#[doc = "Arasan SD3.0 Host AHB eMMC 4.4"]
983pub mod emmc;
984#[no_mangle]
985static mut DEVICE_PERIPHERALS: bool = false;
986#[doc = r" All the peripherals."]
987#[allow(non_snake_case)]
988pub struct Peripherals {
989 #[doc = "VCMAILBOX"]
990 pub VCMAILBOX: VCMAILBOX,
991 #[doc = "CM_PCM"]
992 pub CM_PCM: CM_PCM,
993 #[doc = "CM_PWM"]
994 pub CM_PWM: CM_PWM,
995 #[doc = "GPIO"]
996 pub GPIO: GPIO,
997 #[doc = "SYSTMR"]
998 pub SYSTMR: SYSTMR,
999 #[doc = "UART0"]
1000 pub UART0: UART0,
1001 #[doc = "SPI0"]
1002 pub SPI0: SPI0,
1003 #[doc = "BSC0"]
1004 pub BSC0: BSC0,
1005 #[doc = "PWM0"]
1006 pub PWM0: PWM0,
1007 #[doc = "BSC1"]
1008 pub BSC1: BSC1,
1009 #[doc = "BSC2"]
1010 pub BSC2: BSC2,
1011 #[doc = "AUX"]
1012 pub AUX: AUX,
1013 #[doc = "UART1"]
1014 pub UART1: UART1,
1015 #[doc = "SPI1"]
1016 pub SPI1: SPI1,
1017 #[doc = "SPI2"]
1018 pub SPI2: SPI2,
1019 #[doc = "LIC"]
1020 pub LIC: LIC,
1021 #[doc = "USB_OTG_GLOBAL"]
1022 pub USB_OTG_GLOBAL: USB_OTG_GLOBAL,
1023 #[doc = "USB_OTG_HOST"]
1024 pub USB_OTG_HOST: USB_OTG_HOST,
1025 #[doc = "USB_OTG_DEVICE"]
1026 pub USB_OTG_DEVICE: USB_OTG_DEVICE,
1027 #[doc = "USB_OTG_PWRCLK"]
1028 pub USB_OTG_PWRCLK: USB_OTG_PWRCLK,
1029 #[doc = "EMMC"]
1030 pub EMMC: EMMC,
1031}
1032impl Peripherals {
1033 #[doc = r" Returns all the peripherals *once*."]
1034 #[cfg(feature = "critical-section")]
1035 #[inline]
1036 pub fn take() -> Option<Self> {
1037 critical_section::with(|_| {
1038 if unsafe { DEVICE_PERIPHERALS } {
1039 return None;
1040 }
1041 Some(unsafe { Peripherals::steal() })
1042 })
1043 }
1044 #[doc = r" Unchecked version of `Peripherals::take`."]
1045 #[doc = r""]
1046 #[doc = r" # Safety"]
1047 #[doc = r""]
1048 #[doc = r" Each of the returned peripherals must be used at most once."]
1049 #[inline]
1050 pub unsafe fn steal() -> Self {
1051 DEVICE_PERIPHERALS = true;
1052 Peripherals {
1053 VCMAILBOX: VCMAILBOX {
1054 _marker: PhantomData,
1055 },
1056 CM_PCM: CM_PCM {
1057 _marker: PhantomData,
1058 },
1059 CM_PWM: CM_PWM {
1060 _marker: PhantomData,
1061 },
1062 GPIO: GPIO {
1063 _marker: PhantomData,
1064 },
1065 SYSTMR: SYSTMR {
1066 _marker: PhantomData,
1067 },
1068 UART0: UART0 {
1069 _marker: PhantomData,
1070 },
1071 SPI0: SPI0 {
1072 _marker: PhantomData,
1073 },
1074 BSC0: BSC0 {
1075 _marker: PhantomData,
1076 },
1077 PWM0: PWM0 {
1078 _marker: PhantomData,
1079 },
1080 BSC1: BSC1 {
1081 _marker: PhantomData,
1082 },
1083 BSC2: BSC2 {
1084 _marker: PhantomData,
1085 },
1086 AUX: AUX {
1087 _marker: PhantomData,
1088 },
1089 UART1: UART1 {
1090 _marker: PhantomData,
1091 },
1092 SPI1: SPI1 {
1093 _marker: PhantomData,
1094 },
1095 SPI2: SPI2 {
1096 _marker: PhantomData,
1097 },
1098 LIC: LIC {
1099 _marker: PhantomData,
1100 },
1101 USB_OTG_GLOBAL: USB_OTG_GLOBAL {
1102 _marker: PhantomData,
1103 },
1104 USB_OTG_HOST: USB_OTG_HOST {
1105 _marker: PhantomData,
1106 },
1107 USB_OTG_DEVICE: USB_OTG_DEVICE {
1108 _marker: PhantomData,
1109 },
1110 USB_OTG_PWRCLK: USB_OTG_PWRCLK {
1111 _marker: PhantomData,
1112 },
1113 EMMC: EMMC {
1114 _marker: PhantomData,
1115 },
1116 }
1117 }
1118}