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 GPDMA1RST {
Reset = 1,
}
impl From<GPDMA1RST> for bool {
#[inline(always)]
fn from(variant: GPDMA1RST) -> Self {
variant as u8 != 0
}
}
pub type GPDMA1RST_R = crate::BitReader<GPDMA1RST>;
impl GPDMA1RST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<GPDMA1RST> {
match self.bits {
true => Some(GPDMA1RST::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == GPDMA1RST::Reset
}
}
pub type GPDMA1RST_W<'a, REG> = crate::BitWriter<'a, REG, GPDMA1RST>;
impl<'a, REG> GPDMA1RST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(GPDMA1RST::Reset)
}
}
pub use GPDMA1RST_R as ADC12RST_R;
pub use GPDMA1RST_R as ETH1MACRST_R;
pub use GPDMA1RST_R as OTGHSRST_R;
pub use GPDMA1RST_R as USBPHYCRST_R;
pub use GPDMA1RST_R as OTGFSRST_R;
pub use GPDMA1RST_R as ADFRST_R;
pub use GPDMA1RST_W as ADC12RST_W;
pub use GPDMA1RST_W as ETH1MACRST_W;
pub use GPDMA1RST_W as OTGHSRST_W;
pub use GPDMA1RST_W as USBPHYCRST_W;
pub use GPDMA1RST_W as OTGFSRST_W;
pub use GPDMA1RST_W as ADFRST_W;
impl R {
#[inline(always)]
pub fn gpdma1rst(&self) -> GPDMA1RST_R {
GPDMA1RST_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn adc12rst(&self) -> ADC12RST_R {
ADC12RST_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn eth1macrst(&self) -> ETH1MACRST_R {
ETH1MACRST_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn otghsrst(&self) -> OTGHSRST_R {
OTGHSRST_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn usbphycrst(&self) -> USBPHYCRST_R {
USBPHYCRST_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn otgfsrst(&self) -> OTGFSRST_R {
OTGFSRST_R::new(((self.bits >> 27) & 1) != 0)
}
#[inline(always)]
pub fn adfrst(&self) -> ADFRST_R {
ADFRST_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("AHB1RSTR")
.field("gpdma1rst", &self.gpdma1rst())
.field("adc12rst", &self.adc12rst())
.field("eth1macrst", &self.eth1macrst())
.field("otghsrst", &self.otghsrst())
.field("usbphycrst", &self.usbphycrst())
.field("otgfsrst", &self.otgfsrst())
.field("adfrst", &self.adfrst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn gpdma1rst(&mut self) -> GPDMA1RST_W<AHB1RSTRrs> {
GPDMA1RST_W::new(self, 4)
}
#[inline(always)]
pub fn adc12rst(&mut self) -> ADC12RST_W<AHB1RSTRrs> {
ADC12RST_W::new(self, 5)
}
#[inline(always)]
pub fn eth1macrst(&mut self) -> ETH1MACRST_W<AHB1RSTRrs> {
ETH1MACRST_W::new(self, 15)
}
#[inline(always)]
pub fn otghsrst(&mut self) -> OTGHSRST_W<AHB1RSTRrs> {
OTGHSRST_W::new(self, 25)
}
#[inline(always)]
pub fn usbphycrst(&mut self) -> USBPHYCRST_W<AHB1RSTRrs> {
USBPHYCRST_W::new(self, 26)
}
#[inline(always)]
pub fn otgfsrst(&mut self) -> OTGFSRST_W<AHB1RSTRrs> {
OTGFSRST_W::new(self, 27)
}
#[inline(always)]
pub fn adfrst(&mut self) -> ADFRST_W<AHB1RSTRrs> {
ADFRST_W::new(self, 31)
}
}
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 {}