pub type R = crate::R<AHB3RSTRrs>;
pub type W = crate::W<AHB3RSTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MDMARST {
Reset = 1,
}
impl From<MDMARST> for bool {
#[inline(always)]
fn from(variant: MDMARST) -> Self {
variant as u8 != 0
}
}
pub type MDMARST_R = crate::BitReader<MDMARST>;
impl MDMARST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<MDMARST> {
match self.bits {
true => Some(MDMARST::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == MDMARST::Reset
}
}
pub type MDMARST_W<'a, REG> = crate::BitWriter<'a, REG, MDMARST>;
impl<'a, REG> MDMARST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(MDMARST::Reset)
}
}
pub use MDMARST_R as DMA2DRST_R;
pub use MDMARST_R as JPGDECRST_R;
pub use MDMARST_R as FMCRST_R;
pub use MDMARST_R as QSPIRST_R;
pub use MDMARST_R as SDMMC1RST_R;
pub use MDMARST_R as CPURST_R;
pub use MDMARST_W as DMA2DRST_W;
pub use MDMARST_W as JPGDECRST_W;
pub use MDMARST_W as FMCRST_W;
pub use MDMARST_W as QSPIRST_W;
pub use MDMARST_W as SDMMC1RST_W;
pub use MDMARST_W as CPURST_W;
impl R {
#[inline(always)]
pub fn mdmarst(&self) -> MDMARST_R {
MDMARST_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn dma2drst(&self) -> DMA2DRST_R {
DMA2DRST_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn jpgdecrst(&self) -> JPGDECRST_R {
JPGDECRST_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn fmcrst(&self) -> FMCRST_R {
FMCRST_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn qspirst(&self) -> QSPIRST_R {
QSPIRST_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn sdmmc1rst(&self) -> SDMMC1RST_R {
SDMMC1RST_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn cpurst(&self) -> CPURST_R {
CPURST_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("AHB3RSTR")
.field("mdmarst", &self.mdmarst())
.field("dma2drst", &self.dma2drst())
.field("jpgdecrst", &self.jpgdecrst())
.field("fmcrst", &self.fmcrst())
.field("qspirst", &self.qspirst())
.field("sdmmc1rst", &self.sdmmc1rst())
.field("cpurst", &self.cpurst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn mdmarst(&mut self) -> MDMARST_W<AHB3RSTRrs> {
MDMARST_W::new(self, 0)
}
#[inline(always)]
pub fn dma2drst(&mut self) -> DMA2DRST_W<AHB3RSTRrs> {
DMA2DRST_W::new(self, 4)
}
#[inline(always)]
pub fn jpgdecrst(&mut self) -> JPGDECRST_W<AHB3RSTRrs> {
JPGDECRST_W::new(self, 5)
}
#[inline(always)]
pub fn fmcrst(&mut self) -> FMCRST_W<AHB3RSTRrs> {
FMCRST_W::new(self, 12)
}
#[inline(always)]
pub fn qspirst(&mut self) -> QSPIRST_W<AHB3RSTRrs> {
QSPIRST_W::new(self, 14)
}
#[inline(always)]
pub fn sdmmc1rst(&mut self) -> SDMMC1RST_W<AHB3RSTRrs> {
SDMMC1RST_W::new(self, 16)
}
#[inline(always)]
pub fn cpurst(&mut self) -> CPURST_W<AHB3RSTRrs> {
CPURST_W::new(self, 31)
}
}
pub struct AHB3RSTRrs;
impl crate::RegisterSpec for AHB3RSTRrs {
type Ux = u32;
}
impl crate::Readable for AHB3RSTRrs {}
impl crate::Writable for AHB3RSTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHB3RSTRrs {}