#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
#[cfg(not(feature = "nosync"))]
pub use crate::imxrt105::peripherals::enc::Instance;
pub use crate::imxrt105::peripherals::enc::{RegisterBlock, ResetValues};
pub use crate::imxrt105::peripherals::enc::{
CTRL, CTRL2, FILT, IMR, LCOMP, LINIT, LMOD, LPOS, LPOSH, POSD, POSDH, REV, REVH, TST, UCOMP,
UINIT, UMOD, UPOS, UPOSH, WTR,
};
pub mod ENC1 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x403c8000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CTRL: 0x00000000,
FILT: 0x00000000,
WTR: 0x00000000,
POSD: 0x00000000,
POSDH: 0x00000000,
REV: 0x00000000,
REVH: 0x00000000,
UPOS: 0x00000000,
LPOS: 0x00000000,
UPOSH: 0x00000000,
LPOSH: 0x00000000,
UINIT: 0x00000000,
LINIT: 0x00000000,
IMR: 0x00000000,
TST: 0x00000000,
CTRL2: 0x00000000,
UMOD: 0x00000000,
LMOD: 0x00000000,
UCOMP: 0x0000FFFF,
LCOMP: 0x0000FFFF,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut ENC1_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if ENC1_TAKEN {
None
} else {
ENC1_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if ENC1_TAKEN && inst.addr == INSTANCE.addr {
ENC1_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
ENC1_TAKEN = true;
INSTANCE
}
}
pub const ENC1: *const RegisterBlock = 0x403c8000 as *const _;
pub mod ENC2 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x403cc000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CTRL: 0x00000000,
FILT: 0x00000000,
WTR: 0x00000000,
POSD: 0x00000000,
POSDH: 0x00000000,
REV: 0x00000000,
REVH: 0x00000000,
UPOS: 0x00000000,
LPOS: 0x00000000,
UPOSH: 0x00000000,
LPOSH: 0x00000000,
UINIT: 0x00000000,
LINIT: 0x00000000,
IMR: 0x00000000,
TST: 0x00000000,
CTRL2: 0x00000000,
UMOD: 0x00000000,
LMOD: 0x00000000,
UCOMP: 0x0000FFFF,
LCOMP: 0x0000FFFF,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut ENC2_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if ENC2_TAKEN {
None
} else {
ENC2_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if ENC2_TAKEN && inst.addr == INSTANCE.addr {
ENC2_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
ENC2_TAKEN = true;
INSTANCE
}
}
pub const ENC2: *const RegisterBlock = 0x403cc000 as *const _;
pub mod ENC3 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x403d0000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CTRL: 0x00000000,
FILT: 0x00000000,
WTR: 0x00000000,
POSD: 0x00000000,
POSDH: 0x00000000,
REV: 0x00000000,
REVH: 0x00000000,
UPOS: 0x00000000,
LPOS: 0x00000000,
UPOSH: 0x00000000,
LPOSH: 0x00000000,
UINIT: 0x00000000,
LINIT: 0x00000000,
IMR: 0x00000000,
TST: 0x00000000,
CTRL2: 0x00000000,
UMOD: 0x00000000,
LMOD: 0x00000000,
UCOMP: 0x0000FFFF,
LCOMP: 0x0000FFFF,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut ENC3_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if ENC3_TAKEN {
None
} else {
ENC3_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if ENC3_TAKEN && inst.addr == INSTANCE.addr {
ENC3_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
ENC3_TAKEN = true;
INSTANCE
}
}
pub const ENC3: *const RegisterBlock = 0x403d0000 as *const _;
pub mod ENC4 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x403d4000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CTRL: 0x00000000,
FILT: 0x00000000,
WTR: 0x00000000,
POSD: 0x00000000,
POSDH: 0x00000000,
REV: 0x00000000,
REVH: 0x00000000,
UPOS: 0x00000000,
LPOS: 0x00000000,
UPOSH: 0x00000000,
LPOSH: 0x00000000,
UINIT: 0x00000000,
LINIT: 0x00000000,
IMR: 0x00000000,
TST: 0x00000000,
CTRL2: 0x00000000,
UMOD: 0x00000000,
LMOD: 0x00000000,
UCOMP: 0x0000FFFF,
LCOMP: 0x0000FFFF,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut ENC4_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if ENC4_TAKEN {
None
} else {
ENC4_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if ENC4_TAKEN && inst.addr == INSTANCE.addr {
ENC4_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
ENC4_TAKEN = true;
INSTANCE
}
}
pub const ENC4: *const RegisterBlock = 0x403d4000 as *const _;