#[doc = "Register `CFG0` reader"]
pub struct R(crate::R<CFG0_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CFG0_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<CFG0_SPEC>> for R {
    fn from(reader: crate::R<CFG0_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CFG0` writer"]
pub struct W(crate::W<CFG0_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CFG0_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<CFG0_SPEC>> for W {
    fn from(writer: crate::W<CFG0_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Datapath Permutable Input Mux\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum RAD0_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<RAD0_A> for u8 {
    #[inline(always)]
    fn from(variant: RAD0_A) -> Self {
        variant as _
    }
}
#[doc = "Field `RAD0` reader - Datapath Permutable Input Mux"]
pub struct RAD0_R(crate::FieldReader<u8, RAD0_A>);
impl RAD0_R {
    pub(crate) fn new(bits: u8) -> Self {
        RAD0_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RAD0_A {
        match self.bits {
            0 => RAD0_A::OFF,
            1 => RAD0_A::DP_IN0,
            2 => RAD0_A::DP_IN1,
            3 => RAD0_A::DP_IN2,
            4 => RAD0_A::DP_IN3,
            5 => RAD0_A::DP_IN4,
            6 => RAD0_A::DP_IN5,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `OFF`"]
    #[inline(always)]
    pub fn is_off(&self) -> bool {
        **self == RAD0_A::OFF
    }
    #[doc = "Checks if the value of the field is `DP_IN0`"]
    #[inline(always)]
    pub fn is_dp_in0(&self) -> bool {
        **self == RAD0_A::DP_IN0
    }
    #[doc = "Checks if the value of the field is `DP_IN1`"]
    #[inline(always)]
    pub fn is_dp_in1(&self) -> bool {
        **self == RAD0_A::DP_IN1
    }
    #[doc = "Checks if the value of the field is `DP_IN2`"]
    #[inline(always)]
    pub fn is_dp_in2(&self) -> bool {
        **self == RAD0_A::DP_IN2
    }
    #[doc = "Checks if the value of the field is `DP_IN3`"]
    #[inline(always)]
    pub fn is_dp_in3(&self) -> bool {
        **self == RAD0_A::DP_IN3
    }
    #[doc = "Checks if the value of the field is `DP_IN4`"]
    #[inline(always)]
    pub fn is_dp_in4(&self) -> bool {
        **self == RAD0_A::DP_IN4
    }
    #[doc = "Checks if the value of the field is `DP_IN5`"]
    #[inline(always)]
    pub fn is_dp_in5(&self) -> bool {
        **self == RAD0_A::DP_IN5
    }
}
impl core::ops::Deref for RAD0_R {
    type Target = crate::FieldReader<u8, RAD0_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `RAD0` writer - Datapath Permutable Input Mux"]
pub struct RAD0_W<'a> {
    w: &'a mut W,
}
impl<'a> RAD0_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: RAD0_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn off(self) -> &'a mut W {
        self.variant(RAD0_A::OFF)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in0(self) -> &'a mut W {
        self.variant(RAD0_A::DP_IN0)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in1(self) -> &'a mut W {
        self.variant(RAD0_A::DP_IN1)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in2(self) -> &'a mut W {
        self.variant(RAD0_A::DP_IN2)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in3(self) -> &'a mut W {
        self.variant(RAD0_A::DP_IN3)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in4(self) -> &'a mut W {
        self.variant(RAD0_A::DP_IN4)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in5(self) -> &'a mut W {
        self.variant(RAD0_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 = "Datapath Permutable Input Mux\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum RAD1_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<RAD1_A> for u8 {
    #[inline(always)]
    fn from(variant: RAD1_A) -> Self {
        variant as _
    }
}
#[doc = "Field `RAD1` reader - Datapath Permutable Input Mux"]
pub struct RAD1_R(crate::FieldReader<u8, RAD1_A>);
impl RAD1_R {
    pub(crate) fn new(bits: u8) -> Self {
        RAD1_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RAD1_A {
        match self.bits {
            0 => RAD1_A::OFF,
            1 => RAD1_A::DP_IN0,
            2 => RAD1_A::DP_IN1,
            3 => RAD1_A::DP_IN2,
            4 => RAD1_A::DP_IN3,
            5 => RAD1_A::DP_IN4,
            6 => RAD1_A::DP_IN5,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `OFF`"]
    #[inline(always)]
    pub fn is_off(&self) -> bool {
        **self == RAD1_A::OFF
    }
    #[doc = "Checks if the value of the field is `DP_IN0`"]
    #[inline(always)]
    pub fn is_dp_in0(&self) -> bool {
        **self == RAD1_A::DP_IN0
    }
    #[doc = "Checks if the value of the field is `DP_IN1`"]
    #[inline(always)]
    pub fn is_dp_in1(&self) -> bool {
        **self == RAD1_A::DP_IN1
    }
    #[doc = "Checks if the value of the field is `DP_IN2`"]
    #[inline(always)]
    pub fn is_dp_in2(&self) -> bool {
        **self == RAD1_A::DP_IN2
    }
    #[doc = "Checks if the value of the field is `DP_IN3`"]
    #[inline(always)]
    pub fn is_dp_in3(&self) -> bool {
        **self == RAD1_A::DP_IN3
    }
    #[doc = "Checks if the value of the field is `DP_IN4`"]
    #[inline(always)]
    pub fn is_dp_in4(&self) -> bool {
        **self == RAD1_A::DP_IN4
    }
    #[doc = "Checks if the value of the field is `DP_IN5`"]
    #[inline(always)]
    pub fn is_dp_in5(&self) -> bool {
        **self == RAD1_A::DP_IN5
    }
}
impl core::ops::Deref for RAD1_R {
    type Target = crate::FieldReader<u8, RAD1_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `RAD1` writer - Datapath Permutable Input Mux"]
pub struct RAD1_W<'a> {
    w: &'a mut W,
}
impl<'a> RAD1_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: RAD1_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn off(self) -> &'a mut W {
        self.variant(RAD1_A::OFF)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in0(self) -> &'a mut W {
        self.variant(RAD1_A::DP_IN0)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in1(self) -> &'a mut W {
        self.variant(RAD1_A::DP_IN1)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in2(self) -> &'a mut W {
        self.variant(RAD1_A::DP_IN2)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in3(self) -> &'a mut W {
        self.variant(RAD1_A::DP_IN3)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in4(self) -> &'a mut W {
        self.variant(RAD1_A::DP_IN4)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dp_in5(self) -> &'a mut W {
        self.variant(RAD1_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
    }
}
impl R {
    #[doc = "Bits 0:2 - Datapath Permutable Input Mux"]
    #[inline(always)]
    pub fn rad0(&self) -> RAD0_R {
        RAD0_R::new((self.bits & 0x07) as u8)
    }
    #[doc = "Bits 4:6 - Datapath Permutable Input Mux"]
    #[inline(always)]
    pub fn rad1(&self) -> RAD1_R {
        RAD1_R::new(((self.bits >> 4) & 0x07) as u8)
    }
}
impl W {
    #[doc = "Bits 0:2 - Datapath Permutable Input Mux"]
    #[inline(always)]
    pub fn rad0(&mut self) -> RAD0_W {
        RAD0_W { w: self }
    }
    #[doc = "Bits 4:6 - Datapath Permutable Input Mux"]
    #[inline(always)]
    pub fn rad1(&mut self) -> RAD1_W {
        RAD1_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 - RAD1 RAD0. Address bits 0 and 1 to the dynamic configuration RAM\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 [cfg0](index.html) module"]
pub struct CFG0_SPEC;
impl crate::RegisterSpec for CFG0_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [cfg0::R](R) reader structure"]
impl crate::Readable for CFG0_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cfg0::W](W) writer structure"]
impl crate::Writable for CFG0_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CFG0 to value 0"]
impl crate::Resettable for CFG0_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
