#[doc = "Register `CFG12` reader"]
pub struct R(crate::R<CFG12_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CFG12_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<CFG12_SPEC>> for R {
    fn from(reader: crate::R<CFG12_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CFG12` writer"]
pub struct W(crate::W<CFG12_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CFG12_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<CFG12_SPEC>> for W {
    fn from(writer: crate::W<CFG12_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Datapath shift in source select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum SI_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<SI_SELA_A> for u8 {
    #[inline(always)]
    fn from(variant: SI_SELA_A) -> Self {
        variant as _
    }
}
#[doc = "Field `SI_SELA` reader - Datapath shift in source select"]
pub struct SI_SELA_R(crate::FieldReader<u8, SI_SELA_A>);
impl SI_SELA_R {
    pub(crate) fn new(bits: u8) -> Self {
        SI_SELA_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SI_SELA_A {
        match self.bits {
            0 => SI_SELA_A::DEFAULT,
            1 => SI_SELA_A::REGISTERED,
            2 => SI_SELA_A::ROUTE,
            3 => SI_SELA_A::CHAIN,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DEFAULT`"]
    #[inline(always)]
    pub fn is_default(&self) -> bool {
        **self == SI_SELA_A::DEFAULT
    }
    #[doc = "Checks if the value of the field is `REGISTERED`"]
    #[inline(always)]
    pub fn is_registered(&self) -> bool {
        **self == SI_SELA_A::REGISTERED
    }
    #[doc = "Checks if the value of the field is `ROUTE`"]
    #[inline(always)]
    pub fn is_route(&self) -> bool {
        **self == SI_SELA_A::ROUTE
    }
    #[doc = "Checks if the value of the field is `CHAIN`"]
    #[inline(always)]
    pub fn is_chain(&self) -> bool {
        **self == SI_SELA_A::CHAIN
    }
}
impl core::ops::Deref for SI_SELA_R {
    type Target = crate::FieldReader<u8, SI_SELA_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `SI_SELA` writer - Datapath shift in source select"]
pub struct SI_SELA_W<'a> {
    w: &'a mut W,
}
impl<'a> SI_SELA_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: SI_SELA_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn default(self) -> &'a mut W {
        self.variant(SI_SELA_A::DEFAULT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn registered(self) -> &'a mut W {
        self.variant(SI_SELA_A::REGISTERED)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn route(self) -> &'a mut W {
        self.variant(SI_SELA_A::ROUTE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn chain(self) -> &'a mut W {
        self.variant(SI_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 shift in source select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum SI_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<SI_SELB_A> for u8 {
    #[inline(always)]
    fn from(variant: SI_SELB_A) -> Self {
        variant as _
    }
}
#[doc = "Field `SI_SELB` reader - Datapath shift in source select"]
pub struct SI_SELB_R(crate::FieldReader<u8, SI_SELB_A>);
impl SI_SELB_R {
    pub(crate) fn new(bits: u8) -> Self {
        SI_SELB_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SI_SELB_A {
        match self.bits {
            0 => SI_SELB_A::DEFAULT,
            1 => SI_SELB_A::REGISTERED,
            2 => SI_SELB_A::ROUTE,
            3 => SI_SELB_A::CHAIN,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DEFAULT`"]
    #[inline(always)]
    pub fn is_default(&self) -> bool {
        **self == SI_SELB_A::DEFAULT
    }
    #[doc = "Checks if the value of the field is `REGISTERED`"]
    #[inline(always)]
    pub fn is_registered(&self) -> bool {
        **self == SI_SELB_A::REGISTERED
    }
    #[doc = "Checks if the value of the field is `ROUTE`"]
    #[inline(always)]
    pub fn is_route(&self) -> bool {
        **self == SI_SELB_A::ROUTE
    }
    #[doc = "Checks if the value of the field is `CHAIN`"]
    #[inline(always)]
    pub fn is_chain(&self) -> bool {
        **self == SI_SELB_A::CHAIN
    }
}
impl core::ops::Deref for SI_SELB_R {
    type Target = crate::FieldReader<u8, SI_SELB_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `SI_SELB` writer - Datapath shift in source select"]
pub struct SI_SELB_W<'a> {
    w: &'a mut W,
}
impl<'a> SI_SELB_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: SI_SELB_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn default(self) -> &'a mut W {
        self.variant(SI_SELB_A::DEFAULT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn registered(self) -> &'a mut W {
        self.variant(SI_SELB_A::REGISTERED)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn route(self) -> &'a mut W {
        self.variant(SI_SELB_A::ROUTE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn chain(self) -> &'a mut W {
        self.variant(SI_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 default shift value\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DEF_SI_A {
    #[doc = "0: No description available"]
    DEFAULT_0 = 0,
    #[doc = "1: No description available"]
    DEFAULT_1 = 1,
}
impl From<DEF_SI_A> for bool {
    #[inline(always)]
    fn from(variant: DEF_SI_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DEF_SI` reader - Datapath default shift value"]
pub struct DEF_SI_R(crate::FieldReader<bool, DEF_SI_A>);
impl DEF_SI_R {
    pub(crate) fn new(bits: bool) -> Self {
        DEF_SI_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DEF_SI_A {
        match self.bits {
            false => DEF_SI_A::DEFAULT_0,
            true => DEF_SI_A::DEFAULT_1,
        }
    }
    #[doc = "Checks if the value of the field is `DEFAULT_0`"]
    #[inline(always)]
    pub fn is_default_0(&self) -> bool {
        **self == DEF_SI_A::DEFAULT_0
    }
    #[doc = "Checks if the value of the field is `DEFAULT_1`"]
    #[inline(always)]
    pub fn is_default_1(&self) -> bool {
        **self == DEF_SI_A::DEFAULT_1
    }
}
impl core::ops::Deref for DEF_SI_R {
    type Target = crate::FieldReader<bool, DEF_SI_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `DEF_SI` writer - Datapath default shift value"]
pub struct DEF_SI_W<'a> {
    w: &'a mut W,
}
impl<'a> DEF_SI_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DEF_SI_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn default_0(self) -> &'a mut W {
        self.variant(DEF_SI_A::DEFAULT_0)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn default_1(self) -> &'a mut W {
        self.variant(DEF_SI_A::DEFAULT_1)
    }
    #[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 = "Datapath mask enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum AMASK_EN_A {
    #[doc = "0: No description available"]
    DISABLE = 0,
    #[doc = "1: No description available"]
    ENABLE = 1,
}
impl From<AMASK_EN_A> for bool {
    #[inline(always)]
    fn from(variant: AMASK_EN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `AMASK_EN` reader - Datapath mask enable"]
pub struct AMASK_EN_R(crate::FieldReader<bool, AMASK_EN_A>);
impl AMASK_EN_R {
    pub(crate) fn new(bits: bool) -> Self {
        AMASK_EN_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AMASK_EN_A {
        match self.bits {
            false => AMASK_EN_A::DISABLE,
            true => AMASK_EN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        **self == AMASK_EN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        **self == AMASK_EN_A::ENABLE
    }
}
impl core::ops::Deref for AMASK_EN_R {
    type Target = crate::FieldReader<bool, AMASK_EN_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `AMASK_EN` writer - Datapath mask enable"]
pub struct AMASK_EN_W<'a> {
    w: &'a mut W,
}
impl<'a> AMASK_EN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: AMASK_EN_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(AMASK_EN_A::DISABLE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(AMASK_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 << 5)) | ((value as u8 & 0x01) << 5);
        self.w
    }
}
#[doc = "Datapath mask enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CMASK0_EN_A {
    #[doc = "0: No description available"]
    DISABLE = 0,
    #[doc = "1: No description available"]
    ENABLE = 1,
}
impl From<CMASK0_EN_A> for bool {
    #[inline(always)]
    fn from(variant: CMASK0_EN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CMASK0_EN` reader - Datapath mask enable"]
pub struct CMASK0_EN_R(crate::FieldReader<bool, CMASK0_EN_A>);
impl CMASK0_EN_R {
    pub(crate) fn new(bits: bool) -> Self {
        CMASK0_EN_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CMASK0_EN_A {
        match self.bits {
            false => CMASK0_EN_A::DISABLE,
            true => CMASK0_EN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        **self == CMASK0_EN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        **self == CMASK0_EN_A::ENABLE
    }
}
impl core::ops::Deref for CMASK0_EN_R {
    type Target = crate::FieldReader<bool, CMASK0_EN_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CMASK0_EN` writer - Datapath mask enable"]
pub struct CMASK0_EN_W<'a> {
    w: &'a mut W,
}
impl<'a> CMASK0_EN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CMASK0_EN_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(CMASK0_EN_A::DISABLE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(CMASK0_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 << 6)) | ((value as u8 & 0x01) << 6);
        self.w
    }
}
#[doc = "Datapath mask enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CMASK1_EN_A {
    #[doc = "0: No description available"]
    DISABLE = 0,
    #[doc = "1: No description available"]
    ENABLE = 1,
}
impl From<CMASK1_EN_A> for bool {
    #[inline(always)]
    fn from(variant: CMASK1_EN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CMASK1_EN` reader - Datapath mask enable"]
pub struct CMASK1_EN_R(crate::FieldReader<bool, CMASK1_EN_A>);
impl CMASK1_EN_R {
    pub(crate) fn new(bits: bool) -> Self {
        CMASK1_EN_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CMASK1_EN_A {
        match self.bits {
            false => CMASK1_EN_A::DISABLE,
            true => CMASK1_EN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        **self == CMASK1_EN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        **self == CMASK1_EN_A::ENABLE
    }
}
impl core::ops::Deref for CMASK1_EN_R {
    type Target = crate::FieldReader<bool, CMASK1_EN_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CMASK1_EN` writer - Datapath mask enable"]
pub struct CMASK1_EN_W<'a> {
    w: &'a mut W,
}
impl<'a> CMASK1_EN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CMASK1_EN_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(CMASK1_EN_A::DISABLE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(CMASK1_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 << 7)) | ((value as u8 & 0x01) << 7);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:1 - Datapath shift in source select"]
    #[inline(always)]
    pub fn si_sela(&self) -> SI_SELA_R {
        SI_SELA_R::new((self.bits & 0x03) as u8)
    }
    #[doc = "Bits 2:3 - Datapath shift in source select"]
    #[inline(always)]
    pub fn si_selb(&self) -> SI_SELB_R {
        SI_SELB_R::new(((self.bits >> 2) & 0x03) as u8)
    }
    #[doc = "Bit 4 - Datapath default shift value"]
    #[inline(always)]
    pub fn def_si(&self) -> DEF_SI_R {
        DEF_SI_R::new(((self.bits >> 4) & 0x01) != 0)
    }
    #[doc = "Bit 5 - Datapath mask enable"]
    #[inline(always)]
    pub fn amask_en(&self) -> AMASK_EN_R {
        AMASK_EN_R::new(((self.bits >> 5) & 0x01) != 0)
    }
    #[doc = "Bit 6 - Datapath mask enable"]
    #[inline(always)]
    pub fn cmask0_en(&self) -> CMASK0_EN_R {
        CMASK0_EN_R::new(((self.bits >> 6) & 0x01) != 0)
    }
    #[doc = "Bit 7 - Datapath mask enable"]
    #[inline(always)]
    pub fn cmask1_en(&self) -> CMASK1_EN_R {
        CMASK1_EN_R::new(((self.bits >> 7) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bits 0:1 - Datapath shift in source select"]
    #[inline(always)]
    pub fn si_sela(&mut self) -> SI_SELA_W {
        SI_SELA_W { w: self }
    }
    #[doc = "Bits 2:3 - Datapath shift in source select"]
    #[inline(always)]
    pub fn si_selb(&mut self) -> SI_SELB_W {
        SI_SELB_W { w: self }
    }
    #[doc = "Bit 4 - Datapath default shift value"]
    #[inline(always)]
    pub fn def_si(&mut self) -> DEF_SI_W {
        DEF_SI_W { w: self }
    }
    #[doc = "Bit 5 - Datapath mask enable"]
    #[inline(always)]
    pub fn amask_en(&mut self) -> AMASK_EN_W {
        AMASK_EN_W { w: self }
    }
    #[doc = "Bit 6 - Datapath mask enable"]
    #[inline(always)]
    pub fn cmask0_en(&mut self) -> CMASK0_EN_W {
        CMASK0_EN_W { w: self }
    }
    #[doc = "Bit 7 - Datapath mask enable"]
    #[inline(always)]
    pub fn cmask1_en(&mut self) -> CMASK1_EN_W {
        CMASK1_EN_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 mask enables and shift in 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 [cfg12](index.html) module"]
pub struct CFG12_SPEC;
impl crate::RegisterSpec for CFG12_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [cfg12::R](R) reader structure"]
impl crate::Readable for CFG12_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cfg12::W](W) writer structure"]
impl crate::Writable for CFG12_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CFG12 to value 0"]
impl crate::Resettable for CFG12_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
