#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
#[cfg(not(feature = "nosync"))]
pub use crate::imxrt101::peripherals::snvs::Instance;
pub use crate::imxrt101::peripherals::snvs::{
LPGPR0_legacy_alias, LPGPR_alias0, LPGPR_alias1, LPGPR_alias2, LPGPR_alias3, HPCOMR, HPCR,
HPHACIVR, HPHACR, HPLR, HPRTCLR, HPRTCMR, HPSICR, HPSR, HPSVCR, HPSVSR, HPTALR, HPTAMR,
HPVIDR1, HPVIDR2, LPCR, LPGPR0, LPGPR1, LPGPR2, LPGPR3, LPLR, LPMKCR, LPPGDR, LPSMCLR, LPSMCMR,
LPSR, LPSRTCLR, LPSRTCMR, LPSVCR, LPTAR, LPTDCR, LPZMKR0, LPZMKR1, LPZMKR2, LPZMKR3, LPZMKR4,
LPZMKR5, LPZMKR6, LPZMKR7,
};
pub use crate::imxrt101::peripherals::snvs::{RegisterBlock, ResetValues};
pub mod SNVS {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x400d4000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
HPLR: 0x00000000,
HPCOMR: 0x00000000,
HPCR: 0x00000000,
HPSICR: 0x00000000,
HPSVCR: 0x00000000,
HPSR: 0x80003000,
HPSVSR: 0x80000000,
HPHACIVR: 0x00000000,
HPHACR: 0x00000000,
HPRTCMR: 0x00000000,
HPRTCLR: 0x00000000,
HPTAMR: 0x00000000,
HPTALR: 0x00000000,
LPLR: 0x00000000,
LPCR: 0x00000020,
LPMKCR: 0x00000000,
LPSVCR: 0x00000000,
LPTDCR: 0x00000000,
LPSR: 0x00000008,
LPSRTCMR: 0x00000000,
LPSRTCLR: 0x00000000,
LPTAR: 0x00000000,
LPSMCMR: 0x00000000,
LPSMCLR: 0x00000000,
LPPGDR: 0x00000000,
LPGPR0_legacy_alias: 0x00000000,
LPZMKR0: 0x00000000,
LPZMKR1: 0x00000000,
LPZMKR2: 0x00000000,
LPZMKR3: 0x00000000,
LPZMKR4: 0x00000000,
LPZMKR5: 0x00000000,
LPZMKR6: 0x00000000,
LPZMKR7: 0x00000000,
LPGPR_alias0: 0x00000000,
LPGPR_alias1: 0x00000000,
LPGPR_alias2: 0x00000000,
LPGPR_alias3: 0x00000000,
LPGPR0: 0x00000000,
LPGPR1: 0x00000000,
LPGPR2: 0x00000000,
LPGPR3: 0x00000000,
HPVIDR1: 0x003E0104,
HPVIDR2: 0x06000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SNVS_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SNVS_TAKEN {
None
} else {
SNVS_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SNVS_TAKEN && inst.addr == INSTANCE.addr {
SNVS_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SNVS_TAKEN = true;
INSTANCE
}
}
pub const SNVS: *const RegisterBlock = 0x400d4000 as *const _;