#[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 = "Datapath Output Synchronization. Each datapath output can be registered (default,0), or combinational (1)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum OUT_SYNC_A {
    #[doc = "0: No description available"]
    REGISTERED = 0,
    #[doc = "1: No description available"]
    COMBINATIONAL = 1,
}
impl From<OUT_SYNC_A> for u8 {
    #[inline(always)]
    fn from(variant: OUT_SYNC_A) -> Self {
        variant as _
    }
}
#[doc = "Field `OUT_SYNC` reader - Datapath Output Synchronization. Each datapath output can be registered (default,0), or combinational (1)"]
pub struct OUT_SYNC_R(crate::FieldReader<u8, OUT_SYNC_A>);
impl OUT_SYNC_R {
    pub(crate) fn new(bits: u8) -> Self {
        OUT_SYNC_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<OUT_SYNC_A> {
        match self.bits {
            0 => Some(OUT_SYNC_A::REGISTERED),
            1 => Some(OUT_SYNC_A::COMBINATIONAL),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `REGISTERED`"]
    #[inline(always)]
    pub fn is_registered(&self) -> bool {
        **self == OUT_SYNC_A::REGISTERED
    }
    #[doc = "Checks if the value of the field is `COMBINATIONAL`"]
    #[inline(always)]
    pub fn is_combinational(&self) -> bool {
        **self == OUT_SYNC_A::COMBINATIONAL
    }
}
impl core::ops::Deref for OUT_SYNC_R {
    type Target = crate::FieldReader<u8, OUT_SYNC_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `OUT_SYNC` writer - Datapath Output Synchronization. Each datapath output can be registered (default,0), or combinational (1)"]
pub struct OUT_SYNC_W<'a> {
    w: &'a mut W,
}
impl<'a> OUT_SYNC_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: OUT_SYNC_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn registered(self) -> &'a mut W {
        self.variant(OUT_SYNC_A::REGISTERED)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn combinational(self) -> &'a mut W {
        self.variant(OUT_SYNC_A::COMBINATIONAL)
    }
    #[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 & !0x3f) | (value as u8 & 0x3f);
        self.w
    }
}
#[doc = "Field `NC6` reader - Spare register bit"]
pub struct NC6_R(crate::FieldReader<bool, bool>);
impl NC6_R {
    pub(crate) fn new(bits: bool) -> Self {
        NC6_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for NC6_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `NC6` writer - Spare register bit"]
pub struct NC6_W<'a> {
    w: &'a mut W,
}
impl<'a> NC6_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 << 6)) | ((value as u8 & 0x01) << 6);
        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:5 - Datapath Output Synchronization. Each datapath output can be registered (default,0), or combinational (1)"]
    #[inline(always)]
    pub fn out_sync(&self) -> OUT_SYNC_R {
        OUT_SYNC_R::new((self.bits & 0x3f) as u8)
    }
    #[doc = "Bit 6 - Spare register bit"]
    #[inline(always)]
    pub fn nc6(&self) -> NC6_R {
        NC6_R::new(((self.bits >> 6) & 0x01) != 0)
    }
    #[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:5 - Datapath Output Synchronization. Each datapath output can be registered (default,0), or combinational (1)"]
    #[inline(always)]
    pub fn out_sync(&mut self) -> OUT_SYNC_W {
        OUT_SYNC_W { w: self }
    }
    #[doc = "Bit 6 - Spare register bit"]
    #[inline(always)]
    pub fn nc6(&mut self) -> NC6_W {
        NC6_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 Output Synchronization Option\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
    }
}
