pub type R = crate::R<APB2LPENRrs>;
pub type W = crate::W<APB2LPENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TIM1LPEN {
DisabledInSleep = 0,
EnabledInSleep = 1,
}
impl From<TIM1LPEN> for bool {
#[inline(always)]
fn from(variant: TIM1LPEN) -> Self {
variant as u8 != 0
}
}
pub type TIM1LPEN_R = crate::BitReader<TIM1LPEN>;
impl TIM1LPEN_R {
#[inline(always)]
pub const fn variant(&self) -> TIM1LPEN {
match self.bits {
false => TIM1LPEN::DisabledInSleep,
true => TIM1LPEN::EnabledInSleep,
}
}
#[inline(always)]
pub fn is_disabled_in_sleep(&self) -> bool {
*self == TIM1LPEN::DisabledInSleep
}
#[inline(always)]
pub fn is_enabled_in_sleep(&self) -> bool {
*self == TIM1LPEN::EnabledInSleep
}
}
pub type TIM1LPEN_W<'a, REG> = crate::BitWriter<'a, REG, TIM1LPEN>;
impl<'a, REG> TIM1LPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled_in_sleep(self) -> &'a mut crate::W<REG> {
self.variant(TIM1LPEN::DisabledInSleep)
}
#[inline(always)]
pub fn enabled_in_sleep(self) -> &'a mut crate::W<REG> {
self.variant(TIM1LPEN::EnabledInSleep)
}
}
pub use TIM1LPEN_R as TIM8LPEN_R;
pub use TIM1LPEN_R as USART1LPEN_R;
pub use TIM1LPEN_R as USART6LPEN_R;
pub use TIM1LPEN_R as SDMMC2LPEN_R;
pub use TIM1LPEN_R as ADC1LPEN_R;
pub use TIM1LPEN_R as ADC2LPEN_R;
pub use TIM1LPEN_R as ADC3LPEN_R;
pub use TIM1LPEN_R as SDMMC1LPEN_R;
pub use TIM1LPEN_R as SPI1LPEN_R;
pub use TIM1LPEN_R as SPI4LPEN_R;
pub use TIM1LPEN_R as SYSCFGLPEN_R;
pub use TIM1LPEN_R as TIM9LPEN_R;
pub use TIM1LPEN_R as TIM10LPEN_R;
pub use TIM1LPEN_R as TIM11LPEN_R;
pub use TIM1LPEN_R as SPI5LPEN_R;
pub use TIM1LPEN_R as SPI6LPEN_R;
pub use TIM1LPEN_R as SAI1LPEN_R;
pub use TIM1LPEN_R as SAI2LPEN_R;
pub use TIM1LPEN_R as LTDCLPEN_R;
pub use TIM1LPEN_R as DSILPEN_R;
pub use TIM1LPEN_R as DFSDM1LPEN_R;
pub use TIM1LPEN_R as MDIOLPEN_R;
pub use TIM1LPEN_W as TIM8LPEN_W;
pub use TIM1LPEN_W as USART1LPEN_W;
pub use TIM1LPEN_W as USART6LPEN_W;
pub use TIM1LPEN_W as SDMMC2LPEN_W;
pub use TIM1LPEN_W as ADC1LPEN_W;
pub use TIM1LPEN_W as ADC2LPEN_W;
pub use TIM1LPEN_W as ADC3LPEN_W;
pub use TIM1LPEN_W as SDMMC1LPEN_W;
pub use TIM1LPEN_W as SPI1LPEN_W;
pub use TIM1LPEN_W as SPI4LPEN_W;
pub use TIM1LPEN_W as SYSCFGLPEN_W;
pub use TIM1LPEN_W as TIM9LPEN_W;
pub use TIM1LPEN_W as TIM10LPEN_W;
pub use TIM1LPEN_W as TIM11LPEN_W;
pub use TIM1LPEN_W as SPI5LPEN_W;
pub use TIM1LPEN_W as SPI6LPEN_W;
pub use TIM1LPEN_W as SAI1LPEN_W;
pub use TIM1LPEN_W as SAI2LPEN_W;
pub use TIM1LPEN_W as LTDCLPEN_W;
pub use TIM1LPEN_W as DSILPEN_W;
pub use TIM1LPEN_W as DFSDM1LPEN_W;
pub use TIM1LPEN_W as MDIOLPEN_W;
impl R {
#[inline(always)]
pub fn tim1lpen(&self) -> TIM1LPEN_R {
TIM1LPEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn tim8lpen(&self) -> TIM8LPEN_R {
TIM8LPEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn usart1lpen(&self) -> USART1LPEN_R {
USART1LPEN_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn usart6lpen(&self) -> USART6LPEN_R {
USART6LPEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn sdmmc2lpen(&self) -> SDMMC2LPEN_R {
SDMMC2LPEN_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn adc1lpen(&self) -> ADC1LPEN_R {
ADC1LPEN_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn adc2lpen(&self) -> ADC2LPEN_R {
ADC2LPEN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn adc3lpen(&self) -> ADC3LPEN_R {
ADC3LPEN_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn sdmmc1lpen(&self) -> SDMMC1LPEN_R {
SDMMC1LPEN_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn spi1lpen(&self) -> SPI1LPEN_R {
SPI1LPEN_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn spi4lpen(&self) -> SPI4LPEN_R {
SPI4LPEN_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn syscfglpen(&self) -> SYSCFGLPEN_R {
SYSCFGLPEN_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn tim9lpen(&self) -> TIM9LPEN_R {
TIM9LPEN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn tim10lpen(&self) -> TIM10LPEN_R {
TIM10LPEN_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn tim11lpen(&self) -> TIM11LPEN_R {
TIM11LPEN_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn spi5lpen(&self) -> SPI5LPEN_R {
SPI5LPEN_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn spi6lpen(&self) -> SPI6LPEN_R {
SPI6LPEN_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn sai1lpen(&self) -> SAI1LPEN_R {
SAI1LPEN_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn sai2lpen(&self) -> SAI2LPEN_R {
SAI2LPEN_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn ltdclpen(&self) -> LTDCLPEN_R {
LTDCLPEN_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn dsilpen(&self) -> DSILPEN_R {
DSILPEN_R::new(((self.bits >> 27) & 1) != 0)
}
#[inline(always)]
pub fn dfsdm1lpen(&self) -> DFSDM1LPEN_R {
DFSDM1LPEN_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn mdiolpen(&self) -> MDIOLPEN_R {
MDIOLPEN_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("APB2LPENR")
.field("tim1lpen", &self.tim1lpen())
.field("tim8lpen", &self.tim8lpen())
.field("usart1lpen", &self.usart1lpen())
.field("usart6lpen", &self.usart6lpen())
.field("adc1lpen", &self.adc1lpen())
.field("adc2lpen", &self.adc2lpen())
.field("adc3lpen", &self.adc3lpen())
.field("spi1lpen", &self.spi1lpen())
.field("spi4lpen", &self.spi4lpen())
.field("syscfglpen", &self.syscfglpen())
.field("tim9lpen", &self.tim9lpen())
.field("tim10lpen", &self.tim10lpen())
.field("tim11lpen", &self.tim11lpen())
.field("spi5lpen", &self.spi5lpen())
.field("spi6lpen", &self.spi6lpen())
.field("sai1lpen", &self.sai1lpen())
.field("ltdclpen", &self.ltdclpen())
.field("sai2lpen", &self.sai2lpen())
.field("sdmmc1lpen", &self.sdmmc1lpen())
.field("mdiolpen", &self.mdiolpen())
.field("dfsdm1lpen", &self.dfsdm1lpen())
.field("dsilpen", &self.dsilpen())
.field("sdmmc2lpen", &self.sdmmc2lpen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn tim1lpen(&mut self) -> TIM1LPEN_W<APB2LPENRrs> {
TIM1LPEN_W::new(self, 0)
}
#[inline(always)]
pub fn tim8lpen(&mut self) -> TIM8LPEN_W<APB2LPENRrs> {
TIM8LPEN_W::new(self, 1)
}
#[inline(always)]
pub fn usart1lpen(&mut self) -> USART1LPEN_W<APB2LPENRrs> {
USART1LPEN_W::new(self, 4)
}
#[inline(always)]
pub fn usart6lpen(&mut self) -> USART6LPEN_W<APB2LPENRrs> {
USART6LPEN_W::new(self, 5)
}
#[inline(always)]
pub fn sdmmc2lpen(&mut self) -> SDMMC2LPEN_W<APB2LPENRrs> {
SDMMC2LPEN_W::new(self, 7)
}
#[inline(always)]
pub fn adc1lpen(&mut self) -> ADC1LPEN_W<APB2LPENRrs> {
ADC1LPEN_W::new(self, 8)
}
#[inline(always)]
pub fn adc2lpen(&mut self) -> ADC2LPEN_W<APB2LPENRrs> {
ADC2LPEN_W::new(self, 9)
}
#[inline(always)]
pub fn adc3lpen(&mut self) -> ADC3LPEN_W<APB2LPENRrs> {
ADC3LPEN_W::new(self, 10)
}
#[inline(always)]
pub fn sdmmc1lpen(&mut self) -> SDMMC1LPEN_W<APB2LPENRrs> {
SDMMC1LPEN_W::new(self, 11)
}
#[inline(always)]
pub fn spi1lpen(&mut self) -> SPI1LPEN_W<APB2LPENRrs> {
SPI1LPEN_W::new(self, 12)
}
#[inline(always)]
pub fn spi4lpen(&mut self) -> SPI4LPEN_W<APB2LPENRrs> {
SPI4LPEN_W::new(self, 13)
}
#[inline(always)]
pub fn syscfglpen(&mut self) -> SYSCFGLPEN_W<APB2LPENRrs> {
SYSCFGLPEN_W::new(self, 14)
}
#[inline(always)]
pub fn tim9lpen(&mut self) -> TIM9LPEN_W<APB2LPENRrs> {
TIM9LPEN_W::new(self, 16)
}
#[inline(always)]
pub fn tim10lpen(&mut self) -> TIM10LPEN_W<APB2LPENRrs> {
TIM10LPEN_W::new(self, 17)
}
#[inline(always)]
pub fn tim11lpen(&mut self) -> TIM11LPEN_W<APB2LPENRrs> {
TIM11LPEN_W::new(self, 18)
}
#[inline(always)]
pub fn spi5lpen(&mut self) -> SPI5LPEN_W<APB2LPENRrs> {
SPI5LPEN_W::new(self, 20)
}
#[inline(always)]
pub fn spi6lpen(&mut self) -> SPI6LPEN_W<APB2LPENRrs> {
SPI6LPEN_W::new(self, 21)
}
#[inline(always)]
pub fn sai1lpen(&mut self) -> SAI1LPEN_W<APB2LPENRrs> {
SAI1LPEN_W::new(self, 22)
}
#[inline(always)]
pub fn sai2lpen(&mut self) -> SAI2LPEN_W<APB2LPENRrs> {
SAI2LPEN_W::new(self, 23)
}
#[inline(always)]
pub fn ltdclpen(&mut self) -> LTDCLPEN_W<APB2LPENRrs> {
LTDCLPEN_W::new(self, 26)
}
#[inline(always)]
pub fn dsilpen(&mut self) -> DSILPEN_W<APB2LPENRrs> {
DSILPEN_W::new(self, 27)
}
#[inline(always)]
pub fn dfsdm1lpen(&mut self) -> DFSDM1LPEN_W<APB2LPENRrs> {
DFSDM1LPEN_W::new(self, 29)
}
#[inline(always)]
pub fn mdiolpen(&mut self) -> MDIOLPEN_W<APB2LPENRrs> {
MDIOLPEN_W::new(self, 30)
}
}
pub struct APB2LPENRrs;
impl crate::RegisterSpec for APB2LPENRrs {
type Ux = u32;
}
impl crate::Readable for APB2LPENRrs {}
impl crate::Writable for APB2LPENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for APB2LPENRrs {
const RESET_VALUE: u32 = 0x0007_5f33;
}