pub type R = crate::R<DSTATUSrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DATA0ZERO {
Zero0to31 = 1,
Zero32to63 = 2,
Zero64to95 = 4,
Zero96to127 = 8,
}
impl From<DATA0ZERO> for u8 {
#[inline(always)]
fn from(variant: DATA0ZERO) -> Self {
variant as _
}
}
impl crate::FieldSpec for DATA0ZERO {
type Ux = u8;
}
impl crate::IsEnum for DATA0ZERO {}
pub type Data0zeroR = crate::FieldReader<DATA0ZERO>;
impl Data0zeroR {
#[inline(always)]
pub const fn variant(&self) -> Option<DATA0ZERO> {
match self.bits {
1 => Some(DATA0ZERO::Zero0to31),
2 => Some(DATA0ZERO::Zero32to63),
4 => Some(DATA0ZERO::Zero64to95),
8 => Some(DATA0ZERO::Zero96to127),
_ => None,
}
}
#[inline(always)]
pub fn is_zero0to31(&self) -> bool {
*self == DATA0ZERO::Zero0to31
}
#[inline(always)]
pub fn is_zero32to63(&self) -> bool {
*self == DATA0ZERO::Zero32to63
}
#[inline(always)]
pub fn is_zero64to95(&self) -> bool {
*self == DATA0ZERO::Zero64to95
}
#[inline(always)]
pub fn is_zero96to127(&self) -> bool {
*self == DATA0ZERO::Zero96to127
}
}
pub type Ddata0lsbsR = crate::FieldReader;
pub type Ddata0msbsR = crate::FieldReader;
pub type Ddata1msbR = crate::BitReader;
pub type CarryR = crate::BitReader;
impl R {
#[inline(always)]
pub fn data0zero(&self) -> Data0zeroR {
Data0zeroR::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn ddata0lsbs(&self) -> Ddata0lsbsR {
Ddata0lsbsR::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn ddata0msbs(&self) -> Ddata0msbsR {
Ddata0msbsR::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn ddata1msb(&self) -> Ddata1msbR {
Ddata1msbR::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn carry(&self) -> CarryR {
CarryR::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("DSTATUS")
.field("data0zero", &self.data0zero())
.field("ddata0lsbs", &self.ddata0lsbs())
.field("ddata0msbs", &self.ddata0msbs())
.field("ddata1msb", &self.ddata1msb())
.field("carry", &self.carry())
.finish()
}
}
pub struct DSTATUSrs;
impl crate::RegisterSpec for DSTATUSrs {
type Ux = u32;
}
impl crate::Readable for DSTATUSrs {}
impl crate::Resettable for DSTATUSrs {}