pub type R = crate::R<AHB2LPENRrs>;
pub type W = crate::W<AHB2LPENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DCMILPEN {
DisabledInSleep = 0,
EnabledInSleep = 1,
}
impl From<DCMILPEN> for bool {
#[inline(always)]
fn from(variant: DCMILPEN) -> Self {
variant as u8 != 0
}
}
pub type DCMILPEN_R = crate::BitReader<DCMILPEN>;
impl DCMILPEN_R {
#[inline(always)]
pub const fn variant(&self) -> DCMILPEN {
match self.bits {
false => DCMILPEN::DisabledInSleep,
true => DCMILPEN::EnabledInSleep,
}
}
#[inline(always)]
pub fn is_disabled_in_sleep(&self) -> bool {
*self == DCMILPEN::DisabledInSleep
}
#[inline(always)]
pub fn is_enabled_in_sleep(&self) -> bool {
*self == DCMILPEN::EnabledInSleep
}
}
pub type DCMILPEN_W<'a, REG> = crate::BitWriter<'a, REG, DCMILPEN>;
impl<'a, REG> DCMILPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled_in_sleep(self) -> &'a mut crate::W<REG> {
self.variant(DCMILPEN::DisabledInSleep)
}
#[inline(always)]
pub fn enabled_in_sleep(self) -> &'a mut crate::W<REG> {
self.variant(DCMILPEN::EnabledInSleep)
}
}
pub use DCMILPEN_R as JPEGLPEN_R;
pub use DCMILPEN_R as CRYPLPEN_R;
pub use DCMILPEN_R as HASHLPEN_R;
pub use DCMILPEN_R as RNGLPEN_R;
pub use DCMILPEN_R as OTGFSLPEN_R;
pub use DCMILPEN_W as JPEGLPEN_W;
pub use DCMILPEN_W as CRYPLPEN_W;
pub use DCMILPEN_W as HASHLPEN_W;
pub use DCMILPEN_W as RNGLPEN_W;
pub use DCMILPEN_W as OTGFSLPEN_W;
impl R {
#[inline(always)]
pub fn dcmilpen(&self) -> DCMILPEN_R {
DCMILPEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn jpeglpen(&self) -> JPEGLPEN_R {
JPEGLPEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn cryplpen(&self) -> CRYPLPEN_R {
CRYPLPEN_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn hashlpen(&self) -> HASHLPEN_R {
HASHLPEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn rnglpen(&self) -> RNGLPEN_R {
RNGLPEN_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn otgfslpen(&self) -> OTGFSLPEN_R {
OTGFSLPEN_R::new(((self.bits >> 7) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHB2LPENR")
.field("dcmilpen", &self.dcmilpen())
.field("otgfslpen", &self.otgfslpen())
.field("rnglpen", &self.rnglpen())
.field("hashlpen", &self.hashlpen())
.field("cryplpen", &self.cryplpen())
.field("jpeglpen", &self.jpeglpen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dcmilpen(&mut self) -> DCMILPEN_W<AHB2LPENRrs> {
DCMILPEN_W::new(self, 0)
}
#[inline(always)]
pub fn jpeglpen(&mut self) -> JPEGLPEN_W<AHB2LPENRrs> {
JPEGLPEN_W::new(self, 1)
}
#[inline(always)]
pub fn cryplpen(&mut self) -> CRYPLPEN_W<AHB2LPENRrs> {
CRYPLPEN_W::new(self, 4)
}
#[inline(always)]
pub fn hashlpen(&mut self) -> HASHLPEN_W<AHB2LPENRrs> {
HASHLPEN_W::new(self, 5)
}
#[inline(always)]
pub fn rnglpen(&mut self) -> RNGLPEN_W<AHB2LPENRrs> {
RNGLPEN_W::new(self, 6)
}
#[inline(always)]
pub fn otgfslpen(&mut self) -> OTGFSLPEN_W<AHB2LPENRrs> {
OTGFSLPEN_W::new(self, 7)
}
}
pub struct AHB2LPENRrs;
impl crate::RegisterSpec for AHB2LPENRrs {
type Ux = u32;
}
impl crate::Readable for AHB2LPENRrs {}
impl crate::Writable for AHB2LPENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHB2LPENRrs {
const RESET_VALUE: u32 = 0xf1;
}