pub type R = crate::R<AHB5RSTRrs>;
pub type W = crate::W<AHB5RSTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HPDMA1RST {
Reset = 1,
}
impl From<HPDMA1RST> for bool {
#[inline(always)]
fn from(variant: HPDMA1RST) -> Self {
variant as u8 != 0
}
}
pub type HPDMA1RST_R = crate::BitReader<HPDMA1RST>;
impl HPDMA1RST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<HPDMA1RST> {
match self.bits {
true => Some(HPDMA1RST::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == HPDMA1RST::Reset
}
}
pub type HPDMA1RST_W<'a, REG> = crate::BitWriter<'a, REG, HPDMA1RST>;
impl<'a, REG> HPDMA1RST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(HPDMA1RST::Reset)
}
}
pub use HPDMA1RST_R as DMA2DRST_R;
pub use HPDMA1RST_R as JPEGRST_R;
pub use HPDMA1RST_R as FMCRST_R;
pub use HPDMA1RST_R as XSPI1RST_R;
pub use HPDMA1RST_R as SDMMC1RST_R;
pub use HPDMA1RST_R as XSPI2RST_R;
pub use HPDMA1RST_R as XSPIMRST_R;
pub use HPDMA1RST_R as GFXMMURST_R;
pub use HPDMA1RST_R as GPURST_R;
pub use HPDMA1RST_W as DMA2DRST_W;
pub use HPDMA1RST_W as JPEGRST_W;
pub use HPDMA1RST_W as FMCRST_W;
pub use HPDMA1RST_W as XSPI1RST_W;
pub use HPDMA1RST_W as SDMMC1RST_W;
pub use HPDMA1RST_W as XSPI2RST_W;
pub use HPDMA1RST_W as XSPIMRST_W;
pub use HPDMA1RST_W as GFXMMURST_W;
pub use HPDMA1RST_W as GPURST_W;
impl R {
#[inline(always)]
pub fn hpdma1rst(&self) -> HPDMA1RST_R {
HPDMA1RST_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn dma2drst(&self) -> DMA2DRST_R {
DMA2DRST_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn jpegrst(&self) -> JPEGRST_R {
JPEGRST_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn fmcrst(&self) -> FMCRST_R {
FMCRST_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn xspi1rst(&self) -> XSPI1RST_R {
XSPI1RST_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn sdmmc1rst(&self) -> SDMMC1RST_R {
SDMMC1RST_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn xspi2rst(&self) -> XSPI2RST_R {
XSPI2RST_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn xspimrst(&self) -> XSPIMRST_R {
XSPIMRST_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn gfxmmurst(&self) -> GFXMMURST_R {
GFXMMURST_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn gpurst(&self) -> GPURST_R {
GPURST_R::new(((self.bits >> 20) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHB5RSTR")
.field("hpdma1rst", &self.hpdma1rst())
.field("dma2drst", &self.dma2drst())
.field("jpegrst", &self.jpegrst())
.field("fmcrst", &self.fmcrst())
.field("xspi1rst", &self.xspi1rst())
.field("sdmmc1rst", &self.sdmmc1rst())
.field("xspi2rst", &self.xspi2rst())
.field("xspimrst", &self.xspimrst())
.field("gfxmmurst", &self.gfxmmurst())
.field("gpurst", &self.gpurst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn hpdma1rst(&mut self) -> HPDMA1RST_W<AHB5RSTRrs> {
HPDMA1RST_W::new(self, 0)
}
#[inline(always)]
pub fn dma2drst(&mut self) -> DMA2DRST_W<AHB5RSTRrs> {
DMA2DRST_W::new(self, 1)
}
#[inline(always)]
pub fn jpegrst(&mut self) -> JPEGRST_W<AHB5RSTRrs> {
JPEGRST_W::new(self, 3)
}
#[inline(always)]
pub fn fmcrst(&mut self) -> FMCRST_W<AHB5RSTRrs> {
FMCRST_W::new(self, 4)
}
#[inline(always)]
pub fn xspi1rst(&mut self) -> XSPI1RST_W<AHB5RSTRrs> {
XSPI1RST_W::new(self, 5)
}
#[inline(always)]
pub fn sdmmc1rst(&mut self) -> SDMMC1RST_W<AHB5RSTRrs> {
SDMMC1RST_W::new(self, 8)
}
#[inline(always)]
pub fn xspi2rst(&mut self) -> XSPI2RST_W<AHB5RSTRrs> {
XSPI2RST_W::new(self, 12)
}
#[inline(always)]
pub fn xspimrst(&mut self) -> XSPIMRST_W<AHB5RSTRrs> {
XSPIMRST_W::new(self, 14)
}
#[inline(always)]
pub fn gfxmmurst(&mut self) -> GFXMMURST_W<AHB5RSTRrs> {
GFXMMURST_W::new(self, 19)
}
#[inline(always)]
pub fn gpurst(&mut self) -> GPURST_W<AHB5RSTRrs> {
GPURST_W::new(self, 20)
}
}
pub struct AHB5RSTRrs;
impl crate::RegisterSpec for AHB5RSTRrs {
type Ux = u32;
}
impl crate::Readable for AHB5RSTRrs {}
impl crate::Writable for AHB5RSTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHB5RSTRrs {}