pub type R = crate::R<SRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OVRUDRR {
NoError = 0,
Overrun = 1,
}
impl From<OVRUDRR> for bool {
#[inline(always)]
fn from(variant: OVRUDRR) -> Self {
variant as u8 != 0
}
}
pub type OVRUDR_R = crate::BitReader<OVRUDRR>;
impl OVRUDR_R {
#[inline(always)]
pub const fn variant(&self) -> OVRUDRR {
match self.bits {
false => OVRUDRR::NoError,
true => OVRUDRR::Overrun,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == OVRUDRR::NoError
}
#[inline(always)]
pub fn is_overrun(&self) -> bool {
*self == OVRUDRR::Overrun
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MUTEDETR {
NoMute = 0,
Mute = 1,
}
impl From<MUTEDETR> for bool {
#[inline(always)]
fn from(variant: MUTEDETR) -> Self {
variant as u8 != 0
}
}
pub type MUTEDET_R = crate::BitReader<MUTEDETR>;
impl MUTEDET_R {
#[inline(always)]
pub const fn variant(&self) -> MUTEDETR {
match self.bits {
false => MUTEDETR::NoMute,
true => MUTEDETR::Mute,
}
}
#[inline(always)]
pub fn is_no_mute(&self) -> bool {
*self == MUTEDETR::NoMute
}
#[inline(always)]
pub fn is_mute(&self) -> bool {
*self == MUTEDETR::Mute
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WCKCFGR {
Correct = 0,
Wrong = 1,
}
impl From<WCKCFGR> for bool {
#[inline(always)]
fn from(variant: WCKCFGR) -> Self {
variant as u8 != 0
}
}
pub type WCKCFG_R = crate::BitReader<WCKCFGR>;
impl WCKCFG_R {
#[inline(always)]
pub const fn variant(&self) -> WCKCFGR {
match self.bits {
false => WCKCFGR::Correct,
true => WCKCFGR::Wrong,
}
}
#[inline(always)]
pub fn is_correct(&self) -> bool {
*self == WCKCFGR::Correct
}
#[inline(always)]
pub fn is_wrong(&self) -> bool {
*self == WCKCFGR::Wrong
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FREQR {
NoRequest = 0,
Request = 1,
}
impl From<FREQR> for bool {
#[inline(always)]
fn from(variant: FREQR) -> Self {
variant as u8 != 0
}
}
pub type FREQ_R = crate::BitReader<FREQR>;
impl FREQ_R {
#[inline(always)]
pub const fn variant(&self) -> FREQR {
match self.bits {
false => FREQR::NoRequest,
true => FREQR::Request,
}
}
#[inline(always)]
pub fn is_no_request(&self) -> bool {
*self == FREQR::NoRequest
}
#[inline(always)]
pub fn is_request(&self) -> bool {
*self == FREQR::Request
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CNRDYR {
Ready = 0,
NotReady = 1,
}
impl From<CNRDYR> for bool {
#[inline(always)]
fn from(variant: CNRDYR) -> Self {
variant as u8 != 0
}
}
pub type CNRDY_R = crate::BitReader<CNRDYR>;
impl CNRDY_R {
#[inline(always)]
pub const fn variant(&self) -> CNRDYR {
match self.bits {
false => CNRDYR::Ready,
true => CNRDYR::NotReady,
}
}
#[inline(always)]
pub fn is_ready(&self) -> bool {
*self == CNRDYR::Ready
}
#[inline(always)]
pub fn is_not_ready(&self) -> bool {
*self == CNRDYR::NotReady
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AFSDETR {
NoError = 0,
EarlySync = 1,
}
impl From<AFSDETR> for bool {
#[inline(always)]
fn from(variant: AFSDETR) -> Self {
variant as u8 != 0
}
}
pub type AFSDET_R = crate::BitReader<AFSDETR>;
impl AFSDET_R {
#[inline(always)]
pub const fn variant(&self) -> AFSDETR {
match self.bits {
false => AFSDETR::NoError,
true => AFSDETR::EarlySync,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == AFSDETR::NoError
}
#[inline(always)]
pub fn is_early_sync(&self) -> bool {
*self == AFSDETR::EarlySync
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LFSDETR {
NoError = 0,
NoSync = 1,
}
impl From<LFSDETR> for bool {
#[inline(always)]
fn from(variant: LFSDETR) -> Self {
variant as u8 != 0
}
}
pub type LFSDET_R = crate::BitReader<LFSDETR>;
impl LFSDET_R {
#[inline(always)]
pub const fn variant(&self) -> LFSDETR {
match self.bits {
false => LFSDETR::NoError,
true => LFSDETR::NoSync,
}
}
#[inline(always)]
pub fn is_no_error(&self) -> bool {
*self == LFSDETR::NoError
}
#[inline(always)]
pub fn is_no_sync(&self) -> bool {
*self == LFSDETR::NoSync
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FLVLR {
Empty = 0,
Quarter1 = 1,
Quarter2 = 2,
Quarter3 = 3,
Quarter4 = 4,
Full = 5,
}
impl From<FLVLR> for u8 {
#[inline(always)]
fn from(variant: FLVLR) -> Self {
variant as _
}
}
impl crate::FieldSpec for FLVLR {
type Ux = u8;
}
impl crate::IsEnum for FLVLR {}
pub type FLVL_R = crate::FieldReader<FLVLR>;
impl FLVL_R {
#[inline(always)]
pub const fn variant(&self) -> Option<FLVLR> {
match self.bits {
0 => Some(FLVLR::Empty),
1 => Some(FLVLR::Quarter1),
2 => Some(FLVLR::Quarter2),
3 => Some(FLVLR::Quarter3),
4 => Some(FLVLR::Quarter4),
5 => Some(FLVLR::Full),
_ => None,
}
}
#[inline(always)]
pub fn is_empty(&self) -> bool {
*self == FLVLR::Empty
}
#[inline(always)]
pub fn is_quarter1(&self) -> bool {
*self == FLVLR::Quarter1
}
#[inline(always)]
pub fn is_quarter2(&self) -> bool {
*self == FLVLR::Quarter2
}
#[inline(always)]
pub fn is_quarter3(&self) -> bool {
*self == FLVLR::Quarter3
}
#[inline(always)]
pub fn is_quarter4(&self) -> bool {
*self == FLVLR::Quarter4
}
#[inline(always)]
pub fn is_full(&self) -> bool {
*self == FLVLR::Full
}
}
impl R {
#[inline(always)]
pub fn ovrudr(&self) -> OVRUDR_R {
OVRUDR_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn mutedet(&self) -> MUTEDET_R {
MUTEDET_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn wckcfg(&self) -> WCKCFG_R {
WCKCFG_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn freq(&self) -> FREQ_R {
FREQ_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn cnrdy(&self) -> CNRDY_R {
CNRDY_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn afsdet(&self) -> AFSDET_R {
AFSDET_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn lfsdet(&self) -> LFSDET_R {
LFSDET_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn flvl(&self) -> FLVL_R {
FLVL_R::new(((self.bits >> 16) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SR")
.field("ovrudr", &self.ovrudr())
.field("mutedet", &self.mutedet())
.field("wckcfg", &self.wckcfg())
.field("freq", &self.freq())
.field("cnrdy", &self.cnrdy())
.field("afsdet", &self.afsdet())
.field("lfsdet", &self.lfsdet())
.field("flvl", &self.flvl())
.finish()
}
}
pub struct SRrs;
impl crate::RegisterSpec for SRrs {
type Ux = u32;
}
impl crate::Readable for SRrs {}
impl crate::Resettable for SRrs {
const RESET_VALUE: u32 = 0x08;
}