#[doc = "Register `CFG8` reader"]
pub struct R(crate::R<CFG8_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CFG8_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<CFG8_SPEC>> for R {
    fn from(reader: crate::R<CFG8_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CFG8` writer"]
pub struct W(crate::W<CFG8_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CFG8_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<CFG8_SPEC>> for W {
    fn from(writer: crate::W<CFG8_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Synchronization selection for PA output 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum OUT_SYNC0_A {
    #[doc = "0: No description available"]
    TRANSPARENT = 0,
    #[doc = "1: No description available"]
    SINGLESYNC = 1,
    #[doc = "2: No description available"]
    CLOCK = 2,
    #[doc = "3: No description available"]
    CLOCKINV = 3,
}
impl From<OUT_SYNC0_A> for u8 {
    #[inline(always)]
    fn from(variant: OUT_SYNC0_A) -> Self {
        variant as _
    }
}
#[doc = "Field `OUT_SYNC0` reader - Synchronization selection for PA output 0"]
pub struct OUT_SYNC0_R(crate::FieldReader<u8, OUT_SYNC0_A>);
impl OUT_SYNC0_R {
    pub(crate) fn new(bits: u8) -> Self {
        OUT_SYNC0_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OUT_SYNC0_A {
        match self.bits {
            0 => OUT_SYNC0_A::TRANSPARENT,
            1 => OUT_SYNC0_A::SINGLESYNC,
            2 => OUT_SYNC0_A::CLOCK,
            3 => OUT_SYNC0_A::CLOCKINV,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TRANSPARENT`"]
    #[inline(always)]
    pub fn is_transparent(&self) -> bool {
        **self == OUT_SYNC0_A::TRANSPARENT
    }
    #[doc = "Checks if the value of the field is `SINGLESYNC`"]
    #[inline(always)]
    pub fn is_singlesync(&self) -> bool {
        **self == OUT_SYNC0_A::SINGLESYNC
    }
    #[doc = "Checks if the value of the field is `CLOCK`"]
    #[inline(always)]
    pub fn is_clock(&self) -> bool {
        **self == OUT_SYNC0_A::CLOCK
    }
    #[doc = "Checks if the value of the field is `CLOCKINV`"]
    #[inline(always)]
    pub fn is_clockinv(&self) -> bool {
        **self == OUT_SYNC0_A::CLOCKINV
    }
}
impl core::ops::Deref for OUT_SYNC0_R {
    type Target = crate::FieldReader<u8, OUT_SYNC0_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `OUT_SYNC0` writer - Synchronization selection for PA output 0"]
pub struct OUT_SYNC0_W<'a> {
    w: &'a mut W,
}
impl<'a> OUT_SYNC0_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: OUT_SYNC0_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn transparent(self) -> &'a mut W {
        self.variant(OUT_SYNC0_A::TRANSPARENT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn singlesync(self) -> &'a mut W {
        self.variant(OUT_SYNC0_A::SINGLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn clock(self) -> &'a mut W {
        self.variant(OUT_SYNC0_A::CLOCK)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn clockinv(self) -> &'a mut W {
        self.variant(OUT_SYNC0_A::CLOCKINV)
    }
    #[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 output 1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum OUT_SYNC1_A {
    #[doc = "0: No description available"]
    TRANSPARENT = 0,
    #[doc = "1: No description available"]
    SINGLESYNC = 1,
    #[doc = "2: No description available"]
    CLOCK = 2,
    #[doc = "3: No description available"]
    CLOCKINV = 3,
}
impl From<OUT_SYNC1_A> for u8 {
    #[inline(always)]
    fn from(variant: OUT_SYNC1_A) -> Self {
        variant as _
    }
}
#[doc = "Field `OUT_SYNC1` reader - Synchronization selection for PA output 1"]
pub struct OUT_SYNC1_R(crate::FieldReader<u8, OUT_SYNC1_A>);
impl OUT_SYNC1_R {
    pub(crate) fn new(bits: u8) -> Self {
        OUT_SYNC1_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OUT_SYNC1_A {
        match self.bits {
            0 => OUT_SYNC1_A::TRANSPARENT,
            1 => OUT_SYNC1_A::SINGLESYNC,
            2 => OUT_SYNC1_A::CLOCK,
            3 => OUT_SYNC1_A::CLOCKINV,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TRANSPARENT`"]
    #[inline(always)]
    pub fn is_transparent(&self) -> bool {
        **self == OUT_SYNC1_A::TRANSPARENT
    }
    #[doc = "Checks if the value of the field is `SINGLESYNC`"]
    #[inline(always)]
    pub fn is_singlesync(&self) -> bool {
        **self == OUT_SYNC1_A::SINGLESYNC
    }
    #[doc = "Checks if the value of the field is `CLOCK`"]
    #[inline(always)]
    pub fn is_clock(&self) -> bool {
        **self == OUT_SYNC1_A::CLOCK
    }
    #[doc = "Checks if the value of the field is `CLOCKINV`"]
    #[inline(always)]
    pub fn is_clockinv(&self) -> bool {
        **self == OUT_SYNC1_A::CLOCKINV
    }
}
impl core::ops::Deref for OUT_SYNC1_R {
    type Target = crate::FieldReader<u8, OUT_SYNC1_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `OUT_SYNC1` writer - Synchronization selection for PA output 1"]
pub struct OUT_SYNC1_W<'a> {
    w: &'a mut W,
}
impl<'a> OUT_SYNC1_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: OUT_SYNC1_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn transparent(self) -> &'a mut W {
        self.variant(OUT_SYNC1_A::TRANSPARENT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn singlesync(self) -> &'a mut W {
        self.variant(OUT_SYNC1_A::SINGLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn clock(self) -> &'a mut W {
        self.variant(OUT_SYNC1_A::CLOCK)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn clockinv(self) -> &'a mut W {
        self.variant(OUT_SYNC1_A::CLOCKINV)
    }
    #[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 output 2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum OUT_SYNC2_A {
    #[doc = "0: No description available"]
    TRANSPARENT = 0,
    #[doc = "1: No description available"]
    SINGLESYNC = 1,
    #[doc = "2: No description available"]
    CLOCK = 2,
    #[doc = "3: No description available"]
    CLOCKINV = 3,
}
impl From<OUT_SYNC2_A> for u8 {
    #[inline(always)]
    fn from(variant: OUT_SYNC2_A) -> Self {
        variant as _
    }
}
#[doc = "Field `OUT_SYNC2` reader - Synchronization selection for PA output 2"]
pub struct OUT_SYNC2_R(crate::FieldReader<u8, OUT_SYNC2_A>);
impl OUT_SYNC2_R {
    pub(crate) fn new(bits: u8) -> Self {
        OUT_SYNC2_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OUT_SYNC2_A {
        match self.bits {
            0 => OUT_SYNC2_A::TRANSPARENT,
            1 => OUT_SYNC2_A::SINGLESYNC,
            2 => OUT_SYNC2_A::CLOCK,
            3 => OUT_SYNC2_A::CLOCKINV,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TRANSPARENT`"]
    #[inline(always)]
    pub fn is_transparent(&self) -> bool {
        **self == OUT_SYNC2_A::TRANSPARENT
    }
    #[doc = "Checks if the value of the field is `SINGLESYNC`"]
    #[inline(always)]
    pub fn is_singlesync(&self) -> bool {
        **self == OUT_SYNC2_A::SINGLESYNC
    }
    #[doc = "Checks if the value of the field is `CLOCK`"]
    #[inline(always)]
    pub fn is_clock(&self) -> bool {
        **self == OUT_SYNC2_A::CLOCK
    }
    #[doc = "Checks if the value of the field is `CLOCKINV`"]
    #[inline(always)]
    pub fn is_clockinv(&self) -> bool {
        **self == OUT_SYNC2_A::CLOCKINV
    }
}
impl core::ops::Deref for OUT_SYNC2_R {
    type Target = crate::FieldReader<u8, OUT_SYNC2_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `OUT_SYNC2` writer - Synchronization selection for PA output 2"]
pub struct OUT_SYNC2_W<'a> {
    w: &'a mut W,
}
impl<'a> OUT_SYNC2_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: OUT_SYNC2_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn transparent(self) -> &'a mut W {
        self.variant(OUT_SYNC2_A::TRANSPARENT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn singlesync(self) -> &'a mut W {
        self.variant(OUT_SYNC2_A::SINGLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn clock(self) -> &'a mut W {
        self.variant(OUT_SYNC2_A::CLOCK)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn clockinv(self) -> &'a mut W {
        self.variant(OUT_SYNC2_A::CLOCKINV)
    }
    #[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 output 3\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum OUT_SYNC3_A {
    #[doc = "0: No description available"]
    TRANSPARENT = 0,
    #[doc = "1: No description available"]
    SINGLESYNC = 1,
    #[doc = "2: No description available"]
    CLOCK = 2,
    #[doc = "3: No description available"]
    CLOCKINV = 3,
}
impl From<OUT_SYNC3_A> for u8 {
    #[inline(always)]
    fn from(variant: OUT_SYNC3_A) -> Self {
        variant as _
    }
}
#[doc = "Field `OUT_SYNC3` reader - Synchronization selection for PA output 3"]
pub struct OUT_SYNC3_R(crate::FieldReader<u8, OUT_SYNC3_A>);
impl OUT_SYNC3_R {
    pub(crate) fn new(bits: u8) -> Self {
        OUT_SYNC3_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OUT_SYNC3_A {
        match self.bits {
            0 => OUT_SYNC3_A::TRANSPARENT,
            1 => OUT_SYNC3_A::SINGLESYNC,
            2 => OUT_SYNC3_A::CLOCK,
            3 => OUT_SYNC3_A::CLOCKINV,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TRANSPARENT`"]
    #[inline(always)]
    pub fn is_transparent(&self) -> bool {
        **self == OUT_SYNC3_A::TRANSPARENT
    }
    #[doc = "Checks if the value of the field is `SINGLESYNC`"]
    #[inline(always)]
    pub fn is_singlesync(&self) -> bool {
        **self == OUT_SYNC3_A::SINGLESYNC
    }
    #[doc = "Checks if the value of the field is `CLOCK`"]
    #[inline(always)]
    pub fn is_clock(&self) -> bool {
        **self == OUT_SYNC3_A::CLOCK
    }
    #[doc = "Checks if the value of the field is `CLOCKINV`"]
    #[inline(always)]
    pub fn is_clockinv(&self) -> bool {
        **self == OUT_SYNC3_A::CLOCKINV
    }
}
impl core::ops::Deref for OUT_SYNC3_R {
    type Target = crate::FieldReader<u8, OUT_SYNC3_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `OUT_SYNC3` writer - Synchronization selection for PA output 3"]
pub struct OUT_SYNC3_W<'a> {
    w: &'a mut W,
}
impl<'a> OUT_SYNC3_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: OUT_SYNC3_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn transparent(self) -> &'a mut W {
        self.variant(OUT_SYNC3_A::TRANSPARENT)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn singlesync(self) -> &'a mut W {
        self.variant(OUT_SYNC3_A::SINGLESYNC)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn clock(self) -> &'a mut W {
        self.variant(OUT_SYNC3_A::CLOCK)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn clockinv(self) -> &'a mut W {
        self.variant(OUT_SYNC3_A::CLOCKINV)
    }
    #[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 output 0"]
    #[inline(always)]
    pub fn out_sync0(&self) -> OUT_SYNC0_R {
        OUT_SYNC0_R::new((self.bits & 0x03) as u8)
    }
    #[doc = "Bits 2:3 - Synchronization selection for PA output 1"]
    #[inline(always)]
    pub fn out_sync1(&self) -> OUT_SYNC1_R {
        OUT_SYNC1_R::new(((self.bits >> 2) & 0x03) as u8)
    }
    #[doc = "Bits 4:5 - Synchronization selection for PA output 2"]
    #[inline(always)]
    pub fn out_sync2(&self) -> OUT_SYNC2_R {
        OUT_SYNC2_R::new(((self.bits >> 4) & 0x03) as u8)
    }
    #[doc = "Bits 6:7 - Synchronization selection for PA output 3"]
    #[inline(always)]
    pub fn out_sync3(&self) -> OUT_SYNC3_R {
        OUT_SYNC3_R::new(((self.bits >> 6) & 0x03) as u8)
    }
}
impl W {
    #[doc = "Bits 0:1 - Synchronization selection for PA output 0"]
    #[inline(always)]
    pub fn out_sync0(&mut self) -> OUT_SYNC0_W {
        OUT_SYNC0_W { w: self }
    }
    #[doc = "Bits 2:3 - Synchronization selection for PA output 1"]
    #[inline(always)]
    pub fn out_sync1(&mut self) -> OUT_SYNC1_W {
        OUT_SYNC1_W { w: self }
    }
    #[doc = "Bits 4:5 - Synchronization selection for PA output 2"]
    #[inline(always)]
    pub fn out_sync2(&mut self) -> OUT_SYNC2_W {
        OUT_SYNC2_W { w: self }
    }
    #[doc = "Bits 6:7 - Synchronization selection for PA output 3"]
    #[inline(always)]
    pub fn out_sync3(&mut self) -> OUT_SYNC3_W {
        OUT_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 Output 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 [cfg8](index.html) module"]
pub struct CFG8_SPEC;
impl crate::RegisterSpec for CFG8_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [cfg8::R](R) reader structure"]
impl crate::Readable for CFG8_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cfg8::W](W) writer structure"]
impl crate::Writable for CFG8_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CFG8 to value 0"]
impl crate::Resettable for CFG8_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
