pub type R = crate::R<CSRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SOF0 {
NoSyncEvent = 0,
SyncEvent = 1,
}
impl From<SOF0> for bool {
#[inline(always)]
fn from(variant: SOF0) -> Self {
variant as u8 != 0
}
}
pub type SOF_R = crate::BitReader<SOF0>;
impl SOF_R {
#[inline(always)]
pub const fn variant(&self) -> SOF0 {
match self.bits {
false => SOF0::NoSyncEvent,
true => SOF0::SyncEvent,
}
}
#[inline(always)]
pub fn is_no_sync_event(&self) -> bool {
*self == SOF0::NoSyncEvent
}
#[inline(always)]
pub fn is_sync_event(&self) -> bool {
*self == SOF0::SyncEvent
}
}
impl R {
#[inline(always)]
pub fn sof(&self, n: u8) -> SOF_R {
#[allow(clippy::no_effect)]
[(); 7][n as usize];
SOF_R::new(((self.bits >> n) & 1) != 0)
}
#[inline(always)]
pub fn sof_iter(&self) -> impl Iterator<Item = SOF_R> + '_ {
(0..7).map(move |n| SOF_R::new(((self.bits >> n) & 1) != 0))
}
#[inline(always)]
pub fn sof0(&self) -> SOF_R {
SOF_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn sof1(&self) -> SOF_R {
SOF_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn sof2(&self) -> SOF_R {
SOF_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn sof3(&self) -> SOF_R {
SOF_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn sof4(&self) -> SOF_R {
SOF_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn sof5(&self) -> SOF_R {
SOF_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn sof6(&self) -> SOF_R {
SOF_R::new(((self.bits >> 6) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CSR")
.field("sof0", &self.sof0())
.field("sof1", &self.sof1())
.field("sof2", &self.sof2())
.field("sof3", &self.sof3())
.field("sof4", &self.sof4())
.field("sof5", &self.sof5())
.field("sof6", &self.sof6())
.finish()
}
}
pub struct CSRrs;
impl crate::RegisterSpec for CSRrs {
type Ux = u32;
}
impl crate::Readable for CSRrs {}
impl crate::Resettable for CSRrs {}