#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
#[cfg(not(feature = "nosync"))]
pub use crate::imxrt105::peripherals::lpi2c::Instance;
pub use crate::imxrt105::peripherals::lpi2c::{RegisterBlock, ResetValues};
pub use crate::imxrt105::peripherals::lpi2c::{
MCCR0, MCCR1, MCFGR0, MCFGR1, MCFGR2, MCFGR3, MCR, MDER, MDMR, MFCR, MFSR, MIER, MRDR, MSR,
MTDR, PARAM, SAMR, SASR, SCFGR1, SCFGR2, SCR, SDER, SIER, SRDR, SSR, STAR, STDR, VERID,
};
pub mod LPI2C1 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x403f0000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
VERID: 0x01000003,
PARAM: 0x00000202,
MCR: 0x00000000,
MSR: 0x00000001,
MIER: 0x00000000,
MDER: 0x00000000,
MCFGR0: 0x00000000,
MCFGR1: 0x00000000,
MCFGR2: 0x00000000,
MCFGR3: 0x00000000,
MDMR: 0x00000000,
MCCR0: 0x00000000,
MCCR1: 0x00000000,
MFCR: 0x00000000,
MFSR: 0x00000000,
MTDR: 0x00000000,
MRDR: 0x00004000,
SCR: 0x00000000,
SSR: 0x00000000,
SIER: 0x00000000,
SDER: 0x00000000,
SCFGR1: 0x00000000,
SCFGR2: 0x00000000,
SAMR: 0x00000000,
SASR: 0x00004000,
STAR: 0x00000000,
STDR: 0x00000000,
SRDR: 0x00004000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut LPI2C1_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if LPI2C1_TAKEN {
None
} else {
LPI2C1_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if LPI2C1_TAKEN && inst.addr == INSTANCE.addr {
LPI2C1_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
LPI2C1_TAKEN = true;
INSTANCE
}
}
pub const LPI2C1: *const RegisterBlock = 0x403f0000 as *const _;
pub mod LPI2C2 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x403f4000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
VERID: 0x01000003,
PARAM: 0x00000202,
MCR: 0x00000000,
MSR: 0x00000001,
MIER: 0x00000000,
MDER: 0x00000000,
MCFGR0: 0x00000000,
MCFGR1: 0x00000000,
MCFGR2: 0x00000000,
MCFGR3: 0x00000000,
MDMR: 0x00000000,
MCCR0: 0x00000000,
MCCR1: 0x00000000,
MFCR: 0x00000000,
MFSR: 0x00000000,
MTDR: 0x00000000,
MRDR: 0x00004000,
SCR: 0x00000000,
SSR: 0x00000000,
SIER: 0x00000000,
SDER: 0x00000000,
SCFGR1: 0x00000000,
SCFGR2: 0x00000000,
SAMR: 0x00000000,
SASR: 0x00004000,
STAR: 0x00000000,
STDR: 0x00000000,
SRDR: 0x00004000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut LPI2C2_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if LPI2C2_TAKEN {
None
} else {
LPI2C2_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if LPI2C2_TAKEN && inst.addr == INSTANCE.addr {
LPI2C2_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
LPI2C2_TAKEN = true;
INSTANCE
}
}
pub const LPI2C2: *const RegisterBlock = 0x403f4000 as *const _;
pub mod LPI2C3 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x403f8000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
VERID: 0x01000003,
PARAM: 0x00000202,
MCR: 0x00000000,
MSR: 0x00000001,
MIER: 0x00000000,
MDER: 0x00000000,
MCFGR0: 0x00000000,
MCFGR1: 0x00000000,
MCFGR2: 0x00000000,
MCFGR3: 0x00000000,
MDMR: 0x00000000,
MCCR0: 0x00000000,
MCCR1: 0x00000000,
MFCR: 0x00000000,
MFSR: 0x00000000,
MTDR: 0x00000000,
MRDR: 0x00004000,
SCR: 0x00000000,
SSR: 0x00000000,
SIER: 0x00000000,
SDER: 0x00000000,
SCFGR1: 0x00000000,
SCFGR2: 0x00000000,
SAMR: 0x00000000,
SASR: 0x00004000,
STAR: 0x00000000,
STDR: 0x00000000,
SRDR: 0x00004000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut LPI2C3_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if LPI2C3_TAKEN {
None
} else {
LPI2C3_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if LPI2C3_TAKEN && inst.addr == INSTANCE.addr {
LPI2C3_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
LPI2C3_TAKEN = true;
INSTANCE
}
}
pub const LPI2C3: *const RegisterBlock = 0x403f8000 as *const _;
pub mod LPI2C4 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x403fc000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
VERID: 0x01000003,
PARAM: 0x00000202,
MCR: 0x00000000,
MSR: 0x00000001,
MIER: 0x00000000,
MDER: 0x00000000,
MCFGR0: 0x00000000,
MCFGR1: 0x00000000,
MCFGR2: 0x00000000,
MCFGR3: 0x00000000,
MDMR: 0x00000000,
MCCR0: 0x00000000,
MCCR1: 0x00000000,
MFCR: 0x00000000,
MFSR: 0x00000000,
MTDR: 0x00000000,
MRDR: 0x00004000,
SCR: 0x00000000,
SSR: 0x00000000,
SIER: 0x00000000,
SDER: 0x00000000,
SCFGR1: 0x00000000,
SCFGR2: 0x00000000,
SAMR: 0x00000000,
SASR: 0x00004000,
STAR: 0x00000000,
STDR: 0x00000000,
SRDR: 0x00004000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut LPI2C4_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if LPI2C4_TAKEN {
None
} else {
LPI2C4_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if LPI2C4_TAKEN && inst.addr == INSTANCE.addr {
LPI2C4_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
LPI2C4_TAKEN = true;
INSTANCE
}
}
pub const LPI2C4: *const RegisterBlock = 0x403fc000 as *const _;