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 SBSLPEN {
Disabled = 0,
Enabled = 1,
}
impl From<SBSLPEN> for bool {
#[inline(always)]
fn from(variant: SBSLPEN) -> Self {
variant as u8 != 0
}
}
pub type SBSLPEN_R = crate::BitReader<SBSLPEN>;
impl SBSLPEN_R {
#[inline(always)]
pub const fn variant(&self) -> SBSLPEN {
match self.bits {
false => SBSLPEN::Disabled,
true => SBSLPEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SBSLPEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SBSLPEN::Enabled
}
}
pub type SBSLPEN_W<'a, REG> = crate::BitWriter<'a, REG, SBSLPEN>;
impl<'a, REG> SBSLPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SBSLPEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SBSLPEN::Enabled)
}
}
pub use SBSLPEN_R as LPUART1LPEN_R;
pub use SBSLPEN_R as SPI6LPEN_R;
pub use SBSLPEN_R as LPTIM2LPEN_R;
pub use SBSLPEN_R as LPTIM3LPEN_R;
pub use SBSLPEN_R as LPTIM4LPEN_R;
pub use SBSLPEN_R as LPTIM5LPEN_R;
pub use SBSLPEN_R as VREFLPEN_R;
pub use SBSLPEN_R as RTCAPBLPEN_R;
pub use SBSLPEN_R as TMPSENSLPEN_R;
pub use SBSLPEN_W as LPUART1LPEN_W;
pub use SBSLPEN_W as SPI6LPEN_W;
pub use SBSLPEN_W as LPTIM2LPEN_W;
pub use SBSLPEN_W as LPTIM3LPEN_W;
pub use SBSLPEN_W as LPTIM4LPEN_W;
pub use SBSLPEN_W as LPTIM5LPEN_W;
pub use SBSLPEN_W as VREFLPEN_W;
pub use SBSLPEN_W as RTCAPBLPEN_W;
pub use SBSLPEN_W as TMPSENSLPEN_W;
impl R {
#[inline(always)]
pub fn sbslpen(&self) -> SBSLPEN_R {
SBSLPEN_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 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 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 tmpsenslpen(&self) -> TMPSENSLPEN_R {
TMPSENSLPEN_R::new(((self.bits >> 26) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("APB4LPENR")
.field("sbslpen", &self.sbslpen())
.field("lpuart1lpen", &self.lpuart1lpen())
.field("spi6lpen", &self.spi6lpen())
.field("lptim2lpen", &self.lptim2lpen())
.field("lptim3lpen", &self.lptim3lpen())
.field("lptim4lpen", &self.lptim4lpen())
.field("lptim5lpen", &self.lptim5lpen())
.field("vreflpen", &self.vreflpen())
.field("rtcapblpen", &self.rtcapblpen())
.field("tmpsenslpen", &self.tmpsenslpen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn sbslpen(&mut self) -> SBSLPEN_W<APB4LPENRrs> {
SBSLPEN_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 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 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 tmpsenslpen(&mut self) -> TMPSENSLPEN_W<APB4LPENRrs> {
TMPSENSLPEN_W::new(self, 26)
}
}
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 = 0x0401_9e2a;
}