pub type R = crate::R<APB1LPENRrs>;
pub type W = crate::W<APB1LPENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TIM2LPEN {
DisabledInSleep = 0,
EnabledInSleep = 1,
}
impl From<TIM2LPEN> for bool {
#[inline(always)]
fn from(variant: TIM2LPEN) -> Self {
variant as u8 != 0
}
}
pub type TIM2LPEN_R = crate::BitReader<TIM2LPEN>;
impl TIM2LPEN_R {
#[inline(always)]
pub const fn variant(&self) -> TIM2LPEN {
match self.bits {
false => TIM2LPEN::DisabledInSleep,
true => TIM2LPEN::EnabledInSleep,
}
}
#[inline(always)]
pub fn is_disabled_in_sleep(&self) -> bool {
*self == TIM2LPEN::DisabledInSleep
}
#[inline(always)]
pub fn is_enabled_in_sleep(&self) -> bool {
*self == TIM2LPEN::EnabledInSleep
}
}
pub type TIM2LPEN_W<'a, REG> = crate::BitWriter<'a, REG, TIM2LPEN>;
impl<'a, REG> TIM2LPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled_in_sleep(self) -> &'a mut crate::W<REG> {
self.variant(TIM2LPEN::DisabledInSleep)
}
#[inline(always)]
pub fn enabled_in_sleep(self) -> &'a mut crate::W<REG> {
self.variant(TIM2LPEN::EnabledInSleep)
}
}
pub use TIM2LPEN_R as TIM3LPEN_R;
pub use TIM2LPEN_R as TIM4LPEN_R;
pub use TIM2LPEN_R as TIM5LPEN_R;
pub use TIM2LPEN_R as TIM6LPEN_R;
pub use TIM2LPEN_R as TIM7LPEN_R;
pub use TIM2LPEN_R as TIM12LPEN_R;
pub use TIM2LPEN_R as TIM13LPEN_R;
pub use TIM2LPEN_R as TIM14LPEN_R;
pub use TIM2LPEN_R as LPTIM1LPEN_R;
pub use TIM2LPEN_R as WWDGLPEN_R;
pub use TIM2LPEN_R as CAN3LPEN_R;
pub use TIM2LPEN_R as SPI2LPEN_R;
pub use TIM2LPEN_R as SPI3LPEN_R;
pub use TIM2LPEN_R as SPDIFRXLPEN_R;
pub use TIM2LPEN_R as USART2LPEN_R;
pub use TIM2LPEN_R as USART3LPEN_R;
pub use TIM2LPEN_R as UART4LPEN_R;
pub use TIM2LPEN_R as UART5LPEN_R;
pub use TIM2LPEN_R as I2C1LPEN_R;
pub use TIM2LPEN_R as I2C2LPEN_R;
pub use TIM2LPEN_R as I2C3LPEN_R;
pub use TIM2LPEN_R as I2C4LPEN_R;
pub use TIM2LPEN_R as CAN1LPEN_R;
pub use TIM2LPEN_R as CAN2LPEN_R;
pub use TIM2LPEN_R as CECLPEN_R;
pub use TIM2LPEN_R as PWRLPEN_R;
pub use TIM2LPEN_R as DACLPEN_R;
pub use TIM2LPEN_R as UART7LPEN_R;
pub use TIM2LPEN_R as UART8LPEN_R;
pub use TIM2LPEN_W as TIM3LPEN_W;
pub use TIM2LPEN_W as TIM4LPEN_W;
pub use TIM2LPEN_W as TIM5LPEN_W;
pub use TIM2LPEN_W as TIM6LPEN_W;
pub use TIM2LPEN_W as TIM7LPEN_W;
pub use TIM2LPEN_W as TIM12LPEN_W;
pub use TIM2LPEN_W as TIM13LPEN_W;
pub use TIM2LPEN_W as TIM14LPEN_W;
pub use TIM2LPEN_W as LPTIM1LPEN_W;
pub use TIM2LPEN_W as WWDGLPEN_W;
pub use TIM2LPEN_W as CAN3LPEN_W;
pub use TIM2LPEN_W as SPI2LPEN_W;
pub use TIM2LPEN_W as SPI3LPEN_W;
pub use TIM2LPEN_W as SPDIFRXLPEN_W;
pub use TIM2LPEN_W as USART2LPEN_W;
pub use TIM2LPEN_W as USART3LPEN_W;
pub use TIM2LPEN_W as UART4LPEN_W;
pub use TIM2LPEN_W as UART5LPEN_W;
pub use TIM2LPEN_W as I2C1LPEN_W;
pub use TIM2LPEN_W as I2C2LPEN_W;
pub use TIM2LPEN_W as I2C3LPEN_W;
pub use TIM2LPEN_W as I2C4LPEN_W;
pub use TIM2LPEN_W as CAN1LPEN_W;
pub use TIM2LPEN_W as CAN2LPEN_W;
pub use TIM2LPEN_W as CECLPEN_W;
pub use TIM2LPEN_W as PWRLPEN_W;
pub use TIM2LPEN_W as DACLPEN_W;
pub use TIM2LPEN_W as UART7LPEN_W;
pub use TIM2LPEN_W as UART8LPEN_W;
impl R {
#[inline(always)]
pub fn tim2lpen(&self) -> TIM2LPEN_R {
TIM2LPEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn tim3lpen(&self) -> TIM3LPEN_R {
TIM3LPEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn tim4lpen(&self) -> TIM4LPEN_R {
TIM4LPEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn tim5lpen(&self) -> TIM5LPEN_R {
TIM5LPEN_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn tim6lpen(&self) -> TIM6LPEN_R {
TIM6LPEN_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn tim7lpen(&self) -> TIM7LPEN_R {
TIM7LPEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn tim12lpen(&self) -> TIM12LPEN_R {
TIM12LPEN_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn tim13lpen(&self) -> TIM13LPEN_R {
TIM13LPEN_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn tim14lpen(&self) -> TIM14LPEN_R {
TIM14LPEN_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn lptim1lpen(&self) -> LPTIM1LPEN_R {
LPTIM1LPEN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn wwdglpen(&self) -> WWDGLPEN_R {
WWDGLPEN_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn can3lpen(&self) -> CAN3LPEN_R {
CAN3LPEN_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn spi2lpen(&self) -> SPI2LPEN_R {
SPI2LPEN_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn spi3lpen(&self) -> SPI3LPEN_R {
SPI3LPEN_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn spdifrxlpen(&self) -> SPDIFRXLPEN_R {
SPDIFRXLPEN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn usart2lpen(&self) -> USART2LPEN_R {
USART2LPEN_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn usart3lpen(&self) -> USART3LPEN_R {
USART3LPEN_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn uart4lpen(&self) -> UART4LPEN_R {
UART4LPEN_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn uart5lpen(&self) -> UART5LPEN_R {
UART5LPEN_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn i2c1lpen(&self) -> I2C1LPEN_R {
I2C1LPEN_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn i2c2lpen(&self) -> I2C2LPEN_R {
I2C2LPEN_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn i2c3lpen(&self) -> I2C3LPEN_R {
I2C3LPEN_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn i2c4lpen(&self) -> I2C4LPEN_R {
I2C4LPEN_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn can1lpen(&self) -> CAN1LPEN_R {
CAN1LPEN_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn can2lpen(&self) -> CAN2LPEN_R {
CAN2LPEN_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn ceclpen(&self) -> CECLPEN_R {
CECLPEN_R::new(((self.bits >> 27) & 1) != 0)
}
#[inline(always)]
pub fn pwrlpen(&self) -> PWRLPEN_R {
PWRLPEN_R::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn daclpen(&self) -> DACLPEN_R {
DACLPEN_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn uart7lpen(&self) -> UART7LPEN_R {
UART7LPEN_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn uart8lpen(&self) -> UART8LPEN_R {
UART8LPEN_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("APB1LPENR")
.field("tim2lpen", &self.tim2lpen())
.field("tim3lpen", &self.tim3lpen())
.field("tim4lpen", &self.tim4lpen())
.field("tim5lpen", &self.tim5lpen())
.field("tim6lpen", &self.tim6lpen())
.field("tim7lpen", &self.tim7lpen())
.field("tim12lpen", &self.tim12lpen())
.field("tim13lpen", &self.tim13lpen())
.field("tim14lpen", &self.tim14lpen())
.field("wwdglpen", &self.wwdglpen())
.field("spi2lpen", &self.spi2lpen())
.field("spi3lpen", &self.spi3lpen())
.field("usart2lpen", &self.usart2lpen())
.field("usart3lpen", &self.usart3lpen())
.field("uart4lpen", &self.uart4lpen())
.field("uart5lpen", &self.uart5lpen())
.field("i2c1lpen", &self.i2c1lpen())
.field("i2c2lpen", &self.i2c2lpen())
.field("i2c3lpen", &self.i2c3lpen())
.field("can1lpen", &self.can1lpen())
.field("can2lpen", &self.can2lpen())
.field("pwrlpen", &self.pwrlpen())
.field("daclpen", &self.daclpen())
.field("uart7lpen", &self.uart7lpen())
.field("uart8lpen", &self.uart8lpen())
.field("spdifrxlpen", &self.spdifrxlpen())
.field("ceclpen", &self.ceclpen())
.field("lptim1lpen", &self.lptim1lpen())
.field("i2c4lpen", &self.i2c4lpen())
.field("can3lpen", &self.can3lpen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn tim2lpen(&mut self) -> TIM2LPEN_W<APB1LPENRrs> {
TIM2LPEN_W::new(self, 0)
}
#[inline(always)]
pub fn tim3lpen(&mut self) -> TIM3LPEN_W<APB1LPENRrs> {
TIM3LPEN_W::new(self, 1)
}
#[inline(always)]
pub fn tim4lpen(&mut self) -> TIM4LPEN_W<APB1LPENRrs> {
TIM4LPEN_W::new(self, 2)
}
#[inline(always)]
pub fn tim5lpen(&mut self) -> TIM5LPEN_W<APB1LPENRrs> {
TIM5LPEN_W::new(self, 3)
}
#[inline(always)]
pub fn tim6lpen(&mut self) -> TIM6LPEN_W<APB1LPENRrs> {
TIM6LPEN_W::new(self, 4)
}
#[inline(always)]
pub fn tim7lpen(&mut self) -> TIM7LPEN_W<APB1LPENRrs> {
TIM7LPEN_W::new(self, 5)
}
#[inline(always)]
pub fn tim12lpen(&mut self) -> TIM12LPEN_W<APB1LPENRrs> {
TIM12LPEN_W::new(self, 6)
}
#[inline(always)]
pub fn tim13lpen(&mut self) -> TIM13LPEN_W<APB1LPENRrs> {
TIM13LPEN_W::new(self, 7)
}
#[inline(always)]
pub fn tim14lpen(&mut self) -> TIM14LPEN_W<APB1LPENRrs> {
TIM14LPEN_W::new(self, 8)
}
#[inline(always)]
pub fn lptim1lpen(&mut self) -> LPTIM1LPEN_W<APB1LPENRrs> {
LPTIM1LPEN_W::new(self, 9)
}
#[inline(always)]
pub fn wwdglpen(&mut self) -> WWDGLPEN_W<APB1LPENRrs> {
WWDGLPEN_W::new(self, 11)
}
#[inline(always)]
pub fn can3lpen(&mut self) -> CAN3LPEN_W<APB1LPENRrs> {
CAN3LPEN_W::new(self, 13)
}
#[inline(always)]
pub fn spi2lpen(&mut self) -> SPI2LPEN_W<APB1LPENRrs> {
SPI2LPEN_W::new(self, 14)
}
#[inline(always)]
pub fn spi3lpen(&mut self) -> SPI3LPEN_W<APB1LPENRrs> {
SPI3LPEN_W::new(self, 15)
}
#[inline(always)]
pub fn spdifrxlpen(&mut self) -> SPDIFRXLPEN_W<APB1LPENRrs> {
SPDIFRXLPEN_W::new(self, 16)
}
#[inline(always)]
pub fn usart2lpen(&mut self) -> USART2LPEN_W<APB1LPENRrs> {
USART2LPEN_W::new(self, 17)
}
#[inline(always)]
pub fn usart3lpen(&mut self) -> USART3LPEN_W<APB1LPENRrs> {
USART3LPEN_W::new(self, 18)
}
#[inline(always)]
pub fn uart4lpen(&mut self) -> UART4LPEN_W<APB1LPENRrs> {
UART4LPEN_W::new(self, 19)
}
#[inline(always)]
pub fn uart5lpen(&mut self) -> UART5LPEN_W<APB1LPENRrs> {
UART5LPEN_W::new(self, 20)
}
#[inline(always)]
pub fn i2c1lpen(&mut self) -> I2C1LPEN_W<APB1LPENRrs> {
I2C1LPEN_W::new(self, 21)
}
#[inline(always)]
pub fn i2c2lpen(&mut self) -> I2C2LPEN_W<APB1LPENRrs> {
I2C2LPEN_W::new(self, 22)
}
#[inline(always)]
pub fn i2c3lpen(&mut self) -> I2C3LPEN_W<APB1LPENRrs> {
I2C3LPEN_W::new(self, 23)
}
#[inline(always)]
pub fn i2c4lpen(&mut self) -> I2C4LPEN_W<APB1LPENRrs> {
I2C4LPEN_W::new(self, 24)
}
#[inline(always)]
pub fn can1lpen(&mut self) -> CAN1LPEN_W<APB1LPENRrs> {
CAN1LPEN_W::new(self, 25)
}
#[inline(always)]
pub fn can2lpen(&mut self) -> CAN2LPEN_W<APB1LPENRrs> {
CAN2LPEN_W::new(self, 26)
}
#[inline(always)]
pub fn ceclpen(&mut self) -> CECLPEN_W<APB1LPENRrs> {
CECLPEN_W::new(self, 27)
}
#[inline(always)]
pub fn pwrlpen(&mut self) -> PWRLPEN_W<APB1LPENRrs> {
PWRLPEN_W::new(self, 28)
}
#[inline(always)]
pub fn daclpen(&mut self) -> DACLPEN_W<APB1LPENRrs> {
DACLPEN_W::new(self, 29)
}
#[inline(always)]
pub fn uart7lpen(&mut self) -> UART7LPEN_W<APB1LPENRrs> {
UART7LPEN_W::new(self, 30)
}
#[inline(always)]
pub fn uart8lpen(&mut self) -> UART8LPEN_W<APB1LPENRrs> {
UART8LPEN_W::new(self, 31)
}
}
pub struct APB1LPENRrs;
impl crate::RegisterSpec for APB1LPENRrs {
type Ux = u32;
}
impl crate::Readable for APB1LPENRrs {}
impl crate::Writable for APB1LPENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for APB1LPENRrs {
const RESET_VALUE: u32 = 0x36fe_c9ff;
}