pub type R = crate::R<AHB1RSTRrs>;
pub type W = crate::W<AHB1RSTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DMA1RST {
Reset = 1,
}
impl From<DMA1RST> for bool {
#[inline(always)]
fn from(variant: DMA1RST) -> Self {
variant as u8 != 0
}
}
pub type DMA1RST_R = crate::BitReader<DMA1RST>;
impl DMA1RST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<DMA1RST> {
match self.bits {
true => Some(DMA1RST::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == DMA1RST::Reset
}
}
pub type DMA1RST_W<'a, REG> = crate::BitWriter<'a, REG, DMA1RST>;
impl<'a, REG> DMA1RST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(DMA1RST::Reset)
}
}
pub use DMA1RST_R as DMA2RST_R;
pub use DMA1RST_R as DMAMUX1RST_R;
pub use DMA1RST_R as CORDICRST_R;
pub use DMA1RST_R as FMACRST_R;
pub use DMA1RST_R as FLASHRST_R;
pub use DMA1RST_R as CRCRST_R;
pub use DMA1RST_W as DMA2RST_W;
pub use DMA1RST_W as DMAMUX1RST_W;
pub use DMA1RST_W as CORDICRST_W;
pub use DMA1RST_W as FMACRST_W;
pub use DMA1RST_W as FLASHRST_W;
pub use DMA1RST_W as CRCRST_W;
impl R {
#[inline(always)]
pub fn dma1rst(&self) -> DMA1RST_R {
DMA1RST_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn dma2rst(&self) -> DMA2RST_R {
DMA2RST_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn dmamux1rst(&self) -> DMAMUX1RST_R {
DMAMUX1RST_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn cordicrst(&self) -> CORDICRST_R {
CORDICRST_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn fmacrst(&self) -> FMACRST_R {
FMACRST_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn flashrst(&self) -> FLASHRST_R {
FLASHRST_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn crcrst(&self) -> CRCRST_R {
CRCRST_R::new(((self.bits >> 12) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHB1RSTR")
.field("dma1rst", &self.dma1rst())
.field("dma2rst", &self.dma2rst())
.field("dmamux1rst", &self.dmamux1rst())
.field("cordicrst", &self.cordicrst())
.field("fmacrst", &self.fmacrst())
.field("flashrst", &self.flashrst())
.field("crcrst", &self.crcrst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dma1rst(&mut self) -> DMA1RST_W<AHB1RSTRrs> {
DMA1RST_W::new(self, 0)
}
#[inline(always)]
pub fn dma2rst(&mut self) -> DMA2RST_W<AHB1RSTRrs> {
DMA2RST_W::new(self, 1)
}
#[inline(always)]
pub fn dmamux1rst(&mut self) -> DMAMUX1RST_W<AHB1RSTRrs> {
DMAMUX1RST_W::new(self, 2)
}
#[inline(always)]
pub fn cordicrst(&mut self) -> CORDICRST_W<AHB1RSTRrs> {
CORDICRST_W::new(self, 3)
}
#[inline(always)]
pub fn fmacrst(&mut self) -> FMACRST_W<AHB1RSTRrs> {
FMACRST_W::new(self, 4)
}
#[inline(always)]
pub fn flashrst(&mut self) -> FLASHRST_W<AHB1RSTRrs> {
FLASHRST_W::new(self, 8)
}
#[inline(always)]
pub fn crcrst(&mut self) -> CRCRST_W<AHB1RSTRrs> {
CRCRST_W::new(self, 12)
}
}
pub struct AHB1RSTRrs;
impl crate::RegisterSpec for AHB1RSTRrs {
type Ux = u32;
}
impl crate::Readable for AHB1RSTRrs {}
impl crate::Writable for AHB1RSTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHB1RSTRrs {}