pub type R = crate::R<SDSRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RE {
NoError = 0,
Error = 1,
}
impl From<RE> for bool {
#[inline(always)]
fn from(variant: RE) -> Self {
variant as u8 != 0
}
}
pub type RE_R = crate::BitReader<RE>;
impl RE_R {
#[inline(always)]
pub const fn variant(&self) -> RE {
match self.bits {
false => RE::NoError,
true => RE::Error,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == RE::NoError
}
#[inline(always)]
pub fn is_error(&self) -> bool {
*self == RE::Error
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum MODES1 {
Normal = 0,
SelfRefresh = 1,
PowerDown = 2,
}
impl From<MODES1> for u8 {
#[inline(always)]
fn from(variant: MODES1) -> Self {
variant as _
}
}
impl crate::FieldSpec for MODES1 {
type Ux = u8;
}
impl crate::IsEnum for MODES1 {}
pub type MODES1_R = crate::FieldReader<MODES1>;
impl MODES1_R {
#[inline(always)]
pub const fn variant(&self) -> Option<MODES1> {
match self.bits {
0 => Some(MODES1::Normal),
1 => Some(MODES1::SelfRefresh),
2 => Some(MODES1::PowerDown),
_ => None,
}
}
#[inline(always)]
pub fn is_normal(&self) -> bool {
*self == MODES1::Normal
}
#[inline(always)]
pub fn is_self_refresh(&self) -> bool {
*self == MODES1::SelfRefresh
}
#[inline(always)]
pub fn is_power_down(&self) -> bool {
*self == MODES1::PowerDown
}
}
pub use MODES1_R as MODES2_R;
impl R {
#[inline(always)]
pub fn re(&self) -> RE_R {
RE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn modes1(&self) -> MODES1_R {
MODES1_R::new(((self.bits >> 1) & 3) as u8)
}
#[inline(always)]
pub fn modes2(&self) -> MODES2_R {
MODES2_R::new(((self.bits >> 3) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SDSR")
.field("re", &self.re())
.field("modes1", &self.modes1())
.field("modes2", &self.modes2())
.finish()
}
}
pub struct SDSRrs;
impl crate::RegisterSpec for SDSRrs {
type Ux = u32;
}
impl crate::Readable for SDSRrs {}
impl crate::Resettable for SDSRrs {}