#[doc = "Register `WAIT_CFG` reader"]
pub struct R(crate::R<WAIT_CFG_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<WAIT_CFG_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<WAIT_CFG_SPEC>> for R {
    fn from(reader: crate::R<WAIT_CFG_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `WAIT_CFG` writer"]
pub struct W(crate::W<WAIT_CFG_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<WAIT_CFG_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<WAIT_CFG_SPEC>> for W {
    fn from(writer: crate::W<WAIT_CFG_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Read Configuration Wait States\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum RD_CFG_WAIT_A {
    #[doc = "0: No description available"]
    SIX_WAITS = 0,
    #[doc = "1: No description available"]
    FIVE_WAITS = 1,
    #[doc = "2: No description available"]
    FOUR_WAITS = 2,
    #[doc = "3: No description available"]
    TWO_WAITS = 3,
}
impl From<RD_CFG_WAIT_A> for u8 {
    #[inline(always)]
    fn from(variant: RD_CFG_WAIT_A) -> Self {
        variant as _
    }
}
#[doc = "Field `RD_CFG_WAIT` reader - Read Configuration Wait States"]
pub struct RD_CFG_WAIT_R(crate::FieldReader<u8, RD_CFG_WAIT_A>);
impl RD_CFG_WAIT_R {
    pub(crate) fn new(bits: u8) -> Self {
        RD_CFG_WAIT_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RD_CFG_WAIT_A {
        match self.bits {
            0 => RD_CFG_WAIT_A::SIX_WAITS,
            1 => RD_CFG_WAIT_A::FIVE_WAITS,
            2 => RD_CFG_WAIT_A::FOUR_WAITS,
            3 => RD_CFG_WAIT_A::TWO_WAITS,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `SIX_WAITS`"]
    #[inline(always)]
    pub fn is_six_waits(&self) -> bool {
        **self == RD_CFG_WAIT_A::SIX_WAITS
    }
    #[doc = "Checks if the value of the field is `FIVE_WAITS`"]
    #[inline(always)]
    pub fn is_five_waits(&self) -> bool {
        **self == RD_CFG_WAIT_A::FIVE_WAITS
    }
    #[doc = "Checks if the value of the field is `FOUR_WAITS`"]
    #[inline(always)]
    pub fn is_four_waits(&self) -> bool {
        **self == RD_CFG_WAIT_A::FOUR_WAITS
    }
    #[doc = "Checks if the value of the field is `TWO_WAITS`"]
    #[inline(always)]
    pub fn is_two_waits(&self) -> bool {
        **self == RD_CFG_WAIT_A::TWO_WAITS
    }
}
impl core::ops::Deref for RD_CFG_WAIT_R {
    type Target = crate::FieldReader<u8, RD_CFG_WAIT_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `RD_CFG_WAIT` writer - Read Configuration Wait States"]
pub struct RD_CFG_WAIT_W<'a> {
    w: &'a mut W,
}
impl<'a> RD_CFG_WAIT_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: RD_CFG_WAIT_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn six_waits(self) -> &'a mut W {
        self.variant(RD_CFG_WAIT_A::SIX_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn five_waits(self) -> &'a mut W {
        self.variant(RD_CFG_WAIT_A::FIVE_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn four_waits(self) -> &'a mut W {
        self.variant(RD_CFG_WAIT_A::FOUR_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn two_waits(self) -> &'a mut W {
        self.variant(RD_CFG_WAIT_A::TWO_WAITS)
    }
    #[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 = "Write Configuration Wait States\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum WR_CFG_WAIT_A {
    #[doc = "0: No description available"]
    TWO_WAITS = 0,
    #[doc = "1: No description available"]
    THREE_WAITS = 1,
    #[doc = "2: No description available"]
    FOUR_WAITS = 2,
    #[doc = "3: No description available"]
    ILLEGAL = 3,
}
impl From<WR_CFG_WAIT_A> for u8 {
    #[inline(always)]
    fn from(variant: WR_CFG_WAIT_A) -> Self {
        variant as _
    }
}
#[doc = "Field `WR_CFG_WAIT` reader - Write Configuration Wait States"]
pub struct WR_CFG_WAIT_R(crate::FieldReader<u8, WR_CFG_WAIT_A>);
impl WR_CFG_WAIT_R {
    pub(crate) fn new(bits: u8) -> Self {
        WR_CFG_WAIT_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> WR_CFG_WAIT_A {
        match self.bits {
            0 => WR_CFG_WAIT_A::TWO_WAITS,
            1 => WR_CFG_WAIT_A::THREE_WAITS,
            2 => WR_CFG_WAIT_A::FOUR_WAITS,
            3 => WR_CFG_WAIT_A::ILLEGAL,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TWO_WAITS`"]
    #[inline(always)]
    pub fn is_two_waits(&self) -> bool {
        **self == WR_CFG_WAIT_A::TWO_WAITS
    }
    #[doc = "Checks if the value of the field is `THREE_WAITS`"]
    #[inline(always)]
    pub fn is_three_waits(&self) -> bool {
        **self == WR_CFG_WAIT_A::THREE_WAITS
    }
    #[doc = "Checks if the value of the field is `FOUR_WAITS`"]
    #[inline(always)]
    pub fn is_four_waits(&self) -> bool {
        **self == WR_CFG_WAIT_A::FOUR_WAITS
    }
    #[doc = "Checks if the value of the field is `ILLEGAL`"]
    #[inline(always)]
    pub fn is_illegal(&self) -> bool {
        **self == WR_CFG_WAIT_A::ILLEGAL
    }
}
impl core::ops::Deref for WR_CFG_WAIT_R {
    type Target = crate::FieldReader<u8, WR_CFG_WAIT_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `WR_CFG_WAIT` writer - Write Configuration Wait States"]
pub struct WR_CFG_WAIT_W<'a> {
    w: &'a mut W,
}
impl<'a> WR_CFG_WAIT_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: WR_CFG_WAIT_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn two_waits(self) -> &'a mut W {
        self.variant(WR_CFG_WAIT_A::TWO_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn three_waits(self) -> &'a mut W {
        self.variant(WR_CFG_WAIT_A::THREE_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn four_waits(self) -> &'a mut W {
        self.variant(WR_CFG_WAIT_A::FOUR_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn illegal(self) -> &'a mut W {
        self.variant(WR_CFG_WAIT_A::ILLEGAL)
    }
    #[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 = "Read Work Wait States\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum RD_WRK_WAIT_A {
    #[doc = "0: No description available"]
    TWO_WAITS = 0,
    #[doc = "1: No description available"]
    THREE_WAITS = 1,
    #[doc = "2: No description available"]
    FOUR_WAITS = 2,
    #[doc = "3: No description available"]
    ILLEGAL = 3,
}
impl From<RD_WRK_WAIT_A> for u8 {
    #[inline(always)]
    fn from(variant: RD_WRK_WAIT_A) -> Self {
        variant as _
    }
}
#[doc = "Field `RD_WRK_WAIT` reader - Read Work Wait States"]
pub struct RD_WRK_WAIT_R(crate::FieldReader<u8, RD_WRK_WAIT_A>);
impl RD_WRK_WAIT_R {
    pub(crate) fn new(bits: u8) -> Self {
        RD_WRK_WAIT_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RD_WRK_WAIT_A {
        match self.bits {
            0 => RD_WRK_WAIT_A::TWO_WAITS,
            1 => RD_WRK_WAIT_A::THREE_WAITS,
            2 => RD_WRK_WAIT_A::FOUR_WAITS,
            3 => RD_WRK_WAIT_A::ILLEGAL,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TWO_WAITS`"]
    #[inline(always)]
    pub fn is_two_waits(&self) -> bool {
        **self == RD_WRK_WAIT_A::TWO_WAITS
    }
    #[doc = "Checks if the value of the field is `THREE_WAITS`"]
    #[inline(always)]
    pub fn is_three_waits(&self) -> bool {
        **self == RD_WRK_WAIT_A::THREE_WAITS
    }
    #[doc = "Checks if the value of the field is `FOUR_WAITS`"]
    #[inline(always)]
    pub fn is_four_waits(&self) -> bool {
        **self == RD_WRK_WAIT_A::FOUR_WAITS
    }
    #[doc = "Checks if the value of the field is `ILLEGAL`"]
    #[inline(always)]
    pub fn is_illegal(&self) -> bool {
        **self == RD_WRK_WAIT_A::ILLEGAL
    }
}
impl core::ops::Deref for RD_WRK_WAIT_R {
    type Target = crate::FieldReader<u8, RD_WRK_WAIT_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `RD_WRK_WAIT` writer - Read Work Wait States"]
pub struct RD_WRK_WAIT_W<'a> {
    w: &'a mut W,
}
impl<'a> RD_WRK_WAIT_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: RD_WRK_WAIT_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn two_waits(self) -> &'a mut W {
        self.variant(RD_WRK_WAIT_A::TWO_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn three_waits(self) -> &'a mut W {
        self.variant(RD_WRK_WAIT_A::THREE_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn four_waits(self) -> &'a mut W {
        self.variant(RD_WRK_WAIT_A::FOUR_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn illegal(self) -> &'a mut W {
        self.variant(RD_WRK_WAIT_A::ILLEGAL)
    }
    #[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 = "Write Work Wait States\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum WR_WRK_WAIT_A {
    #[doc = "0: No description available"]
    TWO_WAITS = 0,
    #[doc = "1: No description available"]
    THREE_WAITS = 1,
    #[doc = "2: No description available"]
    FOUR_WAITS = 2,
    #[doc = "3: No description available"]
    ILLEGAL = 3,
}
impl From<WR_WRK_WAIT_A> for u8 {
    #[inline(always)]
    fn from(variant: WR_WRK_WAIT_A) -> Self {
        variant as _
    }
}
#[doc = "Field `WR_WRK_WAIT` reader - Write Work Wait States"]
pub struct WR_WRK_WAIT_R(crate::FieldReader<u8, WR_WRK_WAIT_A>);
impl WR_WRK_WAIT_R {
    pub(crate) fn new(bits: u8) -> Self {
        WR_WRK_WAIT_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> WR_WRK_WAIT_A {
        match self.bits {
            0 => WR_WRK_WAIT_A::TWO_WAITS,
            1 => WR_WRK_WAIT_A::THREE_WAITS,
            2 => WR_WRK_WAIT_A::FOUR_WAITS,
            3 => WR_WRK_WAIT_A::ILLEGAL,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `TWO_WAITS`"]
    #[inline(always)]
    pub fn is_two_waits(&self) -> bool {
        **self == WR_WRK_WAIT_A::TWO_WAITS
    }
    #[doc = "Checks if the value of the field is `THREE_WAITS`"]
    #[inline(always)]
    pub fn is_three_waits(&self) -> bool {
        **self == WR_WRK_WAIT_A::THREE_WAITS
    }
    #[doc = "Checks if the value of the field is `FOUR_WAITS`"]
    #[inline(always)]
    pub fn is_four_waits(&self) -> bool {
        **self == WR_WRK_WAIT_A::FOUR_WAITS
    }
    #[doc = "Checks if the value of the field is `ILLEGAL`"]
    #[inline(always)]
    pub fn is_illegal(&self) -> bool {
        **self == WR_WRK_WAIT_A::ILLEGAL
    }
}
impl core::ops::Deref for WR_WRK_WAIT_R {
    type Target = crate::FieldReader<u8, WR_WRK_WAIT_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `WR_WRK_WAIT` writer - Write Work Wait States"]
pub struct WR_WRK_WAIT_W<'a> {
    w: &'a mut W,
}
impl<'a> WR_WRK_WAIT_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: WR_WRK_WAIT_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn two_waits(self) -> &'a mut W {
        self.variant(WR_WRK_WAIT_A::TWO_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn three_waits(self) -> &'a mut W {
        self.variant(WR_WRK_WAIT_A::THREE_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn four_waits(self) -> &'a mut W {
        self.variant(WR_WRK_WAIT_A::FOUR_WAITS)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn illegal(self) -> &'a mut W {
        self.variant(WR_WRK_WAIT_A::ILLEGAL)
    }
    #[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 - Read Configuration Wait States"]
    #[inline(always)]
    pub fn rd_cfg_wait(&self) -> RD_CFG_WAIT_R {
        RD_CFG_WAIT_R::new((self.bits & 0x03) as u8)
    }
    #[doc = "Bits 2:3 - Write Configuration Wait States"]
    #[inline(always)]
    pub fn wr_cfg_wait(&self) -> WR_CFG_WAIT_R {
        WR_CFG_WAIT_R::new(((self.bits >> 2) & 0x03) as u8)
    }
    #[doc = "Bits 4:5 - Read Work Wait States"]
    #[inline(always)]
    pub fn rd_wrk_wait(&self) -> RD_WRK_WAIT_R {
        RD_WRK_WAIT_R::new(((self.bits >> 4) & 0x03) as u8)
    }
    #[doc = "Bits 6:7 - Write Work Wait States"]
    #[inline(always)]
    pub fn wr_wrk_wait(&self) -> WR_WRK_WAIT_R {
        WR_WRK_WAIT_R::new(((self.bits >> 6) & 0x03) as u8)
    }
}
impl W {
    #[doc = "Bits 0:1 - Read Configuration Wait States"]
    #[inline(always)]
    pub fn rd_cfg_wait(&mut self) -> RD_CFG_WAIT_W {
        RD_CFG_WAIT_W { w: self }
    }
    #[doc = "Bits 2:3 - Write Configuration Wait States"]
    #[inline(always)]
    pub fn wr_cfg_wait(&mut self) -> WR_CFG_WAIT_W {
        WR_CFG_WAIT_W { w: self }
    }
    #[doc = "Bits 4:5 - Read Work Wait States"]
    #[inline(always)]
    pub fn rd_wrk_wait(&mut self) -> RD_WRK_WAIT_W {
        RD_WRK_WAIT_W { w: self }
    }
    #[doc = "Bits 6:7 - Write Work Wait States"]
    #[inline(always)]
    pub fn wr_wrk_wait(&mut self) -> WR_WRK_WAIT_W {
        WR_WRK_WAIT_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 = "Wait States Configuration\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 [wait_cfg](index.html) module"]
pub struct WAIT_CFG_SPEC;
impl crate::RegisterSpec for WAIT_CFG_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [wait_cfg::R](R) reader structure"]
impl crate::Readable for WAIT_CFG_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [wait_cfg::W](W) writer structure"]
impl crate::Writable for WAIT_CFG_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets WAIT_CFG to value 0"]
impl crate::Resettable for WAIT_CFG_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
