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 GPIOARST {
Reset = 1,
}
impl From<GPIOARST> for bool {
#[inline(always)]
fn from(variant: GPIOARST) -> Self {
variant as u8 != 0
}
}
pub type GPIOARST_R = crate::BitReader<GPIOARST>;
impl GPIOARST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<GPIOARST> {
match self.bits {
true => Some(GPIOARST::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == GPIOARST::Reset
}
}
pub type GPIOARST_W<'a, REG> = crate::BitWriter<'a, REG, GPIOARST>;
impl<'a, REG> GPIOARST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(GPIOARST::Reset)
}
}
pub use GPIOARST_R as GPIOBRST_R;
pub use GPIOARST_R as GPIOCRST_R;
pub use GPIOARST_R as GPIODRST_R;
pub use GPIOARST_R as GPIOERST_R;
pub use GPIOARST_R as GPIOFRST_R;
pub use GPIOARST_R as GPIOGRST_R;
pub use GPIOARST_R as GPIOHRST_R;
pub use GPIOARST_R as GPIOIRST_R;
pub use GPIOARST_R as GPIOJRST_R;
pub use GPIOARST_R as GPIOKRST_R;
pub use GPIOARST_R as CRCRST_R;
pub use GPIOARST_R as DMA1RST_R;
pub use GPIOARST_R as DMA2RST_R;
pub use GPIOARST_R as DMA2DRST_R;
pub use GPIOARST_R as ETHMACRST_R;
pub use GPIOARST_R as OTGHSRST_R;
pub use GPIOARST_W as GPIOBRST_W;
pub use GPIOARST_W as GPIOCRST_W;
pub use GPIOARST_W as GPIODRST_W;
pub use GPIOARST_W as GPIOERST_W;
pub use GPIOARST_W as GPIOFRST_W;
pub use GPIOARST_W as GPIOGRST_W;
pub use GPIOARST_W as GPIOHRST_W;
pub use GPIOARST_W as GPIOIRST_W;
pub use GPIOARST_W as GPIOJRST_W;
pub use GPIOARST_W as GPIOKRST_W;
pub use GPIOARST_W as CRCRST_W;
pub use GPIOARST_W as DMA1RST_W;
pub use GPIOARST_W as DMA2RST_W;
pub use GPIOARST_W as DMA2DRST_W;
pub use GPIOARST_W as ETHMACRST_W;
pub use GPIOARST_W as OTGHSRST_W;
impl R {
#[inline(always)]
pub fn gpioarst(&self) -> GPIOARST_R {
GPIOARST_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn gpiobrst(&self) -> GPIOBRST_R {
GPIOBRST_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn gpiocrst(&self) -> GPIOCRST_R {
GPIOCRST_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn gpiodrst(&self) -> GPIODRST_R {
GPIODRST_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn gpioerst(&self) -> GPIOERST_R {
GPIOERST_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn gpiofrst(&self) -> GPIOFRST_R {
GPIOFRST_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn gpiogrst(&self) -> GPIOGRST_R {
GPIOGRST_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn gpiohrst(&self) -> GPIOHRST_R {
GPIOHRST_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn gpioirst(&self) -> GPIOIRST_R {
GPIOIRST_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn gpiojrst(&self) -> GPIOJRST_R {
GPIOJRST_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn gpiokrst(&self) -> GPIOKRST_R {
GPIOKRST_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn crcrst(&self) -> CRCRST_R {
CRCRST_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn dma1rst(&self) -> DMA1RST_R {
DMA1RST_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn dma2rst(&self) -> DMA2RST_R {
DMA2RST_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn dma2drst(&self) -> DMA2DRST_R {
DMA2DRST_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn ethmacrst(&self) -> ETHMACRST_R {
ETHMACRST_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn otghsrst(&self) -> OTGHSRST_R {
OTGHSRST_R::new(((self.bits >> 29) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHB1RSTR")
.field("gpioarst", &self.gpioarst())
.field("otghsrst", &self.otghsrst())
.field("ethmacrst", &self.ethmacrst())
.field("dma2drst", &self.dma2drst())
.field("dma2rst", &self.dma2rst())
.field("dma1rst", &self.dma1rst())
.field("crcrst", &self.crcrst())
.field("gpiokrst", &self.gpiokrst())
.field("gpiojrst", &self.gpiojrst())
.field("gpioirst", &self.gpioirst())
.field("gpiohrst", &self.gpiohrst())
.field("gpiogrst", &self.gpiogrst())
.field("gpiofrst", &self.gpiofrst())
.field("gpioerst", &self.gpioerst())
.field("gpiodrst", &self.gpiodrst())
.field("gpiocrst", &self.gpiocrst())
.field("gpiobrst", &self.gpiobrst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn gpioarst(&mut self) -> GPIOARST_W<AHB1RSTRrs> {
GPIOARST_W::new(self, 0)
}
#[inline(always)]
pub fn gpiobrst(&mut self) -> GPIOBRST_W<AHB1RSTRrs> {
GPIOBRST_W::new(self, 1)
}
#[inline(always)]
pub fn gpiocrst(&mut self) -> GPIOCRST_W<AHB1RSTRrs> {
GPIOCRST_W::new(self, 2)
}
#[inline(always)]
pub fn gpiodrst(&mut self) -> GPIODRST_W<AHB1RSTRrs> {
GPIODRST_W::new(self, 3)
}
#[inline(always)]
pub fn gpioerst(&mut self) -> GPIOERST_W<AHB1RSTRrs> {
GPIOERST_W::new(self, 4)
}
#[inline(always)]
pub fn gpiofrst(&mut self) -> GPIOFRST_W<AHB1RSTRrs> {
GPIOFRST_W::new(self, 5)
}
#[inline(always)]
pub fn gpiogrst(&mut self) -> GPIOGRST_W<AHB1RSTRrs> {
GPIOGRST_W::new(self, 6)
}
#[inline(always)]
pub fn gpiohrst(&mut self) -> GPIOHRST_W<AHB1RSTRrs> {
GPIOHRST_W::new(self, 7)
}
#[inline(always)]
pub fn gpioirst(&mut self) -> GPIOIRST_W<AHB1RSTRrs> {
GPIOIRST_W::new(self, 8)
}
#[inline(always)]
pub fn gpiojrst(&mut self) -> GPIOJRST_W<AHB1RSTRrs> {
GPIOJRST_W::new(self, 9)
}
#[inline(always)]
pub fn gpiokrst(&mut self) -> GPIOKRST_W<AHB1RSTRrs> {
GPIOKRST_W::new(self, 10)
}
#[inline(always)]
pub fn crcrst(&mut self) -> CRCRST_W<AHB1RSTRrs> {
CRCRST_W::new(self, 12)
}
#[inline(always)]
pub fn dma1rst(&mut self) -> DMA1RST_W<AHB1RSTRrs> {
DMA1RST_W::new(self, 21)
}
#[inline(always)]
pub fn dma2rst(&mut self) -> DMA2RST_W<AHB1RSTRrs> {
DMA2RST_W::new(self, 22)
}
#[inline(always)]
pub fn dma2drst(&mut self) -> DMA2DRST_W<AHB1RSTRrs> {
DMA2DRST_W::new(self, 23)
}
#[inline(always)]
pub fn ethmacrst(&mut self) -> ETHMACRST_W<AHB1RSTRrs> {
ETHMACRST_W::new(self, 25)
}
#[inline(always)]
pub fn otghsrst(&mut self) -> OTGHSRST_W<AHB1RSTRrs> {
OTGHSRST_W::new(self, 29)
}
}
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 {}