pub type R = crate::R<APB2ENRrs>;
pub type W = crate::W<APB2ENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SYSCFGEN {
        Disabled = 0,
        Enabled = 1,
}
impl From<SYSCFGEN> for bool {
    #[inline(always)]
    fn from(variant: SYSCFGEN) -> Self {
        variant as u8 != 0
    }
}
pub type SYSCFGEN_R = crate::BitReader<SYSCFGEN>;
impl SYSCFGEN_R {
        #[inline(always)]
    pub const fn variant(&self) -> SYSCFGEN {
        match self.bits {
            false => SYSCFGEN::Disabled,
            true => SYSCFGEN::Enabled,
        }
    }
        #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == SYSCFGEN::Disabled
    }
        #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == SYSCFGEN::Enabled
    }
}
pub type SYSCFGEN_W<'a, REG> = crate::BitWriter<'a, REG, SYSCFGEN>;
impl<'a, REG> SYSCFGEN_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
        #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(SYSCFGEN::Disabled)
    }
        #[inline(always)]
    pub fn enabled(self) -> &'a mut crate::W<REG> {
        self.variant(SYSCFGEN::Enabled)
    }
}
pub use SYSCFGEN_R as ADCEN_R;
pub use SYSCFGEN_R as SPI1EN_R;
pub use SYSCFGEN_R as USART1EN_R;
pub use SYSCFGEN_R as TIM15EN_R;
pub use SYSCFGEN_R as TIM16EN_R;
pub use SYSCFGEN_R as TIM17EN_R;
pub use SYSCFGEN_R as TIM19EN_R;
pub use SYSCFGEN_R as DBGMCUEN_R;
pub use SYSCFGEN_R as SDADC1EN_R;
pub use SYSCFGEN_R as SDADC2EN_R;
pub use SYSCFGEN_R as SDADC3EN_R;
pub use SYSCFGEN_W as ADCEN_W;
pub use SYSCFGEN_W as SPI1EN_W;
pub use SYSCFGEN_W as USART1EN_W;
pub use SYSCFGEN_W as TIM15EN_W;
pub use SYSCFGEN_W as TIM16EN_W;
pub use SYSCFGEN_W as TIM17EN_W;
pub use SYSCFGEN_W as TIM19EN_W;
pub use SYSCFGEN_W as DBGMCUEN_W;
pub use SYSCFGEN_W as SDADC1EN_W;
pub use SYSCFGEN_W as SDADC2EN_W;
pub use SYSCFGEN_W as SDADC3EN_W;
impl R {
        #[inline(always)]
    pub fn syscfgen(&self) -> SYSCFGEN_R {
        SYSCFGEN_R::new((self.bits & 1) != 0)
    }
        #[inline(always)]
    pub fn adcen(&self) -> ADCEN_R {
        ADCEN_R::new(((self.bits >> 9) & 1) != 0)
    }
        #[inline(always)]
    pub fn spi1en(&self) -> SPI1EN_R {
        SPI1EN_R::new(((self.bits >> 12) & 1) != 0)
    }
        #[inline(always)]
    pub fn usart1en(&self) -> USART1EN_R {
        USART1EN_R::new(((self.bits >> 14) & 1) != 0)
    }
        #[inline(always)]
    pub fn tim15en(&self) -> TIM15EN_R {
        TIM15EN_R::new(((self.bits >> 16) & 1) != 0)
    }
        #[inline(always)]
    pub fn tim16en(&self) -> TIM16EN_R {
        TIM16EN_R::new(((self.bits >> 17) & 1) != 0)
    }
        #[inline(always)]
    pub fn tim17en(&self) -> TIM17EN_R {
        TIM17EN_R::new(((self.bits >> 18) & 1) != 0)
    }
        #[inline(always)]
    pub fn tim19en(&self) -> TIM19EN_R {
        TIM19EN_R::new(((self.bits >> 19) & 1) != 0)
    }
        #[inline(always)]
    pub fn dbgmcuen(&self) -> DBGMCUEN_R {
        DBGMCUEN_R::new(((self.bits >> 22) & 1) != 0)
    }
        #[inline(always)]
    pub fn sdadc1en(&self) -> SDADC1EN_R {
        SDADC1EN_R::new(((self.bits >> 24) & 1) != 0)
    }
        #[inline(always)]
    pub fn sdadc2en(&self) -> SDADC2EN_R {
        SDADC2EN_R::new(((self.bits >> 25) & 1) != 0)
    }
        #[inline(always)]
    pub fn sdadc3en(&self) -> SDADC3EN_R {
        SDADC3EN_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("APB2ENR")
            .field("syscfgen", &self.syscfgen())
            .field("adcen", &self.adcen())
            .field("spi1en", &self.spi1en())
            .field("usart1en", &self.usart1en())
            .field("tim15en", &self.tim15en())
            .field("tim16en", &self.tim16en())
            .field("tim17en", &self.tim17en())
            .field("tim19en", &self.tim19en())
            .field("dbgmcuen", &self.dbgmcuen())
            .field("sdadc1en", &self.sdadc1en())
            .field("sdadc2en", &self.sdadc2en())
            .field("sdadc3en", &self.sdadc3en())
            .finish()
    }
}
impl W {
        #[inline(always)]
    pub fn syscfgen(&mut self) -> SYSCFGEN_W<APB2ENRrs> {
        SYSCFGEN_W::new(self, 0)
    }
        #[inline(always)]
    pub fn adcen(&mut self) -> ADCEN_W<APB2ENRrs> {
        ADCEN_W::new(self, 9)
    }
        #[inline(always)]
    pub fn spi1en(&mut self) -> SPI1EN_W<APB2ENRrs> {
        SPI1EN_W::new(self, 12)
    }
        #[inline(always)]
    pub fn usart1en(&mut self) -> USART1EN_W<APB2ENRrs> {
        USART1EN_W::new(self, 14)
    }
        #[inline(always)]
    pub fn tim15en(&mut self) -> TIM15EN_W<APB2ENRrs> {
        TIM15EN_W::new(self, 16)
    }
        #[inline(always)]
    pub fn tim16en(&mut self) -> TIM16EN_W<APB2ENRrs> {
        TIM16EN_W::new(self, 17)
    }
        #[inline(always)]
    pub fn tim17en(&mut self) -> TIM17EN_W<APB2ENRrs> {
        TIM17EN_W::new(self, 18)
    }
        #[inline(always)]
    pub fn tim19en(&mut self) -> TIM19EN_W<APB2ENRrs> {
        TIM19EN_W::new(self, 19)
    }
        #[inline(always)]
    pub fn dbgmcuen(&mut self) -> DBGMCUEN_W<APB2ENRrs> {
        DBGMCUEN_W::new(self, 22)
    }
        #[inline(always)]
    pub fn sdadc1en(&mut self) -> SDADC1EN_W<APB2ENRrs> {
        SDADC1EN_W::new(self, 24)
    }
        #[inline(always)]
    pub fn sdadc2en(&mut self) -> SDADC2EN_W<APB2ENRrs> {
        SDADC2EN_W::new(self, 25)
    }
        #[inline(always)]
    pub fn sdadc3en(&mut self) -> SDADC3EN_W<APB2ENRrs> {
        SDADC3EN_W::new(self, 26)
    }
}
pub struct APB2ENRrs;
impl crate::RegisterSpec for APB2ENRrs {
    type Ux = u32;
}
impl crate::Readable for APB2ENRrs {}
impl crate::Writable for APB2ENRrs {
    type Safety = crate::Unsafe;
}
impl crate::Resettable for APB2ENRrs {}