pub type R = crate::R<AHB3LPENRrs>;
pub type W = crate::W<AHB3LPENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FSMCLPEN {
DisabledInSleep = 0,
EnabledInSleep = 1,
}
impl From<FSMCLPEN> for bool {
#[inline(always)]
fn from(variant: FSMCLPEN) -> Self {
variant as u8 != 0
}
}
pub type FSMCLPEN_R = crate::BitReader<FSMCLPEN>;
impl FSMCLPEN_R {
#[inline(always)]
pub const fn variant(&self) -> FSMCLPEN {
match self.bits {
false => FSMCLPEN::DisabledInSleep,
true => FSMCLPEN::EnabledInSleep,
}
}
#[inline(always)]
pub fn is_disabled_in_sleep(&self) -> bool {
*self == FSMCLPEN::DisabledInSleep
}
#[inline(always)]
pub fn is_enabled_in_sleep(&self) -> bool {
*self == FSMCLPEN::EnabledInSleep
}
}
pub type FSMCLPEN_W<'a, REG> = crate::BitWriter<'a, REG, FSMCLPEN>;
impl<'a, REG> FSMCLPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled_in_sleep(self) -> &'a mut crate::W<REG> {
self.variant(FSMCLPEN::DisabledInSleep)
}
#[inline(always)]
pub fn enabled_in_sleep(self) -> &'a mut crate::W<REG> {
self.variant(FSMCLPEN::EnabledInSleep)
}
}
impl R {
#[inline(always)]
pub fn fsmclpen(&self) -> FSMCLPEN_R {
FSMCLPEN_R::new((self.bits & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHB3LPENR")
.field("fsmclpen", &self.fsmclpen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn fsmclpen(&mut self) -> FSMCLPEN_W<AHB3LPENRrs> {
FSMCLPEN_W::new(self, 0)
}
}
pub struct AHB3LPENRrs;
impl crate::RegisterSpec for AHB3LPENRrs {
type Ux = u32;
}
impl crate::Readable for AHB3LPENRrs {}
impl crate::Writable for AHB3LPENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHB3LPENRrs {
const RESET_VALUE: u32 = 0x01;
}