pub type R = crate::R<SRrs>;
pub type W = crate::W<SRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DRDY {
Invalid = 0,
Valid = 1,
}
impl From<DRDY> for bool {
#[inline(always)]
fn from(variant: DRDY) -> Self {
variant as u8 != 0
}
}
pub type DRDY_R = crate::BitReader<DRDY>;
impl DRDY_R {
#[inline(always)]
pub const fn variant(&self) -> DRDY {
match self.bits {
false => DRDY::Invalid,
true => DRDY::Valid,
}
}
#[inline(always)]
pub fn is_invalid(&self) -> bool {
*self == DRDY::Invalid
}
#[inline(always)]
pub fn is_valid(&self) -> bool {
*self == DRDY::Valid
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CECS {
Correct = 0,
Slow = 1,
}
impl From<CECS> for bool {
#[inline(always)]
fn from(variant: CECS) -> Self {
variant as u8 != 0
}
}
pub type CECS_R = crate::BitReader<CECS>;
impl CECS_R {
#[inline(always)]
pub const fn variant(&self) -> CECS {
match self.bits {
false => CECS::Correct,
true => CECS::Slow,
}
}
#[inline(always)]
pub fn is_correct(&self) -> bool {
*self == CECS::Correct
}
#[inline(always)]
pub fn is_slow(&self) -> bool {
*self == CECS::Slow
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SECS {
NoFault = 0,
Fault = 1,
}
impl From<SECS> for bool {
#[inline(always)]
fn from(variant: SECS) -> Self {
variant as u8 != 0
}
}
pub type SECS_R = crate::BitReader<SECS>;
impl SECS_R {
#[inline(always)]
pub const fn variant(&self) -> SECS {
match self.bits {
false => SECS::NoFault,
true => SECS::Fault,
}
}
#[inline(always)]
pub fn is_no_fault(&self) -> bool {
*self == SECS::NoFault
}
#[inline(always)]
pub fn is_fault(&self) -> bool {
*self == SECS::Fault
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CEISR {
Correct = 0,
Slow = 1,
}
impl From<CEISR> for bool {
#[inline(always)]
fn from(variant: CEISR) -> Self {
variant as u8 != 0
}
}
pub type CEIS_R = crate::BitReader<CEISR>;
impl CEIS_R {
#[inline(always)]
pub const fn variant(&self) -> CEISR {
match self.bits {
false => CEISR::Correct,
true => CEISR::Slow,
}
}
#[inline(always)]
pub fn is_correct(&self) -> bool {
*self == CEISR::Correct
}
#[inline(always)]
pub fn is_slow(&self) -> bool {
*self == CEISR::Slow
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CEISW {
Clear = 0,
}
impl From<CEISW> for bool {
#[inline(always)]
fn from(variant: CEISW) -> Self {
variant as u8 != 0
}
}
pub type CEIS_W<'a, REG> = crate::BitWriter0C<'a, REG, CEISW>;
impl<'a, REG> CEIS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(CEISW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SEISR {
NoFault = 0,
Fault = 1,
}
impl From<SEISR> for bool {
#[inline(always)]
fn from(variant: SEISR) -> Self {
variant as u8 != 0
}
}
pub type SEIS_R = crate::BitReader<SEISR>;
impl SEIS_R {
#[inline(always)]
pub const fn variant(&self) -> SEISR {
match self.bits {
false => SEISR::NoFault,
true => SEISR::Fault,
}
}
#[inline(always)]
pub fn is_no_fault(&self) -> bool {
*self == SEISR::NoFault
}
#[inline(always)]
pub fn is_fault(&self) -> bool {
*self == SEISR::Fault
}
}
pub use CEIS_W as SEIS_W;
impl R {
#[inline(always)]
pub fn drdy(&self) -> DRDY_R {
DRDY_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn cecs(&self) -> CECS_R {
CECS_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn secs(&self) -> SECS_R {
SECS_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn ceis(&self) -> CEIS_R {
CEIS_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn seis(&self) -> SEIS_R {
SEIS_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("SR")
.field("ceis", &self.ceis())
.field("seis", &self.seis())
.field("secs", &self.secs())
.field("cecs", &self.cecs())
.field("drdy", &self.drdy())
.finish()
}
}
impl W {
#[inline(always)]
pub fn ceis(&mut self) -> CEIS_W<SRrs> {
CEIS_W::new(self, 5)
}
#[inline(always)]
pub fn seis(&mut self) -> SEIS_W<SRrs> {
SEIS_W::new(self, 6)
}
}
pub struct SRrs;
impl crate::RegisterSpec for SRrs {
type Ux = u32;
}
impl crate::Readable for SRrs {}
impl crate::Writable for SRrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x60;
}
impl crate::Resettable for SRrs {}