pub type R = crate::R<AHBRSTRrs>;
pub type W = crate::W<AHBRSTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DMARSTW {
Reset = 1,
}
impl From<DMARSTW> for bool {
#[inline(always)]
fn from(variant: DMARSTW) -> Self {
variant as u8 != 0
}
}
pub type DMARST_R = crate::BitReader<DMARSTW>;
impl DMARST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<DMARSTW> {
match self.bits {
true => Some(DMARSTW::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == DMARSTW::Reset
}
}
pub type DMARST_W<'a, REG> = crate::BitWriter<'a, REG, DMARSTW>;
impl<'a, REG> DMARST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(DMARSTW::Reset)
}
}
pub use DMARST_R as MIFRST_R;
pub use DMARST_R as CRCRST_R;
pub use DMARST_R as TOUCHRST_R;
pub use DMARST_R as RNGRST_R;
pub use DMARST_R as CRYPRST_R;
pub use DMARST_W as MIFRST_W;
pub use DMARST_W as CRCRST_W;
pub use DMARST_W as TOUCHRST_W;
pub use DMARST_W as RNGRST_W;
pub use DMARST_W as CRYPRST_W;
impl R {
#[inline(always)]
pub fn dmarst(&self) -> DMARST_R {
DMARST_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn mifrst(&self) -> MIFRST_R {
MIFRST_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn crcrst(&self) -> CRCRST_R {
CRCRST_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn touchrst(&self) -> TOUCHRST_R {
TOUCHRST_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn rngrst(&self) -> RNGRST_R {
RNGRST_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn cryprst(&self) -> CRYPRST_R {
CRYPRST_R::new(((self.bits >> 24) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHBRSTR")
.field("dmarst", &self.dmarst())
.field("cryprst", &self.cryprst())
.field("rngrst", &self.rngrst())
.field("touchrst", &self.touchrst())
.field("crcrst", &self.crcrst())
.field("mifrst", &self.mifrst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dmarst(&mut self) -> DMARST_W<AHBRSTRrs> {
DMARST_W::new(self, 0)
}
#[inline(always)]
pub fn mifrst(&mut self) -> MIFRST_W<AHBRSTRrs> {
MIFRST_W::new(self, 8)
}
#[inline(always)]
pub fn crcrst(&mut self) -> CRCRST_W<AHBRSTRrs> {
CRCRST_W::new(self, 12)
}
#[inline(always)]
pub fn touchrst(&mut self) -> TOUCHRST_W<AHBRSTRrs> {
TOUCHRST_W::new(self, 16)
}
#[inline(always)]
pub fn rngrst(&mut self) -> RNGRST_W<AHBRSTRrs> {
RNGRST_W::new(self, 20)
}
#[inline(always)]
pub fn cryprst(&mut self) -> CRYPRST_W<AHBRSTRrs> {
CRYPRST_W::new(self, 24)
}
}
pub struct AHBRSTRrs;
impl crate::RegisterSpec for AHBRSTRrs {
type Ux = u32;
}
impl crate::Readable for AHBRSTRrs {}
impl crate::Writable for AHBRSTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHBRSTRrs {}