lpc13xx_pac/lpc1342/
mod.rs

1#![doc = "Peripheral access API for LPC13XX microcontrollers (generated using svd2rust v0.25.0 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
2svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.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"]
3use core::marker::PhantomData;
4use core::ops::Deref;
5#[doc = r"Number available in the NVIC for configuring priority"]
6pub const NVIC_PRIO_BITS: u8 = 3;
7#[cfg(feature = "rt")]
8pub use self::Interrupt as interrupt;
9pub use cortex_m::peripheral::Peripherals as CorePeripherals;
10pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, ITM, MPU, NVIC, SCB, SYST, TPIU};
11#[cfg(feature = "rt")]
12pub use cortex_m_rt::interrupt;
13#[cfg(feature = "rt")]
14extern "C" {
15    fn PIO0_0();
16    fn PIO0_1();
17    fn PIO0_2();
18    fn PIO0_3();
19    fn PIO0_4();
20    fn PIO0_5();
21    fn PIO0_6();
22    fn PIO0_7();
23    fn PIO0_8();
24    fn PIO0_9();
25    fn PIO0_10();
26    fn PIO0_11();
27    fn PIO1_0();
28    fn PIO1_1();
29    fn PIO1_2();
30    fn PIO1_3();
31    fn PIO1_4();
32    fn PIO1_5();
33    fn PIO1_6();
34    fn PIO1_7();
35    fn PIO1_8();
36    fn PIO1_9();
37    fn PIO1_10();
38    fn PIO1_11();
39    fn PIO2_0();
40    fn PIO2_1();
41    fn PIO2_2();
42    fn PIO2_3();
43    fn PIO2_4();
44    fn PIO2_5();
45    fn PIO2_6();
46    fn PIO2_7();
47    fn PIO2_8();
48    fn PIO2_9();
49    fn PIO2_10();
50    fn PIO2_11();
51    fn PIO3_0();
52    fn PIO3_1();
53    fn PIO3_2();
54    fn PIO3_3();
55    fn I2C0();
56    fn CT16B0();
57    fn CT16B1();
58    fn CT32B0();
59    fn CT32B1();
60    fn SSP0();
61    fn UART();
62    fn USB();
63    fn USBFIQ();
64    fn ADC();
65    fn WDT();
66    fn BOD();
67    fn PIO_3();
68    fn PIO_2();
69    fn PIO_1();
70    fn PIO_0();
71    fn SSP1();
72}
73#[doc(hidden)]
74pub union Vector {
75    _handler: unsafe extern "C" fn(),
76    _reserved: u32,
77}
78#[cfg(feature = "rt")]
79#[doc(hidden)]
80#[link_section = ".vector_table.interrupts"]
81#[no_mangle]
82pub static __INTERRUPTS: [Vector; 58] = [
83    Vector { _handler: PIO0_0 },
84    Vector { _handler: PIO0_1 },
85    Vector { _handler: PIO0_2 },
86    Vector { _handler: PIO0_3 },
87    Vector { _handler: PIO0_4 },
88    Vector { _handler: PIO0_5 },
89    Vector { _handler: PIO0_6 },
90    Vector { _handler: PIO0_7 },
91    Vector { _handler: PIO0_8 },
92    Vector { _handler: PIO0_9 },
93    Vector { _handler: PIO0_10 },
94    Vector { _handler: PIO0_11 },
95    Vector { _handler: PIO1_0 },
96    Vector { _handler: PIO1_1 },
97    Vector { _handler: PIO1_2 },
98    Vector { _handler: PIO1_3 },
99    Vector { _handler: PIO1_4 },
100    Vector { _handler: PIO1_5 },
101    Vector { _handler: PIO1_6 },
102    Vector { _handler: PIO1_7 },
103    Vector { _handler: PIO1_8 },
104    Vector { _handler: PIO1_9 },
105    Vector { _handler: PIO1_10 },
106    Vector { _handler: PIO1_11 },
107    Vector { _handler: PIO2_0 },
108    Vector { _handler: PIO2_1 },
109    Vector { _handler: PIO2_2 },
110    Vector { _handler: PIO2_3 },
111    Vector { _handler: PIO2_4 },
112    Vector { _handler: PIO2_5 },
113    Vector { _handler: PIO2_6 },
114    Vector { _handler: PIO2_7 },
115    Vector { _handler: PIO2_8 },
116    Vector { _handler: PIO2_9 },
117    Vector { _handler: PIO2_10 },
118    Vector { _handler: PIO2_11 },
119    Vector { _handler: PIO3_0 },
120    Vector { _handler: PIO3_1 },
121    Vector { _handler: PIO3_2 },
122    Vector { _handler: PIO3_3 },
123    Vector { _handler: I2C0 },
124    Vector { _handler: CT16B0 },
125    Vector { _handler: CT16B1 },
126    Vector { _handler: CT32B0 },
127    Vector { _handler: CT32B1 },
128    Vector { _handler: SSP0 },
129    Vector { _handler: UART },
130    Vector { _handler: USB },
131    Vector { _handler: USBFIQ },
132    Vector { _handler: ADC },
133    Vector { _handler: WDT },
134    Vector { _handler: BOD },
135    Vector { _reserved: 0 },
136    Vector { _handler: PIO_3 },
137    Vector { _handler: PIO_2 },
138    Vector { _handler: PIO_1 },
139    Vector { _handler: PIO_0 },
140    Vector { _handler: SSP1 },
141];
142#[doc = r"Enumeration of all the interrupts."]
143#[derive(Copy, Clone, Debug, PartialEq, Eq)]
144#[repr(u16)]
145pub enum Interrupt {
146    #[doc = "0 - PIO0_0"]
147    PIO0_0 = 0,
148    #[doc = "1 - PIO0_1"]
149    PIO0_1 = 1,
150    #[doc = "2 - PIO0_2"]
151    PIO0_2 = 2,
152    #[doc = "3 - PIO0_3"]
153    PIO0_3 = 3,
154    #[doc = "4 - PIO0_4"]
155    PIO0_4 = 4,
156    #[doc = "5 - PIO0_5"]
157    PIO0_5 = 5,
158    #[doc = "6 - PIO0_6"]
159    PIO0_6 = 6,
160    #[doc = "7 - PIO0_7"]
161    PIO0_7 = 7,
162    #[doc = "8 - PIO0_8"]
163    PIO0_8 = 8,
164    #[doc = "9 - PIO0_9"]
165    PIO0_9 = 9,
166    #[doc = "10 - PIO0_10"]
167    PIO0_10 = 10,
168    #[doc = "11 - PIO0_11"]
169    PIO0_11 = 11,
170    #[doc = "12 - PIO1_0"]
171    PIO1_0 = 12,
172    #[doc = "13 - PIO1_1"]
173    PIO1_1 = 13,
174    #[doc = "14 - PIO1_2"]
175    PIO1_2 = 14,
176    #[doc = "15 - PIO1_3"]
177    PIO1_3 = 15,
178    #[doc = "16 - PIO1_4"]
179    PIO1_4 = 16,
180    #[doc = "17 - PIO1_5"]
181    PIO1_5 = 17,
182    #[doc = "18 - PIO1_6"]
183    PIO1_6 = 18,
184    #[doc = "19 - PIO1_7"]
185    PIO1_7 = 19,
186    #[doc = "20 - PIO1_8"]
187    PIO1_8 = 20,
188    #[doc = "21 - PIO1_9"]
189    PIO1_9 = 21,
190    #[doc = "22 - PIO1_10"]
191    PIO1_10 = 22,
192    #[doc = "23 - PIO1_11"]
193    PIO1_11 = 23,
194    #[doc = "24 - PIO2_0"]
195    PIO2_0 = 24,
196    #[doc = "25 - PIO2_1"]
197    PIO2_1 = 25,
198    #[doc = "26 - PIO2_2"]
199    PIO2_2 = 26,
200    #[doc = "27 - PIO2_3"]
201    PIO2_3 = 27,
202    #[doc = "28 - PIO2_4"]
203    PIO2_4 = 28,
204    #[doc = "29 - PIO2_5"]
205    PIO2_5 = 29,
206    #[doc = "30 - PIO2_6"]
207    PIO2_6 = 30,
208    #[doc = "31 - PIO2_7"]
209    PIO2_7 = 31,
210    #[doc = "32 - PIO2_8"]
211    PIO2_8 = 32,
212    #[doc = "33 - PIO2_9"]
213    PIO2_9 = 33,
214    #[doc = "34 - PIO2_10"]
215    PIO2_10 = 34,
216    #[doc = "35 - PIO2_11"]
217    PIO2_11 = 35,
218    #[doc = "36 - PIO3_0"]
219    PIO3_0 = 36,
220    #[doc = "37 - PIO3_1"]
221    PIO3_1 = 37,
222    #[doc = "38 - PIO3_2"]
223    PIO3_2 = 38,
224    #[doc = "39 - PIO3_3"]
225    PIO3_3 = 39,
226    #[doc = "40 - I2C0"]
227    I2C0 = 40,
228    #[doc = "41 - CT16B0"]
229    CT16B0 = 41,
230    #[doc = "42 - CT16B1"]
231    CT16B1 = 42,
232    #[doc = "43 - CT32B0"]
233    CT32B0 = 43,
234    #[doc = "44 - CT32B1"]
235    CT32B1 = 44,
236    #[doc = "45 - SSP0"]
237    SSP0 = 45,
238    #[doc = "46 - UART"]
239    UART = 46,
240    #[doc = "47 - USB"]
241    USB = 47,
242    #[doc = "48 - USBFIQ"]
243    USBFIQ = 48,
244    #[doc = "49 - ADC"]
245    ADC = 49,
246    #[doc = "50 - WDT"]
247    WDT = 50,
248    #[doc = "51 - BOD"]
249    BOD = 51,
250    #[doc = "53 - PIO_3"]
251    PIO_3 = 53,
252    #[doc = "54 - PIO_2"]
253    PIO_2 = 54,
254    #[doc = "55 - PIO_1"]
255    PIO_1 = 55,
256    #[doc = "56 - PIO_0"]
257    PIO_0 = 56,
258    #[doc = "57 - SSP1"]
259    SSP1 = 57,
260}
261unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
262    #[inline(always)]
263    fn number(self) -> u16 {
264        self as u16
265    }
266}
267#[doc = "I2C-bus controller"]
268pub struct I2C {
269    _marker: PhantomData<*const ()>,
270}
271unsafe impl Send for I2C {}
272impl I2C {
273    #[doc = r"Pointer to the register block"]
274    pub const PTR: *const i2c::RegisterBlock = 0x4000_0000 as *const _;
275    #[doc = r"Return the pointer to the register block"]
276    #[inline(always)]
277    pub const fn ptr() -> *const i2c::RegisterBlock {
278        Self::PTR
279    }
280}
281impl Deref for I2C {
282    type Target = i2c::RegisterBlock;
283    #[inline(always)]
284    fn deref(&self) -> &Self::Target {
285        unsafe { &*Self::PTR }
286    }
287}
288impl core::fmt::Debug for I2C {
289    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
290        f.debug_struct("I2C").finish()
291    }
292}
293#[doc = "I2C-bus controller"]
294pub mod i2c;
295#[doc = "Windowed WatchDog Timer (WWDT)"]
296pub struct WWDT {
297    _marker: PhantomData<*const ()>,
298}
299unsafe impl Send for WWDT {}
300impl WWDT {
301    #[doc = r"Pointer to the register block"]
302    pub const PTR: *const wwdt::RegisterBlock = 0x4000_4000 as *const _;
303    #[doc = r"Return the pointer to the register block"]
304    #[inline(always)]
305    pub const fn ptr() -> *const wwdt::RegisterBlock {
306        Self::PTR
307    }
308}
309impl Deref for WWDT {
310    type Target = wwdt::RegisterBlock;
311    #[inline(always)]
312    fn deref(&self) -> &Self::Target {
313        unsafe { &*Self::PTR }
314    }
315}
316impl core::fmt::Debug for WWDT {
317    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
318        f.debug_struct("WWDT").finish()
319    }
320}
321#[doc = "Windowed WatchDog Timer (WWDT)"]
322pub mod wwdt;
323#[doc = "UART"]
324pub struct UART {
325    _marker: PhantomData<*const ()>,
326}
327unsafe impl Send for UART {}
328impl UART {
329    #[doc = r"Pointer to the register block"]
330    pub const PTR: *const uart::RegisterBlock = 0x4000_8000 as *const _;
331    #[doc = r"Return the pointer to the register block"]
332    #[inline(always)]
333    pub const fn ptr() -> *const uart::RegisterBlock {
334        Self::PTR
335    }
336}
337impl Deref for UART {
338    type Target = uart::RegisterBlock;
339    #[inline(always)]
340    fn deref(&self) -> &Self::Target {
341        unsafe { &*Self::PTR }
342    }
343}
344impl core::fmt::Debug for UART {
345    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
346        f.debug_struct("UART").finish()
347    }
348}
349#[doc = "UART"]
350pub mod uart;
351#[doc = "16-bit counter/timers (CT16B0/1)"]
352pub struct CT16B0 {
353    _marker: PhantomData<*const ()>,
354}
355unsafe impl Send for CT16B0 {}
356impl CT16B0 {
357    #[doc = r"Pointer to the register block"]
358    pub const PTR: *const ct16b0::RegisterBlock = 0x4000_c000 as *const _;
359    #[doc = r"Return the pointer to the register block"]
360    #[inline(always)]
361    pub const fn ptr() -> *const ct16b0::RegisterBlock {
362        Self::PTR
363    }
364}
365impl Deref for CT16B0 {
366    type Target = ct16b0::RegisterBlock;
367    #[inline(always)]
368    fn deref(&self) -> &Self::Target {
369        unsafe { &*Self::PTR }
370    }
371}
372impl core::fmt::Debug for CT16B0 {
373    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
374        f.debug_struct("CT16B0").finish()
375    }
376}
377#[doc = "16-bit counter/timers (CT16B0/1)"]
378pub mod ct16b0;
379#[doc = "16-bit counter/timers (CT16B0/1)"]
380pub struct CT16B1 {
381    _marker: PhantomData<*const ()>,
382}
383unsafe impl Send for CT16B1 {}
384impl CT16B1 {
385    #[doc = r"Pointer to the register block"]
386    pub const PTR: *const ct16b0::RegisterBlock = 0x4001_0000 as *const _;
387    #[doc = r"Return the pointer to the register block"]
388    #[inline(always)]
389    pub const fn ptr() -> *const ct16b0::RegisterBlock {
390        Self::PTR
391    }
392}
393impl Deref for CT16B1 {
394    type Target = ct16b0::RegisterBlock;
395    #[inline(always)]
396    fn deref(&self) -> &Self::Target {
397        unsafe { &*Self::PTR }
398    }
399}
400impl core::fmt::Debug for CT16B1 {
401    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
402        f.debug_struct("CT16B1").finish()
403    }
404}
405#[doc = "16-bit counter/timers (CT16B0/1)"]
406pub use ct16b0 as ct16b1;
407#[doc = "32-bit counter/timers (CT32B0/1)"]
408pub struct CT32B0 {
409    _marker: PhantomData<*const ()>,
410}
411unsafe impl Send for CT32B0 {}
412impl CT32B0 {
413    #[doc = r"Pointer to the register block"]
414    pub const PTR: *const ct32b0::RegisterBlock = 0x4001_4000 as *const _;
415    #[doc = r"Return the pointer to the register block"]
416    #[inline(always)]
417    pub const fn ptr() -> *const ct32b0::RegisterBlock {
418        Self::PTR
419    }
420}
421impl Deref for CT32B0 {
422    type Target = ct32b0::RegisterBlock;
423    #[inline(always)]
424    fn deref(&self) -> &Self::Target {
425        unsafe { &*Self::PTR }
426    }
427}
428impl core::fmt::Debug for CT32B0 {
429    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
430        f.debug_struct("CT32B0").finish()
431    }
432}
433#[doc = "32-bit counter/timers (CT32B0/1)"]
434pub mod ct32b0;
435#[doc = "32-bit counter/timers (CT32B0/1)"]
436pub struct CT32B1 {
437    _marker: PhantomData<*const ()>,
438}
439unsafe impl Send for CT32B1 {}
440impl CT32B1 {
441    #[doc = r"Pointer to the register block"]
442    pub const PTR: *const ct32b0::RegisterBlock = 0x4001_8000 as *const _;
443    #[doc = r"Return the pointer to the register block"]
444    #[inline(always)]
445    pub const fn ptr() -> *const ct32b0::RegisterBlock {
446        Self::PTR
447    }
448}
449impl Deref for CT32B1 {
450    type Target = ct32b0::RegisterBlock;
451    #[inline(always)]
452    fn deref(&self) -> &Self::Target {
453        unsafe { &*Self::PTR }
454    }
455}
456impl core::fmt::Debug for CT32B1 {
457    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
458        f.debug_struct("CT32B1").finish()
459    }
460}
461#[doc = "32-bit counter/timers (CT32B0/1)"]
462pub use ct32b0 as ct32b1;
463#[doc = "Analog-to-Digital Converter (ADC)"]
464pub struct ADC {
465    _marker: PhantomData<*const ()>,
466}
467unsafe impl Send for ADC {}
468impl ADC {
469    #[doc = r"Pointer to the register block"]
470    pub const PTR: *const adc::RegisterBlock = 0x4001_c000 as *const _;
471    #[doc = r"Return the pointer to the register block"]
472    #[inline(always)]
473    pub const fn ptr() -> *const adc::RegisterBlock {
474        Self::PTR
475    }
476}
477impl Deref for ADC {
478    type Target = adc::RegisterBlock;
479    #[inline(always)]
480    fn deref(&self) -> &Self::Target {
481        unsafe { &*Self::PTR }
482    }
483}
484impl core::fmt::Debug for ADC {
485    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
486        f.debug_struct("ADC").finish()
487    }
488}
489#[doc = "Analog-to-Digital Converter (ADC)"]
490pub mod adc;
491#[doc = "USB device"]
492pub struct USB {
493    _marker: PhantomData<*const ()>,
494}
495unsafe impl Send for USB {}
496impl USB {
497    #[doc = r"Pointer to the register block"]
498    pub const PTR: *const usb::RegisterBlock = 0x4002_0000 as *const _;
499    #[doc = r"Return the pointer to the register block"]
500    #[inline(always)]
501    pub const fn ptr() -> *const usb::RegisterBlock {
502        Self::PTR
503    }
504}
505impl Deref for USB {
506    type Target = usb::RegisterBlock;
507    #[inline(always)]
508    fn deref(&self) -> &Self::Target {
509        unsafe { &*Self::PTR }
510    }
511}
512impl core::fmt::Debug for USB {
513    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
514        f.debug_struct("USB").finish()
515    }
516}
517#[doc = "USB device"]
518pub mod usb;
519#[doc = "Power Management Unit (PMU)"]
520pub struct PMU {
521    _marker: PhantomData<*const ()>,
522}
523unsafe impl Send for PMU {}
524impl PMU {
525    #[doc = r"Pointer to the register block"]
526    pub const PTR: *const pmu::RegisterBlock = 0x4003_8000 as *const _;
527    #[doc = r"Return the pointer to the register block"]
528    #[inline(always)]
529    pub const fn ptr() -> *const pmu::RegisterBlock {
530        Self::PTR
531    }
532}
533impl Deref for PMU {
534    type Target = pmu::RegisterBlock;
535    #[inline(always)]
536    fn deref(&self) -> &Self::Target {
537        unsafe { &*Self::PTR }
538    }
539}
540impl core::fmt::Debug for PMU {
541    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
542        f.debug_struct("PMU").finish()
543    }
544}
545#[doc = "Power Management Unit (PMU)"]
546pub mod pmu;
547#[doc = "Flash memory programming firmware"]
548pub struct FMC {
549    _marker: PhantomData<*const ()>,
550}
551unsafe impl Send for FMC {}
552impl FMC {
553    #[doc = r"Pointer to the register block"]
554    pub const PTR: *const fmc::RegisterBlock = 0x4003_c000 as *const _;
555    #[doc = r"Return the pointer to the register block"]
556    #[inline(always)]
557    pub const fn ptr() -> *const fmc::RegisterBlock {
558        Self::PTR
559    }
560}
561impl Deref for FMC {
562    type Target = fmc::RegisterBlock;
563    #[inline(always)]
564    fn deref(&self) -> &Self::Target {
565        unsafe { &*Self::PTR }
566    }
567}
568impl core::fmt::Debug for FMC {
569    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
570        f.debug_struct("FMC").finish()
571    }
572}
573#[doc = "Flash memory programming firmware"]
574pub mod fmc;
575#[doc = "SSP0/1"]
576pub struct SSP0 {
577    _marker: PhantomData<*const ()>,
578}
579unsafe impl Send for SSP0 {}
580impl SSP0 {
581    #[doc = r"Pointer to the register block"]
582    pub const PTR: *const ssp0::RegisterBlock = 0x4004_0000 as *const _;
583    #[doc = r"Return the pointer to the register block"]
584    #[inline(always)]
585    pub const fn ptr() -> *const ssp0::RegisterBlock {
586        Self::PTR
587    }
588}
589impl Deref for SSP0 {
590    type Target = ssp0::RegisterBlock;
591    #[inline(always)]
592    fn deref(&self) -> &Self::Target {
593        unsafe { &*Self::PTR }
594    }
595}
596impl core::fmt::Debug for SSP0 {
597    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
598        f.debug_struct("SSP0").finish()
599    }
600}
601#[doc = "SSP0/1"]
602pub mod ssp0;
603#[doc = "I/O configuration"]
604pub struct IOCON {
605    _marker: PhantomData<*const ()>,
606}
607unsafe impl Send for IOCON {}
608impl IOCON {
609    #[doc = r"Pointer to the register block"]
610    pub const PTR: *const iocon::RegisterBlock = 0x4004_4000 as *const _;
611    #[doc = r"Return the pointer to the register block"]
612    #[inline(always)]
613    pub const fn ptr() -> *const iocon::RegisterBlock {
614        Self::PTR
615    }
616}
617impl Deref for IOCON {
618    type Target = iocon::RegisterBlock;
619    #[inline(always)]
620    fn deref(&self) -> &Self::Target {
621        unsafe { &*Self::PTR }
622    }
623}
624impl core::fmt::Debug for IOCON {
625    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
626        f.debug_struct("IOCON").finish()
627    }
628}
629#[doc = "I/O configuration"]
630pub mod iocon;
631#[doc = "System configuration"]
632pub struct SYSCON {
633    _marker: PhantomData<*const ()>,
634}
635unsafe impl Send for SYSCON {}
636impl SYSCON {
637    #[doc = r"Pointer to the register block"]
638    pub const PTR: *const syscon::RegisterBlock = 0x4004_8000 as *const _;
639    #[doc = r"Return the pointer to the register block"]
640    #[inline(always)]
641    pub const fn ptr() -> *const syscon::RegisterBlock {
642        Self::PTR
643    }
644}
645impl Deref for SYSCON {
646    type Target = syscon::RegisterBlock;
647    #[inline(always)]
648    fn deref(&self) -> &Self::Target {
649        unsafe { &*Self::PTR }
650    }
651}
652impl core::fmt::Debug for SYSCON {
653    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
654        f.debug_struct("SYSCON").finish()
655    }
656}
657#[doc = "System configuration"]
658pub mod syscon;
659#[doc = "SSP0/1"]
660pub struct SSP1 {
661    _marker: PhantomData<*const ()>,
662}
663unsafe impl Send for SSP1 {}
664impl SSP1 {
665    #[doc = r"Pointer to the register block"]
666    pub const PTR: *const ssp0::RegisterBlock = 0x4005_8000 as *const _;
667    #[doc = r"Return the pointer to the register block"]
668    #[inline(always)]
669    pub const fn ptr() -> *const ssp0::RegisterBlock {
670        Self::PTR
671    }
672}
673impl Deref for SSP1 {
674    type Target = ssp0::RegisterBlock;
675    #[inline(always)]
676    fn deref(&self) -> &Self::Target {
677        unsafe { &*Self::PTR }
678    }
679}
680impl core::fmt::Debug for SSP1 {
681    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
682        f.debug_struct("SSP1").finish()
683    }
684}
685#[doc = "SSP0/1"]
686pub use ssp0 as ssp1;
687#[doc = "General Purpose I/O (GPIO)"]
688pub struct GPIO0 {
689    _marker: PhantomData<*const ()>,
690}
691unsafe impl Send for GPIO0 {}
692impl GPIO0 {
693    #[doc = r"Pointer to the register block"]
694    pub const PTR: *const gpio0::RegisterBlock = 0x5000_0000 as *const _;
695    #[doc = r"Return the pointer to the register block"]
696    #[inline(always)]
697    pub const fn ptr() -> *const gpio0::RegisterBlock {
698        Self::PTR
699    }
700}
701impl Deref for GPIO0 {
702    type Target = gpio0::RegisterBlock;
703    #[inline(always)]
704    fn deref(&self) -> &Self::Target {
705        unsafe { &*Self::PTR }
706    }
707}
708impl core::fmt::Debug for GPIO0 {
709    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
710        f.debug_struct("GPIO0").finish()
711    }
712}
713#[doc = "General Purpose I/O (GPIO)"]
714pub mod gpio0;
715#[doc = "General Purpose I/O (GPIO)"]
716pub struct GPIO1 {
717    _marker: PhantomData<*const ()>,
718}
719unsafe impl Send for GPIO1 {}
720impl GPIO1 {
721    #[doc = r"Pointer to the register block"]
722    pub const PTR: *const gpio0::RegisterBlock = 0x5001_0000 as *const _;
723    #[doc = r"Return the pointer to the register block"]
724    #[inline(always)]
725    pub const fn ptr() -> *const gpio0::RegisterBlock {
726        Self::PTR
727    }
728}
729impl Deref for GPIO1 {
730    type Target = gpio0::RegisterBlock;
731    #[inline(always)]
732    fn deref(&self) -> &Self::Target {
733        unsafe { &*Self::PTR }
734    }
735}
736impl core::fmt::Debug for GPIO1 {
737    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
738        f.debug_struct("GPIO1").finish()
739    }
740}
741#[doc = "General Purpose I/O (GPIO)"]
742pub use gpio0 as gpio1;
743#[doc = "General Purpose I/O (GPIO)"]
744pub struct GPIO2 {
745    _marker: PhantomData<*const ()>,
746}
747unsafe impl Send for GPIO2 {}
748impl GPIO2 {
749    #[doc = r"Pointer to the register block"]
750    pub const PTR: *const gpio0::RegisterBlock = 0x5002_0000 as *const _;
751    #[doc = r"Return the pointer to the register block"]
752    #[inline(always)]
753    pub const fn ptr() -> *const gpio0::RegisterBlock {
754        Self::PTR
755    }
756}
757impl Deref for GPIO2 {
758    type Target = gpio0::RegisterBlock;
759    #[inline(always)]
760    fn deref(&self) -> &Self::Target {
761        unsafe { &*Self::PTR }
762    }
763}
764impl core::fmt::Debug for GPIO2 {
765    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
766        f.debug_struct("GPIO2").finish()
767    }
768}
769#[doc = "General Purpose I/O (GPIO)"]
770pub use gpio0 as gpio2;
771#[doc = "General Purpose I/O (GPIO)"]
772pub struct GPIO3 {
773    _marker: PhantomData<*const ()>,
774}
775unsafe impl Send for GPIO3 {}
776impl GPIO3 {
777    #[doc = r"Pointer to the register block"]
778    pub const PTR: *const gpio0::RegisterBlock = 0x5003_0000 as *const _;
779    #[doc = r"Return the pointer to the register block"]
780    #[inline(always)]
781    pub const fn ptr() -> *const gpio0::RegisterBlock {
782        Self::PTR
783    }
784}
785impl Deref for GPIO3 {
786    type Target = gpio0::RegisterBlock;
787    #[inline(always)]
788    fn deref(&self) -> &Self::Target {
789        unsafe { &*Self::PTR }
790    }
791}
792impl core::fmt::Debug for GPIO3 {
793    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
794        f.debug_struct("GPIO3").finish()
795    }
796}
797#[doc = "General Purpose I/O (GPIO)"]
798pub use gpio0 as gpio3;
799#[no_mangle]
800static mut DEVICE_PERIPHERALS: bool = false;
801#[doc = r"All the peripherals"]
802#[allow(non_snake_case)]
803pub struct Peripherals {
804    #[doc = "I2C"]
805    pub I2C: I2C,
806    #[doc = "WWDT"]
807    pub WWDT: WWDT,
808    #[doc = "UART"]
809    pub UART: UART,
810    #[doc = "CT16B0"]
811    pub CT16B0: CT16B0,
812    #[doc = "CT16B1"]
813    pub CT16B1: CT16B1,
814    #[doc = "CT32B0"]
815    pub CT32B0: CT32B0,
816    #[doc = "CT32B1"]
817    pub CT32B1: CT32B1,
818    #[doc = "ADC"]
819    pub ADC: ADC,
820    #[doc = "USB"]
821    pub USB: USB,
822    #[doc = "PMU"]
823    pub PMU: PMU,
824    #[doc = "FMC"]
825    pub FMC: FMC,
826    #[doc = "SSP0"]
827    pub SSP0: SSP0,
828    #[doc = "IOCON"]
829    pub IOCON: IOCON,
830    #[doc = "SYSCON"]
831    pub SYSCON: SYSCON,
832    #[doc = "SSP1"]
833    pub SSP1: SSP1,
834    #[doc = "GPIO0"]
835    pub GPIO0: GPIO0,
836    #[doc = "GPIO1"]
837    pub GPIO1: GPIO1,
838    #[doc = "GPIO2"]
839    pub GPIO2: GPIO2,
840    #[doc = "GPIO3"]
841    pub GPIO3: GPIO3,
842}
843impl Peripherals {
844    #[doc = r"Returns all the peripherals *once*"]
845    #[inline]
846    pub fn take() -> Option<Self> {
847        cortex_m::interrupt::free(|_| {
848            if unsafe { DEVICE_PERIPHERALS } {
849                None
850            } else {
851                Some(unsafe { Peripherals::steal() })
852            }
853        })
854    }
855    #[doc = r"Unchecked version of `Peripherals::take`"]
856    #[inline]
857    pub unsafe fn steal() -> Self {
858        DEVICE_PERIPHERALS = true;
859        Peripherals {
860            I2C: I2C {
861                _marker: PhantomData,
862            },
863            WWDT: WWDT {
864                _marker: PhantomData,
865            },
866            UART: UART {
867                _marker: PhantomData,
868            },
869            CT16B0: CT16B0 {
870                _marker: PhantomData,
871            },
872            CT16B1: CT16B1 {
873                _marker: PhantomData,
874            },
875            CT32B0: CT32B0 {
876                _marker: PhantomData,
877            },
878            CT32B1: CT32B1 {
879                _marker: PhantomData,
880            },
881            ADC: ADC {
882                _marker: PhantomData,
883            },
884            USB: USB {
885                _marker: PhantomData,
886            },
887            PMU: PMU {
888                _marker: PhantomData,
889            },
890            FMC: FMC {
891                _marker: PhantomData,
892            },
893            SSP0: SSP0 {
894                _marker: PhantomData,
895            },
896            IOCON: IOCON {
897                _marker: PhantomData,
898            },
899            SYSCON: SYSCON {
900                _marker: PhantomData,
901            },
902            SSP1: SSP1 {
903                _marker: PhantomData,
904            },
905            GPIO0: GPIO0 {
906                _marker: PhantomData,
907            },
908            GPIO1: GPIO1 {
909                _marker: PhantomData,
910            },
911            GPIO2: GPIO2 {
912                _marker: PhantomData,
913            },
914            GPIO3: GPIO3 {
915                _marker: PhantomData,
916            },
917        }
918    }
919}