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 LPTIM4LPEN_R;
pub use SYSCFGLPEN_R as LPTIM5LPEN_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 SAI4LPEN_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 LPTIM4LPEN_W;
pub use SYSCFGLPEN_W as LPTIM5LPEN_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 SAI4LPEN_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 lptim4lpen(&self) -> LPTIM4LPEN_R {
LPTIM4LPEN_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn lptim5lpen(&self) -> LPTIM5LPEN_R {
LPTIM5LPEN_R::new(((self.bits >> 12) & 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 sai4lpen(&self) -> SAI4LPEN_R {
SAI4LPEN_R::new(((self.bits >> 21) & 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("lptim4lpen", &self.lptim4lpen())
.field("lptim5lpen", &self.lptim5lpen())
.field("comp12lpen", &self.comp12lpen())
.field("vreflpen", &self.vreflpen())
.field("rtcapblpen", &self.rtcapblpen())
.field("sai4lpen", &self.sai4lpen())
.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 lptim4lpen(&mut self) -> LPTIM4LPEN_W<APB4LPENRrs> {
LPTIM4LPEN_W::new(self, 11)
}
#[inline(always)]
pub fn lptim5lpen(&mut self) -> LPTIM5LPEN_W<APB4LPENRrs> {
LPTIM5LPEN_W::new(self, 12)
}
#[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 sai4lpen(&mut self) -> SAI4LPEN_W<APB4LPENRrs> {
SAI4LPEN_W::new(self, 21)
}
}
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 {}