pub type R = crate::R<ISRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CMP1 {
NoEvent = 0,
Event = 1,
}
impl From<CMP1> for bool {
#[inline(always)]
fn from(variant: CMP1) -> Self {
variant as u8 != 0
}
}
pub type CMP_R = crate::BitReader<CMP1>;
impl CMP_R {
#[inline(always)]
pub const fn variant(&self) -> CMP1 {
match self.bits {
false => CMP1::NoEvent,
true => CMP1::Event,
}
}
#[inline(always)]
pub fn is_no_event(&self) -> bool {
*self == CMP1::NoEvent
}
#[inline(always)]
pub fn is_event(&self) -> bool {
*self == CMP1::Event
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum REP {
NoEvent = 0,
Event = 1,
}
impl From<REP> for bool {
#[inline(always)]
fn from(variant: REP) -> Self {
variant as u8 != 0
}
}
pub type REP_R = crate::BitReader<REP>;
impl REP_R {
#[inline(always)]
pub const fn variant(&self) -> REP {
match self.bits {
false => REP::NoEvent,
true => REP::Event,
}
}
#[inline(always)]
pub fn is_no_event(&self) -> bool {
*self == REP::NoEvent
}
#[inline(always)]
pub fn is_event(&self) -> bool {
*self == REP::Event
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SYNC {
NoEvent = 0,
Event = 1,
}
impl From<SYNC> for bool {
#[inline(always)]
fn from(variant: SYNC) -> Self {
variant as u8 != 0
}
}
pub type SYNC_R = crate::BitReader<SYNC>;
impl SYNC_R {
#[inline(always)]
pub const fn variant(&self) -> SYNC {
match self.bits {
false => SYNC::NoEvent,
true => SYNC::Event,
}
}
#[inline(always)]
pub fn is_no_event(&self) -> bool {
*self == SYNC::NoEvent
}
#[inline(always)]
pub fn is_event(&self) -> bool {
*self == SYNC::Event
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum UPD {
NoEvent = 0,
Event = 1,
}
impl From<UPD> for bool {
#[inline(always)]
fn from(variant: UPD) -> Self {
variant as u8 != 0
}
}
pub type UPD_R = crate::BitReader<UPD>;
impl UPD_R {
#[inline(always)]
pub const fn variant(&self) -> UPD {
match self.bits {
false => UPD::NoEvent,
true => UPD::Event,
}
}
#[inline(always)]
pub fn is_no_event(&self) -> bool {
*self == UPD::NoEvent
}
#[inline(always)]
pub fn is_event(&self) -> bool {
*self == UPD::Event
}
}
impl R {
#[inline(always)]
pub fn cmp(&self, n: u8) -> CMP_R {
#[allow(clippy::no_effect)] [(); 4][n as usize];
CMP_R::new(((self.bits >> n) & 1) != 0)
}
#[inline(always)]
pub fn cmp_iter(&self) -> impl Iterator<Item = CMP_R> + '_ {
(0..4).map(move |n| CMP_R::new(((self.bits >> n) & 1) != 0))
}
#[inline(always)]
pub fn cmp1(&self) -> CMP_R {
CMP_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn cmp2(&self) -> CMP_R {
CMP_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn cmp3(&self) -> CMP_R {
CMP_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn cmp4(&self) -> CMP_R {
CMP_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn rep(&self) -> REP_R {
REP_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn sync(&self) -> SYNC_R {
SYNC_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn upd(&self) -> UPD_R {
UPD_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("ISR")
.field("upd", &self.upd())
.field("sync", &self.sync())
.field("rep", &self.rep())
.field("cmp1", &self.cmp1())
.field("cmp2", &self.cmp2())
.field("cmp3", &self.cmp3())
.field("cmp4", &self.cmp4())
.finish()
}
}
pub struct ISRrs;
impl crate::RegisterSpec for ISRrs {
type Ux = u32;
}
impl crate::Readable for ISRrs {}
impl crate::Resettable for ISRrs {}