#[doc = "Register `ACTL5` reader"]
pub struct R(crate::R<ACTL5_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<ACTL5_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<ACTL5_SPEC>> for R {
    fn from(reader: crate::R<ACTL5_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `ACTL5` writer"]
pub struct W(crate::W<ACTL5_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<ACTL5_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 core::convert::From<crate::W<ACTL5_SPEC>> for W {
    fn from(writer: crate::W<ACTL5_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "FIFO clear\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FIFO0_CLR_A {
    #[doc = "0: No description available"]
    NORMAL = 0,
    #[doc = "1: No description available"]
    CLEAR = 1,
}
impl From<FIFO0_CLR_A> for bool {
    #[inline(always)]
    fn from(variant: FIFO0_CLR_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIFO0_CLR` reader - FIFO clear"]
pub struct FIFO0_CLR_R(crate::FieldReader<bool, FIFO0_CLR_A>);
impl FIFO0_CLR_R {
    pub(crate) fn new(bits: bool) -> Self {
        FIFO0_CLR_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FIFO0_CLR_A {
        match self.bits {
            false => FIFO0_CLR_A::NORMAL,
            true => FIFO0_CLR_A::CLEAR,
        }
    }
    #[doc = "Checks if the value of the field is `NORMAL`"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        **self == FIFO0_CLR_A::NORMAL
    }
    #[doc = "Checks if the value of the field is `CLEAR`"]
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        **self == FIFO0_CLR_A::CLEAR
    }
}
impl core::ops::Deref for FIFO0_CLR_R {
    type Target = crate::FieldReader<bool, FIFO0_CLR_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `FIFO0_CLR` writer - FIFO clear"]
pub struct FIFO0_CLR_W<'a> {
    w: &'a mut W,
}
impl<'a> FIFO0_CLR_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: FIFO0_CLR_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn normal(self) -> &'a mut W {
        self.variant(FIFO0_CLR_A::NORMAL)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn clear(self) -> &'a mut W {
        self.variant(FIFO0_CLR_A::CLEAR)
    }
    #[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 u8 & 0x01);
        self.w
    }
}
#[doc = "FIFO clear\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FIFO1_CLR_A {
    #[doc = "0: No description available"]
    NORMAL = 0,
    #[doc = "1: No description available"]
    CLEAR = 1,
}
impl From<FIFO1_CLR_A> for bool {
    #[inline(always)]
    fn from(variant: FIFO1_CLR_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIFO1_CLR` reader - FIFO clear"]
pub struct FIFO1_CLR_R(crate::FieldReader<bool, FIFO1_CLR_A>);
impl FIFO1_CLR_R {
    pub(crate) fn new(bits: bool) -> Self {
        FIFO1_CLR_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FIFO1_CLR_A {
        match self.bits {
            false => FIFO1_CLR_A::NORMAL,
            true => FIFO1_CLR_A::CLEAR,
        }
    }
    #[doc = "Checks if the value of the field is `NORMAL`"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        **self == FIFO1_CLR_A::NORMAL
    }
    #[doc = "Checks if the value of the field is `CLEAR`"]
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        **self == FIFO1_CLR_A::CLEAR
    }
}
impl core::ops::Deref for FIFO1_CLR_R {
    type Target = crate::FieldReader<bool, FIFO1_CLR_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `FIFO1_CLR` writer - FIFO clear"]
pub struct FIFO1_CLR_W<'a> {
    w: &'a mut W,
}
impl<'a> FIFO1_CLR_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: FIFO1_CLR_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn normal(self) -> &'a mut W {
        self.variant(FIFO1_CLR_A::NORMAL)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn clear(self) -> &'a mut W {
        self.variant(FIFO1_CLR_A::CLEAR)
    }
    #[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 u8 & 0x01) << 1);
        self.w
    }
}
#[doc = "FIFO fill status level control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FIFO0_LVL_A {
    #[doc = "0: No description available"]
    NORMAL = 0,
    #[doc = "1: No description available"]
    MID = 1,
}
impl From<FIFO0_LVL_A> for bool {
    #[inline(always)]
    fn from(variant: FIFO0_LVL_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIFO0_LVL` reader - FIFO fill status level control"]
pub struct FIFO0_LVL_R(crate::FieldReader<bool, FIFO0_LVL_A>);
impl FIFO0_LVL_R {
    pub(crate) fn new(bits: bool) -> Self {
        FIFO0_LVL_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FIFO0_LVL_A {
        match self.bits {
            false => FIFO0_LVL_A::NORMAL,
            true => FIFO0_LVL_A::MID,
        }
    }
    #[doc = "Checks if the value of the field is `NORMAL`"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        **self == FIFO0_LVL_A::NORMAL
    }
    #[doc = "Checks if the value of the field is `MID`"]
    #[inline(always)]
    pub fn is_mid(&self) -> bool {
        **self == FIFO0_LVL_A::MID
    }
}
impl core::ops::Deref for FIFO0_LVL_R {
    type Target = crate::FieldReader<bool, FIFO0_LVL_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `FIFO0_LVL` writer - FIFO fill status level control"]
pub struct FIFO0_LVL_W<'a> {
    w: &'a mut W,
}
impl<'a> FIFO0_LVL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: FIFO0_LVL_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn normal(self) -> &'a mut W {
        self.variant(FIFO0_LVL_A::NORMAL)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn mid(self) -> &'a mut W {
        self.variant(FIFO0_LVL_A::MID)
    }
    #[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 u8 & 0x01) << 2);
        self.w
    }
}
#[doc = "FIFO fill status level control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FIFO1_LVL_A {
    #[doc = "0: No description available"]
    NORMAL = 0,
    #[doc = "1: No description available"]
    MID = 1,
}
impl From<FIFO1_LVL_A> for bool {
    #[inline(always)]
    fn from(variant: FIFO1_LVL_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIFO1_LVL` reader - FIFO fill status level control"]
pub struct FIFO1_LVL_R(crate::FieldReader<bool, FIFO1_LVL_A>);
impl FIFO1_LVL_R {
    pub(crate) fn new(bits: bool) -> Self {
        FIFO1_LVL_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FIFO1_LVL_A {
        match self.bits {
            false => FIFO1_LVL_A::NORMAL,
            true => FIFO1_LVL_A::MID,
        }
    }
    #[doc = "Checks if the value of the field is `NORMAL`"]
    #[inline(always)]
    pub fn is_normal(&self) -> bool {
        **self == FIFO1_LVL_A::NORMAL
    }
    #[doc = "Checks if the value of the field is `MID`"]
    #[inline(always)]
    pub fn is_mid(&self) -> bool {
        **self == FIFO1_LVL_A::MID
    }
}
impl core::ops::Deref for FIFO1_LVL_R {
    type Target = crate::FieldReader<bool, FIFO1_LVL_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `FIFO1_LVL` writer - FIFO fill status level control"]
pub struct FIFO1_LVL_W<'a> {
    w: &'a mut W,
}
impl<'a> FIFO1_LVL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: FIFO1_LVL_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn normal(self) -> &'a mut W {
        self.variant(FIFO1_LVL_A::NORMAL)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn mid(self) -> &'a mut W {
        self.variant(FIFO1_LVL_A::MID)
    }
    #[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 u8 & 0x01) << 3);
        self.w
    }
}
#[doc = "enable interrupt\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum INT_EN_A {
    #[doc = "0: No description available"]
    DISABLE = 0,
    #[doc = "1: No description available"]
    ENABLE = 1,
}
impl From<INT_EN_A> for bool {
    #[inline(always)]
    fn from(variant: INT_EN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `INT_EN` reader - enable interrupt"]
pub struct INT_EN_R(crate::FieldReader<bool, INT_EN_A>);
impl INT_EN_R {
    pub(crate) fn new(bits: bool) -> Self {
        INT_EN_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> INT_EN_A {
        match self.bits {
            false => INT_EN_A::DISABLE,
            true => INT_EN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        **self == INT_EN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        **self == INT_EN_A::ENABLE
    }
}
impl core::ops::Deref for INT_EN_R {
    type Target = crate::FieldReader<bool, INT_EN_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `INT_EN` writer - enable interrupt"]
pub struct INT_EN_W<'a> {
    w: &'a mut W,
}
impl<'a> INT_EN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: INT_EN_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(INT_EN_A::DISABLE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(INT_EN_A::ENABLE)
    }
    #[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 u8 & 0x01) << 4);
        self.w
    }
}
#[doc = "Control Register Counter Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CNT_START_A {
    #[doc = "0: No description available"]
    DISABLE = 0,
    #[doc = "1: No description available"]
    ENABLE = 1,
}
impl From<CNT_START_A> for bool {
    #[inline(always)]
    fn from(variant: CNT_START_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CNT_START` reader - Control Register Counter Enable"]
pub struct CNT_START_R(crate::FieldReader<bool, CNT_START_A>);
impl CNT_START_R {
    pub(crate) fn new(bits: bool) -> Self {
        CNT_START_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CNT_START_A {
        match self.bits {
            false => CNT_START_A::DISABLE,
            true => CNT_START_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        **self == CNT_START_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        **self == CNT_START_A::ENABLE
    }
}
impl core::ops::Deref for CNT_START_R {
    type Target = crate::FieldReader<bool, CNT_START_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CNT_START` writer - Control Register Counter Enable"]
pub struct CNT_START_W<'a> {
    w: &'a mut W,
}
impl<'a> CNT_START_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CNT_START_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(CNT_START_A::DISABLE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(CNT_START_A::ENABLE)
    }
    #[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 u8 & 0x01) << 5);
        self.w
    }
}
impl R {
    #[doc = "Bit 0 - FIFO clear"]
    #[inline(always)]
    pub fn fifo0_clr(&self) -> FIFO0_CLR_R {
        FIFO0_CLR_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bit 1 - FIFO clear"]
    #[inline(always)]
    pub fn fifo1_clr(&self) -> FIFO1_CLR_R {
        FIFO1_CLR_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bit 2 - FIFO fill status level control"]
    #[inline(always)]
    pub fn fifo0_lvl(&self) -> FIFO0_LVL_R {
        FIFO0_LVL_R::new(((self.bits >> 2) & 0x01) != 0)
    }
    #[doc = "Bit 3 - FIFO fill status level control"]
    #[inline(always)]
    pub fn fifo1_lvl(&self) -> FIFO1_LVL_R {
        FIFO1_LVL_R::new(((self.bits >> 3) & 0x01) != 0)
    }
    #[doc = "Bit 4 - enable interrupt"]
    #[inline(always)]
    pub fn int_en(&self) -> INT_EN_R {
        INT_EN_R::new(((self.bits >> 4) & 0x01) != 0)
    }
    #[doc = "Bit 5 - Control Register Counter Enable"]
    #[inline(always)]
    pub fn cnt_start(&self) -> CNT_START_R {
        CNT_START_R::new(((self.bits >> 5) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - FIFO clear"]
    #[inline(always)]
    pub fn fifo0_clr(&mut self) -> FIFO0_CLR_W {
        FIFO0_CLR_W { w: self }
    }
    #[doc = "Bit 1 - FIFO clear"]
    #[inline(always)]
    pub fn fifo1_clr(&mut self) -> FIFO1_CLR_W {
        FIFO1_CLR_W { w: self }
    }
    #[doc = "Bit 2 - FIFO fill status level control"]
    #[inline(always)]
    pub fn fifo0_lvl(&mut self) -> FIFO0_LVL_W {
        FIFO0_LVL_W { w: self }
    }
    #[doc = "Bit 3 - FIFO fill status level control"]
    #[inline(always)]
    pub fn fifo1_lvl(&mut self) -> FIFO1_LVL_W {
        FIFO1_LVL_W { w: self }
    }
    #[doc = "Bit 4 - enable interrupt"]
    #[inline(always)]
    pub fn int_en(&mut self) -> INT_EN_W {
        INT_EN_W { w: self }
    }
    #[doc = "Bit 5 - Control Register Counter Enable"]
    #[inline(always)]
    pub fn cnt_start(&mut self) -> CNT_START_W {
        CNT_START_W { w: self }
    }
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Auxiliary Control\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 [actl5](index.html) module"]
pub struct ACTL5_SPEC;
impl crate::RegisterSpec for ACTL5_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [actl5::R](R) reader structure"]
impl crate::Readable for ACTL5_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [actl5::W](W) writer structure"]
impl crate::Writable for ACTL5_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets ACTL5 to value 0"]
impl crate::Resettable for ACTL5_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
