pub type R = crate::R<SRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TEF {
NoError = 0,
Error = 1,
}
impl From<TEF> for bool {
#[inline(always)]
fn from(variant: TEF) -> Self {
variant as u8 != 0
}
}
pub type TEF_R = crate::BitReader<TEF>;
impl TEF_R {
#[inline(always)]
pub const fn variant(&self) -> TEF {
match self.bits {
false => TEF::NoError,
true => TEF::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == TEF::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == TEF::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TCF {
NotComplete = 0,
Complete = 1,
}
impl From<TCF> for bool {
#[inline(always)]
fn from(variant: TCF) -> Self {
variant as u8 != 0
}
}
pub type TCF_R = crate::BitReader<TCF>;
impl TCF_R {
#[inline(always)]
pub const fn variant(&self) -> TCF {
match self.bits {
false => TCF::NotComplete,
true => TCF::Complete,
}
}
#[inline(always)]
pub fn is_not_complete(&self) -> bool {
*self == TCF::NotComplete
}
#[inline(always)]
pub fn is_complete(&self) -> bool {
*self == TCF::Complete
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FTF {
NotReached = 0,
Reached = 1,
}
impl From<FTF> for bool {
#[inline(always)]
fn from(variant: FTF) -> Self {
variant as u8 != 0
}
}
pub type FTF_R = crate::BitReader<FTF>;
impl FTF_R {
#[inline(always)]
pub const fn variant(&self) -> FTF {
match self.bits {
false => FTF::NotReached,
true => FTF::Reached,
}
}
#[inline(always)]
pub fn is_not_reached(&self) -> bool {
*self == FTF::NotReached
}
#[inline(always)]
pub fn is_reached(&self) -> bool {
*self == FTF::Reached
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SMF {
NotMatched = 0,
Matched = 1,
}
impl From<SMF> for bool {
#[inline(always)]
fn from(variant: SMF) -> Self {
variant as u8 != 0
}
}
pub type SMF_R = crate::BitReader<SMF>;
impl SMF_R {
#[inline(always)]
pub const fn variant(&self) -> SMF {
match self.bits {
false => SMF::NotMatched,
true => SMF::Matched,
}
}
#[inline(always)]
pub fn is_not_matched(&self) -> bool {
*self == SMF::NotMatched
}
#[inline(always)]
pub fn is_matched(&self) -> bool {
*self == SMF::Matched
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TOF {
NotTimeout = 0,
Timeout = 1,
}
impl From<TOF> for bool {
#[inline(always)]
fn from(variant: TOF) -> Self {
variant as u8 != 0
}
}
pub type TOF_R = crate::BitReader<TOF>;
impl TOF_R {
#[inline(always)]
pub const fn variant(&self) -> TOF {
match self.bits {
false => TOF::NotTimeout,
true => TOF::Timeout,
}
}
#[inline(always)]
pub fn is_not_timeout(&self) -> bool {
*self == TOF::NotTimeout
}
#[inline(always)]
pub fn is_timeout(&self) -> bool {
*self == TOF::Timeout
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BUSY {
NotBusy = 0,
Busy = 1,
}
impl From<BUSY> for bool {
#[inline(always)]
fn from(variant: BUSY) -> Self {
variant as u8 != 0
}
}
pub type BUSY_R = crate::BitReader<BUSY>;
impl BUSY_R {
#[inline(always)]
pub const fn variant(&self) -> BUSY {
match self.bits {
false => BUSY::NotBusy,
true => BUSY::Busy,
}
}
#[inline(always)]
pub fn is_not_busy(&self) -> bool {
*self == BUSY::NotBusy
}
#[inline(always)]
pub fn is_busy(&self) -> bool {
*self == BUSY::Busy
}
}
pub type FLEVEL_R = crate::FieldReader;
impl R {
#[inline(always)]
pub fn tef(&self) -> TEF_R {
TEF_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn tcf(&self) -> TCF_R {
TCF_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn ftf(&self) -> FTF_R {
FTF_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn smf(&self) -> SMF_R {
SMF_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn tof(&self) -> TOF_R {
TOF_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn busy(&self) -> BUSY_R {
BUSY_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn flevel(&self) -> FLEVEL_R {
FLEVEL_R::new(((self.bits >> 8) & 0x3f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SR")
.field("tef", &self.tef())
.field("tcf", &self.tcf())
.field("ftf", &self.ftf())
.field("smf", &self.smf())
.field("tof", &self.tof())
.field("busy", &self.busy())
.field("flevel", &self.flevel())
.finish()
}
}
pub struct SRrs;
impl crate::RegisterSpec for SRrs {
type Ux = u32;
}
impl crate::Readable for SRrs {}
impl crate::Resettable for SRrs {}