pub type R = crate::R<AHB3ENRrs>;
pub type W = crate::W<AHB3ENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MDMAEN {
Disabled = 0,
Enabled = 1,
}
impl From<MDMAEN> for bool {
#[inline(always)]
fn from(variant: MDMAEN) -> Self {
variant as u8 != 0
}
}
pub type MDMAEN_R = crate::BitReader<MDMAEN>;
impl MDMAEN_R {
#[inline(always)]
pub const fn variant(&self) -> MDMAEN {
match self.bits {
false => MDMAEN::Disabled,
true => MDMAEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == MDMAEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == MDMAEN::Enabled
}
}
pub type MDMAEN_W<'a, REG> = crate::BitWriter<'a, REG, MDMAEN>;
impl<'a, REG> MDMAEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(MDMAEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(MDMAEN::Enabled)
}
}
pub use MDMAEN_R as DMA2DEN_R;
pub use MDMAEN_R as JPGDECEN_R;
pub use MDMAEN_R as FMCEN_R;
pub use MDMAEN_R as OCTOSPI1EN_R;
pub use MDMAEN_R as SDMMC1EN_R;
pub use MDMAEN_R as OCTOSPI2EN_R;
pub use MDMAEN_R as OCTOSPIMEN_R;
pub use MDMAEN_R as OTFD1EN_R;
pub use MDMAEN_R as OTFD2EN_R;
pub use MDMAEN_R as GFXMMUEN_R;
pub use MDMAEN_R as DTCM1EN_R;
pub use MDMAEN_R as DTCM2EN_R;
pub use MDMAEN_R as ITCM1EN_R;
pub use MDMAEN_R as AXISRAMEN_R;
pub use MDMAEN_W as DMA2DEN_W;
pub use MDMAEN_W as JPGDECEN_W;
pub use MDMAEN_W as FMCEN_W;
pub use MDMAEN_W as OCTOSPI1EN_W;
pub use MDMAEN_W as SDMMC1EN_W;
pub use MDMAEN_W as OCTOSPI2EN_W;
pub use MDMAEN_W as OCTOSPIMEN_W;
pub use MDMAEN_W as OTFD1EN_W;
pub use MDMAEN_W as OTFD2EN_W;
pub use MDMAEN_W as GFXMMUEN_W;
pub use MDMAEN_W as DTCM1EN_W;
pub use MDMAEN_W as DTCM2EN_W;
pub use MDMAEN_W as ITCM1EN_W;
pub use MDMAEN_W as AXISRAMEN_W;
impl R {
#[inline(always)]
pub fn mdmaen(&self) -> MDMAEN_R {
MDMAEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn dma2den(&self) -> DMA2DEN_R {
DMA2DEN_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn jpgdecen(&self) -> JPGDECEN_R {
JPGDECEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn fmcen(&self) -> FMCEN_R {
FMCEN_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn octospi1en(&self) -> OCTOSPI1EN_R {
OCTOSPI1EN_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn sdmmc1en(&self) -> SDMMC1EN_R {
SDMMC1EN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn octospi2en(&self) -> OCTOSPI2EN_R {
OCTOSPI2EN_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn octospimen(&self) -> OCTOSPIMEN_R {
OCTOSPIMEN_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn otfd1en(&self) -> OTFD1EN_R {
OTFD1EN_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn otfd2en(&self) -> OTFD2EN_R {
OTFD2EN_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn gfxmmuen(&self) -> GFXMMUEN_R {
GFXMMUEN_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn dtcm1en(&self) -> DTCM1EN_R {
DTCM1EN_R::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn dtcm2en(&self) -> DTCM2EN_R {
DTCM2EN_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn itcm1en(&self) -> ITCM1EN_R {
ITCM1EN_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn axisramen(&self) -> AXISRAMEN_R {
AXISRAMEN_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("AHB3ENR")
.field("mdmaen", &self.mdmaen())
.field("dma2den", &self.dma2den())
.field("jpgdecen", &self.jpgdecen())
.field("fmcen", &self.fmcen())
.field("octospi1en", &self.octospi1en())
.field("sdmmc1en", &self.sdmmc1en())
.field("octospi2en", &self.octospi2en())
.field("octospimen", &self.octospimen())
.field("otfd1en", &self.otfd1en())
.field("otfd2en", &self.otfd2en())
.field("gfxmmuen", &self.gfxmmuen())
.field("dtcm1en", &self.dtcm1en())
.field("dtcm2en", &self.dtcm2en())
.field("itcm1en", &self.itcm1en())
.field("axisramen", &self.axisramen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn mdmaen(&mut self) -> MDMAEN_W<AHB3ENRrs> {
MDMAEN_W::new(self, 0)
}
#[inline(always)]
pub fn dma2den(&mut self) -> DMA2DEN_W<AHB3ENRrs> {
DMA2DEN_W::new(self, 4)
}
#[inline(always)]
pub fn jpgdecen(&mut self) -> JPGDECEN_W<AHB3ENRrs> {
JPGDECEN_W::new(self, 5)
}
#[inline(always)]
pub fn fmcen(&mut self) -> FMCEN_W<AHB3ENRrs> {
FMCEN_W::new(self, 12)
}
#[inline(always)]
pub fn octospi1en(&mut self) -> OCTOSPI1EN_W<AHB3ENRrs> {
OCTOSPI1EN_W::new(self, 14)
}
#[inline(always)]
pub fn sdmmc1en(&mut self) -> SDMMC1EN_W<AHB3ENRrs> {
SDMMC1EN_W::new(self, 16)
}
#[inline(always)]
pub fn octospi2en(&mut self) -> OCTOSPI2EN_W<AHB3ENRrs> {
OCTOSPI2EN_W::new(self, 19)
}
#[inline(always)]
pub fn octospimen(&mut self) -> OCTOSPIMEN_W<AHB3ENRrs> {
OCTOSPIMEN_W::new(self, 21)
}
#[inline(always)]
pub fn otfd1en(&mut self) -> OTFD1EN_W<AHB3ENRrs> {
OTFD1EN_W::new(self, 22)
}
#[inline(always)]
pub fn otfd2en(&mut self) -> OTFD2EN_W<AHB3ENRrs> {
OTFD2EN_W::new(self, 23)
}
#[inline(always)]
pub fn gfxmmuen(&mut self) -> GFXMMUEN_W<AHB3ENRrs> {
GFXMMUEN_W::new(self, 24)
}
#[inline(always)]
pub fn dtcm1en(&mut self) -> DTCM1EN_W<AHB3ENRrs> {
DTCM1EN_W::new(self, 28)
}
#[inline(always)]
pub fn dtcm2en(&mut self) -> DTCM2EN_W<AHB3ENRrs> {
DTCM2EN_W::new(self, 29)
}
#[inline(always)]
pub fn itcm1en(&mut self) -> ITCM1EN_W<AHB3ENRrs> {
ITCM1EN_W::new(self, 30)
}
#[inline(always)]
pub fn axisramen(&mut self) -> AXISRAMEN_W<AHB3ENRrs> {
AXISRAMEN_W::new(self, 31)
}
}
pub struct AHB3ENRrs;
impl crate::RegisterSpec for AHB3ENRrs {
type Ux = u32;
}
impl crate::Readable for AHB3ENRrs {}
impl crate::Writable for AHB3ENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHB3ENRrs {}