pub type R = crate::R<STATUSrs>;
pub type SingleactR = crate::BitReader;
pub type ScanactR = crate::BitReader;
pub type SinglerefwarmR = crate::BitReader;
pub type ScanrefwarmR = crate::BitReader;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PROGERR {
Busconf = 1,
Negselconf = 2,
}
impl From<PROGERR> for u8 {
#[inline(always)]
fn from(variant: PROGERR) -> Self {
variant as _
}
}
impl crate::FieldSpec for PROGERR {
type Ux = u8;
}
impl crate::IsEnum for PROGERR {}
pub type ProgerrR = crate::FieldReader<PROGERR>;
impl ProgerrR {
#[inline(always)]
pub const fn variant(&self) -> Option<PROGERR> {
match self.bits {
1 => Some(PROGERR::Busconf),
2 => Some(PROGERR::Negselconf),
_ => None,
}
}
#[inline(always)]
pub fn is_busconf(&self) -> bool {
*self == PROGERR::Busconf
}
#[inline(always)]
pub fn is_negselconf(&self) -> bool {
*self == PROGERR::Negselconf
}
}
pub type WarmR = crate::BitReader;
pub type SingledvR = crate::BitReader;
pub type ScandvR = crate::BitReader;
impl R {
#[inline(always)]
pub fn singleact(&self) -> SingleactR {
SingleactR::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn scanact(&self) -> ScanactR {
ScanactR::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn singlerefwarm(&self) -> SinglerefwarmR {
SinglerefwarmR::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn scanrefwarm(&self) -> ScanrefwarmR {
ScanrefwarmR::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn progerr(&self) -> ProgerrR {
ProgerrR::new(((self.bits >> 10) & 3) as u8)
}
#[inline(always)]
pub fn warm(&self) -> WarmR {
WarmR::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn singledv(&self) -> SingledvR {
SingledvR::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn scandv(&self) -> ScandvR {
ScandvR::new(((self.bits >> 17) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("STATUS")
.field("singleact", &self.singleact())
.field("scanact", &self.scanact())
.field("singlerefwarm", &self.singlerefwarm())
.field("scanrefwarm", &self.scanrefwarm())
.field("progerr", &self.progerr())
.field("warm", &self.warm())
.field("singledv", &self.singledv())
.field("scandv", &self.scandv())
.finish()
}
}
pub struct STATUSrs;
impl crate::RegisterSpec for STATUSrs {
type Ux = u32;
}
impl crate::Readable for STATUSrs {}
impl crate::Resettable for STATUSrs {}