#[doc = "Register `CFG2` reader"]
pub struct R(crate::R<CFG2_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CFG2_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<CFG2_SPEC>> for R {
    fn from(reader: crate::R<CFG2_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CFG2` writer"]
pub struct W(crate::W<CFG2_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CFG2_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<CFG2_SPEC>> for W {
    fn from(writer: crate::W<CFG2_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Datapath Permutable Input Mux\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum F0_LD_A {
    #[doc = "0: No description available"]
    OFF = 0,
    #[doc = "1: No description available"]
    DP_IN0 = 1,
    #[doc = "2: No description available"]
    DP_IN1 = 2,
    #[doc = "3: No description available"]
    DP_IN2 = 3,
    #[doc = "4: No description available"]
    DP_IN3 = 4,
    #[doc = "5: No description available"]
    DP_IN4 = 5,
    #[doc = "6: No description available"]
    DP_IN5 = 6,
}
impl From<F0_LD_A> for u8 {
    #[inline(always)]
    fn from(variant: F0_LD_A) -> Self {
        variant as _
    }
}
#[doc = "Field `F0_LD` reader - Datapath Permutable Input Mux"]
pub struct F0_LD_R(crate::FieldReader<u8, F0_LD_A>);
impl F0_LD_R {
    pub(crate) fn new(bits: u8) -> Self {
        F0_LD_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> F0_LD_A {
        match self.bits {
            0 => F0_LD_A::OFF,
            1 => F0_LD_A::DP_IN0,
            2 => F0_LD_A::DP_IN1,
            3 => F0_LD_A::DP_IN2,
            4 => F0_LD_A::DP_IN3,
            5 => F0_LD_A::DP_IN4,
            6 => F0_LD_A::DP_IN5,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `OFF`"]
    #[inline(always)]
    pub fn is_off(&self) -> bool {
        **self == F0_LD_A::OFF
    }
    #[doc = "Checks if the value of the field is `DP_IN0`"]
    #[inline(always)]
    pub fn is_dp_in0(&self) -> bool {
        **self == F0_LD_A::DP_IN0
    }
    #[doc = "Checks if the value of the field is `DP_IN1`"]
    #[inline(always)]
    pub fn is_dp_in1(&self) -> bool {
        **self == F0_LD_A::DP_IN1
    }
    #[doc = "Checks if the value of the field is `DP_IN2`"]
    #[inline(always)]
    pub fn is_dp_in2(&self) -> bool {
        **self == F0_LD_A::DP_IN2
    }
    #[doc = "Checks if the value of the field is `DP_IN3`"]
    #[inline(always)]
    pub fn is_dp_in3(&self) -> bool {
        **self == F0_LD_A::DP_IN3
    }
    #[doc = "Checks if the value of the field is `DP_IN4`"]
    #[inline(always)]
    pub fn is_dp_in4(&self) -> bool {
        **self == F0_LD_A::DP_IN4
    }
    #[doc = "Checks if the value of the field is `DP_IN5`"]
    #[inline(always)]
    pub fn is_dp_in5(&self) -> bool {
        **self == F0_LD_A::DP_IN5
    }
}
impl core::ops::Deref for F0_LD_R {
    type Target = crate::FieldReader<u8, F0_LD_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `F0_LD` writer - Datapath Permutable Input Mux"]
pub struct F0_LD_W<'a> {
    w: &'a mut W,
}
impl<'a> F0_LD_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: F0_LD_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn off(self) -> &'a mut W {
        self.variant(F0_LD_A::OFF)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in0(self) -> &'a mut W {
        self.variant(F0_LD_A::DP_IN0)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in1(self) -> &'a mut W {
        self.variant(F0_LD_A::DP_IN1)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in2(self) -> &'a mut W {
        self.variant(F0_LD_A::DP_IN2)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in3(self) -> &'a mut W {
        self.variant(F0_LD_A::DP_IN3)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in4(self) -> &'a mut W {
        self.variant(F0_LD_A::DP_IN4)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in5(self) -> &'a mut W {
        self.variant(F0_LD_A::DP_IN5)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x07) | (value as u8 & 0x07);
        self.w
    }
}
#[doc = "DP_In bypass control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DP_RTE_BYPASS5_A {
    #[doc = "0: No description available"]
    DP_IN5_ROUTE = 0,
    #[doc = "1: No description available"]
    DP_IN5_BYPASS = 1,
}
impl From<DP_RTE_BYPASS5_A> for bool {
    #[inline(always)]
    fn from(variant: DP_RTE_BYPASS5_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DP_RTE_BYPASS5` reader - DP_In bypass control"]
pub struct DP_RTE_BYPASS5_R(crate::FieldReader<bool, DP_RTE_BYPASS5_A>);
impl DP_RTE_BYPASS5_R {
    pub(crate) fn new(bits: bool) -> Self {
        DP_RTE_BYPASS5_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DP_RTE_BYPASS5_A {
        match self.bits {
            false => DP_RTE_BYPASS5_A::DP_IN5_ROUTE,
            true => DP_RTE_BYPASS5_A::DP_IN5_BYPASS,
        }
    }
    #[doc = "Checks if the value of the field is `DP_IN5_ROUTE`"]
    #[inline(always)]
    pub fn is_dp_in5_route(&self) -> bool {
        **self == DP_RTE_BYPASS5_A::DP_IN5_ROUTE
    }
    #[doc = "Checks if the value of the field is `DP_IN5_BYPASS`"]
    #[inline(always)]
    pub fn is_dp_in5_bypass(&self) -> bool {
        **self == DP_RTE_BYPASS5_A::DP_IN5_BYPASS
    }
}
impl core::ops::Deref for DP_RTE_BYPASS5_R {
    type Target = crate::FieldReader<bool, DP_RTE_BYPASS5_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `DP_RTE_BYPASS5` writer - DP_In bypass control"]
pub struct DP_RTE_BYPASS5_W<'a> {
    w: &'a mut W,
}
impl<'a> DP_RTE_BYPASS5_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DP_RTE_BYPASS5_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in5_route(self) -> &'a mut W {
        self.variant(DP_RTE_BYPASS5_A::DP_IN5_ROUTE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in5_bypass(self) -> &'a mut W {
        self.variant(DP_RTE_BYPASS5_A::DP_IN5_BYPASS)
    }
    #[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 = "Datapath Permutable Input Mux\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum F1_LD_A {
    #[doc = "0: No description available"]
    OFF = 0,
    #[doc = "1: No description available"]
    DP_IN0 = 1,
    #[doc = "2: No description available"]
    DP_IN1 = 2,
    #[doc = "3: No description available"]
    DP_IN2 = 3,
    #[doc = "4: No description available"]
    DP_IN3 = 4,
    #[doc = "5: No description available"]
    DP_IN4 = 5,
    #[doc = "6: No description available"]
    DP_IN5 = 6,
}
impl From<F1_LD_A> for u8 {
    #[inline(always)]
    fn from(variant: F1_LD_A) -> Self {
        variant as _
    }
}
#[doc = "Field `F1_LD` reader - Datapath Permutable Input Mux"]
pub struct F1_LD_R(crate::FieldReader<u8, F1_LD_A>);
impl F1_LD_R {
    pub(crate) fn new(bits: u8) -> Self {
        F1_LD_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> F1_LD_A {
        match self.bits {
            0 => F1_LD_A::OFF,
            1 => F1_LD_A::DP_IN0,
            2 => F1_LD_A::DP_IN1,
            3 => F1_LD_A::DP_IN2,
            4 => F1_LD_A::DP_IN3,
            5 => F1_LD_A::DP_IN4,
            6 => F1_LD_A::DP_IN5,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `OFF`"]
    #[inline(always)]
    pub fn is_off(&self) -> bool {
        **self == F1_LD_A::OFF
    }
    #[doc = "Checks if the value of the field is `DP_IN0`"]
    #[inline(always)]
    pub fn is_dp_in0(&self) -> bool {
        **self == F1_LD_A::DP_IN0
    }
    #[doc = "Checks if the value of the field is `DP_IN1`"]
    #[inline(always)]
    pub fn is_dp_in1(&self) -> bool {
        **self == F1_LD_A::DP_IN1
    }
    #[doc = "Checks if the value of the field is `DP_IN2`"]
    #[inline(always)]
    pub fn is_dp_in2(&self) -> bool {
        **self == F1_LD_A::DP_IN2
    }
    #[doc = "Checks if the value of the field is `DP_IN3`"]
    #[inline(always)]
    pub fn is_dp_in3(&self) -> bool {
        **self == F1_LD_A::DP_IN3
    }
    #[doc = "Checks if the value of the field is `DP_IN4`"]
    #[inline(always)]
    pub fn is_dp_in4(&self) -> bool {
        **self == F1_LD_A::DP_IN4
    }
    #[doc = "Checks if the value of the field is `DP_IN5`"]
    #[inline(always)]
    pub fn is_dp_in5(&self) -> bool {
        **self == F1_LD_A::DP_IN5
    }
}
impl core::ops::Deref for F1_LD_R {
    type Target = crate::FieldReader<u8, F1_LD_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `F1_LD` writer - Datapath Permutable Input Mux"]
pub struct F1_LD_W<'a> {
    w: &'a mut W,
}
impl<'a> F1_LD_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: F1_LD_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn off(self) -> &'a mut W {
        self.variant(F1_LD_A::OFF)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in0(self) -> &'a mut W {
        self.variant(F1_LD_A::DP_IN0)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in1(self) -> &'a mut W {
        self.variant(F1_LD_A::DP_IN1)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in2(self) -> &'a mut W {
        self.variant(F1_LD_A::DP_IN2)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in3(self) -> &'a mut W {
        self.variant(F1_LD_A::DP_IN3)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in4(self) -> &'a mut W {
        self.variant(F1_LD_A::DP_IN4)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in5(self) -> &'a mut W {
        self.variant(F1_LD_A::DP_IN5)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 4)) | ((value as u8 & 0x07) << 4);
        self.w
    }
}
#[doc = "Field `NC7` reader - Spare register bit"]
pub struct NC7_R(crate::FieldReader<bool, bool>);
impl NC7_R {
    pub(crate) fn new(bits: bool) -> Self {
        NC7_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for NC7_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `NC7` writer - Spare register bit"]
pub struct NC7_W<'a> {
    w: &'a mut W,
}
impl<'a> NC7_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 << 7)) | ((value as u8 & 0x01) << 7);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:2 - Datapath Permutable Input Mux"]
    #[inline(always)]
    pub fn f0_ld(&self) -> F0_LD_R {
        F0_LD_R::new((self.bits & 0x07) as u8)
    }
    #[doc = "Bit 3 - DP_In bypass control"]
    #[inline(always)]
    pub fn dp_rte_bypass5(&self) -> DP_RTE_BYPASS5_R {
        DP_RTE_BYPASS5_R::new(((self.bits >> 3) & 0x01) != 0)
    }
    #[doc = "Bits 4:6 - Datapath Permutable Input Mux"]
    #[inline(always)]
    pub fn f1_ld(&self) -> F1_LD_R {
        F1_LD_R::new(((self.bits >> 4) & 0x07) as u8)
    }
    #[doc = "Bit 7 - Spare register bit"]
    #[inline(always)]
    pub fn nc7(&self) -> NC7_R {
        NC7_R::new(((self.bits >> 7) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bits 0:2 - Datapath Permutable Input Mux"]
    #[inline(always)]
    pub fn f0_ld(&mut self) -> F0_LD_W {
        F0_LD_W { w: self }
    }
    #[doc = "Bit 3 - DP_In bypass control"]
    #[inline(always)]
    pub fn dp_rte_bypass5(&mut self) -> DP_RTE_BYPASS5_W {
        DP_RTE_BYPASS5_W { w: self }
    }
    #[doc = "Bits 4:6 - Datapath Permutable Input Mux"]
    #[inline(always)]
    pub fn f1_ld(&mut self) -> F1_LD_W {
        F1_LD_W { w: self }
    }
    #[doc = "Bit 7 - Spare register bit"]
    #[inline(always)]
    pub fn nc7(&mut self) -> NC7_W {
        NC7_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 Input Selection - F1_LD, F0_LD.\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 [cfg2](index.html) module"]
pub struct CFG2_SPEC;
impl crate::RegisterSpec for CFG2_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [cfg2::R](R) reader structure"]
impl crate::Readable for CFG2_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cfg2::W](W) writer structure"]
impl crate::Writable for CFG2_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CFG2 to value 0"]
impl crate::Resettable for CFG2_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
