1#![allow(non_camel_case_types)]
11#![allow(non_snake_case)]
12#![no_std]
13#![cfg_attr(docsrs, feature(doc_cfg))]
14pub const NVIC_PRIO_BITS: u8 = 4;
16#[allow(unused_imports)]
17use generic::*;
18pub mod generic;
20#[cfg(feature = "rt")]
21extern "C" {
22 fn IEL0();
23 fn IEL1();
24 fn IEL2();
25 fn IEL3();
26 fn IEL4();
27 fn IEL5();
28 fn IEL6();
29 fn IEL7();
30 fn IEL8();
31 fn IEL9();
32 fn IEL10();
33 fn IEL11();
34 fn IEL12();
35 fn IEL13();
36 fn IEL14();
37 fn IEL15();
38 fn IEL16();
39 fn IEL17();
40 fn IEL18();
41 fn IEL19();
42 fn IEL20();
43 fn IEL21();
44 fn IEL22();
45 fn IEL23();
46 fn IEL24();
47 fn IEL25();
48 fn IEL26();
49 fn IEL27();
50 fn IEL28();
51 fn IEL29();
52 fn IEL30();
53 fn IEL31();
54}
55#[doc(hidden)]
56#[repr(C)]
57pub union Vector {
58 _handler: unsafe extern "C" fn(),
59 _reserved: u32,
60}
61#[cfg(feature = "rt")]
62#[doc(hidden)]
63#[cfg_attr(feature = "fsp", link_section = ".application_vectors")]
64#[cfg_attr(
65 feature = "cortex-m-rt-device",
66 link_section = ".vector_table.interrupts"
67)]
68#[no_mangle]
69pub static __INTERRUPTS: [Vector; 32] = [
70 Vector { _handler: IEL0 },
71 Vector { _handler: IEL1 },
72 Vector { _handler: IEL2 },
73 Vector { _handler: IEL3 },
74 Vector { _handler: IEL4 },
75 Vector { _handler: IEL5 },
76 Vector { _handler: IEL6 },
77 Vector { _handler: IEL7 },
78 Vector { _handler: IEL8 },
79 Vector { _handler: IEL9 },
80 Vector { _handler: IEL10 },
81 Vector { _handler: IEL11 },
82 Vector { _handler: IEL12 },
83 Vector { _handler: IEL13 },
84 Vector { _handler: IEL14 },
85 Vector { _handler: IEL15 },
86 Vector { _handler: IEL16 },
87 Vector { _handler: IEL17 },
88 Vector { _handler: IEL18 },
89 Vector { _handler: IEL19 },
90 Vector { _handler: IEL20 },
91 Vector { _handler: IEL21 },
92 Vector { _handler: IEL22 },
93 Vector { _handler: IEL23 },
94 Vector { _handler: IEL24 },
95 Vector { _handler: IEL25 },
96 Vector { _handler: IEL26 },
97 Vector { _handler: IEL27 },
98 Vector { _handler: IEL28 },
99 Vector { _handler: IEL29 },
100 Vector { _handler: IEL30 },
101 Vector { _handler: IEL31 },
102];
103#[derive(Copy, Clone, Debug, PartialEq, Eq)]
105#[repr(u16)]
106pub enum Interrupt {
107 IEL0 = 0,
109 IEL1 = 1,
111 IEL2 = 2,
113 IEL3 = 3,
115 IEL4 = 4,
117 IEL5 = 5,
119 IEL6 = 6,
121 IEL7 = 7,
123 IEL8 = 8,
125 IEL9 = 9,
127 IEL10 = 10,
129 IEL11 = 11,
131 IEL12 = 12,
133 IEL13 = 13,
135 IEL14 = 14,
137 IEL15 = 15,
139 IEL16 = 16,
141 IEL17 = 17,
143 IEL18 = 18,
145 IEL19 = 19,
147 IEL20 = 20,
149 IEL21 = 21,
151 IEL22 = 22,
153 IEL23 = 23,
155 IEL24 = 24,
157 IEL25 = 25,
159 IEL26 = 26,
161 IEL27 = 27,
163 IEL28 = 28,
165 IEL29 = 29,
167 IEL30 = 30,
169 IEL31 = 31,
171}
172unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
173 #[inline(always)]
174 fn number(self) -> u16 {
175 self as u16
176 }
177}
178pub type SYSTEM = crate::Periph<system::RegisterBlock, 0x4001_e000>;
180impl core::fmt::Debug for SYSTEM {
181 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
182 f.debug_struct("SYSTEM").finish()
183 }
184}
185pub mod system;
187pub type BUS = crate::Periph<bus::RegisterBlock, 0x4000_3000>;
189impl core::fmt::Debug for BUS {
190 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
191 f.debug_struct("BUS").finish()
192 }
193}
194pub mod bus;
196pub type CAC = crate::Periph<cac::RegisterBlock, 0x4004_4600>;
198impl core::fmt::Debug for CAC {
199 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
200 f.debug_struct("CAC").finish()
201 }
202}
203pub mod cac;
205pub type CAN0 = crate::Periph<can0::RegisterBlock, 0x4005_0000>;
207impl core::fmt::Debug for CAN0 {
208 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
209 f.debug_struct("CAN0").finish()
210 }
211}
212pub mod can0;
214pub type DBG = crate::Periph<dbg::RegisterBlock, 0x4001_b000>;
216impl core::fmt::Debug for DBG {
217 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
218 f.debug_struct("DBG").finish()
219 }
220}
221pub mod dbg;
223pub type CRC = crate::Periph<crc::RegisterBlock, 0x4007_4000>;
225impl core::fmt::Debug for CRC {
226 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
227 f.debug_struct("CRC").finish()
228 }
229}
230pub mod crc;
232pub type CTSU = crate::Periph<ctsu::RegisterBlock, 0x4008_1000>;
234impl core::fmt::Debug for CTSU {
235 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
236 f.debug_struct("CTSU").finish()
237 }
238}
239pub mod ctsu;
241pub type DAC12 = crate::Periph<dac12::RegisterBlock, 0x4005_e000>;
243impl core::fmt::Debug for DAC12 {
244 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
245 f.debug_struct("DAC12").finish()
246 }
247}
248pub mod dac12;
250pub type DAC8 = crate::Periph<dac8::RegisterBlock, 0x4009_e000>;
252impl core::fmt::Debug for DAC8 {
253 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
254 f.debug_struct("DAC8").finish()
255 }
256}
257pub mod dac8;
259pub type DMAC0 = crate::Periph<dmac0::RegisterBlock, 0x4000_5000>;
261impl core::fmt::Debug for DMAC0 {
262 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
263 f.debug_struct("DMAC0").finish()
264 }
265}
266pub mod dmac0;
268pub type DMAC1 = crate::Periph<dmac0::RegisterBlock, 0x4000_5040>;
270impl core::fmt::Debug for DMAC1 {
271 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
272 f.debug_struct("DMAC1").finish()
273 }
274}
275pub use self::dmac0 as dmac1;
277pub type DMAC2 = crate::Periph<dmac0::RegisterBlock, 0x4000_5080>;
279impl core::fmt::Debug for DMAC2 {
280 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
281 f.debug_struct("DMAC2").finish()
282 }
283}
284pub use self::dmac0 as dmac2;
286pub type DMAC3 = crate::Periph<dmac0::RegisterBlock, 0x4000_50c0>;
288impl core::fmt::Debug for DMAC3 {
289 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
290 f.debug_struct("DMAC3").finish()
291 }
292}
293pub use self::dmac0 as dmac3;
295pub type DMA = crate::Periph<dma::RegisterBlock, 0x4000_5200>;
297impl core::fmt::Debug for DMA {
298 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
299 f.debug_struct("DMA").finish()
300 }
301}
302pub mod dma;
304pub type DOC = crate::Periph<doc::RegisterBlock, 0x4005_4100>;
306impl core::fmt::Debug for DOC {
307 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
308 f.debug_struct("DOC").finish()
309 }
310}
311pub mod doc;
313pub type DTC = crate::Periph<dtc::RegisterBlock, 0x4000_5400>;
315impl core::fmt::Debug for DTC {
316 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
317 f.debug_struct("DTC").finish()
318 }
319}
320pub mod dtc;
322pub type ELC = crate::Periph<elc::RegisterBlock, 0x4004_1000>;
324impl core::fmt::Debug for ELC {
325 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
326 f.debug_struct("ELC").finish()
327 }
328}
329pub mod elc;
331pub type FCACHE = crate::Periph<fcache::RegisterBlock, 0x4001_c000>;
333impl core::fmt::Debug for FCACHE {
334 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
335 f.debug_struct("FCACHE").finish()
336 }
337}
338pub mod fcache;
340pub type PORT0 = crate::Periph<port0::RegisterBlock, 0x4004_0000>;
342impl core::fmt::Debug for PORT0 {
343 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
344 f.debug_struct("PORT0").finish()
345 }
346}
347pub mod port0;
349pub type PORT1 = crate::Periph<port1::RegisterBlock, 0x4004_0020>;
351impl core::fmt::Debug for PORT1 {
352 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
353 f.debug_struct("PORT1").finish()
354 }
355}
356pub mod port1;
358pub type PORT2 = crate::Periph<port1::RegisterBlock, 0x4004_0040>;
360impl core::fmt::Debug for PORT2 {
361 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
362 f.debug_struct("PORT2").finish()
363 }
364}
365pub use self::port1 as port2;
367pub type PORT3 = crate::Periph<port1::RegisterBlock, 0x4004_0060>;
369impl core::fmt::Debug for PORT3 {
370 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
371 f.debug_struct("PORT3").finish()
372 }
373}
374pub use self::port1 as port3;
376pub type PORT4 = crate::Periph<port1::RegisterBlock, 0x4004_0080>;
378impl core::fmt::Debug for PORT4 {
379 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
380 f.debug_struct("PORT4").finish()
381 }
382}
383pub use self::port1 as port4;
385pub type PORT5 = crate::Periph<port0::RegisterBlock, 0x4004_00a0>;
387impl core::fmt::Debug for PORT5 {
388 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
389 f.debug_struct("PORT5").finish()
390 }
391}
392pub use self::port0 as port5;
394pub type PORT6 = crate::Periph<port0::RegisterBlock, 0x4004_00c0>;
396impl core::fmt::Debug for PORT6 {
397 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
398 f.debug_struct("PORT6").finish()
399 }
400}
401pub use self::port0 as port6;
403pub type PORT7 = crate::Periph<port0::RegisterBlock, 0x4004_00e0>;
405impl core::fmt::Debug for PORT7 {
406 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
407 f.debug_struct("PORT7").finish()
408 }
409}
410pub use self::port0 as port7;
412pub type PORT8 = crate::Periph<port0::RegisterBlock, 0x4004_0100>;
414impl core::fmt::Debug for PORT8 {
415 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
416 f.debug_struct("PORT8").finish()
417 }
418}
419pub use self::port0 as port8;
421pub type PORT9 = crate::Periph<port0::RegisterBlock, 0x4004_0120>;
423impl core::fmt::Debug for PORT9 {
424 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
425 f.debug_struct("PORT9").finish()
426 }
427}
428pub use self::port0 as port9;
430pub type PFS = crate::Periph<pfs::RegisterBlock, 0x4004_0800>;
432impl core::fmt::Debug for PFS {
433 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
434 f.debug_struct("PFS").finish()
435 }
436}
437pub mod pfs;
439pub type PMISC = crate::Periph<pmisc::RegisterBlock, 0x4004_0d00>;
441impl core::fmt::Debug for PMISC {
442 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
443 f.debug_struct("PMISC").finish()
444 }
445}
446pub mod pmisc;
448pub type ICU = crate::Periph<icu::RegisterBlock, 0x4000_6000>;
450impl core::fmt::Debug for ICU {
451 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
452 f.debug_struct("ICU").finish()
453 }
454}
455pub mod icu;
457pub type IIC0 = crate::Periph<iic0::RegisterBlock, 0x4005_3000>;
459impl core::fmt::Debug for IIC0 {
460 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
461 f.debug_struct("IIC0").finish()
462 }
463}
464pub mod iic0;
466pub type IIC1 = crate::Periph<iic1::RegisterBlock, 0x4005_3100>;
468impl core::fmt::Debug for IIC1 {
469 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
470 f.debug_struct("IIC1").finish()
471 }
472}
473pub mod iic1;
475pub type IWDT = crate::Periph<iwdt::RegisterBlock, 0x4004_4400>;
477impl core::fmt::Debug for IWDT {
478 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
479 f.debug_struct("IWDT").finish()
480 }
481}
482pub mod iwdt;
484pub type KINT = crate::Periph<kint::RegisterBlock, 0x4008_0000>;
486impl core::fmt::Debug for KINT {
487 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
488 f.debug_struct("KINT").finish()
489 }
490}
491pub mod kint;
493pub type MSTP = crate::Periph<mstp::RegisterBlock, 0x4004_7000>;
495impl core::fmt::Debug for MSTP {
496 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
497 f.debug_struct("MSTP").finish()
498 }
499}
500pub mod mstp;
502pub type MMPU = crate::Periph<mmpu::RegisterBlock, 0x4000_0000>;
504impl core::fmt::Debug for MMPU {
505 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
506 f.debug_struct("MMPU").finish()
507 }
508}
509pub mod mmpu;
511pub type SMPU = crate::Periph<smpu::RegisterBlock, 0x4000_0c00>;
513impl core::fmt::Debug for SMPU {
514 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
515 f.debug_struct("SMPU").finish()
516 }
517}
518pub mod smpu;
520pub type SPMON = crate::Periph<spmon::RegisterBlock, 0x4000_0d00>;
522impl core::fmt::Debug for SPMON {
523 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
524 f.debug_struct("SPMON").finish()
525 }
526}
527pub mod spmon;
529pub type OPAMP = crate::Periph<opamp::RegisterBlock, 0x4008_6000>;
531impl core::fmt::Debug for OPAMP {
532 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
533 f.debug_struct("OPAMP").finish()
534 }
535}
536pub mod opamp;
538pub type POEG = crate::Periph<poeg::RegisterBlock, 0x4004_2000>;
540impl core::fmt::Debug for POEG {
541 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
542 f.debug_struct("POEG").finish()
543 }
544}
545pub mod poeg;
547pub type SRAM = crate::Periph<sram::RegisterBlock, 0x4000_2000>;
549impl core::fmt::Debug for SRAM {
550 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
551 f.debug_struct("SRAM").finish()
552 }
553}
554pub mod sram;
556pub type RTC = crate::Periph<rtc::RegisterBlock, 0x4004_4000>;
558impl core::fmt::Debug for RTC {
559 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
560 f.debug_struct("RTC").finish()
561 }
562}
563pub mod rtc;
565pub type SCI0 = crate::Periph<sci0::RegisterBlock, 0x4007_0000>;
567impl core::fmt::Debug for SCI0 {
568 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
569 f.debug_struct("SCI0").finish()
570 }
571}
572pub mod sci0;
574pub type SCI1 = crate::Periph<sci0::RegisterBlock, 0x4007_0020>;
576impl core::fmt::Debug for SCI1 {
577 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
578 f.debug_struct("SCI1").finish()
579 }
580}
581pub use self::sci0 as sci1;
583pub type SCI2 = crate::Periph<sci2::RegisterBlock, 0x4007_0040>;
585impl core::fmt::Debug for SCI2 {
586 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
587 f.debug_struct("SCI2").finish()
588 }
589}
590pub mod sci2;
592pub type SCI9 = crate::Periph<sci2::RegisterBlock, 0x4007_0120>;
594impl core::fmt::Debug for SCI9 {
595 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
596 f.debug_struct("SCI9").finish()
597 }
598}
599pub use self::sci2 as sci9;
601pub type SLCDC = crate::Periph<slcdc::RegisterBlock, 0x4008_2000>;
603impl core::fmt::Debug for SLCDC {
604 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
605 f.debug_struct("SLCDC").finish()
606 }
607}
608pub mod slcdc;
610pub type SPI0 = crate::Periph<spi0::RegisterBlock, 0x4007_2000>;
612impl core::fmt::Debug for SPI0 {
613 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
614 f.debug_struct("SPI0").finish()
615 }
616}
617pub mod spi0;
619pub type SPI1 = crate::Periph<spi1::RegisterBlock, 0x4007_2100>;
621impl core::fmt::Debug for SPI1 {
622 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
623 f.debug_struct("SPI1").finish()
624 }
625}
626pub mod spi1;
628pub type SSIE0 = crate::Periph<ssie0::RegisterBlock, 0x4004_e000>;
630impl core::fmt::Debug for SSIE0 {
631 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
632 f.debug_struct("SSIE0").finish()
633 }
634}
635pub mod ssie0;
637pub type TSN = crate::Periph<tsn::RegisterBlock, 0x407e_c000>;
639impl core::fmt::Debug for TSN {
640 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
641 f.debug_struct("TSN").finish()
642 }
643}
644pub mod tsn;
646pub type USBFS = crate::Periph<usbfs::RegisterBlock, 0x4009_0000>;
648impl core::fmt::Debug for USBFS {
649 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
650 f.debug_struct("USBFS").finish()
651 }
652}
653pub mod usbfs;
655pub type WDT = crate::Periph<wdt::RegisterBlock, 0x4004_4200>;
657impl core::fmt::Debug for WDT {
658 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
659 f.debug_struct("WDT").finish()
660 }
661}
662pub mod wdt;
664pub type ACMPLP = crate::Periph<acmplp::RegisterBlock, 0x4008_5e00>;
666impl core::fmt::Debug for ACMPLP {
667 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
668 f.debug_struct("ACMPLP").finish()
669 }
670}
671pub mod acmplp;
673pub type ADC140 = crate::Periph<adc140::RegisterBlock, 0x4005_c000>;
675impl core::fmt::Debug for ADC140 {
676 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
677 f.debug_struct("ADC140").finish()
678 }
679}
680pub mod adc140;
682pub type AGT0 = crate::Periph<agt0::RegisterBlock, 0x4008_4000>;
684impl core::fmt::Debug for AGT0 {
685 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
686 f.debug_struct("AGT0").finish()
687 }
688}
689pub mod agt0;
691pub type AGT1 = crate::Periph<agt0::RegisterBlock, 0x4008_4100>;
693impl core::fmt::Debug for AGT1 {
694 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
695 f.debug_struct("AGT1").finish()
696 }
697}
698pub use self::agt0 as agt1;
700pub type GPT320 = crate::Periph<gpt320::RegisterBlock, 0x4007_8000>;
702impl core::fmt::Debug for GPT320 {
703 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
704 f.debug_struct("GPT320").finish()
705 }
706}
707pub mod gpt320;
709pub type GPT321 = crate::Periph<gpt320::RegisterBlock, 0x4007_8100>;
711impl core::fmt::Debug for GPT321 {
712 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
713 f.debug_struct("GPT321").finish()
714 }
715}
716pub use self::gpt320 as gpt321;
718pub type GPT162 = crate::Periph<gpt162::RegisterBlock, 0x4007_8200>;
720impl core::fmt::Debug for GPT162 {
721 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
722 f.debug_struct("GPT162").finish()
723 }
724}
725pub mod gpt162;
727pub type GPT163 = crate::Periph<gpt162::RegisterBlock, 0x4007_8300>;
729impl core::fmt::Debug for GPT163 {
730 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
731 f.debug_struct("GPT163").finish()
732 }
733}
734pub use self::gpt162 as gpt163;
736pub type GPT164 = crate::Periph<gpt162::RegisterBlock, 0x4007_8400>;
738impl core::fmt::Debug for GPT164 {
739 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
740 f.debug_struct("GPT164").finish()
741 }
742}
743pub use self::gpt162 as gpt164;
745pub type GPT165 = crate::Periph<gpt162::RegisterBlock, 0x4007_8500>;
747impl core::fmt::Debug for GPT165 {
748 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
749 f.debug_struct("GPT165").finish()
750 }
751}
752pub use self::gpt162 as gpt165;
754pub type GPT166 = crate::Periph<gpt162::RegisterBlock, 0x4007_8600>;
756impl core::fmt::Debug for GPT166 {
757 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
758 f.debug_struct("GPT166").finish()
759 }
760}
761pub use self::gpt162 as gpt166;
763pub type GPT167 = crate::Periph<gpt162::RegisterBlock, 0x4007_8700>;
765impl core::fmt::Debug for GPT167 {
766 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
767 f.debug_struct("GPT167").finish()
768 }
769}
770pub use self::gpt162 as gpt167;
772pub type GPT_OPS = crate::Periph<gpt_ops::RegisterBlock, 0x4007_8ff0>;
774impl core::fmt::Debug for GPT_OPS {
775 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
776 f.debug_struct("GPT_OPS").finish()
777 }
778}
779pub mod gpt_ops;
781#[no_mangle]
782static mut DEVICE_PERIPHERALS: bool = false;
783#[allow(non_snake_case)]
785pub struct Peripherals {
786 pub SYSTEM: SYSTEM,
788 pub BUS: BUS,
790 pub CAC: CAC,
792 pub CAN0: CAN0,
794 pub DBG: DBG,
796 pub CRC: CRC,
798 pub CTSU: CTSU,
800 pub DAC12: DAC12,
802 pub DAC8: DAC8,
804 pub DMAC0: DMAC0,
806 pub DMAC1: DMAC1,
808 pub DMAC2: DMAC2,
810 pub DMAC3: DMAC3,
812 pub DMA: DMA,
814 pub DOC: DOC,
816 pub DTC: DTC,
818 pub ELC: ELC,
820 pub FCACHE: FCACHE,
822 pub PORT0: PORT0,
824 pub PORT1: PORT1,
826 pub PORT2: PORT2,
828 pub PORT3: PORT3,
830 pub PORT4: PORT4,
832 pub PORT5: PORT5,
834 pub PORT6: PORT6,
836 pub PORT7: PORT7,
838 pub PORT8: PORT8,
840 pub PORT9: PORT9,
842 pub PFS: PFS,
844 pub PMISC: PMISC,
846 pub ICU: ICU,
848 pub IIC0: IIC0,
850 pub IIC1: IIC1,
852 pub IWDT: IWDT,
854 pub KINT: KINT,
856 pub MSTP: MSTP,
858 pub MMPU: MMPU,
860 pub SMPU: SMPU,
862 pub SPMON: SPMON,
864 pub OPAMP: OPAMP,
866 pub POEG: POEG,
868 pub SRAM: SRAM,
870 pub RTC: RTC,
872 pub SCI0: SCI0,
874 pub SCI1: SCI1,
876 pub SCI2: SCI2,
878 pub SCI9: SCI9,
880 pub SLCDC: SLCDC,
882 pub SPI0: SPI0,
884 pub SPI1: SPI1,
886 pub SSIE0: SSIE0,
888 pub TSN: TSN,
890 pub USBFS: USBFS,
892 pub WDT: WDT,
894 pub ACMPLP: ACMPLP,
896 pub ADC140: ADC140,
898 pub AGT0: AGT0,
900 pub AGT1: AGT1,
902 pub GPT320: GPT320,
904 pub GPT321: GPT321,
906 pub GPT162: GPT162,
908 pub GPT163: GPT163,
910 pub GPT164: GPT164,
912 pub GPT165: GPT165,
914 pub GPT166: GPT166,
916 pub GPT167: GPT167,
918 pub GPT_OPS: GPT_OPS,
920}
921impl Peripherals {
922 #[cfg(feature = "critical-section")]
924 #[inline]
925 pub fn take() -> Option<Self> {
926 critical_section::with(|_| {
927 if unsafe { DEVICE_PERIPHERALS } {
928 return None;
929 }
930 Some(unsafe { Peripherals::steal() })
931 })
932 }
933 #[inline]
939 pub unsafe fn steal() -> Self {
940 DEVICE_PERIPHERALS = true;
941 Peripherals {
942 SYSTEM: SYSTEM::steal(),
943 BUS: BUS::steal(),
944 CAC: CAC::steal(),
945 CAN0: CAN0::steal(),
946 DBG: DBG::steal(),
947 CRC: CRC::steal(),
948 CTSU: CTSU::steal(),
949 DAC12: DAC12::steal(),
950 DAC8: DAC8::steal(),
951 DMAC0: DMAC0::steal(),
952 DMAC1: DMAC1::steal(),
953 DMAC2: DMAC2::steal(),
954 DMAC3: DMAC3::steal(),
955 DMA: DMA::steal(),
956 DOC: DOC::steal(),
957 DTC: DTC::steal(),
958 ELC: ELC::steal(),
959 FCACHE: FCACHE::steal(),
960 PORT0: PORT0::steal(),
961 PORT1: PORT1::steal(),
962 PORT2: PORT2::steal(),
963 PORT3: PORT3::steal(),
964 PORT4: PORT4::steal(),
965 PORT5: PORT5::steal(),
966 PORT6: PORT6::steal(),
967 PORT7: PORT7::steal(),
968 PORT8: PORT8::steal(),
969 PORT9: PORT9::steal(),
970 PFS: PFS::steal(),
971 PMISC: PMISC::steal(),
972 ICU: ICU::steal(),
973 IIC0: IIC0::steal(),
974 IIC1: IIC1::steal(),
975 IWDT: IWDT::steal(),
976 KINT: KINT::steal(),
977 MSTP: MSTP::steal(),
978 MMPU: MMPU::steal(),
979 SMPU: SMPU::steal(),
980 SPMON: SPMON::steal(),
981 OPAMP: OPAMP::steal(),
982 POEG: POEG::steal(),
983 SRAM: SRAM::steal(),
984 RTC: RTC::steal(),
985 SCI0: SCI0::steal(),
986 SCI1: SCI1::steal(),
987 SCI2: SCI2::steal(),
988 SCI9: SCI9::steal(),
989 SLCDC: SLCDC::steal(),
990 SPI0: SPI0::steal(),
991 SPI1: SPI1::steal(),
992 SSIE0: SSIE0::steal(),
993 TSN: TSN::steal(),
994 USBFS: USBFS::steal(),
995 WDT: WDT::steal(),
996 ACMPLP: ACMPLP::steal(),
997 ADC140: ADC140::steal(),
998 AGT0: AGT0::steal(),
999 AGT1: AGT1::steal(),
1000 GPT320: GPT320::steal(),
1001 GPT321: GPT321::steal(),
1002 GPT162: GPT162::steal(),
1003 GPT163: GPT163::steal(),
1004 GPT164: GPT164::steal(),
1005 GPT165: GPT165::steal(),
1006 GPT166: GPT166::steal(),
1007 GPT167: GPT167::steal(),
1008 GPT_OPS: GPT_OPS::steal(),
1009 }
1010 }
1011}
1012#[cfg(all(feature = "fsp", feature = "cortex-m-rt-device"))]
1013compile_error!("Cannot enable both `fsp` and `cortex-m-rt-device` features at the same time.");
1014pub use self::Interrupt as interrupt;
1015impl Interrupt {
1016 pub const fn try_from_u16(n: u16) -> Option<Self> {
1017 #[cfg(feature = "rt")]
1018 const {
1019 assert!(__INTERRUPTS.len() == 32);
1020 assert!(__INTERRUPTS.len() <= (u16::MAX as usize));
1021 };
1022 if n >= 32 as u16 {
1023 return None;
1024 }
1025 Some(unsafe { ::core::mem::transmute(n as u16) })
1026 }
1027}
1028#[derive(Debug)]
1029pub struct InvalidInterruptNumber;
1030impl TryFrom<u16> for Interrupt {
1031 type Error = InvalidInterruptNumber;
1032 fn try_from(value: u16) -> Result<Self, Self::Error> {
1033 Interrupt::try_from_u16(value).ok_or(InvalidInterruptNumber)
1034 }
1035}
1036impl core::error::Error for InvalidInterruptNumber {}
1037impl core::fmt::Display for InvalidInterruptNumber {
1038 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1039 write!(f, "Invalid interrupt number")
1040 }
1041}