pub type R = crate::R<CNTrs>;
pub type W = crate::W<CNTrs>;
pub type CNT_R = crate::FieldReader<u16>;
pub type CNT_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum UIFCPYR {
NoUpdateOccurred = 0,
UpdatePending = 1,
}
impl From<UIFCPYR> for bool {
#[inline(always)]
fn from(variant: UIFCPYR) -> Self {
variant as u8 != 0
}
}
pub type UIFCPY_R = crate::BitReader<UIFCPYR>;
impl UIFCPY_R {
#[inline(always)]
pub const fn variant(&self) -> UIFCPYR {
match self.bits {
false => UIFCPYR::NoUpdateOccurred,
true => UIFCPYR::UpdatePending,
}
}
#[inline(always)]
pub fn is_no_update_occurred(&self) -> bool {
*self == UIFCPYR::NoUpdateOccurred
}
#[inline(always)]
pub fn is_update_pending(&self) -> bool {
*self == UIFCPYR::UpdatePending
}
}
impl R {
#[inline(always)]
pub fn cnt(&self) -> CNT_R {
CNT_R::new((self.bits & 0xffff) as u16)
}
#[inline(always)]
pub fn uifcpy(&self) -> UIFCPY_R {
UIFCPY_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("CNT")
.field("cnt", &self.cnt())
.field("uifcpy", &self.uifcpy())
.finish()
}
}
impl W {
#[inline(always)]
pub fn cnt(&mut self) -> CNT_W<CNTrs> {
CNT_W::new(self, 0)
}
}
pub struct CNTrs;
impl crate::RegisterSpec for CNTrs {
type Ux = u32;
}
impl crate::Readable for CNTrs {}
impl crate::Writable for CNTrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CNTrs {}