#[doc = "Register `CFG17` reader"]
pub struct R(crate::R<CFG17_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CFG17_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<CFG17_SPEC>> for R {
    fn from(reader: crate::R<CFG17_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CFG17` writer"]
pub struct W(crate::W<CFG17_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CFG17_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<CFG17_SPEC>> for W {
    fn from(writer: crate::W<CFG17_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "When this bit is set, the associated FIFO configuration may be dynamically controlled.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum F0_DYN_A {
    #[doc = "0: No description available"]
    STATIC = 0,
    #[doc = "1: No description available"]
    DYNAMIC = 1,
}
impl From<F0_DYN_A> for bool {
    #[inline(always)]
    fn from(variant: F0_DYN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `F0_DYN` reader - When this bit is set, the associated FIFO configuration may be dynamically controlled."]
pub struct F0_DYN_R(crate::FieldReader<bool, F0_DYN_A>);
impl F0_DYN_R {
    pub(crate) fn new(bits: bool) -> Self {
        F0_DYN_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> F0_DYN_A {
        match self.bits {
            false => F0_DYN_A::STATIC,
            true => F0_DYN_A::DYNAMIC,
        }
    }
    #[doc = "Checks if the value of the field is `STATIC`"]
    #[inline(always)]
    pub fn is_static_(&self) -> bool {
        **self == F0_DYN_A::STATIC
    }
    #[doc = "Checks if the value of the field is `DYNAMIC`"]
    #[inline(always)]
    pub fn is_dynamic(&self) -> bool {
        **self == F0_DYN_A::DYNAMIC
    }
}
impl core::ops::Deref for F0_DYN_R {
    type Target = crate::FieldReader<bool, F0_DYN_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `F0_DYN` writer - When this bit is set, the associated FIFO configuration may be dynamically controlled."]
pub struct F0_DYN_W<'a> {
    w: &'a mut W,
}
impl<'a> F0_DYN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: F0_DYN_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn static_(self) -> &'a mut W {
        self.variant(F0_DYN_A::STATIC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dynamic(self) -> &'a mut W {
        self.variant(F0_DYN_A::DYNAMIC)
    }
    #[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 = "No description available\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum F1_DYN_A {
    #[doc = "0: No description available"]
    STATIC = 0,
    #[doc = "1: No description available"]
    DYNAMIC = 1,
}
impl From<F1_DYN_A> for bool {
    #[inline(always)]
    fn from(variant: F1_DYN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `F1_DYN` reader - No description available"]
pub struct F1_DYN_R(crate::FieldReader<bool, F1_DYN_A>);
impl F1_DYN_R {
    pub(crate) fn new(bits: bool) -> Self {
        F1_DYN_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> F1_DYN_A {
        match self.bits {
            false => F1_DYN_A::STATIC,
            true => F1_DYN_A::DYNAMIC,
        }
    }
    #[doc = "Checks if the value of the field is `STATIC`"]
    #[inline(always)]
    pub fn is_static_(&self) -> bool {
        **self == F1_DYN_A::STATIC
    }
    #[doc = "Checks if the value of the field is `DYNAMIC`"]
    #[inline(always)]
    pub fn is_dynamic(&self) -> bool {
        **self == F1_DYN_A::DYNAMIC
    }
}
impl core::ops::Deref for F1_DYN_R {
    type Target = crate::FieldReader<bool, F1_DYN_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `F1_DYN` writer - No description available"]
pub struct F1_DYN_W<'a> {
    w: &'a mut W,
}
impl<'a> F1_DYN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: F1_DYN_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn static_(self) -> &'a mut W {
        self.variant(F1_DYN_A::STATIC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dynamic(self) -> &'a mut W {
        self.variant(F1_DYN_A::DYNAMIC)
    }
    #[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 = "Field `NC2` reader - Spare register bit"]
pub struct NC2_R(crate::FieldReader<bool, bool>);
impl NC2_R {
    pub(crate) fn new(bits: bool) -> Self {
        NC2_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for NC2_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `NC2` writer - Spare register bit"]
pub struct NC2_W<'a> {
    w: &'a mut W,
}
impl<'a> NC2_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 u8 & 0x01) << 2);
        self.w
    }
}
#[doc = "Field `NC3` reader - Spare register bit"]
pub struct NC3_R(crate::FieldReader<bool, bool>);
impl NC3_R {
    pub(crate) fn new(bits: bool) -> Self {
        NC3_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for NC3_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `NC3` writer - Spare register bit"]
pub struct NC3_W<'a> {
    w: &'a mut W,
}
impl<'a> NC3_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 u8 & 0x01) << 3);
        self.w
    }
}
#[doc = "Adds an additional sync flip-flop to FIFO block status.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FIFO_ADD_SYNC_A {
    #[doc = "0: No description available"]
    DISABLE = 0,
    #[doc = "1: No description available"]
    ENABLE = 1,
}
impl From<FIFO_ADD_SYNC_A> for bool {
    #[inline(always)]
    fn from(variant: FIFO_ADD_SYNC_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FIFO_ADD_SYNC` reader - Adds an additional sync flip-flop to FIFO block status."]
pub struct FIFO_ADD_SYNC_R(crate::FieldReader<bool, FIFO_ADD_SYNC_A>);
impl FIFO_ADD_SYNC_R {
    pub(crate) fn new(bits: bool) -> Self {
        FIFO_ADD_SYNC_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FIFO_ADD_SYNC_A {
        match self.bits {
            false => FIFO_ADD_SYNC_A::DISABLE,
            true => FIFO_ADD_SYNC_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        **self == FIFO_ADD_SYNC_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        **self == FIFO_ADD_SYNC_A::ENABLE
    }
}
impl core::ops::Deref for FIFO_ADD_SYNC_R {
    type Target = crate::FieldReader<bool, FIFO_ADD_SYNC_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `FIFO_ADD_SYNC` writer - Adds an additional sync flip-flop to FIFO block status."]
pub struct FIFO_ADD_SYNC_W<'a> {
    w: &'a mut W,
}
impl<'a> FIFO_ADD_SYNC_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: FIFO_ADD_SYNC_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(FIFO_ADD_SYNC_A::DISABLE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(FIFO_ADD_SYNC_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
    }
}
impl R {
    #[doc = "Bit 0 - When this bit is set, the associated FIFO configuration may be dynamically controlled."]
    #[inline(always)]
    pub fn f0_dyn(&self) -> F0_DYN_R {
        F0_DYN_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bit 1 - No description available"]
    #[inline(always)]
    pub fn f1_dyn(&self) -> F1_DYN_R {
        F1_DYN_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bit 2 - Spare register bit"]
    #[inline(always)]
    pub fn nc2(&self) -> NC2_R {
        NC2_R::new(((self.bits >> 2) & 0x01) != 0)
    }
    #[doc = "Bit 3 - Spare register bit"]
    #[inline(always)]
    pub fn nc3(&self) -> NC3_R {
        NC3_R::new(((self.bits >> 3) & 0x01) != 0)
    }
    #[doc = "Bit 4 - Adds an additional sync flip-flop to FIFO block status."]
    #[inline(always)]
    pub fn fifo_add_sync(&self) -> FIFO_ADD_SYNC_R {
        FIFO_ADD_SYNC_R::new(((self.bits >> 4) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - When this bit is set, the associated FIFO configuration may be dynamically controlled."]
    #[inline(always)]
    pub fn f0_dyn(&mut self) -> F0_DYN_W {
        F0_DYN_W { w: self }
    }
    #[doc = "Bit 1 - No description available"]
    #[inline(always)]
    pub fn f1_dyn(&mut self) -> F1_DYN_W {
        F1_DYN_W { w: self }
    }
    #[doc = "Bit 2 - Spare register bit"]
    #[inline(always)]
    pub fn nc2(&mut self) -> NC2_W {
        NC2_W { w: self }
    }
    #[doc = "Bit 3 - Spare register bit"]
    #[inline(always)]
    pub fn nc3(&mut self) -> NC3_W {
        NC3_W { w: self }
    }
    #[doc = "Bit 4 - Adds an additional sync flip-flop to FIFO block status."]
    #[inline(always)]
    pub fn fifo_add_sync(&mut self) -> FIFO_ADD_SYNC_W {
        FIFO_ADD_SYNC_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 = "Datapath FIFO 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 [cfg17](index.html) module"]
pub struct CFG17_SPEC;
impl crate::RegisterSpec for CFG17_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [cfg17::R](R) reader structure"]
impl crate::Readable for CFG17_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cfg17::W](W) writer structure"]
impl crate::Writable for CFG17_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CFG17 to value 0"]
impl crate::Resettable for CFG17_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
