#[doc = "Register `SR` reader"]
pub struct R(crate::R<SR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<SR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `SR` writer"]
pub struct W(crate::W<SR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<SR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<SR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `FLVL` reader - FIFO level threshold"]
pub struct FLVL_R(crate::FieldReader<u8, u8>);
impl FLVL_R {
pub(crate) fn new(bits: u8) -> Self {
FLVL_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FLVL_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FLVL` writer - FIFO level threshold"]
pub struct FLVL_W<'a> {
w: &'a mut W,
}
impl<'a> FLVL_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16);
self.w
}
}
#[doc = "Field `LFSDET` reader - Late frame synchronization detection"]
pub struct LFSDET_R(crate::FieldReader<bool, bool>);
impl LFSDET_R {
pub(crate) fn new(bits: bool) -> Self {
LFSDET_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for LFSDET_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `LFSDET` writer - Late frame synchronization detection"]
pub struct LFSDET_W<'a> {
w: &'a mut W,
}
impl<'a> LFSDET_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
self.w
}
}
#[doc = "Field `AFSDET` reader - Anticipated frame synchronization detection"]
pub struct AFSDET_R(crate::FieldReader<bool, bool>);
impl AFSDET_R {
pub(crate) fn new(bits: bool) -> Self {
AFSDET_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for AFSDET_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `AFSDET` writer - Anticipated frame synchronization detection"]
pub struct AFSDET_W<'a> {
w: &'a mut W,
}
impl<'a> AFSDET_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
self.w
}
}
#[doc = "Field `CNRDY` reader - Codec not ready"]
pub struct CNRDY_R(crate::FieldReader<bool, bool>);
impl CNRDY_R {
pub(crate) fn new(bits: bool) -> Self {
CNRDY_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CNRDY_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CNRDY` writer - Codec not ready"]
pub struct CNRDY_W<'a> {
w: &'a mut W,
}
impl<'a> CNRDY_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
self.w
}
}
#[doc = "Field `FREQ` reader - FIFO request"]
pub struct FREQ_R(crate::FieldReader<bool, bool>);
impl FREQ_R {
pub(crate) fn new(bits: bool) -> Self {
FREQ_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FREQ_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FREQ` writer - FIFO request"]
pub struct FREQ_W<'a> {
w: &'a mut W,
}
impl<'a> FREQ_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
self.w
}
}
#[doc = "Field `WCKCFG` reader - Wrong clock configuration flag. This bit is read only"]
pub struct WCKCFG_R(crate::FieldReader<bool, bool>);
impl WCKCFG_R {
pub(crate) fn new(bits: bool) -> Self {
WCKCFG_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for WCKCFG_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WCKCFG` writer - Wrong clock configuration flag. This bit is read only"]
pub struct WCKCFG_W<'a> {
w: &'a mut W,
}
impl<'a> WCKCFG_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
self.w
}
}
#[doc = "Field `MUTEDET` reader - Mute detection"]
pub struct MUTEDET_R(crate::FieldReader<bool, bool>);
impl MUTEDET_R {
pub(crate) fn new(bits: bool) -> Self {
MUTEDET_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for MUTEDET_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `MUTEDET` writer - Mute detection"]
pub struct MUTEDET_W<'a> {
w: &'a mut W,
}
impl<'a> MUTEDET_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
self.w
}
}
#[doc = "Field `OVRUDR` reader - Overrun / underrun"]
pub struct OVRUDR_R(crate::FieldReader<bool, bool>);
impl OVRUDR_R {
pub(crate) fn new(bits: bool) -> Self {
OVRUDR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for OVRUDR_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `OVRUDR` writer - Overrun / underrun"]
pub struct OVRUDR_W<'a> {
w: &'a mut W,
}
impl<'a> OVRUDR_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
self.w
}
}
impl R {
#[doc = "Bits 16:18 - FIFO level threshold"]
#[inline(always)]
pub fn flvl(&self) -> FLVL_R {
FLVL_R::new(((self.bits >> 16) & 0x07) as u8)
}
#[doc = "Bit 6 - Late frame synchronization detection"]
#[inline(always)]
pub fn lfsdet(&self) -> LFSDET_R {
LFSDET_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 5 - Anticipated frame synchronization detection"]
#[inline(always)]
pub fn afsdet(&self) -> AFSDET_R {
AFSDET_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 4 - Codec not ready"]
#[inline(always)]
pub fn cnrdy(&self) -> CNRDY_R {
CNRDY_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 3 - FIFO request"]
#[inline(always)]
pub fn freq(&self) -> FREQ_R {
FREQ_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 2 - Wrong clock configuration flag. This bit is read only"]
#[inline(always)]
pub fn wckcfg(&self) -> WCKCFG_R {
WCKCFG_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 1 - Mute detection"]
#[inline(always)]
pub fn mutedet(&self) -> MUTEDET_R {
MUTEDET_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0 - Overrun / underrun"]
#[inline(always)]
pub fn ovrudr(&self) -> OVRUDR_R {
OVRUDR_R::new((self.bits & 0x01) != 0)
}
}
impl W {
#[doc = "Bits 16:18 - FIFO level threshold"]
#[inline(always)]
pub fn flvl(&mut self) -> FLVL_W {
FLVL_W { w: self }
}
#[doc = "Bit 6 - Late frame synchronization detection"]
#[inline(always)]
pub fn lfsdet(&mut self) -> LFSDET_W {
LFSDET_W { w: self }
}
#[doc = "Bit 5 - Anticipated frame synchronization detection"]
#[inline(always)]
pub fn afsdet(&mut self) -> AFSDET_W {
AFSDET_W { w: self }
}
#[doc = "Bit 4 - Codec not ready"]
#[inline(always)]
pub fn cnrdy(&mut self) -> CNRDY_W {
CNRDY_W { w: self }
}
#[doc = "Bit 3 - FIFO request"]
#[inline(always)]
pub fn freq(&mut self) -> FREQ_W {
FREQ_W { w: self }
}
#[doc = "Bit 2 - Wrong clock configuration flag. This bit is read only"]
#[inline(always)]
pub fn wckcfg(&mut self) -> WCKCFG_W {
WCKCFG_W { w: self }
}
#[doc = "Bit 1 - Mute detection"]
#[inline(always)]
pub fn mutedet(&mut self) -> MUTEDET_W {
MUTEDET_W { w: self }
}
#[doc = "Bit 0 - Overrun / underrun"]
#[inline(always)]
pub fn ovrudr(&mut self) -> OVRUDR_W {
OVRUDR_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "AStatus register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sr](index.html) module"]
pub struct SR_SPEC;
impl crate::RegisterSpec for SR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [sr::R](R) reader structure"]
impl crate::Readable for SR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [sr::W](W) writer structure"]
impl crate::Writable for SR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets SR to value 0"]
impl crate::Resettable for SR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}