pub type R = crate::R<SRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CCF {
Complete = 0,
NotComplete = 1,
}
impl From<CCF> for bool {
#[inline(always)]
fn from(variant: CCF) -> Self {
variant as u8 != 0
}
}
pub type CCF_R = crate::BitReader<CCF>;
impl CCF_R {
#[inline(always)]
pub const fn variant(&self) -> CCF {
match self.bits {
false => CCF::Complete,
true => CCF::NotComplete,
}
}
#[inline(always)]
pub fn is_complete(&self) -> bool {
*self == CCF::Complete
}
#[inline(always)]
pub fn is_not_complete(&self) -> bool {
*self == CCF::NotComplete
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RDERR {
NoError = 0,
Error = 1,
}
impl From<RDERR> for bool {
#[inline(always)]
fn from(variant: RDERR) -> Self {
variant as u8 != 0
}
}
pub type RDERR_R = crate::BitReader<RDERR>;
impl RDERR_R {
#[inline(always)]
pub const fn variant(&self) -> RDERR {
match self.bits {
false => RDERR::NoError,
true => RDERR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == RDERR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == RDERR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WRERR {
NoError = 0,
Error = 1,
}
impl From<WRERR> for bool {
#[inline(always)]
fn from(variant: WRERR) -> Self {
variant as u8 != 0
}
}
pub type WRERR_R = crate::BitReader<WRERR>;
impl WRERR_R {
#[inline(always)]
pub const fn variant(&self) -> WRERR {
match self.bits {
false => WRERR::NoError,
true => WRERR::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == WRERR::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == WRERR::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum BUSY {
Idle = 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::Idle,
true => BUSY::Busy,
}
}
#[inline(always)]
pub fn is_idle(&self) -> bool {
*self == BUSY::Idle
}
#[inline(always)]
pub fn is_busy(&self) -> bool {
*self == BUSY::Busy
}
}
impl R {
#[inline(always)]
pub fn ccf(&self) -> CCF_R {
CCF_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn rderr(&self) -> RDERR_R {
RDERR_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn wrerr(&self) -> WRERR_R {
WRERR_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn busy(&self) -> BUSY_R {
BUSY_R::new(((self.bits >> 3) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SR")
.field("busy", &self.busy())
.field("wrerr", &self.wrerr())
.field("rderr", &self.rderr())
.field("ccf", &self.ccf())
.finish()
}
}
pub struct SRrs;
impl crate::RegisterSpec for SRrs {
type Ux = u32;
}
impl crate::Readable for SRrs {}
impl crate::Resettable for SRrs {}