pub type R = crate::R<AHBENRrs>;
pub type W = crate::W<AHBENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DMA1EN {
        Disabled = 0,
        Enabled = 1,
}
impl From<DMA1EN> for bool {
    #[inline(always)]
    fn from(variant: DMA1EN) -> Self {
        variant as u8 != 0
    }
}
pub type DMA1EN_R = crate::BitReader<DMA1EN>;
impl DMA1EN_R {
        #[inline(always)]
    pub const fn variant(&self) -> DMA1EN {
        match self.bits {
            false => DMA1EN::Disabled,
            true => DMA1EN::Enabled,
        }
    }
        #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == DMA1EN::Disabled
    }
        #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == DMA1EN::Enabled
    }
}
pub type DMA1EN_W<'a, REG> = crate::BitWriter<'a, REG, DMA1EN>;
impl<'a, REG> DMA1EN_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
        #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(DMA1EN::Disabled)
    }
        #[inline(always)]
    pub fn enabled(self) -> &'a mut crate::W<REG> {
        self.variant(DMA1EN::Enabled)
    }
}
pub use DMA1EN_R as DMA2EN_R;
pub use DMA1EN_R as SRAMEN_R;
pub use DMA1EN_R as FLITFEN_R;
pub use DMA1EN_R as CRCEN_R;
pub use DMA1EN_R as IOPAEN_R;
pub use DMA1EN_R as IOPBEN_R;
pub use DMA1EN_R as IOPCEN_R;
pub use DMA1EN_R as IOPDEN_R;
pub use DMA1EN_R as IOPEEN_R;
pub use DMA1EN_R as IOPFEN_R;
pub use DMA1EN_R as TSCEN_R;
pub use DMA1EN_W as DMA2EN_W;
pub use DMA1EN_W as SRAMEN_W;
pub use DMA1EN_W as FLITFEN_W;
pub use DMA1EN_W as CRCEN_W;
pub use DMA1EN_W as IOPAEN_W;
pub use DMA1EN_W as IOPBEN_W;
pub use DMA1EN_W as IOPCEN_W;
pub use DMA1EN_W as IOPDEN_W;
pub use DMA1EN_W as IOPEEN_W;
pub use DMA1EN_W as IOPFEN_W;
pub use DMA1EN_W as TSCEN_W;
impl R {
        #[inline(always)]
    pub fn dma1en(&self) -> DMA1EN_R {
        DMA1EN_R::new((self.bits & 1) != 0)
    }
        #[inline(always)]
    pub fn dma2en(&self) -> DMA2EN_R {
        DMA2EN_R::new(((self.bits >> 1) & 1) != 0)
    }
        #[inline(always)]
    pub fn sramen(&self) -> SRAMEN_R {
        SRAMEN_R::new(((self.bits >> 2) & 1) != 0)
    }
        #[inline(always)]
    pub fn flitfen(&self) -> FLITFEN_R {
        FLITFEN_R::new(((self.bits >> 4) & 1) != 0)
    }
        #[inline(always)]
    pub fn crcen(&self) -> CRCEN_R {
        CRCEN_R::new(((self.bits >> 6) & 1) != 0)
    }
        #[inline(always)]
    pub fn iopaen(&self) -> IOPAEN_R {
        IOPAEN_R::new(((self.bits >> 17) & 1) != 0)
    }
        #[inline(always)]
    pub fn iopben(&self) -> IOPBEN_R {
        IOPBEN_R::new(((self.bits >> 18) & 1) != 0)
    }
        #[inline(always)]
    pub fn iopcen(&self) -> IOPCEN_R {
        IOPCEN_R::new(((self.bits >> 19) & 1) != 0)
    }
        #[inline(always)]
    pub fn iopden(&self) -> IOPDEN_R {
        IOPDEN_R::new(((self.bits >> 20) & 1) != 0)
    }
        #[inline(always)]
    pub fn iopeen(&self) -> IOPEEN_R {
        IOPEEN_R::new(((self.bits >> 21) & 1) != 0)
    }
        #[inline(always)]
    pub fn iopfen(&self) -> IOPFEN_R {
        IOPFEN_R::new(((self.bits >> 22) & 1) != 0)
    }
        #[inline(always)]
    pub fn tscen(&self) -> TSCEN_R {
        TSCEN_R::new(((self.bits >> 24) & 1) != 0)
    }
}
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("AHBENR")
            .field("dma1en", &self.dma1en())
            .field("dma2en", &self.dma2en())
            .field("sramen", &self.sramen())
            .field("flitfen", &self.flitfen())
            .field("crcen", &self.crcen())
            .field("iopaen", &self.iopaen())
            .field("iopben", &self.iopben())
            .field("iopcen", &self.iopcen())
            .field("iopden", &self.iopden())
            .field("iopeen", &self.iopeen())
            .field("iopfen", &self.iopfen())
            .field("tscen", &self.tscen())
            .finish()
    }
}
impl W {
        #[inline(always)]
    pub fn dma1en(&mut self) -> DMA1EN_W<AHBENRrs> {
        DMA1EN_W::new(self, 0)
    }
        #[inline(always)]
    pub fn dma2en(&mut self) -> DMA2EN_W<AHBENRrs> {
        DMA2EN_W::new(self, 1)
    }
        #[inline(always)]
    pub fn sramen(&mut self) -> SRAMEN_W<AHBENRrs> {
        SRAMEN_W::new(self, 2)
    }
        #[inline(always)]
    pub fn flitfen(&mut self) -> FLITFEN_W<AHBENRrs> {
        FLITFEN_W::new(self, 4)
    }
        #[inline(always)]
    pub fn crcen(&mut self) -> CRCEN_W<AHBENRrs> {
        CRCEN_W::new(self, 6)
    }
        #[inline(always)]
    pub fn iopaen(&mut self) -> IOPAEN_W<AHBENRrs> {
        IOPAEN_W::new(self, 17)
    }
        #[inline(always)]
    pub fn iopben(&mut self) -> IOPBEN_W<AHBENRrs> {
        IOPBEN_W::new(self, 18)
    }
        #[inline(always)]
    pub fn iopcen(&mut self) -> IOPCEN_W<AHBENRrs> {
        IOPCEN_W::new(self, 19)
    }
        #[inline(always)]
    pub fn iopden(&mut self) -> IOPDEN_W<AHBENRrs> {
        IOPDEN_W::new(self, 20)
    }
        #[inline(always)]
    pub fn iopeen(&mut self) -> IOPEEN_W<AHBENRrs> {
        IOPEEN_W::new(self, 21)
    }
        #[inline(always)]
    pub fn iopfen(&mut self) -> IOPFEN_W<AHBENRrs> {
        IOPFEN_W::new(self, 22)
    }
        #[inline(always)]
    pub fn tscen(&mut self) -> TSCEN_W<AHBENRrs> {
        TSCEN_W::new(self, 24)
    }
}
pub struct AHBENRrs;
impl crate::RegisterSpec for AHBENRrs {
    type Ux = u32;
}
impl crate::Readable for AHBENRrs {}
impl crate::Writable for AHBENRrs {
    type Safety = crate::Unsafe;
}
impl crate::Resettable for AHBENRrs {
    const RESET_VALUE: u32 = 0x14;
}