s32k148-pac 0.1.0

Device Support Crate for NXP S32K148 Devices
#[doc = "Register `SAI_RFR2` reader"]
pub struct R(crate::R<SAI_RFR2_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<SAI_RFR2_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<SAI_RFR2_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<SAI_RFR2_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Field `RFP` reader - Read FIFO Pointer"]
pub struct RFP_R(crate::FieldReader<u8, u8>);
impl RFP_R {
    #[inline(always)]
    pub(crate) fn new(bits: u8) -> Self {
        RFP_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for RFP_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Receive Channel Pointer\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RCP_A {
    #[doc = "0: No effect."]
    _0 = 0,
    #[doc = "1: FIFO combine is enabled for FIFO reads and this FIFO will be read on the next FIFO read."]
    _1 = 1,
}
impl From<RCP_A> for bool {
    #[inline(always)]
    fn from(variant: RCP_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RCP` reader - Receive Channel Pointer"]
pub struct RCP_R(crate::FieldReader<bool, RCP_A>);
impl RCP_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        RCP_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RCP_A {
        match self.bits {
            false => RCP_A::_0,
            true => RCP_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        **self == RCP_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        **self == RCP_A::_1
    }
}
impl core::ops::Deref for RCP_R {
    type Target = crate::FieldReader<bool, RCP_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `WFP` reader - Write FIFO Pointer"]
pub struct WFP_R(crate::FieldReader<u8, u8>);
impl WFP_R {
    #[inline(always)]
    pub(crate) fn new(bits: u8) -> Self {
        WFP_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for WFP_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bits 0:3 - Read FIFO Pointer"]
    #[inline(always)]
    pub fn rfp(&self) -> RFP_R {
        RFP_R::new((self.bits & 0x0f) as u8)
    }
    #[doc = "Bit 15 - Receive Channel Pointer"]
    #[inline(always)]
    pub fn rcp(&self) -> RCP_R {
        RCP_R::new(((self.bits >> 15) & 0x01) != 0)
    }
    #[doc = "Bits 16:19 - Write FIFO Pointer"]
    #[inline(always)]
    pub fn wfp(&self) -> WFP_R {
        WFP_R::new(((self.bits >> 16) & 0x0f) as u8)
    }
}
#[doc = "SAI Receive FIFO Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sai_rfr2](index.html) module"]
pub struct SAI_RFR2_SPEC;
impl crate::RegisterSpec for SAI_RFR2_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [sai_rfr2::R](R) reader structure"]
impl crate::Readable for SAI_RFR2_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets SAI_RFR2 to value 0"]
impl crate::Resettable for SAI_RFR2_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}