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 FSMCRST {
Reset = 1,
}
impl From<FSMCRST> for bool {
#[inline(always)]
fn from(variant: FSMCRST) -> Self {
variant as u8 != 0
}
}
pub type FSMCRST_R = crate::BitReader<FSMCRST>;
impl FSMCRST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<FSMCRST> {
match self.bits {
true => Some(FSMCRST::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == FSMCRST::Reset
}
}
pub type FSMCRST_W<'a, REG> = crate::BitWriter<'a, REG, FSMCRST>;
impl<'a, REG> FSMCRST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(FSMCRST::Reset)
}
}
impl R {
#[inline(always)]
pub fn fsmcrst(&self) -> FSMCRST_R {
FSMCRST_R::new((self.bits & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHB3RSTR")
.field("fsmcrst", &self.fsmcrst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn fsmcrst(&mut self) -> FSMCRST_W<AHB3RSTRrs> {
FSMCRST_W::new(self, 0)
}
}
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 {}