#![doc = "Peripheral access API for VA108XX microcontrollers (generated using svd2rust v0.33.3 ( ))\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.3/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![no_std] use core::marker::PhantomData; use core::ops::Deref; #[doc = r"Number available in the NVIC for configuring priority"] pub const NVIC_PRIO_BITS: u8 = 2; #[cfg(feature = "rt")] pub use self::Interrupt as interrupt; #[cfg(feature = "rt")] pub use cortex_m_rt::interrupt; #[allow(unused_imports)] use generic::*; #[doc = r"Common register and bit access and modify traits"] pub mod generic; #[cfg(feature = "rt")] extern "C" { fn OC0(); fn OC1(); fn OC2(); fn OC3(); fn OC4(); fn OC5(); fn OC6(); fn OC7(); fn OC8(); fn OC9(); fn OC10(); fn OC11(); fn OC12(); fn OC13(); fn OC14(); fn OC15(); fn OC16(); fn OC17(); fn OC18(); fn OC19(); fn OC20(); fn OC21(); fn OC22(); fn OC23(); fn OC24(); fn OC25(); fn OC26(); fn OC27(); fn OC28(); fn OC29(); fn OC30(); fn OC31(); } #[doc(hidden)] #[repr(C)] pub union Vector { _handler: unsafe extern "C" fn(), _reserved: u32, } #[cfg(feature = "rt")] #[doc(hidden)] #[link_section = ".vector_table.interrupts"] #[no_mangle] pub static __INTERRUPTS: [Vector; 32] = [ Vector { _handler: OC0 }, Vector { _handler: OC1 }, Vector { _handler: OC2 }, Vector { _handler: OC3 }, Vector { _handler: OC4 }, Vector { _handler: OC5 }, Vector { _handler: OC6 }, Vector { _handler: OC7 }, Vector { _handler: OC8 }, Vector { _handler: OC9 }, Vector { _handler: OC10 }, Vector { _handler: OC11 }, Vector { _handler: OC12 }, Vector { _handler: OC13 }, Vector { _handler: OC14 }, Vector { _handler: OC15 }, Vector { _handler: OC16 }, Vector { _handler: OC17 }, Vector { _handler: OC18 }, Vector { _handler: OC19 }, Vector { _handler: OC20 }, Vector { _handler: OC21 }, Vector { _handler: OC22 }, Vector { _handler: OC23 }, Vector { _handler: OC24 }, Vector { _handler: OC25 }, Vector { _handler: OC26 }, Vector { _handler: OC27 }, Vector { _handler: OC28 }, Vector { _handler: OC29 }, Vector { _handler: OC30 }, Vector { _handler: OC31 }, ]; #[doc = r"Enumeration of all the interrupts."] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u16)] pub enum Interrupt { #[doc = "0 - OC0"] OC0 = 0, #[doc = "1 - OC1"] OC1 = 1, #[doc = "2 - OC2"] OC2 = 2, #[doc = "3 - OC3"] OC3 = 3, #[doc = "4 - OC4"] OC4 = 4, #[doc = "5 - OC5"] OC5 = 5, #[doc = "6 - OC6"] OC6 = 6, #[doc = "7 - OC7"] OC7 = 7, #[doc = "8 - OC8"] OC8 = 8, #[doc = "9 - OC9"] OC9 = 9, #[doc = "10 - OC10"] OC10 = 10, #[doc = "11 - OC11"] OC11 = 11, #[doc = "12 - OC12"] OC12 = 12, #[doc = "13 - OC13"] OC13 = 13, #[doc = "14 - OC14"] OC14 = 14, #[doc = "15 - OC15"] OC15 = 15, #[doc = "16 - OC16"] OC16 = 16, #[doc = "17 - OC17"] OC17 = 17, #[doc = "18 - OC18"] OC18 = 18, #[doc = "19 - OC19"] OC19 = 19, #[doc = "20 - OC20"] OC20 = 20, #[doc = "21 - OC21"] OC21 = 21, #[doc = "22 - OC22"] OC22 = 22, #[doc = "23 - OC23"] OC23 = 23, #[doc = "24 - OC24"] OC24 = 24, #[doc = "25 - OC25"] OC25 = 25, #[doc = "26 - OC26"] OC26 = 26, #[doc = "27 - OC27"] OC27 = 27, #[doc = "28 - OC28"] OC28 = 28, #[doc = "29 - OC29"] OC29 = 29, #[doc = "30 - OC30"] OC30 = 30, #[doc = "31 - OC31"] OC31 = 31, } unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt { #[inline(always)] fn number(self) -> u16 { self as u16 } } #[doc = "System Configuration Peripheral"] pub struct Sysconfig { _marker: PhantomData<*const ()>, } unsafe impl Send for Sysconfig {} impl Sysconfig { #[doc = r"Pointer to the register block"] pub const PTR: *const sysconfig::RegisterBlock = 0x4000_0000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const sysconfig::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Sysconfig { type Target = sysconfig::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Sysconfig { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Sysconfig").finish() } } #[doc = "System Configuration Peripheral"] pub mod sysconfig; #[doc = "Interrupt Selector Peripheral"] pub struct Irqsel { _marker: PhantomData<*const ()>, } unsafe impl Send for Irqsel {} impl Irqsel { #[doc = r"Pointer to the register block"] pub const PTR: *const irqsel::RegisterBlock = 0x4000_1000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const irqsel::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Irqsel { type Target = irqsel::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Irqsel { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Irqsel").finish() } } #[doc = "Interrupt Selector Peripheral"] pub mod irqsel; #[doc = "IO Pin Configuration Peripheral"] pub struct Ioconfig { _marker: PhantomData<*const ()>, } unsafe impl Send for Ioconfig {} impl Ioconfig { #[doc = r"Pointer to the register block"] pub const PTR: *const ioconfig::RegisterBlock = 0x4000_2000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const ioconfig::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Ioconfig { type Target = ioconfig::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Ioconfig { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Ioconfig").finish() } } #[doc = "IO Pin Configuration Peripheral"] pub mod ioconfig; #[doc = "Utility Peripheral"] pub struct Utility { _marker: PhantomData<*const ()>, } unsafe impl Send for Utility {} impl Utility { #[doc = r"Pointer to the register block"] pub const PTR: *const utility::RegisterBlock = 0x4000_3000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const utility::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Utility { type Target = utility::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Utility { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Utility").finish() } } #[doc = "Utility Peripheral"] pub mod utility; #[doc = "GPIO Peripheral"] pub struct Porta { _marker: PhantomData<*const ()>, } unsafe impl Send for Porta {} impl Porta { #[doc = r"Pointer to the register block"] pub const PTR: *const porta::RegisterBlock = 0x5000_0000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const porta::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Porta { type Target = porta::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Porta { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Porta").finish() } } #[doc = "GPIO Peripheral"] pub mod porta; #[doc = "GPIO Peripheral"] pub struct Portb { _marker: PhantomData<*const ()>, } unsafe impl Send for Portb {} impl Portb { #[doc = r"Pointer to the register block"] pub const PTR: *const porta::RegisterBlock = 0x5000_1000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const porta::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Portb { type Target = porta::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Portb { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Portb").finish() } } #[doc = "GPIO Peripheral"] pub use self::porta as portb; #[doc = "Timer/Counter Peripheral"] pub struct Tim0 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim0 {} impl Tim0 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_0000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim0 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim0 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim0").finish() } } #[doc = "Timer/Counter Peripheral"] pub mod tim0; #[doc = "Timer/Counter Peripheral"] pub struct Tim1 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim1 {} impl Tim1 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_1000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim1 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim1 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim1").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim1; #[doc = "Timer/Counter Peripheral"] pub struct Tim2 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim2 {} impl Tim2 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_2000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim2 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim2 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim2").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim2; #[doc = "Timer/Counter Peripheral"] pub struct Tim3 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim3 {} impl Tim3 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_3000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim3 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim3 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim3").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim3; #[doc = "Timer/Counter Peripheral"] pub struct Tim4 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim4 {} impl Tim4 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_4000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim4 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim4 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim4").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim4; #[doc = "Timer/Counter Peripheral"] pub struct Tim5 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim5 {} impl Tim5 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_5000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim5 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim5 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim5").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim5; #[doc = "Timer/Counter Peripheral"] pub struct Tim6 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim6 {} impl Tim6 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_6000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim6 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim6 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim6").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim6; #[doc = "Timer/Counter Peripheral"] pub struct Tim7 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim7 {} impl Tim7 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_7000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim7 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim7 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim7").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim7; #[doc = "Timer/Counter Peripheral"] pub struct Tim8 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim8 {} impl Tim8 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_8000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim8 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim8 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim8").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim8; #[doc = "Timer/Counter Peripheral"] pub struct Tim9 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim9 {} impl Tim9 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_9000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim9 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim9 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim9").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim9; #[doc = "Timer/Counter Peripheral"] pub struct Tim10 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim10 {} impl Tim10 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_a000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim10 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim10 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim10").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim10; #[doc = "Timer/Counter Peripheral"] pub struct Tim11 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim11 {} impl Tim11 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_b000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim11 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim11 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim11").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim11; #[doc = "Timer/Counter Peripheral"] pub struct Tim12 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim12 {} impl Tim12 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_c000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim12 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim12 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim12").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim12; #[doc = "Timer/Counter Peripheral"] pub struct Tim13 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim13 {} impl Tim13 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_d000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim13 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim13 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim13").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim13; #[doc = "Timer/Counter Peripheral"] pub struct Tim14 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim14 {} impl Tim14 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_e000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim14 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim14 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim14").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim14; #[doc = "Timer/Counter Peripheral"] pub struct Tim15 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim15 {} impl Tim15 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4002_f000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim15 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim15 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim15").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim15; #[doc = "Timer/Counter Peripheral"] pub struct Tim16 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim16 {} impl Tim16 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4003_0000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim16 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim16 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim16").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim16; #[doc = "Timer/Counter Peripheral"] pub struct Tim17 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim17 {} impl Tim17 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4003_1000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim17 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim17 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim17").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim17; #[doc = "Timer/Counter Peripheral"] pub struct Tim18 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim18 {} impl Tim18 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4003_2000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim18 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim18 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim18").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim18; #[doc = "Timer/Counter Peripheral"] pub struct Tim19 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim19 {} impl Tim19 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4003_3000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim19 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim19 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim19").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim19; #[doc = "Timer/Counter Peripheral"] pub struct Tim20 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim20 {} impl Tim20 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4003_4000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim20 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim20 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim20").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim20; #[doc = "Timer/Counter Peripheral"] pub struct Tim21 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim21 {} impl Tim21 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4003_5000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim21 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim21 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim21").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim21; #[doc = "Timer/Counter Peripheral"] pub struct Tim22 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim22 {} impl Tim22 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4003_6000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim22 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim22 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim22").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim22; #[doc = "Timer/Counter Peripheral"] pub struct Tim23 { _marker: PhantomData<*const ()>, } unsafe impl Send for Tim23 {} impl Tim23 { #[doc = r"Pointer to the register block"] pub const PTR: *const tim0::RegisterBlock = 0x4003_7000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const tim0::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Tim23 { type Target = tim0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Tim23 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Tim23").finish() } } #[doc = "Timer/Counter Peripheral"] pub use self::tim0 as tim23; #[doc = "UART Peripheral"] pub struct Uarta { _marker: PhantomData<*const ()>, } unsafe impl Send for Uarta {} impl Uarta { #[doc = r"Pointer to the register block"] pub const PTR: *const uarta::RegisterBlock = 0x4004_0000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const uarta::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Uarta { type Target = uarta::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Uarta { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Uarta").finish() } } #[doc = "UART Peripheral"] pub mod uarta; #[doc = "UART Peripheral"] pub struct Uartb { _marker: PhantomData<*const ()>, } unsafe impl Send for Uartb {} impl Uartb { #[doc = r"Pointer to the register block"] pub const PTR: *const uarta::RegisterBlock = 0x4004_1000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const uarta::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Uartb { type Target = uarta::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Uartb { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Uartb").finish() } } #[doc = "UART Peripheral"] pub use self::uarta as uartb; #[doc = "SPI Peripheral"] pub struct Spia { _marker: PhantomData<*const ()>, } unsafe impl Send for Spia {} impl Spia { #[doc = r"Pointer to the register block"] pub const PTR: *const spia::RegisterBlock = 0x4005_0000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const spia::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Spia { type Target = spia::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Spia { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Spia").finish() } } #[doc = "SPI Peripheral"] pub mod spia; #[doc = "SPI Peripheral"] pub struct Spib { _marker: PhantomData<*const ()>, } unsafe impl Send for Spib {} impl Spib { #[doc = r"Pointer to the register block"] pub const PTR: *const spia::RegisterBlock = 0x4005_1000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const spia::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Spib { type Target = spia::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Spib { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Spib").finish() } } #[doc = "SPI Peripheral"] pub use self::spia as spib; #[doc = "SPI Peripheral"] pub struct Spic { _marker: PhantomData<*const ()>, } unsafe impl Send for Spic {} impl Spic { #[doc = r"Pointer to the register block"] pub const PTR: *const spia::RegisterBlock = 0x4005_2000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const spia::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for Spic { type Target = spia::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for Spic { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("Spic").finish() } } #[doc = "SPI Peripheral"] pub use self::spia as spic; #[doc = "I2C Peripheral"] pub struct I2ca { _marker: PhantomData<*const ()>, } unsafe impl Send for I2ca {} impl I2ca { #[doc = r"Pointer to the register block"] pub const PTR: *const i2ca::RegisterBlock = 0x4006_0000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const i2ca::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for I2ca { type Target = i2ca::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for I2ca { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("I2ca").finish() } } #[doc = "I2C Peripheral"] pub mod i2ca; #[doc = "I2C Peripheral"] pub struct I2cb { _marker: PhantomData<*const ()>, } unsafe impl Send for I2cb {} impl I2cb { #[doc = r"Pointer to the register block"] pub const PTR: *const i2ca::RegisterBlock = 0x4006_1000 as *const _; #[doc = r"Return the pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const i2ca::RegisterBlock { Self::PTR } #[doc = r" Steal an instance of this peripheral"] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] #[doc = r" that may race with any existing instances, for example by only"] #[doc = r" accessing read-only or write-only registers, or by consuming the"] #[doc = r" original peripheral and using critical sections to coordinate"] #[doc = r" access between multiple new instances."] #[doc = r""] #[doc = r" Additionally, other software such as HALs may rely on only one"] #[doc = r" peripheral instance existing to ensure memory safety; ensure"] #[doc = r" no stolen instances are passed to such software."] pub unsafe fn steal() -> Self { Self { _marker: PhantomData, } } } impl Deref for I2cb { type Target = i2ca::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } impl core::fmt::Debug for I2cb { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { f.debug_struct("I2cb").finish() } } #[doc = "I2C Peripheral"] pub use self::i2ca as i2cb; #[no_mangle] static mut DEVICE_PERIPHERALS: bool = false; #[doc = r" All the peripherals."] #[allow(non_snake_case)] pub struct Peripherals { #[doc = "SYSCONFIG"] pub sysconfig: Sysconfig, #[doc = "IRQSEL"] pub irqsel: Irqsel, #[doc = "IOCONFIG"] pub ioconfig: Ioconfig, #[doc = "UTILITY"] pub utility: Utility, #[doc = "PORTA"] pub porta: Porta, #[doc = "PORTB"] pub portb: Portb, #[doc = "TIM0"] pub tim0: Tim0, #[doc = "TIM1"] pub tim1: Tim1, #[doc = "TIM2"] pub tim2: Tim2, #[doc = "TIM3"] pub tim3: Tim3, #[doc = "TIM4"] pub tim4: Tim4, #[doc = "TIM5"] pub tim5: Tim5, #[doc = "TIM6"] pub tim6: Tim6, #[doc = "TIM7"] pub tim7: Tim7, #[doc = "TIM8"] pub tim8: Tim8, #[doc = "TIM9"] pub tim9: Tim9, #[doc = "TIM10"] pub tim10: Tim10, #[doc = "TIM11"] pub tim11: Tim11, #[doc = "TIM12"] pub tim12: Tim12, #[doc = "TIM13"] pub tim13: Tim13, #[doc = "TIM14"] pub tim14: Tim14, #[doc = "TIM15"] pub tim15: Tim15, #[doc = "TIM16"] pub tim16: Tim16, #[doc = "TIM17"] pub tim17: Tim17, #[doc = "TIM18"] pub tim18: Tim18, #[doc = "TIM19"] pub tim19: Tim19, #[doc = "TIM20"] pub tim20: Tim20, #[doc = "TIM21"] pub tim21: Tim21, #[doc = "TIM22"] pub tim22: Tim22, #[doc = "TIM23"] pub tim23: Tim23, #[doc = "UARTA"] pub uarta: Uarta, #[doc = "UARTB"] pub uartb: Uartb, #[doc = "SPIA"] pub spia: Spia, #[doc = "SPIB"] pub spib: Spib, #[doc = "SPIC"] pub spic: Spic, #[doc = "I2CA"] pub i2ca: I2ca, #[doc = "I2CB"] pub i2cb: I2cb, } impl Peripherals { #[doc = r" Returns all the peripherals *once*."] #[cfg(feature = "critical-section")] #[inline] pub fn take() -> Option { critical_section::with(|_| { if unsafe { DEVICE_PERIPHERALS } { return None; } Some(unsafe { Peripherals::steal() }) }) } #[doc = r" Unchecked version of `Peripherals::take`."] #[doc = r""] #[doc = r" # Safety"] #[doc = r""] #[doc = r" Each of the returned peripherals must be used at most once."] #[inline] pub unsafe fn steal() -> Self { DEVICE_PERIPHERALS = true; Peripherals { sysconfig: Sysconfig { _marker: PhantomData, }, irqsel: Irqsel { _marker: PhantomData, }, ioconfig: Ioconfig { _marker: PhantomData, }, utility: Utility { _marker: PhantomData, }, porta: Porta { _marker: PhantomData, }, portb: Portb { _marker: PhantomData, }, tim0: Tim0 { _marker: PhantomData, }, tim1: Tim1 { _marker: PhantomData, }, tim2: Tim2 { _marker: PhantomData, }, tim3: Tim3 { _marker: PhantomData, }, tim4: Tim4 { _marker: PhantomData, }, tim5: Tim5 { _marker: PhantomData, }, tim6: Tim6 { _marker: PhantomData, }, tim7: Tim7 { _marker: PhantomData, }, tim8: Tim8 { _marker: PhantomData, }, tim9: Tim9 { _marker: PhantomData, }, tim10: Tim10 { _marker: PhantomData, }, tim11: Tim11 { _marker: PhantomData, }, tim12: Tim12 { _marker: PhantomData, }, tim13: Tim13 { _marker: PhantomData, }, tim14: Tim14 { _marker: PhantomData, }, tim15: Tim15 { _marker: PhantomData, }, tim16: Tim16 { _marker: PhantomData, }, tim17: Tim17 { _marker: PhantomData, }, tim18: Tim18 { _marker: PhantomData, }, tim19: Tim19 { _marker: PhantomData, }, tim20: Tim20 { _marker: PhantomData, }, tim21: Tim21 { _marker: PhantomData, }, tim22: Tim22 { _marker: PhantomData, }, tim23: Tim23 { _marker: PhantomData, }, uarta: Uarta { _marker: PhantomData, }, uartb: Uartb { _marker: PhantomData, }, spia: Spia { _marker: PhantomData, }, spib: Spib { _marker: PhantomData, }, spic: Spic { _marker: PhantomData, }, i2ca: I2ca { _marker: PhantomData, }, i2cb: I2cb { _marker: PhantomData, }, } } }