#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
#[cfg(not(feature = "nosync"))]
pub use crate::imxrt106::peripherals::lpspi::Instance;
pub use crate::imxrt106::peripherals::lpspi::{RegisterBlock, ResetValues};
pub use crate::imxrt106::peripherals::lpspi::{
CCR, CFGR0, CFGR1, CR, DER, DMR0, DMR1, FCR, FSR, IER, PARAM, RDR, RSR, SR, TCR, TDR, VERID,
};
pub mod LPSPI1 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40394000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
VERID: 0x01020004,
PARAM: 0x00040404,
CR: 0x00000000,
SR: 0x00000001,
IER: 0x00000000,
DER: 0x00000000,
CFGR0: 0x00000000,
CFGR1: 0x00000000,
DMR0: 0x00000000,
DMR1: 0x00000000,
CCR: 0x00000000,
FCR: 0x00000000,
FSR: 0x00000000,
TCR: 0x0000001F,
TDR: 0x00000000,
RSR: 0x00000002,
RDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut LPSPI1_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if LPSPI1_TAKEN {
None
} else {
LPSPI1_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if LPSPI1_TAKEN && inst.addr == INSTANCE.addr {
LPSPI1_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
LPSPI1_TAKEN = true;
INSTANCE
}
}
pub const LPSPI1: *const RegisterBlock = 0x40394000 as *const _;
pub mod LPSPI2 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40398000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
VERID: 0x01020004,
PARAM: 0x00040404,
CR: 0x00000000,
SR: 0x00000001,
IER: 0x00000000,
DER: 0x00000000,
CFGR0: 0x00000000,
CFGR1: 0x00000000,
DMR0: 0x00000000,
DMR1: 0x00000000,
CCR: 0x00000000,
FCR: 0x00000000,
FSR: 0x00000000,
TCR: 0x0000001F,
TDR: 0x00000000,
RSR: 0x00000002,
RDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut LPSPI2_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if LPSPI2_TAKEN {
None
} else {
LPSPI2_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if LPSPI2_TAKEN && inst.addr == INSTANCE.addr {
LPSPI2_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
LPSPI2_TAKEN = true;
INSTANCE
}
}
pub const LPSPI2: *const RegisterBlock = 0x40398000 as *const _;
pub mod LPSPI3 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x4039c000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
VERID: 0x01020004,
PARAM: 0x00040404,
CR: 0x00000000,
SR: 0x00000001,
IER: 0x00000000,
DER: 0x00000000,
CFGR0: 0x00000000,
CFGR1: 0x00000000,
DMR0: 0x00000000,
DMR1: 0x00000000,
CCR: 0x00000000,
FCR: 0x00000000,
FSR: 0x00000000,
TCR: 0x0000001F,
TDR: 0x00000000,
RSR: 0x00000002,
RDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut LPSPI3_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if LPSPI3_TAKEN {
None
} else {
LPSPI3_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if LPSPI3_TAKEN && inst.addr == INSTANCE.addr {
LPSPI3_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
LPSPI3_TAKEN = true;
INSTANCE
}
}
pub const LPSPI3: *const RegisterBlock = 0x4039c000 as *const _;
pub mod LPSPI4 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x403a0000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
VERID: 0x01020004,
PARAM: 0x00040404,
CR: 0x00000000,
SR: 0x00000001,
IER: 0x00000000,
DER: 0x00000000,
CFGR0: 0x00000000,
CFGR1: 0x00000000,
DMR0: 0x00000000,
DMR1: 0x00000000,
CCR: 0x00000000,
FCR: 0x00000000,
FSR: 0x00000000,
TCR: 0x0000001F,
TDR: 0x00000000,
RSR: 0x00000002,
RDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut LPSPI4_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if LPSPI4_TAKEN {
None
} else {
LPSPI4_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if LPSPI4_TAKEN && inst.addr == INSTANCE.addr {
LPSPI4_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
LPSPI4_TAKEN = true;
INSTANCE
}
}
pub const LPSPI4: *const RegisterBlock = 0x403a0000 as *const _;