#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
#[cfg(not(feature = "nosync"))]
pub use crate::imxrt101::peripherals::systemcontrol::Instance;
pub use crate::imxrt101::peripherals::systemcontrol::{RegisterBlock, ResetValues};
pub use crate::imxrt101::peripherals::systemcontrol::{
ACTLR, AIRCR, BFAR, CCR, CCSIDR, CFSR, CLIDR, CM7_ABFSR, CM7_AHBPCR, CM7_AHBSCR, CM7_CACR,
CM7_DTCMCR, CM7_ITCMCR, CPACR, CPUID, CSSELR, CTR, DCCIMVAC, DCCISW, DCCMVAC, DCCMVAU, DCCSW,
DCIMVAC, DCISW, DFSR, HFSR, ICIALLU, ICIMVAU, ICSR, ID_AFR0, ID_DFR0, ID_ISAR0, ID_ISAR1,
ID_ISAR2, ID_ISAR3, ID_ISAR4, ID_MMFR0, ID_MMFR1, ID_MMFR2, ID_MMFR3, ID_PFR0, ID_PFR1, MMFAR,
SCR, SHCSR, SHPR1, SHPR2, SHPR3, STIR, VTOR,
};
pub mod SystemControl {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0xe000e000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
ACTLR: 0x00000000,
CPUID: 0x410FC240,
ICSR: 0x00000000,
VTOR: 0x00000000,
AIRCR: 0xFA050000,
SCR: 0x00000000,
CCR: 0x00040000,
SHPR1: 0x00000000,
SHPR2: 0x00000000,
SHPR3: 0x00000000,
SHCSR: 0x00000000,
CFSR: 0x00000000,
HFSR: 0x00000000,
DFSR: 0x00000000,
MMFAR: 0x00000000,
BFAR: 0x00000000,
ID_PFR0: 0x00000000,
ID_PFR1: 0x00000000,
ID_DFR0: 0x00000000,
ID_AFR0: 0x00000000,
ID_MMFR0: 0x00000000,
ID_MMFR1: 0x00000000,
ID_MMFR2: 0x00000000,
ID_MMFR3: 0x00000000,
ID_ISAR0: 0x00000000,
ID_ISAR1: 0x00000000,
ID_ISAR2: 0x00000000,
ID_ISAR3: 0x00000000,
ID_ISAR4: 0x00000000,
CLIDR: 0x00000000,
CTR: 0x8000C000,
CCSIDR: 0x00000000,
CSSELR: 0x00000000,
CPACR: 0x00000000,
STIR: 0x00000000,
ICIALLU: 0x00000000,
ICIMVAU: 0x00000000,
DCIMVAC: 0x00000000,
DCISW: 0x00000000,
DCCMVAU: 0x00000000,
DCCMVAC: 0x00000000,
DCCSW: 0x00000000,
DCCIMVAC: 0x00000000,
DCCISW: 0x00000000,
CM7_ITCMCR: 0x00000000,
CM7_DTCMCR: 0x00000000,
CM7_AHBPCR: 0x00000000,
CM7_CACR: 0x00000000,
CM7_AHBSCR: 0x00000000,
CM7_ABFSR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SystemControl_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SystemControl_TAKEN {
None
} else {
SystemControl_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SystemControl_TAKEN && inst.addr == INSTANCE.addr {
SystemControl_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SystemControl_TAKEN = true;
INSTANCE
}
}
pub const SystemControl: *const RegisterBlock = 0xe000e000 as *const _;