#[doc = "Register `CFG5` reader"]
pub struct R(crate::R<CFG5_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CFG5_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<CFG5_SPEC>> for R {
    fn from(reader: crate::R<CFG5_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CFG5` writer"]
pub struct W(crate::W<CFG5_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CFG5_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<CFG5_SPEC>> for W {
    fn from(writer: crate::W<CFG5_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Select port input to route to reset multiplexer (dsi_xx_input_p\\[7:0\\])\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PIN_SEL_A {
    #[doc = "0: No description available"]
    PIN0 = 0,
    #[doc = "1: No description available"]
    PIN1 = 1,
    #[doc = "2: No description available"]
    PIN2 = 2,
    #[doc = "3: No description available"]
    PIN3 = 3,
    #[doc = "4: No description available"]
    PIN4 = 4,
    #[doc = "5: No description available"]
    PIN5 = 5,
    #[doc = "6: No description available"]
    PIN6 = 6,
    #[doc = "7: No description available"]
    PIN7 = 7,
}
impl From<PIN_SEL_A> for bool {
    #[inline(always)]
    fn from(variant: PIN_SEL_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `PIN_SEL` reader - Select port input to route to reset multiplexer (dsi_xx_input_p\\[7:0\\])"]
pub struct PIN_SEL_R(crate::FieldReader<bool, PIN_SEL_A>);
impl PIN_SEL_R {
    pub(crate) fn new(bits: bool) -> Self {
        PIN_SEL_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<PIN_SEL_A> {
        match self.bits {
            false => Some(PIN_SEL_A::PIN0),
            true => Some(PIN_SEL_A::PIN1),
            true => Some(PIN_SEL_A::PIN2),
            true => Some(PIN_SEL_A::PIN3),
            true => Some(PIN_SEL_A::PIN4),
            true => Some(PIN_SEL_A::PIN5),
            true => Some(PIN_SEL_A::PIN6),
            true => Some(PIN_SEL_A::PIN7),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `PIN0`"]
    #[inline(always)]
    pub fn is_pin0(&self) -> bool {
        **self == PIN_SEL_A::PIN0
    }
    #[doc = "Checks if the value of the field is `PIN1`"]
    #[inline(always)]
    pub fn is_pin1(&self) -> bool {
        **self == PIN_SEL_A::PIN1
    }
    #[doc = "Checks if the value of the field is `PIN2`"]
    #[inline(always)]
    pub fn is_pin2(&self) -> bool {
        **self == PIN_SEL_A::PIN2
    }
    #[doc = "Checks if the value of the field is `PIN3`"]
    #[inline(always)]
    pub fn is_pin3(&self) -> bool {
        **self == PIN_SEL_A::PIN3
    }
    #[doc = "Checks if the value of the field is `PIN4`"]
    #[inline(always)]
    pub fn is_pin4(&self) -> bool {
        **self == PIN_SEL_A::PIN4
    }
    #[doc = "Checks if the value of the field is `PIN5`"]
    #[inline(always)]
    pub fn is_pin5(&self) -> bool {
        **self == PIN_SEL_A::PIN5
    }
    #[doc = "Checks if the value of the field is `PIN6`"]
    #[inline(always)]
    pub fn is_pin6(&self) -> bool {
        **self == PIN_SEL_A::PIN6
    }
    #[doc = "Checks if the value of the field is `PIN7`"]
    #[inline(always)]
    pub fn is_pin7(&self) -> bool {
        **self == PIN_SEL_A::PIN7
    }
}
impl core::ops::Deref for PIN_SEL_R {
    type Target = crate::FieldReader<bool, PIN_SEL_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `PIN_SEL` writer - Select port input to route to reset multiplexer (dsi_xx_input_p\\[7:0\\])"]
pub struct PIN_SEL_W<'a> {
    w: &'a mut W,
}
impl<'a> PIN_SEL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: PIN_SEL_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn pin0(self) -> &'a mut W {
        self.variant(PIN_SEL_A::PIN0)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn pin1(self) -> &'a mut W {
        self.variant(PIN_SEL_A::PIN1)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn pin2(self) -> &'a mut W {
        self.variant(PIN_SEL_A::PIN2)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn pin3(self) -> &'a mut W {
        self.variant(PIN_SEL_A::PIN3)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn pin4(self) -> &'a mut W {
        self.variant(PIN_SEL_A::PIN4)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn pin5(self) -> &'a mut W {
        self.variant(PIN_SEL_A::PIN5)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn pin6(self) -> &'a mut W {
        self.variant(PIN_SEL_A::PIN6)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn pin7(self) -> &'a mut W {
        self.variant(PIN_SEL_A::PIN7)
    }
    #[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 = "Field `NC7654` reader - Spare register bits"]
pub struct NC7654_R(crate::FieldReader<u8, u8>);
impl NC7654_R {
    pub(crate) fn new(bits: u8) -> Self {
        NC7654_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for NC7654_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `NC7654` writer - Spare register bits"]
pub struct NC7654_W<'a> {
    w: &'a mut W,
}
impl<'a> NC7654_W<'a> {
    #[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 & !(0x1f << 3)) | ((value as u8 & 0x1f) << 3);
        self.w
    }
}
impl R {
    #[doc = "Bit 0 - Select port input to route to reset multiplexer (dsi_xx_input_p\\[7:0\\])"]
    #[inline(always)]
    pub fn pin_sel(&self) -> PIN_SEL_R {
        PIN_SEL_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bits 3:7 - Spare register bits"]
    #[inline(always)]
    pub fn nc7654(&self) -> NC7654_R {
        NC7654_R::new(((self.bits >> 3) & 0x1f) as u8)
    }
}
impl W {
    #[doc = "Bit 0 - Select port input to route to reset multiplexer (dsi_xx_input_p\\[7:0\\])"]
    #[inline(always)]
    pub fn pin_sel(&mut self) -> PIN_SEL_W {
        PIN_SEL_W { w: self }
    }
    #[doc = "Bits 3:7 - Spare register bits"]
    #[inline(always)]
    pub fn nc7654(&mut self) -> NC7654_W {
        NC7654_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 = "PA Reset Pin Select Register\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 [cfg5](index.html) module"]
pub struct CFG5_SPEC;
impl crate::RegisterSpec for CFG5_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [cfg5::R](R) reader structure"]
impl crate::Readable for CFG5_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cfg5::W](W) writer structure"]
impl crate::Writable for CFG5_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CFG5 to value 0"]
impl crate::Resettable for CFG5_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
