pub type R = crate::R<APB4LPENRrs>;
pub type W = crate::W<APB4LPENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SYSCFGLPEN {
Disabled = 0,
Enabled = 1,
}
impl From<SYSCFGLPEN> for bool {
#[inline(always)]
fn from(variant: SYSCFGLPEN) -> Self {
variant as u8 != 0
}
}
pub type SYSCFGLPEN_R = crate::BitReader<SYSCFGLPEN>;
impl SYSCFGLPEN_R {
#[inline(always)]
pub const fn variant(&self) -> SYSCFGLPEN {
match self.bits {
false => SYSCFGLPEN::Disabled,
true => SYSCFGLPEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SYSCFGLPEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SYSCFGLPEN::Enabled
}
}
pub type SYSCFGLPEN_W<'a, REG> = crate::BitWriter<'a, REG, SYSCFGLPEN>;
impl<'a, REG> SYSCFGLPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SYSCFGLPEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SYSCFGLPEN::Enabled)
}
}
pub use SYSCFGLPEN_R as LPUART1LPEN_R;
pub use SYSCFGLPEN_R as SPI6LPEN_R;
pub use SYSCFGLPEN_R as I2C4LPEN_R;
pub use SYSCFGLPEN_R as LPTIM2LPEN_R;
pub use SYSCFGLPEN_R as LPTIM3LPEN_R;
pub use SYSCFGLPEN_R as DAC2LPEN_R;
pub use SYSCFGLPEN_R as COMP12LPEN_R;
pub use SYSCFGLPEN_R as VREFLPEN_R;
pub use SYSCFGLPEN_R as RTCAPBLPEN_R;
pub use SYSCFGLPEN_R as DTSLPEN_R;
pub use SYSCFGLPEN_R as DFSDM2LPEN_R;
pub use SYSCFGLPEN_W as LPUART1LPEN_W;
pub use SYSCFGLPEN_W as SPI6LPEN_W;
pub use SYSCFGLPEN_W as I2C4LPEN_W;
pub use SYSCFGLPEN_W as LPTIM2LPEN_W;
pub use SYSCFGLPEN_W as LPTIM3LPEN_W;
pub use SYSCFGLPEN_W as DAC2LPEN_W;
pub use SYSCFGLPEN_W as COMP12LPEN_W;
pub use SYSCFGLPEN_W as VREFLPEN_W;
pub use SYSCFGLPEN_W as RTCAPBLPEN_W;
pub use SYSCFGLPEN_W as DTSLPEN_W;
pub use SYSCFGLPEN_W as DFSDM2LPEN_W;
impl R {
#[inline(always)]
pub fn syscfglpen(&self) -> SYSCFGLPEN_R {
SYSCFGLPEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn lpuart1lpen(&self) -> LPUART1LPEN_R {
LPUART1LPEN_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn spi6lpen(&self) -> SPI6LPEN_R {
SPI6LPEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn i2c4lpen(&self) -> I2C4LPEN_R {
I2C4LPEN_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn lptim2lpen(&self) -> LPTIM2LPEN_R {
LPTIM2LPEN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn lptim3lpen(&self) -> LPTIM3LPEN_R {
LPTIM3LPEN_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn dac2lpen(&self) -> DAC2LPEN_R {
DAC2LPEN_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn comp12lpen(&self) -> COMP12LPEN_R {
COMP12LPEN_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn vreflpen(&self) -> VREFLPEN_R {
VREFLPEN_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn rtcapblpen(&self) -> RTCAPBLPEN_R {
RTCAPBLPEN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn dtslpen(&self) -> DTSLPEN_R {
DTSLPEN_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn dfsdm2lpen(&self) -> DFSDM2LPEN_R {
DFSDM2LPEN_R::new(((self.bits >> 27) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("APB4LPENR")
.field("syscfglpen", &self.syscfglpen())
.field("lpuart1lpen", &self.lpuart1lpen())
.field("spi6lpen", &self.spi6lpen())
.field("i2c4lpen", &self.i2c4lpen())
.field("lptim2lpen", &self.lptim2lpen())
.field("lptim3lpen", &self.lptim3lpen())
.field("dac2lpen", &self.dac2lpen())
.field("comp12lpen", &self.comp12lpen())
.field("vreflpen", &self.vreflpen())
.field("rtcapblpen", &self.rtcapblpen())
.field("dtslpen", &self.dtslpen())
.field("dfsdm2lpen", &self.dfsdm2lpen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn syscfglpen(&mut self) -> SYSCFGLPEN_W<APB4LPENRrs> {
SYSCFGLPEN_W::new(self, 1)
}
#[inline(always)]
pub fn lpuart1lpen(&mut self) -> LPUART1LPEN_W<APB4LPENRrs> {
LPUART1LPEN_W::new(self, 3)
}
#[inline(always)]
pub fn spi6lpen(&mut self) -> SPI6LPEN_W<APB4LPENRrs> {
SPI6LPEN_W::new(self, 5)
}
#[inline(always)]
pub fn i2c4lpen(&mut self) -> I2C4LPEN_W<APB4LPENRrs> {
I2C4LPEN_W::new(self, 7)
}
#[inline(always)]
pub fn lptim2lpen(&mut self) -> LPTIM2LPEN_W<APB4LPENRrs> {
LPTIM2LPEN_W::new(self, 9)
}
#[inline(always)]
pub fn lptim3lpen(&mut self) -> LPTIM3LPEN_W<APB4LPENRrs> {
LPTIM3LPEN_W::new(self, 10)
}
#[inline(always)]
pub fn dac2lpen(&mut self) -> DAC2LPEN_W<APB4LPENRrs> {
DAC2LPEN_W::new(self, 13)
}
#[inline(always)]
pub fn comp12lpen(&mut self) -> COMP12LPEN_W<APB4LPENRrs> {
COMP12LPEN_W::new(self, 14)
}
#[inline(always)]
pub fn vreflpen(&mut self) -> VREFLPEN_W<APB4LPENRrs> {
VREFLPEN_W::new(self, 15)
}
#[inline(always)]
pub fn rtcapblpen(&mut self) -> RTCAPBLPEN_W<APB4LPENRrs> {
RTCAPBLPEN_W::new(self, 16)
}
#[inline(always)]
pub fn dtslpen(&mut self) -> DTSLPEN_W<APB4LPENRrs> {
DTSLPEN_W::new(self, 26)
}
#[inline(always)]
pub fn dfsdm2lpen(&mut self) -> DFSDM2LPEN_W<APB4LPENRrs> {
DFSDM2LPEN_W::new(self, 27)
}
}
pub struct APB4LPENRrs;
impl crate::RegisterSpec for APB4LPENRrs {
type Ux = u32;
}
impl crate::Readable for APB4LPENRrs {}
impl crate::Writable for APB4LPENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for APB4LPENRrs {
const RESET_VALUE: u32 = 0x0c01_e6aa;
}