pub type R = crate::R<SRrs>;
pub type W = crate::W<SRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum UIFR {
NoUpdateOccurred = 0,
UpdatePending = 1,
}
impl From<UIFR> for bool {
#[inline(always)]
fn from(variant: UIFR) -> Self {
variant as u8 != 0
}
}
pub type UIF_R = crate::BitReader<UIFR>;
impl UIF_R {
#[inline(always)]
pub const fn variant(&self) -> UIFR {
match self.bits {
false => UIFR::NoUpdateOccurred,
true => UIFR::UpdatePending,
}
}
#[inline(always)]
pub fn is_no_update_occurred(&self) -> bool {
*self == UIFR::NoUpdateOccurred
}
#[inline(always)]
pub fn is_update_pending(&self) -> bool {
*self == UIFR::UpdatePending
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum UIFW {
Clear = 0,
}
impl From<UIFW> for bool {
#[inline(always)]
fn from(variant: UIFW) -> Self {
variant as u8 != 0
}
}
pub type UIF_W<'a, REG> = crate::BitWriter0C<'a, REG, UIFW>;
impl<'a, REG> UIF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(UIFW::Clear)
}
}
impl R {
#[inline(always)]
pub fn uif(&self) -> UIF_R {
UIF_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("SR").field("uif", &self.uif()).finish()
}
}
impl W {
#[inline(always)]
pub fn uif(&mut self) -> UIF_W<SRrs> {
UIF_W::new(self, 0)
}
}
pub struct SRrs;
impl crate::RegisterSpec for SRrs {
type Ux = u32;
}
impl crate::Readable for SRrs {}
impl crate::Writable for SRrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x01;
}
impl crate::Resettable for SRrs {}