#![doc = "Peripheral access API for EFM32PG12 microcontrollers (generated using svd2rust v0.16.1)\n\nYou can find an overview of the API [here].\n\n[here]: https://docs.rs/svd2rust/0.16.1/svd2rust/#peripheral-api"]
#![deny(missing_docs)]
#![deny(warnings)]
#![allow(non_camel_case_types)]
#![no_std]
extern crate bare_metal;
extern crate cortex_m;
#[cfg(feature = "rt")]
extern crate cortex_m_rt;
extern crate vcell;
use core::marker::PhantomData;
use core::ops::Deref;
#[doc = r"Number available in the NVIC for configuring priority"]
pub const NVIC_PRIO_BITS: u8 = 3;
#[cfg(feature = "rt")]
extern "C" {
fn EMU();
fn WDOG0();
fn WDOG1();
fn LDMA();
fn GPIO_EVEN();
fn TIMER0();
fn USART0_RX();
fn USART0_TX();
fn ACMP0();
fn ADC0();
fn IDAC0();
fn I2C0();
fn GPIO_ODD();
fn TIMER1();
fn USART1_RX();
fn USART1_TX();
fn LEUART0();
fn PCNT0();
fn CMU();
fn MSC();
fn CRYPTO0();
fn LETIMER0();
fn RTCC();
fn CRYOTIMER();
fn FPUEH();
fn SMU();
fn WTIMER0();
fn WTIMER1();
fn PCNT1();
fn PCNT2();
fn USART2_RX();
fn USART2_TX();
fn I2C1();
fn USART3_RX();
fn USART3_TX();
fn VDAC0();
fn CSEN();
fn LESENSE();
fn CRYPTO1();
fn TRNG0();
}
#[doc(hidden)]
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; 50] = [
Vector { _handler: EMU },
Vector { _reserved: 0 },
Vector { _handler: WDOG0 },
Vector { _handler: WDOG1 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _handler: LDMA },
Vector {
_handler: GPIO_EVEN,
},
Vector { _handler: TIMER0 },
Vector {
_handler: USART0_RX,
},
Vector {
_handler: USART0_TX,
},
Vector { _handler: ACMP0 },
Vector { _handler: ADC0 },
Vector { _handler: IDAC0 },
Vector { _handler: I2C0 },
Vector { _handler: GPIO_ODD },
Vector { _handler: TIMER1 },
Vector {
_handler: USART1_RX,
},
Vector {
_handler: USART1_TX,
},
Vector { _handler: LEUART0 },
Vector { _handler: PCNT0 },
Vector { _handler: CMU },
Vector { _handler: MSC },
Vector { _handler: CRYPTO0 },
Vector { _handler: LETIMER0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _handler: RTCC },
Vector { _reserved: 0 },
Vector {
_handler: CRYOTIMER,
},
Vector { _reserved: 0 },
Vector { _handler: FPUEH },
Vector { _handler: SMU },
Vector { _handler: WTIMER0 },
Vector { _handler: WTIMER1 },
Vector { _handler: PCNT1 },
Vector { _handler: PCNT2 },
Vector {
_handler: USART2_RX,
},
Vector {
_handler: USART2_TX,
},
Vector { _handler: I2C1 },
Vector {
_handler: USART3_RX,
},
Vector {
_handler: USART3_TX,
},
Vector { _handler: VDAC0 },
Vector { _handler: CSEN },
Vector { _handler: LESENSE },
Vector { _handler: CRYPTO1 },
Vector { _handler: TRNG0 },
];
#[doc = r"Enumeration of all the interrupts"]
#[derive(Copy, Clone, Debug)]
pub enum Interrupt {
#[doc = "0 - EMU"]
EMU,
#[doc = "2 - WDOG0"]
WDOG0,
#[doc = "3 - WDOG1"]
WDOG1,
#[doc = "9 - LDMA"]
LDMA,
#[doc = "10 - GPIO_EVEN"]
GPIO_EVEN,
#[doc = "11 - TIMER0"]
TIMER0,
#[doc = "12 - USART0_RX"]
USART0_RX,
#[doc = "13 - USART0_TX"]
USART0_TX,
#[doc = "14 - ACMP0"]
ACMP0,
#[doc = "15 - ADC0"]
ADC0,
#[doc = "16 - IDAC0"]
IDAC0,
#[doc = "17 - I2C0"]
I2C0,
#[doc = "18 - GPIO_ODD"]
GPIO_ODD,
#[doc = "19 - TIMER1"]
TIMER1,
#[doc = "20 - USART1_RX"]
USART1_RX,
#[doc = "21 - USART1_TX"]
USART1_TX,
#[doc = "22 - LEUART0"]
LEUART0,
#[doc = "23 - PCNT0"]
PCNT0,
#[doc = "24 - CMU"]
CMU,
#[doc = "25 - MSC"]
MSC,
#[doc = "26 - CRYPTO0"]
CRYPTO0,
#[doc = "27 - LETIMER0"]
LETIMER0,
#[doc = "30 - RTCC"]
RTCC,
#[doc = "32 - CRYOTIMER"]
CRYOTIMER,
#[doc = "34 - FPUEH"]
FPUEH,
#[doc = "35 - SMU"]
SMU,
#[doc = "36 - WTIMER0"]
WTIMER0,
#[doc = "37 - WTIMER1"]
WTIMER1,
#[doc = "38 - PCNT1"]
PCNT1,
#[doc = "39 - PCNT2"]
PCNT2,
#[doc = "40 - USART2_RX"]
USART2_RX,
#[doc = "41 - USART2_TX"]
USART2_TX,
#[doc = "42 - I2C1"]
I2C1,
#[doc = "43 - USART3_RX"]
USART3_RX,
#[doc = "44 - USART3_TX"]
USART3_TX,
#[doc = "45 - VDAC0"]
VDAC0,
#[doc = "46 - CSEN"]
CSEN,
#[doc = "47 - LESENSE"]
LESENSE,
#[doc = "48 - CRYPTO1"]
CRYPTO1,
#[doc = "49 - TRNG0"]
TRNG0,
}
unsafe impl bare_metal::Nr for Interrupt {
#[inline]
fn nr(&self) -> u8 {
match *self {
Interrupt::EMU => 0,
Interrupt::WDOG0 => 2,
Interrupt::WDOG1 => 3,
Interrupt::LDMA => 9,
Interrupt::GPIO_EVEN => 10,
Interrupt::TIMER0 => 11,
Interrupt::USART0_RX => 12,
Interrupt::USART0_TX => 13,
Interrupt::ACMP0 => 14,
Interrupt::ADC0 => 15,
Interrupt::IDAC0 => 16,
Interrupt::I2C0 => 17,
Interrupt::GPIO_ODD => 18,
Interrupt::TIMER1 => 19,
Interrupt::USART1_RX => 20,
Interrupt::USART1_TX => 21,
Interrupt::LEUART0 => 22,
Interrupt::PCNT0 => 23,
Interrupt::CMU => 24,
Interrupt::MSC => 25,
Interrupt::CRYPTO0 => 26,
Interrupt::LETIMER0 => 27,
Interrupt::RTCC => 30,
Interrupt::CRYOTIMER => 32,
Interrupt::FPUEH => 34,
Interrupt::SMU => 35,
Interrupt::WTIMER0 => 36,
Interrupt::WTIMER1 => 37,
Interrupt::PCNT1 => 38,
Interrupt::PCNT2 => 39,
Interrupt::USART2_RX => 40,
Interrupt::USART2_TX => 41,
Interrupt::I2C1 => 42,
Interrupt::USART3_RX => 43,
Interrupt::USART3_TX => 44,
Interrupt::VDAC0 => 45,
Interrupt::CSEN => 46,
Interrupt::LESENSE => 47,
Interrupt::CRYPTO1 => 48,
Interrupt::TRNG0 => 49,
}
}
}
#[cfg(feature = "rt")]
pub use self::Interrupt as interrupt;
pub use cortex_m::peripheral::Peripherals as CorePeripherals;
pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, FPU, ITM, MPU, NVIC, SCB, SYST, TPIU};
#[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;
#[doc = "MSC"]
pub struct MSC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for MSC {}
impl MSC {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const msc::RegisterBlock {
0x400e_0000 as *const _
}
}
impl Deref for MSC {
type Target = msc::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*MSC::ptr() }
}
}
#[doc = "MSC"]
pub mod msc;
#[doc = "EMU"]
pub struct EMU {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for EMU {}
impl EMU {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const emu::RegisterBlock {
0x400e_3000 as *const _
}
}
impl Deref for EMU {
type Target = emu::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*EMU::ptr() }
}
}
#[doc = "EMU"]
pub mod emu;
#[doc = "RMU"]
pub struct RMU {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for RMU {}
impl RMU {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const rmu::RegisterBlock {
0x400e_5000 as *const _
}
}
impl Deref for RMU {
type Target = rmu::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*RMU::ptr() }
}
}
#[doc = "RMU"]
pub mod rmu;
#[doc = "CMU"]
pub struct CMU {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CMU {}
impl CMU {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const cmu::RegisterBlock {
0x400e_4000 as *const _
}
}
impl Deref for CMU {
type Target = cmu::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*CMU::ptr() }
}
}
#[doc = "CMU"]
pub mod cmu;
#[doc = "CRYPTO0"]
pub struct CRYPTO0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CRYPTO0 {}
impl CRYPTO0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const crypto0::RegisterBlock {
0x400f_0000 as *const _
}
}
impl Deref for CRYPTO0 {
type Target = crypto0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*CRYPTO0::ptr() }
}
}
#[doc = "CRYPTO0"]
pub mod crypto0;
#[doc = "CRYPTO1"]
pub struct CRYPTO1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CRYPTO1 {}
impl CRYPTO1 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const crypto0::RegisterBlock {
0x400f_0400 as *const _
}
}
impl Deref for CRYPTO1 {
type Target = crypto0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*CRYPTO1::ptr() }
}
}
#[doc = "GPIO"]
pub struct GPIO {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIO {}
impl GPIO {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const gpio::RegisterBlock {
0x4000_a000 as *const _
}
}
impl Deref for GPIO {
type Target = gpio::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*GPIO::ptr() }
}
}
#[doc = "GPIO"]
pub mod gpio;
#[doc = "PRS"]
pub struct PRS {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for PRS {}
impl PRS {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const prs::RegisterBlock {
0x400e_6000 as *const _
}
}
impl Deref for PRS {
type Target = prs::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*PRS::ptr() }
}
}
#[doc = "PRS"]
pub mod prs;
#[doc = "LDMA"]
pub struct LDMA {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for LDMA {}
impl LDMA {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const ldma::RegisterBlock {
0x400e_2000 as *const _
}
}
impl Deref for LDMA {
type Target = ldma::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*LDMA::ptr() }
}
}
#[doc = "LDMA"]
pub mod ldma;
#[doc = "FPUEH"]
pub struct FPUEH {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for FPUEH {}
impl FPUEH {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const fpueh::RegisterBlock {
0x400e_1000 as *const _
}
}
impl Deref for FPUEH {
type Target = fpueh::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*FPUEH::ptr() }
}
}
#[doc = "FPUEH"]
pub mod fpueh;
#[doc = "GPCRC"]
pub struct GPCRC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPCRC {}
impl GPCRC {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const gpcrc::RegisterBlock {
0x4001_c000 as *const _
}
}
impl Deref for GPCRC {
type Target = gpcrc::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*GPCRC::ptr() }
}
}
#[doc = "GPCRC"]
pub mod gpcrc;
#[doc = "TIMER0"]
pub struct TIMER0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIMER0 {}
impl TIMER0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const timer0::RegisterBlock {
0x4001_8000 as *const _
}
}
impl Deref for TIMER0 {
type Target = timer0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*TIMER0::ptr() }
}
}
#[doc = "TIMER0"]
pub mod timer0;
#[doc = "TIMER1"]
pub struct TIMER1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIMER1 {}
impl TIMER1 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const timer0::RegisterBlock {
0x4001_8400 as *const _
}
}
impl Deref for TIMER1 {
type Target = timer0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*TIMER1::ptr() }
}
}
#[doc = "WTIMER0"]
pub struct WTIMER0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for WTIMER0 {}
impl WTIMER0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const wtimer0::RegisterBlock {
0x4001_a000 as *const _
}
}
impl Deref for WTIMER0 {
type Target = wtimer0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*WTIMER0::ptr() }
}
}
#[doc = "WTIMER0"]
pub mod wtimer0;
#[doc = "WTIMER1"]
pub struct WTIMER1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for WTIMER1 {}
impl WTIMER1 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const wtimer0::RegisterBlock {
0x4001_a400 as *const _
}
}
impl Deref for WTIMER1 {
type Target = wtimer0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*WTIMER1::ptr() }
}
}
#[doc = "USART0"]
pub struct USART0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USART0 {}
impl USART0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usart0::RegisterBlock {
0x4001_0000 as *const _
}
}
impl Deref for USART0 {
type Target = usart0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*USART0::ptr() }
}
}
#[doc = "USART0"]
pub mod usart0;
#[doc = "USART1"]
pub struct USART1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USART1 {}
impl USART1 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usart0::RegisterBlock {
0x4001_0400 as *const _
}
}
impl Deref for USART1 {
type Target = usart0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*USART1::ptr() }
}
}
#[doc = "USART2"]
pub struct USART2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USART2 {}
impl USART2 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usart0::RegisterBlock {
0x4001_0800 as *const _
}
}
impl Deref for USART2 {
type Target = usart0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*USART2::ptr() }
}
}
#[doc = "USART3"]
pub struct USART3 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USART3 {}
impl USART3 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usart0::RegisterBlock {
0x4001_0c00 as *const _
}
}
impl Deref for USART3 {
type Target = usart0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*USART3::ptr() }
}
}
#[doc = "LEUART0"]
pub struct LEUART0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for LEUART0 {}
impl LEUART0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const leuart0::RegisterBlock {
0x4004_a000 as *const _
}
}
impl Deref for LEUART0 {
type Target = leuart0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*LEUART0::ptr() }
}
}
#[doc = "LEUART0"]
pub mod leuart0;
#[doc = "LETIMER0"]
pub struct LETIMER0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for LETIMER0 {}
impl LETIMER0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const letimer0::RegisterBlock {
0x4004_6000 as *const _
}
}
impl Deref for LETIMER0 {
type Target = letimer0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*LETIMER0::ptr() }
}
}
#[doc = "LETIMER0"]
pub mod letimer0;
#[doc = "CRYOTIMER"]
pub struct CRYOTIMER {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CRYOTIMER {}
impl CRYOTIMER {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const cryotimer::RegisterBlock {
0x4001_e000 as *const _
}
}
impl Deref for CRYOTIMER {
type Target = cryotimer::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*CRYOTIMER::ptr() }
}
}
#[doc = "CRYOTIMER"]
pub mod cryotimer;
#[doc = "PCNT0"]
pub struct PCNT0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for PCNT0 {}
impl PCNT0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const pcnt0::RegisterBlock {
0x4004_e000 as *const _
}
}
impl Deref for PCNT0 {
type Target = pcnt0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*PCNT0::ptr() }
}
}
#[doc = "PCNT0"]
pub mod pcnt0;
#[doc = "PCNT1"]
pub struct PCNT1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for PCNT1 {}
impl PCNT1 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const pcnt0::RegisterBlock {
0x4004_e400 as *const _
}
}
impl Deref for PCNT1 {
type Target = pcnt0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*PCNT1::ptr() }
}
}
#[doc = "PCNT2"]
pub struct PCNT2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for PCNT2 {}
impl PCNT2 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const pcnt0::RegisterBlock {
0x4004_e800 as *const _
}
}
impl Deref for PCNT2 {
type Target = pcnt0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*PCNT2::ptr() }
}
}
#[doc = "I2C0"]
pub struct I2C0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for I2C0 {}
impl I2C0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const i2c0::RegisterBlock {
0x4000_c000 as *const _
}
}
impl Deref for I2C0 {
type Target = i2c0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*I2C0::ptr() }
}
}
#[doc = "I2C0"]
pub mod i2c0;
#[doc = "I2C1"]
pub struct I2C1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for I2C1 {}
impl I2C1 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const i2c0::RegisterBlock {
0x4000_c400 as *const _
}
}
impl Deref for I2C1 {
type Target = i2c0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*I2C1::ptr() }
}
}
#[doc = "ADC0"]
pub struct ADC0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for ADC0 {}
impl ADC0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const adc0::RegisterBlock {
0x4000_2000 as *const _
}
}
impl Deref for ADC0 {
type Target = adc0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*ADC0::ptr() }
}
}
#[doc = "ADC0"]
pub mod adc0;
#[doc = "ACMP0"]
pub struct ACMP0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for ACMP0 {}
impl ACMP0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const acmp0::RegisterBlock {
0x4000_0000 as *const _
}
}
impl Deref for ACMP0 {
type Target = acmp0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*ACMP0::ptr() }
}
}
#[doc = "ACMP0"]
pub mod acmp0;
#[doc = "ACMP1"]
pub struct ACMP1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for ACMP1 {}
impl ACMP1 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const acmp0::RegisterBlock {
0x4000_0400 as *const _
}
}
impl Deref for ACMP1 {
type Target = acmp0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*ACMP1::ptr() }
}
}
#[doc = "IDAC0"]
pub struct IDAC0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for IDAC0 {}
impl IDAC0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const idac0::RegisterBlock {
0x4000_6000 as *const _
}
}
impl Deref for IDAC0 {
type Target = idac0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*IDAC0::ptr() }
}
}
#[doc = "IDAC0"]
pub mod idac0;
#[doc = "VDAC0"]
pub struct VDAC0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for VDAC0 {}
impl VDAC0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const vdac0::RegisterBlock {
0x4000_8000 as *const _
}
}
impl Deref for VDAC0 {
type Target = vdac0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*VDAC0::ptr() }
}
}
#[doc = "VDAC0"]
pub mod vdac0;
#[doc = "CSEN"]
pub struct CSEN {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CSEN {}
impl CSEN {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const csen::RegisterBlock {
0x4001_f000 as *const _
}
}
impl Deref for CSEN {
type Target = csen::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*CSEN::ptr() }
}
}
#[doc = "CSEN"]
pub mod csen;
#[doc = "LESENSE"]
pub struct LESENSE {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for LESENSE {}
impl LESENSE {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const lesense::RegisterBlock {
0x4005_5000 as *const _
}
}
impl Deref for LESENSE {
type Target = lesense::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*LESENSE::ptr() }
}
}
#[doc = "LESENSE"]
pub mod lesense;
#[doc = "RTCC"]
pub struct RTCC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for RTCC {}
impl RTCC {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const rtcc::RegisterBlock {
0x4004_2000 as *const _
}
}
impl Deref for RTCC {
type Target = rtcc::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*RTCC::ptr() }
}
}
#[doc = "RTCC"]
pub mod rtcc;
#[doc = "WDOG0"]
pub struct WDOG0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for WDOG0 {}
impl WDOG0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const wdog0::RegisterBlock {
0x4005_2000 as *const _
}
}
impl Deref for WDOG0 {
type Target = wdog0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*WDOG0::ptr() }
}
}
#[doc = "WDOG0"]
pub mod wdog0;
#[doc = "WDOG1"]
pub struct WDOG1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for WDOG1 {}
impl WDOG1 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const wdog0::RegisterBlock {
0x4005_2400 as *const _
}
}
impl Deref for WDOG1 {
type Target = wdog0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*WDOG1::ptr() }
}
}
#[doc = "ETM"]
pub struct ETM {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for ETM {}
impl ETM {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const etm::RegisterBlock {
0xe004_1000 as *const _
}
}
impl Deref for ETM {
type Target = etm::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*ETM::ptr() }
}
}
#[doc = "ETM"]
pub mod etm;
#[doc = "SMU"]
pub struct SMU {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SMU {}
impl SMU {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const smu::RegisterBlock {
0x4002_2000 as *const _
}
}
impl Deref for SMU {
type Target = smu::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*SMU::ptr() }
}
}
#[doc = "SMU"]
pub mod smu;
#[doc = "TRNG0"]
pub struct TRNG0 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TRNG0 {}
impl TRNG0 {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const trng0::RegisterBlock {
0x4001_d000 as *const _
}
}
impl Deref for TRNG0 {
type Target = trng0::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*TRNG0::ptr() }
}
}
#[doc = "TRNG0"]
pub mod trng0;
#[no_mangle]
static mut DEVICE_PERIPHERALS: bool = false;
#[doc = r"All the peripherals"]
#[allow(non_snake_case)]
pub struct Peripherals {
#[doc = "MSC"]
pub MSC: MSC,
#[doc = "EMU"]
pub EMU: EMU,
#[doc = "RMU"]
pub RMU: RMU,
#[doc = "CMU"]
pub CMU: CMU,
#[doc = "CRYPTO0"]
pub CRYPTO0: CRYPTO0,
#[doc = "CRYPTO1"]
pub CRYPTO1: CRYPTO1,
#[doc = "GPIO"]
pub GPIO: GPIO,
#[doc = "PRS"]
pub PRS: PRS,
#[doc = "LDMA"]
pub LDMA: LDMA,
#[doc = "FPUEH"]
pub FPUEH: FPUEH,
#[doc = "GPCRC"]
pub GPCRC: GPCRC,
#[doc = "TIMER0"]
pub TIMER0: TIMER0,
#[doc = "TIMER1"]
pub TIMER1: TIMER1,
#[doc = "WTIMER0"]
pub WTIMER0: WTIMER0,
#[doc = "WTIMER1"]
pub WTIMER1: WTIMER1,
#[doc = "USART0"]
pub USART0: USART0,
#[doc = "USART1"]
pub USART1: USART1,
#[doc = "USART2"]
pub USART2: USART2,
#[doc = "USART3"]
pub USART3: USART3,
#[doc = "LEUART0"]
pub LEUART0: LEUART0,
#[doc = "LETIMER0"]
pub LETIMER0: LETIMER0,
#[doc = "CRYOTIMER"]
pub CRYOTIMER: CRYOTIMER,
#[doc = "PCNT0"]
pub PCNT0: PCNT0,
#[doc = "PCNT1"]
pub PCNT1: PCNT1,
#[doc = "PCNT2"]
pub PCNT2: PCNT2,
#[doc = "I2C0"]
pub I2C0: I2C0,
#[doc = "I2C1"]
pub I2C1: I2C1,
#[doc = "ADC0"]
pub ADC0: ADC0,
#[doc = "ACMP0"]
pub ACMP0: ACMP0,
#[doc = "ACMP1"]
pub ACMP1: ACMP1,
#[doc = "IDAC0"]
pub IDAC0: IDAC0,
#[doc = "VDAC0"]
pub VDAC0: VDAC0,
#[doc = "CSEN"]
pub CSEN: CSEN,
#[doc = "LESENSE"]
pub LESENSE: LESENSE,
#[doc = "RTCC"]
pub RTCC: RTCC,
#[doc = "WDOG0"]
pub WDOG0: WDOG0,
#[doc = "WDOG1"]
pub WDOG1: WDOG1,
#[doc = "ETM"]
pub ETM: ETM,
#[doc = "SMU"]
pub SMU: SMU,
#[doc = "TRNG0"]
pub TRNG0: TRNG0,
}
impl Peripherals {
#[doc = r"Returns all the peripherals *once*"]
#[inline]
pub fn take() -> Option<Self> {
cortex_m::interrupt::free(|_| {
if unsafe { DEVICE_PERIPHERALS } {
None
} else {
Some(unsafe { Peripherals::steal() })
}
})
}
#[doc = r"Unchecked version of `Peripherals::take`"]
pub unsafe fn steal() -> Self {
DEVICE_PERIPHERALS = true;
Peripherals {
MSC: MSC {
_marker: PhantomData,
},
EMU: EMU {
_marker: PhantomData,
},
RMU: RMU {
_marker: PhantomData,
},
CMU: CMU {
_marker: PhantomData,
},
CRYPTO0: CRYPTO0 {
_marker: PhantomData,
},
CRYPTO1: CRYPTO1 {
_marker: PhantomData,
},
GPIO: GPIO {
_marker: PhantomData,
},
PRS: PRS {
_marker: PhantomData,
},
LDMA: LDMA {
_marker: PhantomData,
},
FPUEH: FPUEH {
_marker: PhantomData,
},
GPCRC: GPCRC {
_marker: PhantomData,
},
TIMER0: TIMER0 {
_marker: PhantomData,
},
TIMER1: TIMER1 {
_marker: PhantomData,
},
WTIMER0: WTIMER0 {
_marker: PhantomData,
},
WTIMER1: WTIMER1 {
_marker: PhantomData,
},
USART0: USART0 {
_marker: PhantomData,
},
USART1: USART1 {
_marker: PhantomData,
},
USART2: USART2 {
_marker: PhantomData,
},
USART3: USART3 {
_marker: PhantomData,
},
LEUART0: LEUART0 {
_marker: PhantomData,
},
LETIMER0: LETIMER0 {
_marker: PhantomData,
},
CRYOTIMER: CRYOTIMER {
_marker: PhantomData,
},
PCNT0: PCNT0 {
_marker: PhantomData,
},
PCNT1: PCNT1 {
_marker: PhantomData,
},
PCNT2: PCNT2 {
_marker: PhantomData,
},
I2C0: I2C0 {
_marker: PhantomData,
},
I2C1: I2C1 {
_marker: PhantomData,
},
ADC0: ADC0 {
_marker: PhantomData,
},
ACMP0: ACMP0 {
_marker: PhantomData,
},
ACMP1: ACMP1 {
_marker: PhantomData,
},
IDAC0: IDAC0 {
_marker: PhantomData,
},
VDAC0: VDAC0 {
_marker: PhantomData,
},
CSEN: CSEN {
_marker: PhantomData,
},
LESENSE: LESENSE {
_marker: PhantomData,
},
RTCC: RTCC {
_marker: PhantomData,
},
WDOG0: WDOG0 {
_marker: PhantomData,
},
WDOG1: WDOG1 {
_marker: PhantomData,
},
ETM: ETM {
_marker: PhantomData,
},
SMU: SMU {
_marker: PhantomData,
},
TRNG0: TRNG0 {
_marker: PhantomData,
},
}
}
}