#[doc = "Register `CFG13` reader"]
pub struct R(crate::R<CFG13_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CFG13_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<CFG13_SPEC>> for R {
    fn from(reader: crate::R<CFG13_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CFG13` writer"]
pub struct W(crate::W<CFG13_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CFG13_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<CFG13_SPEC>> for W {
    fn from(writer: crate::W<CFG13_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Datapath carry in source select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CI_SELA_A {
    #[doc = "0: No description available"]
    DEFAULT = 0,
    #[doc = "1: No description available"]
    REGISTERED = 1,
    #[doc = "2: No description available"]
    ROUTE = 2,
    #[doc = "3: No description available"]
    CHAIN = 3,
}
impl From<CI_SELA_A> for u8 {
    #[inline(always)]
    fn from(variant: CI_SELA_A) -> Self {
        variant as _
    }
}
#[doc = "Field `CI_SELA` reader - Datapath carry in source select"]
pub struct CI_SELA_R(crate::FieldReader<u8, CI_SELA_A>);
impl CI_SELA_R {
    pub(crate) fn new(bits: u8) -> Self {
        CI_SELA_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CI_SELA_A {
        match self.bits {
            0 => CI_SELA_A::DEFAULT,
            1 => CI_SELA_A::REGISTERED,
            2 => CI_SELA_A::ROUTE,
            3 => CI_SELA_A::CHAIN,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DEFAULT`"]
    #[inline(always)]
    pub fn is_default(&self) -> bool {
        **self == CI_SELA_A::DEFAULT
    }
    #[doc = "Checks if the value of the field is `REGISTERED`"]
    #[inline(always)]
    pub fn is_registered(&self) -> bool {
        **self == CI_SELA_A::REGISTERED
    }
    #[doc = "Checks if the value of the field is `ROUTE`"]
    #[inline(always)]
    pub fn is_route(&self) -> bool {
        **self == CI_SELA_A::ROUTE
    }
    #[doc = "Checks if the value of the field is `CHAIN`"]
    #[inline(always)]
    pub fn is_chain(&self) -> bool {
        **self == CI_SELA_A::CHAIN
    }
}
impl core::ops::Deref for CI_SELA_R {
    type Target = crate::FieldReader<u8, CI_SELA_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CI_SELA` writer - Datapath carry in source select"]
pub struct CI_SELA_W<'a> {
    w: &'a mut W,
}
impl<'a> CI_SELA_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CI_SELA_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn default(self) -> &'a mut W {
        self.variant(CI_SELA_A::DEFAULT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn registered(self) -> &'a mut W {
        self.variant(CI_SELA_A::REGISTERED)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn route(self) -> &'a mut W {
        self.variant(CI_SELA_A::ROUTE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn chain(self) -> &'a mut W {
        self.variant(CI_SELA_A::CHAIN)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x03) | (value as u8 & 0x03);
        self.w
    }
}
#[doc = "Datapath carry in source select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CI_SELB_A {
    #[doc = "0: No description available"]
    DEFAULT = 0,
    #[doc = "1: No description available"]
    REGISTERED = 1,
    #[doc = "2: No description available"]
    ROUTE = 2,
    #[doc = "3: No description available"]
    CHAIN = 3,
}
impl From<CI_SELB_A> for u8 {
    #[inline(always)]
    fn from(variant: CI_SELB_A) -> Self {
        variant as _
    }
}
#[doc = "Field `CI_SELB` reader - Datapath carry in source select"]
pub struct CI_SELB_R(crate::FieldReader<u8, CI_SELB_A>);
impl CI_SELB_R {
    pub(crate) fn new(bits: u8) -> Self {
        CI_SELB_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CI_SELB_A {
        match self.bits {
            0 => CI_SELB_A::DEFAULT,
            1 => CI_SELB_A::REGISTERED,
            2 => CI_SELB_A::ROUTE,
            3 => CI_SELB_A::CHAIN,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DEFAULT`"]
    #[inline(always)]
    pub fn is_default(&self) -> bool {
        **self == CI_SELB_A::DEFAULT
    }
    #[doc = "Checks if the value of the field is `REGISTERED`"]
    #[inline(always)]
    pub fn is_registered(&self) -> bool {
        **self == CI_SELB_A::REGISTERED
    }
    #[doc = "Checks if the value of the field is `ROUTE`"]
    #[inline(always)]
    pub fn is_route(&self) -> bool {
        **self == CI_SELB_A::ROUTE
    }
    #[doc = "Checks if the value of the field is `CHAIN`"]
    #[inline(always)]
    pub fn is_chain(&self) -> bool {
        **self == CI_SELB_A::CHAIN
    }
}
impl core::ops::Deref for CI_SELB_R {
    type Target = crate::FieldReader<u8, CI_SELB_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CI_SELB` writer - Datapath carry in source select"]
pub struct CI_SELB_W<'a> {
    w: &'a mut W,
}
impl<'a> CI_SELB_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CI_SELB_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn default(self) -> &'a mut W {
        self.variant(CI_SELB_A::DEFAULT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn registered(self) -> &'a mut W {
        self.variant(CI_SELB_A::REGISTERED)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn route(self) -> &'a mut W {
        self.variant(CI_SELB_A::ROUTE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn chain(self) -> &'a mut W {
        self.variant(CI_SELB_A::CHAIN)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u8 & 0x03) << 2);
        self.w
    }
}
#[doc = "Datapath compare select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CMP_SELA_A {
    #[doc = "0: No description available"]
    A1_D1 = 0,
    #[doc = "1: No description available"]
    A1_A0 = 1,
    #[doc = "2: No description available"]
    A0_D1 = 2,
    #[doc = "3: No description available"]
    A0_A0 = 3,
}
impl From<CMP_SELA_A> for u8 {
    #[inline(always)]
    fn from(variant: CMP_SELA_A) -> Self {
        variant as _
    }
}
#[doc = "Field `CMP_SELA` reader - Datapath compare select"]
pub struct CMP_SELA_R(crate::FieldReader<u8, CMP_SELA_A>);
impl CMP_SELA_R {
    pub(crate) fn new(bits: u8) -> Self {
        CMP_SELA_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CMP_SELA_A {
        match self.bits {
            0 => CMP_SELA_A::A1_D1,
            1 => CMP_SELA_A::A1_A0,
            2 => CMP_SELA_A::A0_D1,
            3 => CMP_SELA_A::A0_A0,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `A1_D1`"]
    #[inline(always)]
    pub fn is_a1_d1(&self) -> bool {
        **self == CMP_SELA_A::A1_D1
    }
    #[doc = "Checks if the value of the field is `A1_A0`"]
    #[inline(always)]
    pub fn is_a1_a0(&self) -> bool {
        **self == CMP_SELA_A::A1_A0
    }
    #[doc = "Checks if the value of the field is `A0_D1`"]
    #[inline(always)]
    pub fn is_a0_d1(&self) -> bool {
        **self == CMP_SELA_A::A0_D1
    }
    #[doc = "Checks if the value of the field is `A0_A0`"]
    #[inline(always)]
    pub fn is_a0_a0(&self) -> bool {
        **self == CMP_SELA_A::A0_A0
    }
}
impl core::ops::Deref for CMP_SELA_R {
    type Target = crate::FieldReader<u8, CMP_SELA_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CMP_SELA` writer - Datapath compare select"]
pub struct CMP_SELA_W<'a> {
    w: &'a mut W,
}
impl<'a> CMP_SELA_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CMP_SELA_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn a1_d1(self) -> &'a mut W {
        self.variant(CMP_SELA_A::A1_D1)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn a1_a0(self) -> &'a mut W {
        self.variant(CMP_SELA_A::A1_A0)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn a0_d1(self) -> &'a mut W {
        self.variant(CMP_SELA_A::A0_D1)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn a0_a0(self) -> &'a mut W {
        self.variant(CMP_SELA_A::A0_A0)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u8 & 0x03) << 4);
        self.w
    }
}
#[doc = "Datapath compare select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CMP_SELB_A {
    #[doc = "0: No description available"]
    A1_D1 = 0,
    #[doc = "1: No description available"]
    A1_A0 = 1,
    #[doc = "2: No description available"]
    A0_D1 = 2,
    #[doc = "3: No description available"]
    A0_A0 = 3,
}
impl From<CMP_SELB_A> for u8 {
    #[inline(always)]
    fn from(variant: CMP_SELB_A) -> Self {
        variant as _
    }
}
#[doc = "Field `CMP_SELB` reader - Datapath compare select"]
pub struct CMP_SELB_R(crate::FieldReader<u8, CMP_SELB_A>);
impl CMP_SELB_R {
    pub(crate) fn new(bits: u8) -> Self {
        CMP_SELB_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CMP_SELB_A {
        match self.bits {
            0 => CMP_SELB_A::A1_D1,
            1 => CMP_SELB_A::A1_A0,
            2 => CMP_SELB_A::A0_D1,
            3 => CMP_SELB_A::A0_A0,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `A1_D1`"]
    #[inline(always)]
    pub fn is_a1_d1(&self) -> bool {
        **self == CMP_SELB_A::A1_D1
    }
    #[doc = "Checks if the value of the field is `A1_A0`"]
    #[inline(always)]
    pub fn is_a1_a0(&self) -> bool {
        **self == CMP_SELB_A::A1_A0
    }
    #[doc = "Checks if the value of the field is `A0_D1`"]
    #[inline(always)]
    pub fn is_a0_d1(&self) -> bool {
        **self == CMP_SELB_A::A0_D1
    }
    #[doc = "Checks if the value of the field is `A0_A0`"]
    #[inline(always)]
    pub fn is_a0_a0(&self) -> bool {
        **self == CMP_SELB_A::A0_A0
    }
}
impl core::ops::Deref for CMP_SELB_R {
    type Target = crate::FieldReader<u8, CMP_SELB_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CMP_SELB` writer - Datapath compare select"]
pub struct CMP_SELB_W<'a> {
    w: &'a mut W,
}
impl<'a> CMP_SELB_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CMP_SELB_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn a1_d1(self) -> &'a mut W {
        self.variant(CMP_SELB_A::A1_D1)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn a1_a0(self) -> &'a mut W {
        self.variant(CMP_SELB_A::A1_A0)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn a0_d1(self) -> &'a mut W {
        self.variant(CMP_SELB_A::A0_D1)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn a0_a0(self) -> &'a mut W {
        self.variant(CMP_SELB_A::A0_A0)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u8 & 0x03) << 6);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:1 - Datapath carry in source select"]
    #[inline(always)]
    pub fn ci_sela(&self) -> CI_SELA_R {
        CI_SELA_R::new((self.bits & 0x03) as u8)
    }
    #[doc = "Bits 2:3 - Datapath carry in source select"]
    #[inline(always)]
    pub fn ci_selb(&self) -> CI_SELB_R {
        CI_SELB_R::new(((self.bits >> 2) & 0x03) as u8)
    }
    #[doc = "Bits 4:5 - Datapath compare select"]
    #[inline(always)]
    pub fn cmp_sela(&self) -> CMP_SELA_R {
        CMP_SELA_R::new(((self.bits >> 4) & 0x03) as u8)
    }
    #[doc = "Bits 6:7 - Datapath compare select"]
    #[inline(always)]
    pub fn cmp_selb(&self) -> CMP_SELB_R {
        CMP_SELB_R::new(((self.bits >> 6) & 0x03) as u8)
    }
}
impl W {
    #[doc = "Bits 0:1 - Datapath carry in source select"]
    #[inline(always)]
    pub fn ci_sela(&mut self) -> CI_SELA_W {
        CI_SELA_W { w: self }
    }
    #[doc = "Bits 2:3 - Datapath carry in source select"]
    #[inline(always)]
    pub fn ci_selb(&mut self) -> CI_SELB_W {
        CI_SELB_W { w: self }
    }
    #[doc = "Bits 4:5 - Datapath compare select"]
    #[inline(always)]
    pub fn cmp_sela(&mut self) -> CMP_SELA_W {
        CMP_SELA_W { w: self }
    }
    #[doc = "Bits 6:7 - Datapath compare select"]
    #[inline(always)]
    pub fn cmp_selb(&mut self) -> CMP_SELB_W {
        CMP_SELB_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 carry in and compare configuration\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 [cfg13](index.html) module"]
pub struct CFG13_SPEC;
impl crate::RegisterSpec for CFG13_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [cfg13::R](R) reader structure"]
impl crate::Readable for CFG13_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cfg13::W](W) writer structure"]
impl crate::Writable for CFG13_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CFG13 to value 0"]
impl crate::Resettable for CFG13_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
