pub type R = crate::R<AHB2RSTRrs>;
pub type W = crate::W<AHB2RSTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DCMI_PSSIRST {
Reset = 1,
}
impl From<DCMI_PSSIRST> for bool {
#[inline(always)]
fn from(variant: DCMI_PSSIRST) -> Self {
variant as u8 != 0
}
}
pub type DCMI_PSSIRST_R = crate::BitReader<DCMI_PSSIRST>;
impl DCMI_PSSIRST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<DCMI_PSSIRST> {
match self.bits {
true => Some(DCMI_PSSIRST::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == DCMI_PSSIRST::Reset
}
}
pub type DCMI_PSSIRST_W<'a, REG> = crate::BitWriter<'a, REG, DCMI_PSSIRST>;
impl<'a, REG> DCMI_PSSIRST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(DCMI_PSSIRST::Reset)
}
}
pub use DCMI_PSSIRST_R as HSEMRST_R;
pub use DCMI_PSSIRST_R as CRYPTRST_R;
pub use DCMI_PSSIRST_R as HASHRST_R;
pub use DCMI_PSSIRST_R as RNGRST_R;
pub use DCMI_PSSIRST_R as SDMMC2RST_R;
pub use DCMI_PSSIRST_R as BDMA1RST_R;
pub use DCMI_PSSIRST_W as HSEMRST_W;
pub use DCMI_PSSIRST_W as CRYPTRST_W;
pub use DCMI_PSSIRST_W as HASHRST_W;
pub use DCMI_PSSIRST_W as RNGRST_W;
pub use DCMI_PSSIRST_W as SDMMC2RST_W;
pub use DCMI_PSSIRST_W as BDMA1RST_W;
impl R {
#[inline(always)]
pub fn dcmi_pssirst(&self) -> DCMI_PSSIRST_R {
DCMI_PSSIRST_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn hsemrst(&self) -> HSEMRST_R {
HSEMRST_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn cryptrst(&self) -> CRYPTRST_R {
CRYPTRST_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn hashrst(&self) -> HASHRST_R {
HASHRST_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn rngrst(&self) -> RNGRST_R {
RNGRST_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn sdmmc2rst(&self) -> SDMMC2RST_R {
SDMMC2RST_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn bdma1rst(&self) -> BDMA1RST_R {
BDMA1RST_R::new(((self.bits >> 11) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHB2RSTR")
.field("dcmi_pssirst", &self.dcmi_pssirst())
.field("hsemrst", &self.hsemrst())
.field("cryptrst", &self.cryptrst())
.field("hashrst", &self.hashrst())
.field("rngrst", &self.rngrst())
.field("sdmmc2rst", &self.sdmmc2rst())
.field("bdma1rst", &self.bdma1rst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dcmi_pssirst(&mut self) -> DCMI_PSSIRST_W<AHB2RSTRrs> {
DCMI_PSSIRST_W::new(self, 0)
}
#[inline(always)]
pub fn hsemrst(&mut self) -> HSEMRST_W<AHB2RSTRrs> {
HSEMRST_W::new(self, 2)
}
#[inline(always)]
pub fn cryptrst(&mut self) -> CRYPTRST_W<AHB2RSTRrs> {
CRYPTRST_W::new(self, 4)
}
#[inline(always)]
pub fn hashrst(&mut self) -> HASHRST_W<AHB2RSTRrs> {
HASHRST_W::new(self, 5)
}
#[inline(always)]
pub fn rngrst(&mut self) -> RNGRST_W<AHB2RSTRrs> {
RNGRST_W::new(self, 6)
}
#[inline(always)]
pub fn sdmmc2rst(&mut self) -> SDMMC2RST_W<AHB2RSTRrs> {
SDMMC2RST_W::new(self, 9)
}
#[inline(always)]
pub fn bdma1rst(&mut self) -> BDMA1RST_W<AHB2RSTRrs> {
BDMA1RST_W::new(self, 11)
}
}
pub struct AHB2RSTRrs;
impl crate::RegisterSpec for AHB2RSTRrs {
type Ux = u32;
}
impl crate::Readable for AHB2RSTRrs {}
impl crate::Writable for AHB2RSTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHB2RSTRrs {}