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 PSSILPEN {
Disabled = 0,
Enabled = 1,
}
impl From<PSSILPEN> for bool {
#[inline(always)]
fn from(variant: PSSILPEN) -> Self {
variant as u8 != 0
}
}
pub type PSSILPEN_R = crate::BitReader<PSSILPEN>;
impl PSSILPEN_R {
#[inline(always)]
pub const fn variant(&self) -> PSSILPEN {
match self.bits {
false => PSSILPEN::Disabled,
true => PSSILPEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PSSILPEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PSSILPEN::Enabled
}
}
pub type PSSILPEN_W<'a, REG> = crate::BitWriter<'a, REG, PSSILPEN>;
impl<'a, REG> PSSILPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PSSILPEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(PSSILPEN::Enabled)
}
}
pub use PSSILPEN_R as SDMMC2LPEN_R;
pub use PSSILPEN_R as CORDICLPEN_R;
pub use PSSILPEN_R as SRAM1LPEN_R;
pub use PSSILPEN_R as SRAM2LPEN_R;
pub use PSSILPEN_W as SDMMC2LPEN_W;
pub use PSSILPEN_W as CORDICLPEN_W;
pub use PSSILPEN_W as SRAM1LPEN_W;
pub use PSSILPEN_W as SRAM2LPEN_W;
impl R {
#[inline(always)]
pub fn pssilpen(&self) -> PSSILPEN_R {
PSSILPEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn sdmmc2lpen(&self) -> SDMMC2LPEN_R {
SDMMC2LPEN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn cordiclpen(&self) -> CORDICLPEN_R {
CORDICLPEN_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn sram1lpen(&self) -> SRAM1LPEN_R {
SRAM1LPEN_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn sram2lpen(&self) -> SRAM2LPEN_R {
SRAM2LPEN_R::new(((self.bits >> 30) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHB2LPENR")
.field("pssilpen", &self.pssilpen())
.field("sdmmc2lpen", &self.sdmmc2lpen())
.field("cordiclpen", &self.cordiclpen())
.field("sram1lpen", &self.sram1lpen())
.field("sram2lpen", &self.sram2lpen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn pssilpen(&mut self) -> PSSILPEN_W<AHB2LPENRrs> {
PSSILPEN_W::new(self, 1)
}
#[inline(always)]
pub fn sdmmc2lpen(&mut self) -> SDMMC2LPEN_W<AHB2LPENRrs> {
SDMMC2LPEN_W::new(self, 9)
}
#[inline(always)]
pub fn cordiclpen(&mut self) -> CORDICLPEN_W<AHB2LPENRrs> {
CORDICLPEN_W::new(self, 14)
}
#[inline(always)]
pub fn sram1lpen(&mut self) -> SRAM1LPEN_W<AHB2LPENRrs> {
SRAM1LPEN_W::new(self, 29)
}
#[inline(always)]
pub fn sram2lpen(&mut self) -> SRAM2LPEN_W<AHB2LPENRrs> {
SRAM2LPEN_W::new(self, 30)
}
}
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 = 0x6000_4202;
}