#[doc = "Register `CFG6` reader"]
pub struct R(crate::R<CFG6_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CFG6_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<CFG6_SPEC>> for R {
    fn from(reader: crate::R<CFG6_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CFG6` writer"]
pub struct W(crate::W<CFG6_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CFG6_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<CFG6_SPEC>> for W {
    fn from(writer: crate::W<CFG6_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Synchronization selection for PA input 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum IN_SYNC0_A {
    #[doc = "0: No description available"]
    TRANSPARENT = 0,
    #[doc = "1: No description available"]
    SINGLESYNC = 1,
    #[doc = "2: No description available"]
    DOUBLESYNC = 2,
    #[doc = "3: No description available"]
    RSVD = 3,
}
impl From<IN_SYNC0_A> for u8 {
    #[inline(always)]
    fn from(variant: IN_SYNC0_A) -> Self {
        variant as _
    }
}
#[doc = "Field `IN_SYNC0` reader - Synchronization selection for PA input 0"]
pub struct IN_SYNC0_R(crate::FieldReader<u8, IN_SYNC0_A>);
impl IN_SYNC0_R {
    pub(crate) fn new(bits: u8) -> Self {
        IN_SYNC0_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IN_SYNC0_A {
        match self.bits {
            0 => IN_SYNC0_A::TRANSPARENT,
            1 => IN_SYNC0_A::SINGLESYNC,
            2 => IN_SYNC0_A::DOUBLESYNC,
            3 => IN_SYNC0_A::RSVD,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TRANSPARENT`"]
    #[inline(always)]
    pub fn is_transparent(&self) -> bool {
        **self == IN_SYNC0_A::TRANSPARENT
    }
    #[doc = "Checks if the value of the field is `SINGLESYNC`"]
    #[inline(always)]
    pub fn is_singlesync(&self) -> bool {
        **self == IN_SYNC0_A::SINGLESYNC
    }
    #[doc = "Checks if the value of the field is `DOUBLESYNC`"]
    #[inline(always)]
    pub fn is_doublesync(&self) -> bool {
        **self == IN_SYNC0_A::DOUBLESYNC
    }
    #[doc = "Checks if the value of the field is `RSVD`"]
    #[inline(always)]
    pub fn is_rsvd(&self) -> bool {
        **self == IN_SYNC0_A::RSVD
    }
}
impl core::ops::Deref for IN_SYNC0_R {
    type Target = crate::FieldReader<u8, IN_SYNC0_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `IN_SYNC0` writer - Synchronization selection for PA input 0"]
pub struct IN_SYNC0_W<'a> {
    w: &'a mut W,
}
impl<'a> IN_SYNC0_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: IN_SYNC0_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn transparent(self) -> &'a mut W {
        self.variant(IN_SYNC0_A::TRANSPARENT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn singlesync(self) -> &'a mut W {
        self.variant(IN_SYNC0_A::SINGLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn doublesync(self) -> &'a mut W {
        self.variant(IN_SYNC0_A::DOUBLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn rsvd(self) -> &'a mut W {
        self.variant(IN_SYNC0_A::RSVD)
    }
    #[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 = "Synchronization selection for PA input 1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum IN_SYNC1_A {
    #[doc = "0: No description available"]
    TRANSPARENT = 0,
    #[doc = "1: No description available"]
    SINGLESYNC = 1,
    #[doc = "2: No description available"]
    DOUBLESYNC = 2,
    #[doc = "3: No description available"]
    RSVD = 3,
}
impl From<IN_SYNC1_A> for u8 {
    #[inline(always)]
    fn from(variant: IN_SYNC1_A) -> Self {
        variant as _
    }
}
#[doc = "Field `IN_SYNC1` reader - Synchronization selection for PA input 1"]
pub struct IN_SYNC1_R(crate::FieldReader<u8, IN_SYNC1_A>);
impl IN_SYNC1_R {
    pub(crate) fn new(bits: u8) -> Self {
        IN_SYNC1_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IN_SYNC1_A {
        match self.bits {
            0 => IN_SYNC1_A::TRANSPARENT,
            1 => IN_SYNC1_A::SINGLESYNC,
            2 => IN_SYNC1_A::DOUBLESYNC,
            3 => IN_SYNC1_A::RSVD,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TRANSPARENT`"]
    #[inline(always)]
    pub fn is_transparent(&self) -> bool {
        **self == IN_SYNC1_A::TRANSPARENT
    }
    #[doc = "Checks if the value of the field is `SINGLESYNC`"]
    #[inline(always)]
    pub fn is_singlesync(&self) -> bool {
        **self == IN_SYNC1_A::SINGLESYNC
    }
    #[doc = "Checks if the value of the field is `DOUBLESYNC`"]
    #[inline(always)]
    pub fn is_doublesync(&self) -> bool {
        **self == IN_SYNC1_A::DOUBLESYNC
    }
    #[doc = "Checks if the value of the field is `RSVD`"]
    #[inline(always)]
    pub fn is_rsvd(&self) -> bool {
        **self == IN_SYNC1_A::RSVD
    }
}
impl core::ops::Deref for IN_SYNC1_R {
    type Target = crate::FieldReader<u8, IN_SYNC1_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `IN_SYNC1` writer - Synchronization selection for PA input 1"]
pub struct IN_SYNC1_W<'a> {
    w: &'a mut W,
}
impl<'a> IN_SYNC1_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: IN_SYNC1_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn transparent(self) -> &'a mut W {
        self.variant(IN_SYNC1_A::TRANSPARENT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn singlesync(self) -> &'a mut W {
        self.variant(IN_SYNC1_A::SINGLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn doublesync(self) -> &'a mut W {
        self.variant(IN_SYNC1_A::DOUBLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn rsvd(self) -> &'a mut W {
        self.variant(IN_SYNC1_A::RSVD)
    }
    #[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 = "Synchronization selection for PA input 2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum IN_SYNC2_A {
    #[doc = "0: No description available"]
    TRANSPARENT = 0,
    #[doc = "1: No description available"]
    SINGLESYNC = 1,
    #[doc = "2: No description available"]
    DOUBLESYNC = 2,
    #[doc = "3: No description available"]
    RSVD = 3,
}
impl From<IN_SYNC2_A> for u8 {
    #[inline(always)]
    fn from(variant: IN_SYNC2_A) -> Self {
        variant as _
    }
}
#[doc = "Field `IN_SYNC2` reader - Synchronization selection for PA input 2"]
pub struct IN_SYNC2_R(crate::FieldReader<u8, IN_SYNC2_A>);
impl IN_SYNC2_R {
    pub(crate) fn new(bits: u8) -> Self {
        IN_SYNC2_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IN_SYNC2_A {
        match self.bits {
            0 => IN_SYNC2_A::TRANSPARENT,
            1 => IN_SYNC2_A::SINGLESYNC,
            2 => IN_SYNC2_A::DOUBLESYNC,
            3 => IN_SYNC2_A::RSVD,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TRANSPARENT`"]
    #[inline(always)]
    pub fn is_transparent(&self) -> bool {
        **self == IN_SYNC2_A::TRANSPARENT
    }
    #[doc = "Checks if the value of the field is `SINGLESYNC`"]
    #[inline(always)]
    pub fn is_singlesync(&self) -> bool {
        **self == IN_SYNC2_A::SINGLESYNC
    }
    #[doc = "Checks if the value of the field is `DOUBLESYNC`"]
    #[inline(always)]
    pub fn is_doublesync(&self) -> bool {
        **self == IN_SYNC2_A::DOUBLESYNC
    }
    #[doc = "Checks if the value of the field is `RSVD`"]
    #[inline(always)]
    pub fn is_rsvd(&self) -> bool {
        **self == IN_SYNC2_A::RSVD
    }
}
impl core::ops::Deref for IN_SYNC2_R {
    type Target = crate::FieldReader<u8, IN_SYNC2_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `IN_SYNC2` writer - Synchronization selection for PA input 2"]
pub struct IN_SYNC2_W<'a> {
    w: &'a mut W,
}
impl<'a> IN_SYNC2_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: IN_SYNC2_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn transparent(self) -> &'a mut W {
        self.variant(IN_SYNC2_A::TRANSPARENT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn singlesync(self) -> &'a mut W {
        self.variant(IN_SYNC2_A::SINGLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn doublesync(self) -> &'a mut W {
        self.variant(IN_SYNC2_A::DOUBLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn rsvd(self) -> &'a mut W {
        self.variant(IN_SYNC2_A::RSVD)
    }
    #[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 = "Synchronization selection for PA input 3\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum IN_SYNC3_A {
    #[doc = "0: No description available"]
    TRANSPARENT = 0,
    #[doc = "1: No description available"]
    SINGLESYNC = 1,
    #[doc = "2: No description available"]
    DOUBLESYNC = 2,
    #[doc = "3: No description available"]
    RSVD = 3,
}
impl From<IN_SYNC3_A> for u8 {
    #[inline(always)]
    fn from(variant: IN_SYNC3_A) -> Self {
        variant as _
    }
}
#[doc = "Field `IN_SYNC3` reader - Synchronization selection for PA input 3"]
pub struct IN_SYNC3_R(crate::FieldReader<u8, IN_SYNC3_A>);
impl IN_SYNC3_R {
    pub(crate) fn new(bits: u8) -> Self {
        IN_SYNC3_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IN_SYNC3_A {
        match self.bits {
            0 => IN_SYNC3_A::TRANSPARENT,
            1 => IN_SYNC3_A::SINGLESYNC,
            2 => IN_SYNC3_A::DOUBLESYNC,
            3 => IN_SYNC3_A::RSVD,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TRANSPARENT`"]
    #[inline(always)]
    pub fn is_transparent(&self) -> bool {
        **self == IN_SYNC3_A::TRANSPARENT
    }
    #[doc = "Checks if the value of the field is `SINGLESYNC`"]
    #[inline(always)]
    pub fn is_singlesync(&self) -> bool {
        **self == IN_SYNC3_A::SINGLESYNC
    }
    #[doc = "Checks if the value of the field is `DOUBLESYNC`"]
    #[inline(always)]
    pub fn is_doublesync(&self) -> bool {
        **self == IN_SYNC3_A::DOUBLESYNC
    }
    #[doc = "Checks if the value of the field is `RSVD`"]
    #[inline(always)]
    pub fn is_rsvd(&self) -> bool {
        **self == IN_SYNC3_A::RSVD
    }
}
impl core::ops::Deref for IN_SYNC3_R {
    type Target = crate::FieldReader<u8, IN_SYNC3_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `IN_SYNC3` writer - Synchronization selection for PA input 3"]
pub struct IN_SYNC3_W<'a> {
    w: &'a mut W,
}
impl<'a> IN_SYNC3_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: IN_SYNC3_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn transparent(self) -> &'a mut W {
        self.variant(IN_SYNC3_A::TRANSPARENT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn singlesync(self) -> &'a mut W {
        self.variant(IN_SYNC3_A::SINGLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn doublesync(self) -> &'a mut W {
        self.variant(IN_SYNC3_A::DOUBLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn rsvd(self) -> &'a mut W {
        self.variant(IN_SYNC3_A::RSVD)
    }
    #[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 - Synchronization selection for PA input 0"]
    #[inline(always)]
    pub fn in_sync0(&self) -> IN_SYNC0_R {
        IN_SYNC0_R::new((self.bits & 0x03) as u8)
    }
    #[doc = "Bits 2:3 - Synchronization selection for PA input 1"]
    #[inline(always)]
    pub fn in_sync1(&self) -> IN_SYNC1_R {
        IN_SYNC1_R::new(((self.bits >> 2) & 0x03) as u8)
    }
    #[doc = "Bits 4:5 - Synchronization selection for PA input 2"]
    #[inline(always)]
    pub fn in_sync2(&self) -> IN_SYNC2_R {
        IN_SYNC2_R::new(((self.bits >> 4) & 0x03) as u8)
    }
    #[doc = "Bits 6:7 - Synchronization selection for PA input 3"]
    #[inline(always)]
    pub fn in_sync3(&self) -> IN_SYNC3_R {
        IN_SYNC3_R::new(((self.bits >> 6) & 0x03) as u8)
    }
}
impl W {
    #[doc = "Bits 0:1 - Synchronization selection for PA input 0"]
    #[inline(always)]
    pub fn in_sync0(&mut self) -> IN_SYNC0_W {
        IN_SYNC0_W { w: self }
    }
    #[doc = "Bits 2:3 - Synchronization selection for PA input 1"]
    #[inline(always)]
    pub fn in_sync1(&mut self) -> IN_SYNC1_W {
        IN_SYNC1_W { w: self }
    }
    #[doc = "Bits 4:5 - Synchronization selection for PA input 2"]
    #[inline(always)]
    pub fn in_sync2(&mut self) -> IN_SYNC2_W {
        IN_SYNC2_W { w: self }
    }
    #[doc = "Bits 6:7 - Synchronization selection for PA input 3"]
    #[inline(always)]
    pub fn in_sync3(&mut self) -> IN_SYNC3_W {
        IN_SYNC3_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 Input Data Sync Control Register - Low\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 [cfg6](index.html) module"]
pub struct CFG6_SPEC;
impl crate::RegisterSpec for CFG6_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [cfg6::R](R) reader structure"]
impl crate::Readable for CFG6_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cfg6::W](W) writer structure"]
impl crate::Writable for CFG6_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CFG6 to value 0"]
impl crate::Resettable for CFG6_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
