pub type R = crate::R<SRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ALRAF {
Match = 1,
}
impl From<ALRAF> for bool {
#[inline(always)]
fn from(variant: ALRAF) -> Self {
variant as u8 != 0
}
}
pub type ALRF_R = crate::BitReader<ALRAF>;
impl ALRF_R {
#[inline(always)]
pub const fn variant(&self) -> Option<ALRAF> {
match self.bits {
true => Some(ALRAF::Match),
_ => None,
}
}
#[inline(always)]
pub fn is_match(&self) -> bool {
*self == ALRAF::Match
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WUTF {
Zero = 1,
}
impl From<WUTF> for bool {
#[inline(always)]
fn from(variant: WUTF) -> Self {
variant as u8 != 0
}
}
pub type WUTF_R = crate::BitReader<WUTF>;
impl WUTF_R {
#[inline(always)]
pub const fn variant(&self) -> Option<WUTF> {
match self.bits {
true => Some(WUTF::Zero),
_ => None,
}
}
#[inline(always)]
pub fn is_zero(&self) -> bool {
*self == WUTF::Zero
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TSF {
TimestampEvent = 1,
}
impl From<TSF> for bool {
#[inline(always)]
fn from(variant: TSF) -> Self {
variant as u8 != 0
}
}
pub type TSF_R = crate::BitReader<TSF>;
impl TSF_R {
#[inline(always)]
pub const fn variant(&self) -> Option<TSF> {
match self.bits {
true => Some(TSF::TimestampEvent),
_ => None,
}
}
#[inline(always)]
pub fn is_timestamp_event(&self) -> bool {
*self == TSF::TimestampEvent
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TSOVF {
Overflow = 1,
}
impl From<TSOVF> for bool {
#[inline(always)]
fn from(variant: TSOVF) -> Self {
variant as u8 != 0
}
}
pub type TSOVF_R = crate::BitReader<TSOVF>;
impl TSOVF_R {
#[inline(always)]
pub const fn variant(&self) -> Option<TSOVF> {
match self.bits {
true => Some(TSOVF::Overflow),
_ => None,
}
}
#[inline(always)]
pub fn is_overflow(&self) -> bool {
*self == TSOVF::Overflow
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ITSF {
TimestampEvent = 1,
}
impl From<ITSF> for bool {
#[inline(always)]
fn from(variant: ITSF) -> Self {
variant as u8 != 0
}
}
pub type ITSF_R = crate::BitReader<ITSF>;
impl ITSF_R {
#[inline(always)]
pub const fn variant(&self) -> Option<ITSF> {
match self.bits {
true => Some(ITSF::TimestampEvent),
_ => None,
}
}
#[inline(always)]
pub fn is_timestamp_event(&self) -> bool {
*self == ITSF::TimestampEvent
}
}
impl R {
#[inline(always)]
pub fn alrf(&self, n: u8) -> ALRF_R {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
ALRF_R::new(((self.bits >> n) & 1) != 0)
}
#[inline(always)]
pub fn alrf_iter(&self) -> impl Iterator<Item = ALRF_R> + '_ {
(0..2).map(move |n| ALRF_R::new(((self.bits >> n) & 1) != 0))
}
#[inline(always)]
pub fn alraf(&self) -> ALRF_R {
ALRF_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn alrbf(&self) -> ALRF_R {
ALRF_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn wutf(&self) -> WUTF_R {
WUTF_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn tsf(&self) -> TSF_R {
TSF_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn tsovf(&self) -> TSOVF_R {
TSOVF_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn itsf(&self) -> ITSF_R {
ITSF_R::new(((self.bits >> 5) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SR")
.field("alraf", &self.alraf())
.field("alrbf", &self.alrbf())
.field("wutf", &self.wutf())
.field("tsf", &self.tsf())
.field("tsovf", &self.tsovf())
.field("itsf", &self.itsf())
.finish()
}
}
pub struct SRrs;
impl crate::RegisterSpec for SRrs {
type Ux = u32;
}
impl crate::Readable for SRrs {}
impl crate::Resettable for SRrs {}