esp32c6_lp/
lib.rs

1#![doc = "Peripheral access API for ESP32-C6-LP microcontrollers (generated using svd2rust v0.33.4 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next] svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.33.4/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
2#![allow(non_camel_case_types)]
3#![allow(non_snake_case)]
4#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/46717278")]
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 = 0;
10#[allow(unused_imports)]
11use generic::*;
12#[doc = r"Common register and bit access and modify traits"]
13pub mod generic;
14#[cfg(feature = "rt")]
15extern "C" {
16    fn LP_TIMER();
17    fn PMU();
18    fn LP_UART();
19    fn LP_I2C();
20    fn LP_WDT();
21    fn LP_PERI_TIMEOUT();
22    fn LP_APM_M0();
23    fn LP_APM_M1();
24}
25#[doc(hidden)]
26#[repr(C)]
27pub union Vector {
28    pub _handler: unsafe extern "C" fn(),
29    pub _reserved: usize,
30}
31#[cfg(feature = "rt")]
32#[doc(hidden)]
33#[link_section = ".rwtext"]
34#[no_mangle]
35pub static __EXTERNAL_INTERRUPTS: [Vector; 22] = [
36    Vector { _reserved: 0 },
37    Vector { _reserved: 0 },
38    Vector { _reserved: 0 },
39    Vector { _reserved: 0 },
40    Vector { _reserved: 0 },
41    Vector { _reserved: 0 },
42    Vector { _reserved: 0 },
43    Vector { _handler: LP_TIMER },
44    Vector { _reserved: 0 },
45    Vector { _reserved: 0 },
46    Vector { _reserved: 0 },
47    Vector { _reserved: 0 },
48    Vector { _reserved: 0 },
49    Vector { _handler: PMU },
50    Vector { _reserved: 0 },
51    Vector { _reserved: 0 },
52    Vector { _handler: LP_UART },
53    Vector { _handler: LP_I2C },
54    Vector { _handler: LP_WDT },
55    Vector {
56        _handler: LP_PERI_TIMEOUT,
57    },
58    Vector {
59        _handler: LP_APM_M0,
60    },
61    Vector {
62        _handler: LP_APM_M1,
63    },
64];
65#[doc(hidden)]
66pub mod interrupt;
67pub use self::interrupt::Interrupt;
68#[doc = "Low-power I2C (Inter-Integrated Circuit) Controller 0"]
69pub struct LP_I2C0 {
70    _marker: PhantomData<*const ()>,
71}
72unsafe impl Send for LP_I2C0 {}
73impl LP_I2C0 {
74    #[doc = r"Pointer to the register block"]
75    pub const PTR: *const lp_i2c0::RegisterBlock = 0x600b_1800 as *const _;
76    #[doc = r"Return the pointer to the register block"]
77    #[inline(always)]
78    pub const fn ptr() -> *const lp_i2c0::RegisterBlock {
79        Self::PTR
80    }
81    #[doc = r" Steal an instance of this peripheral"]
82    #[doc = r""]
83    #[doc = r" # Safety"]
84    #[doc = r""]
85    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
86    #[doc = r" that may race with any existing instances, for example by only"]
87    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
88    #[doc = r" original peripheral and using critical sections to coordinate"]
89    #[doc = r" access between multiple new instances."]
90    #[doc = r""]
91    #[doc = r" Additionally, other software such as HALs may rely on only one"]
92    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
93    #[doc = r" no stolen instances are passed to such software."]
94    pub unsafe fn steal() -> Self {
95        Self {
96            _marker: PhantomData,
97        }
98    }
99}
100impl Deref for LP_I2C0 {
101    type Target = lp_i2c0::RegisterBlock;
102    #[inline(always)]
103    fn deref(&self) -> &Self::Target {
104        unsafe { &*Self::PTR }
105    }
106}
107impl core::fmt::Debug for LP_I2C0 {
108    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
109        f.debug_struct("LP_I2C0").finish()
110    }
111}
112#[doc = "Low-power I2C (Inter-Integrated Circuit) Controller 0"]
113pub mod lp_i2c0;
114#[doc = "LP_PERI Peripheral"]
115pub struct LP_PERI {
116    _marker: PhantomData<*const ()>,
117}
118unsafe impl Send for LP_PERI {}
119impl LP_PERI {
120    #[doc = r"Pointer to the register block"]
121    pub const PTR: *const lp_peri::RegisterBlock = 0x600b_2800 as *const _;
122    #[doc = r"Return the pointer to the register block"]
123    #[inline(always)]
124    pub const fn ptr() -> *const lp_peri::RegisterBlock {
125        Self::PTR
126    }
127    #[doc = r" Steal an instance of this peripheral"]
128    #[doc = r""]
129    #[doc = r" # Safety"]
130    #[doc = r""]
131    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
132    #[doc = r" that may race with any existing instances, for example by only"]
133    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
134    #[doc = r" original peripheral and using critical sections to coordinate"]
135    #[doc = r" access between multiple new instances."]
136    #[doc = r""]
137    #[doc = r" Additionally, other software such as HALs may rely on only one"]
138    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
139    #[doc = r" no stolen instances are passed to such software."]
140    pub unsafe fn steal() -> Self {
141        Self {
142            _marker: PhantomData,
143        }
144    }
145}
146impl Deref for LP_PERI {
147    type Target = lp_peri::RegisterBlock;
148    #[inline(always)]
149    fn deref(&self) -> &Self::Target {
150        unsafe { &*Self::PTR }
151    }
152}
153impl core::fmt::Debug for LP_PERI {
154    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
155        f.debug_struct("LP_PERI").finish()
156    }
157}
158#[doc = "LP_PERI Peripheral"]
159pub mod lp_peri;
160#[doc = "LP_ANA_PERI Peripheral"]
161pub struct LP_ANA {
162    _marker: PhantomData<*const ()>,
163}
164unsafe impl Send for LP_ANA {}
165impl LP_ANA {
166    #[doc = r"Pointer to the register block"]
167    pub const PTR: *const lp_ana::RegisterBlock = 0x600b_2c00 as *const _;
168    #[doc = r"Return the pointer to the register block"]
169    #[inline(always)]
170    pub const fn ptr() -> *const lp_ana::RegisterBlock {
171        Self::PTR
172    }
173    #[doc = r" Steal an instance of this peripheral"]
174    #[doc = r""]
175    #[doc = r" # Safety"]
176    #[doc = r""]
177    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
178    #[doc = r" that may race with any existing instances, for example by only"]
179    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
180    #[doc = r" original peripheral and using critical sections to coordinate"]
181    #[doc = r" access between multiple new instances."]
182    #[doc = r""]
183    #[doc = r" Additionally, other software such as HALs may rely on only one"]
184    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
185    #[doc = r" no stolen instances are passed to such software."]
186    pub unsafe fn steal() -> Self {
187        Self {
188            _marker: PhantomData,
189        }
190    }
191}
192impl Deref for LP_ANA {
193    type Target = lp_ana::RegisterBlock;
194    #[inline(always)]
195    fn deref(&self) -> &Self::Target {
196        unsafe { &*Self::PTR }
197    }
198}
199impl core::fmt::Debug for LP_ANA {
200    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
201        f.debug_struct("LP_ANA").finish()
202    }
203}
204#[doc = "LP_ANA_PERI Peripheral"]
205pub mod lp_ana;
206#[doc = "LP_AON Peripheral"]
207pub struct LP_AON {
208    _marker: PhantomData<*const ()>,
209}
210unsafe impl Send for LP_AON {}
211impl LP_AON {
212    #[doc = r"Pointer to the register block"]
213    pub const PTR: *const lp_aon::RegisterBlock = 0x600b_1000 as *const _;
214    #[doc = r"Return the pointer to the register block"]
215    #[inline(always)]
216    pub const fn ptr() -> *const lp_aon::RegisterBlock {
217        Self::PTR
218    }
219    #[doc = r" Steal an instance of this peripheral"]
220    #[doc = r""]
221    #[doc = r" # Safety"]
222    #[doc = r""]
223    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
224    #[doc = r" that may race with any existing instances, for example by only"]
225    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
226    #[doc = r" original peripheral and using critical sections to coordinate"]
227    #[doc = r" access between multiple new instances."]
228    #[doc = r""]
229    #[doc = r" Additionally, other software such as HALs may rely on only one"]
230    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
231    #[doc = r" no stolen instances are passed to such software."]
232    pub unsafe fn steal() -> Self {
233        Self {
234            _marker: PhantomData,
235        }
236    }
237}
238impl Deref for LP_AON {
239    type Target = lp_aon::RegisterBlock;
240    #[inline(always)]
241    fn deref(&self) -> &Self::Target {
242        unsafe { &*Self::PTR }
243    }
244}
245impl core::fmt::Debug for LP_AON {
246    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
247        f.debug_struct("LP_AON").finish()
248    }
249}
250#[doc = "LP_AON Peripheral"]
251pub mod lp_aon;
252#[doc = "Low-power Access Permission Management Controller"]
253pub struct LP_APM {
254    _marker: PhantomData<*const ()>,
255}
256unsafe impl Send for LP_APM {}
257impl LP_APM {
258    #[doc = r"Pointer to the register block"]
259    pub const PTR: *const lp_apm::RegisterBlock = 0x600b_3800 as *const _;
260    #[doc = r"Return the pointer to the register block"]
261    #[inline(always)]
262    pub const fn ptr() -> *const lp_apm::RegisterBlock {
263        Self::PTR
264    }
265    #[doc = r" Steal an instance of this peripheral"]
266    #[doc = r""]
267    #[doc = r" # Safety"]
268    #[doc = r""]
269    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
270    #[doc = r" that may race with any existing instances, for example by only"]
271    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
272    #[doc = r" original peripheral and using critical sections to coordinate"]
273    #[doc = r" access between multiple new instances."]
274    #[doc = r""]
275    #[doc = r" Additionally, other software such as HALs may rely on only one"]
276    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
277    #[doc = r" no stolen instances are passed to such software."]
278    pub unsafe fn steal() -> Self {
279        Self {
280            _marker: PhantomData,
281        }
282    }
283}
284impl Deref for LP_APM {
285    type Target = lp_apm::RegisterBlock;
286    #[inline(always)]
287    fn deref(&self) -> &Self::Target {
288        unsafe { &*Self::PTR }
289    }
290}
291impl core::fmt::Debug for LP_APM {
292    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
293        f.debug_struct("LP_APM").finish()
294    }
295}
296#[doc = "Low-power Access Permission Management Controller"]
297pub mod lp_apm;
298#[doc = "LP_CLKRST Peripheral"]
299pub struct LP_CLKRST {
300    _marker: PhantomData<*const ()>,
301}
302unsafe impl Send for LP_CLKRST {}
303impl LP_CLKRST {
304    #[doc = r"Pointer to the register block"]
305    pub const PTR: *const lp_clkrst::RegisterBlock = 0x600b_0400 as *const _;
306    #[doc = r"Return the pointer to the register block"]
307    #[inline(always)]
308    pub const fn ptr() -> *const lp_clkrst::RegisterBlock {
309        Self::PTR
310    }
311    #[doc = r" Steal an instance of this peripheral"]
312    #[doc = r""]
313    #[doc = r" # Safety"]
314    #[doc = r""]
315    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
316    #[doc = r" that may race with any existing instances, for example by only"]
317    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
318    #[doc = r" original peripheral and using critical sections to coordinate"]
319    #[doc = r" access between multiple new instances."]
320    #[doc = r""]
321    #[doc = r" Additionally, other software such as HALs may rely on only one"]
322    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
323    #[doc = r" no stolen instances are passed to such software."]
324    pub unsafe fn steal() -> Self {
325        Self {
326            _marker: PhantomData,
327        }
328    }
329}
330impl Deref for LP_CLKRST {
331    type Target = lp_clkrst::RegisterBlock;
332    #[inline(always)]
333    fn deref(&self) -> &Self::Target {
334        unsafe { &*Self::PTR }
335    }
336}
337impl core::fmt::Debug for LP_CLKRST {
338    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
339        f.debug_struct("LP_CLKRST").finish()
340    }
341}
342#[doc = "LP_CLKRST Peripheral"]
343pub mod lp_clkrst;
344#[doc = "LP_I2C_ANA_MST Peripheral"]
345pub struct LP_I2C_ANA_MST {
346    _marker: PhantomData<*const ()>,
347}
348unsafe impl Send for LP_I2C_ANA_MST {}
349impl LP_I2C_ANA_MST {
350    #[doc = r"Pointer to the register block"]
351    pub const PTR: *const lp_i2c_ana_mst::RegisterBlock = 0x600b_2400 as *const _;
352    #[doc = r"Return the pointer to the register block"]
353    #[inline(always)]
354    pub const fn ptr() -> *const lp_i2c_ana_mst::RegisterBlock {
355        Self::PTR
356    }
357    #[doc = r" Steal an instance of this peripheral"]
358    #[doc = r""]
359    #[doc = r" # Safety"]
360    #[doc = r""]
361    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
362    #[doc = r" that may race with any existing instances, for example by only"]
363    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
364    #[doc = r" original peripheral and using critical sections to coordinate"]
365    #[doc = r" access between multiple new instances."]
366    #[doc = r""]
367    #[doc = r" Additionally, other software such as HALs may rely on only one"]
368    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
369    #[doc = r" no stolen instances are passed to such software."]
370    pub unsafe fn steal() -> Self {
371        Self {
372            _marker: PhantomData,
373        }
374    }
375}
376impl Deref for LP_I2C_ANA_MST {
377    type Target = lp_i2c_ana_mst::RegisterBlock;
378    #[inline(always)]
379    fn deref(&self) -> &Self::Target {
380        unsafe { &*Self::PTR }
381    }
382}
383impl core::fmt::Debug for LP_I2C_ANA_MST {
384    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
385        f.debug_struct("LP_I2C_ANA_MST").finish()
386    }
387}
388#[doc = "LP_I2C_ANA_MST Peripheral"]
389pub mod lp_i2c_ana_mst;
390#[doc = "LP_IO Peripheral"]
391pub struct LP_IO {
392    _marker: PhantomData<*const ()>,
393}
394unsafe impl Send for LP_IO {}
395impl LP_IO {
396    #[doc = r"Pointer to the register block"]
397    pub const PTR: *const lp_io::RegisterBlock = 0x600b_2000 as *const _;
398    #[doc = r"Return the pointer to the register block"]
399    #[inline(always)]
400    pub const fn ptr() -> *const lp_io::RegisterBlock {
401        Self::PTR
402    }
403    #[doc = r" Steal an instance of this peripheral"]
404    #[doc = r""]
405    #[doc = r" # Safety"]
406    #[doc = r""]
407    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
408    #[doc = r" that may race with any existing instances, for example by only"]
409    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
410    #[doc = r" original peripheral and using critical sections to coordinate"]
411    #[doc = r" access between multiple new instances."]
412    #[doc = r""]
413    #[doc = r" Additionally, other software such as HALs may rely on only one"]
414    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
415    #[doc = r" no stolen instances are passed to such software."]
416    pub unsafe fn steal() -> Self {
417        Self {
418            _marker: PhantomData,
419        }
420    }
421}
422impl Deref for LP_IO {
423    type Target = lp_io::RegisterBlock;
424    #[inline(always)]
425    fn deref(&self) -> &Self::Target {
426        unsafe { &*Self::PTR }
427    }
428}
429impl core::fmt::Debug for LP_IO {
430    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
431        f.debug_struct("LP_IO").finish()
432    }
433}
434#[doc = "LP_IO Peripheral"]
435pub mod lp_io;
436#[doc = "Low-power Trusted Execution Environment"]
437pub struct LP_TEE {
438    _marker: PhantomData<*const ()>,
439}
440unsafe impl Send for LP_TEE {}
441impl LP_TEE {
442    #[doc = r"Pointer to the register block"]
443    pub const PTR: *const lp_tee::RegisterBlock = 0x600b_3400 as *const _;
444    #[doc = r"Return the pointer to the register block"]
445    #[inline(always)]
446    pub const fn ptr() -> *const lp_tee::RegisterBlock {
447        Self::PTR
448    }
449    #[doc = r" Steal an instance of this peripheral"]
450    #[doc = r""]
451    #[doc = r" # Safety"]
452    #[doc = r""]
453    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
454    #[doc = r" that may race with any existing instances, for example by only"]
455    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
456    #[doc = r" original peripheral and using critical sections to coordinate"]
457    #[doc = r" access between multiple new instances."]
458    #[doc = r""]
459    #[doc = r" Additionally, other software such as HALs may rely on only one"]
460    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
461    #[doc = r" no stolen instances are passed to such software."]
462    pub unsafe fn steal() -> Self {
463        Self {
464            _marker: PhantomData,
465        }
466    }
467}
468impl Deref for LP_TEE {
469    type Target = lp_tee::RegisterBlock;
470    #[inline(always)]
471    fn deref(&self) -> &Self::Target {
472        unsafe { &*Self::PTR }
473    }
474}
475impl core::fmt::Debug for LP_TEE {
476    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
477        f.debug_struct("LP_TEE").finish()
478    }
479}
480#[doc = "Low-power Trusted Execution Environment"]
481pub mod lp_tee;
482#[doc = "Low-power Timer"]
483pub struct LP_TIMER {
484    _marker: PhantomData<*const ()>,
485}
486unsafe impl Send for LP_TIMER {}
487impl LP_TIMER {
488    #[doc = r"Pointer to the register block"]
489    pub const PTR: *const lp_timer::RegisterBlock = 0x600b_0c00 as *const _;
490    #[doc = r"Return the pointer to the register block"]
491    #[inline(always)]
492    pub const fn ptr() -> *const lp_timer::RegisterBlock {
493        Self::PTR
494    }
495    #[doc = r" Steal an instance of this peripheral"]
496    #[doc = r""]
497    #[doc = r" # Safety"]
498    #[doc = r""]
499    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
500    #[doc = r" that may race with any existing instances, for example by only"]
501    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
502    #[doc = r" original peripheral and using critical sections to coordinate"]
503    #[doc = r" access between multiple new instances."]
504    #[doc = r""]
505    #[doc = r" Additionally, other software such as HALs may rely on only one"]
506    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
507    #[doc = r" no stolen instances are passed to such software."]
508    pub unsafe fn steal() -> Self {
509        Self {
510            _marker: PhantomData,
511        }
512    }
513}
514impl Deref for LP_TIMER {
515    type Target = lp_timer::RegisterBlock;
516    #[inline(always)]
517    fn deref(&self) -> &Self::Target {
518        unsafe { &*Self::PTR }
519    }
520}
521impl core::fmt::Debug for LP_TIMER {
522    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
523        f.debug_struct("LP_TIMER").finish()
524    }
525}
526#[doc = "Low-power Timer"]
527pub mod lp_timer;
528#[doc = "Low-power UART (Universal Asynchronous Receiver-Transmitter) Controller"]
529pub struct LP_UART {
530    _marker: PhantomData<*const ()>,
531}
532unsafe impl Send for LP_UART {}
533impl LP_UART {
534    #[doc = r"Pointer to the register block"]
535    pub const PTR: *const lp_uart::RegisterBlock = 0x600b_1400 as *const _;
536    #[doc = r"Return the pointer to the register block"]
537    #[inline(always)]
538    pub const fn ptr() -> *const lp_uart::RegisterBlock {
539        Self::PTR
540    }
541    #[doc = r" Steal an instance of this peripheral"]
542    #[doc = r""]
543    #[doc = r" # Safety"]
544    #[doc = r""]
545    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
546    #[doc = r" that may race with any existing instances, for example by only"]
547    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
548    #[doc = r" original peripheral and using critical sections to coordinate"]
549    #[doc = r" access between multiple new instances."]
550    #[doc = r""]
551    #[doc = r" Additionally, other software such as HALs may rely on only one"]
552    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
553    #[doc = r" no stolen instances are passed to such software."]
554    pub unsafe fn steal() -> Self {
555        Self {
556            _marker: PhantomData,
557        }
558    }
559}
560impl Deref for LP_UART {
561    type Target = lp_uart::RegisterBlock;
562    #[inline(always)]
563    fn deref(&self) -> &Self::Target {
564        unsafe { &*Self::PTR }
565    }
566}
567impl core::fmt::Debug for LP_UART {
568    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
569        f.debug_struct("LP_UART").finish()
570    }
571}
572#[doc = "Low-power UART (Universal Asynchronous Receiver-Transmitter) Controller"]
573pub mod lp_uart;
574#[doc = "Low-power Watchdog Timer"]
575pub struct LP_WDT {
576    _marker: PhantomData<*const ()>,
577}
578unsafe impl Send for LP_WDT {}
579impl LP_WDT {
580    #[doc = r"Pointer to the register block"]
581    pub const PTR: *const lp_wdt::RegisterBlock = 0x600b_1c00 as *const _;
582    #[doc = r"Return the pointer to the register block"]
583    #[inline(always)]
584    pub const fn ptr() -> *const lp_wdt::RegisterBlock {
585        Self::PTR
586    }
587    #[doc = r" Steal an instance of this peripheral"]
588    #[doc = r""]
589    #[doc = r" # Safety"]
590    #[doc = r""]
591    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
592    #[doc = r" that may race with any existing instances, for example by only"]
593    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
594    #[doc = r" original peripheral and using critical sections to coordinate"]
595    #[doc = r" access between multiple new instances."]
596    #[doc = r""]
597    #[doc = r" Additionally, other software such as HALs may rely on only one"]
598    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
599    #[doc = r" no stolen instances are passed to such software."]
600    pub unsafe fn steal() -> Self {
601        Self {
602            _marker: PhantomData,
603        }
604    }
605}
606impl Deref for LP_WDT {
607    type Target = lp_wdt::RegisterBlock;
608    #[inline(always)]
609    fn deref(&self) -> &Self::Target {
610        unsafe { &*Self::PTR }
611    }
612}
613impl core::fmt::Debug for LP_WDT {
614    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
615        f.debug_struct("LP_WDT").finish()
616    }
617}
618#[doc = "Low-power Watchdog Timer"]
619pub mod lp_wdt;
620#[doc = "PMU Peripheral"]
621pub struct PMU {
622    _marker: PhantomData<*const ()>,
623}
624unsafe impl Send for PMU {}
625impl PMU {
626    #[doc = r"Pointer to the register block"]
627    pub const PTR: *const pmu::RegisterBlock = 0x600b_0000 as *const _;
628    #[doc = r"Return the pointer to the register block"]
629    #[inline(always)]
630    pub const fn ptr() -> *const pmu::RegisterBlock {
631        Self::PTR
632    }
633    #[doc = r" Steal an instance of this peripheral"]
634    #[doc = r""]
635    #[doc = r" # Safety"]
636    #[doc = r""]
637    #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"]
638    #[doc = r" that may race with any existing instances, for example by only"]
639    #[doc = r" accessing read-only or write-only registers, or by consuming the"]
640    #[doc = r" original peripheral and using critical sections to coordinate"]
641    #[doc = r" access between multiple new instances."]
642    #[doc = r""]
643    #[doc = r" Additionally, other software such as HALs may rely on only one"]
644    #[doc = r" peripheral instance existing to ensure memory safety; ensure"]
645    #[doc = r" no stolen instances are passed to such software."]
646    pub unsafe fn steal() -> Self {
647        Self {
648            _marker: PhantomData,
649        }
650    }
651}
652impl Deref for PMU {
653    type Target = pmu::RegisterBlock;
654    #[inline(always)]
655    fn deref(&self) -> &Self::Target {
656        unsafe { &*Self::PTR }
657    }
658}
659impl core::fmt::Debug for PMU {
660    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
661        f.debug_struct("PMU").finish()
662    }
663}
664#[doc = "PMU Peripheral"]
665pub mod pmu;
666#[no_mangle]
667static mut DEVICE_PERIPHERALS: bool = false;
668#[doc = r" All the peripherals."]
669#[allow(non_snake_case)]
670pub struct Peripherals {
671    #[doc = "LP_I2C0"]
672    pub LP_I2C0: LP_I2C0,
673    #[doc = "LP_PERI"]
674    pub LP_PERI: LP_PERI,
675    #[doc = "LP_ANA"]
676    pub LP_ANA: LP_ANA,
677    #[doc = "LP_AON"]
678    pub LP_AON: LP_AON,
679    #[doc = "LP_APM"]
680    pub LP_APM: LP_APM,
681    #[doc = "LP_CLKRST"]
682    pub LP_CLKRST: LP_CLKRST,
683    #[doc = "LP_I2C_ANA_MST"]
684    pub LP_I2C_ANA_MST: LP_I2C_ANA_MST,
685    #[doc = "LP_IO"]
686    pub LP_IO: LP_IO,
687    #[doc = "LP_TEE"]
688    pub LP_TEE: LP_TEE,
689    #[doc = "LP_TIMER"]
690    pub LP_TIMER: LP_TIMER,
691    #[doc = "LP_UART"]
692    pub LP_UART: LP_UART,
693    #[doc = "LP_WDT"]
694    pub LP_WDT: LP_WDT,
695    #[doc = "PMU"]
696    pub PMU: PMU,
697}
698impl Peripherals {
699    #[doc = r" Returns all the peripherals *once*."]
700    #[cfg(feature = "critical-section")]
701    #[inline]
702    pub fn take() -> Option<Self> {
703        critical_section::with(|_| {
704            if unsafe { DEVICE_PERIPHERALS } {
705                return None;
706            }
707            Some(unsafe { Peripherals::steal() })
708        })
709    }
710    #[doc = r" Unchecked version of `Peripherals::take`."]
711    #[doc = r""]
712    #[doc = r" # Safety"]
713    #[doc = r""]
714    #[doc = r" Each of the returned peripherals must be used at most once."]
715    #[inline]
716    pub unsafe fn steal() -> Self {
717        DEVICE_PERIPHERALS = true;
718        Peripherals {
719            LP_I2C0: LP_I2C0::steal(),
720            LP_PERI: LP_PERI::steal(),
721            LP_ANA: LP_ANA::steal(),
722            LP_AON: LP_AON::steal(),
723            LP_APM: LP_APM::steal(),
724            LP_CLKRST: LP_CLKRST::steal(),
725            LP_I2C_ANA_MST: LP_I2C_ANA_MST::steal(),
726            LP_IO: LP_IO::steal(),
727            LP_TEE: LP_TEE::steal(),
728            LP_TIMER: LP_TIMER::steal(),
729            LP_UART: LP_UART::steal(),
730            LP_WDT: LP_WDT::steal(),
731            PMU: PMU::steal(),
732        }
733    }
734}