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 DCMI_PSSILPEN {
Disabled = 0,
Enabled = 1,
}
impl From<DCMI_PSSILPEN> for bool {
#[inline(always)]
fn from(variant: DCMI_PSSILPEN) -> Self {
variant as u8 != 0
}
}
pub type DCMI_PSSILPEN_R = crate::BitReader<DCMI_PSSILPEN>;
impl DCMI_PSSILPEN_R {
#[inline(always)]
pub const fn variant(&self) -> DCMI_PSSILPEN {
match self.bits {
false => DCMI_PSSILPEN::Disabled,
true => DCMI_PSSILPEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DCMI_PSSILPEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DCMI_PSSILPEN::Enabled
}
}
pub type DCMI_PSSILPEN_W<'a, REG> = crate::BitWriter<'a, REG, DCMI_PSSILPEN>;
impl<'a, REG> DCMI_PSSILPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DCMI_PSSILPEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DCMI_PSSILPEN::Enabled)
}
}
pub use DCMI_PSSILPEN_R as RNGLPEN_R;
pub use DCMI_PSSILPEN_R as SDMMC2LPEN_R;
pub use DCMI_PSSILPEN_R as DFSDMDMALPEN_R;
pub use DCMI_PSSILPEN_R as AHBSRAM1LPEN_R;
pub use DCMI_PSSILPEN_R as AHBSRAM2LPEN_R;
pub use DCMI_PSSILPEN_W as RNGLPEN_W;
pub use DCMI_PSSILPEN_W as SDMMC2LPEN_W;
pub use DCMI_PSSILPEN_W as DFSDMDMALPEN_W;
pub use DCMI_PSSILPEN_W as AHBSRAM1LPEN_W;
pub use DCMI_PSSILPEN_W as AHBSRAM2LPEN_W;
impl R {
#[inline(always)]
pub fn dcmi_pssilpen(&self) -> DCMI_PSSILPEN_R {
DCMI_PSSILPEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn rnglpen(&self) -> RNGLPEN_R {
RNGLPEN_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn sdmmc2lpen(&self) -> SDMMC2LPEN_R {
SDMMC2LPEN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn dfsdmdmalpen(&self) -> DFSDMDMALPEN_R {
DFSDMDMALPEN_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn ahbsram1lpen(&self) -> AHBSRAM1LPEN_R {
AHBSRAM1LPEN_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn ahbsram2lpen(&self) -> AHBSRAM2LPEN_R {
AHBSRAM2LPEN_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("dcmi_pssilpen", &self.dcmi_pssilpen())
.field("rnglpen", &self.rnglpen())
.field("sdmmc2lpen", &self.sdmmc2lpen())
.field("dfsdmdmalpen", &self.dfsdmdmalpen())
.field("ahbsram1lpen", &self.ahbsram1lpen())
.field("ahbsram2lpen", &self.ahbsram2lpen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dcmi_pssilpen(&mut self) -> DCMI_PSSILPEN_W<AHB2LPENRrs> {
DCMI_PSSILPEN_W::new(self, 0)
}
#[inline(always)]
pub fn rnglpen(&mut self) -> RNGLPEN_W<AHB2LPENRrs> {
RNGLPEN_W::new(self, 6)
}
#[inline(always)]
pub fn sdmmc2lpen(&mut self) -> SDMMC2LPEN_W<AHB2LPENRrs> {
SDMMC2LPEN_W::new(self, 9)
}
#[inline(always)]
pub fn dfsdmdmalpen(&mut self) -> DFSDMDMALPEN_W<AHB2LPENRrs> {
DFSDMDMALPEN_W::new(self, 11)
}
#[inline(always)]
pub fn ahbsram1lpen(&mut self) -> AHBSRAM1LPEN_W<AHB2LPENRrs> {
AHBSRAM1LPEN_W::new(self, 29)
}
#[inline(always)]
pub fn ahbsram2lpen(&mut self) -> AHBSRAM2LPEN_W<AHB2LPENRrs> {
AHBSRAM2LPEN_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_0a71;
}