#[doc = "Register `MBCLK_EN` reader"]
pub struct R(crate::R<MBCLK_EN_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<MBCLK_EN_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<MBCLK_EN_SPEC>> for R {
    fn from(reader: crate::R<MBCLK_EN_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `MBCLK_EN` writer"]
pub struct W(crate::W<MBCLK_EN_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<MBCLK_EN_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<MBCLK_EN_SPEC>> for W {
    fn from(writer: crate::W<MBCLK_EN_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Bank Clock Enable Control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BCEN_A {
    #[doc = "0: No description available"]
    DISABLE = 0,
    #[doc = "1: No description available"]
    ENABLE = 1,
}
impl From<BCEN_A> for bool {
    #[inline(always)]
    fn from(variant: BCEN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `BCEN` reader - Bank Clock Enable Control"]
pub struct BCEN_R(crate::FieldReader<bool, BCEN_A>);
impl BCEN_R {
    pub(crate) fn new(bits: bool) -> Self {
        BCEN_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BCEN_A {
        match self.bits {
            false => BCEN_A::DISABLE,
            true => BCEN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        **self == BCEN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        **self == BCEN_A::ENABLE
    }
}
impl core::ops::Deref for BCEN_R {
    type Target = crate::FieldReader<bool, BCEN_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `BCEN` writer - Bank Clock Enable Control"]
pub struct BCEN_W<'a> {
    w: &'a mut W,
}
impl<'a> BCEN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: BCEN_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(BCEN_A::DISABLE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(BCEN_A::ENABLE)
    }
    #[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
    }
}
impl R {
    #[doc = "Bit 0 - Bank Clock Enable Control"]
    #[inline(always)]
    pub fn bcen(&self) -> BCEN_R {
        BCEN_R::new((self.bits & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Bank Clock Enable Control"]
    #[inline(always)]
    pub fn bcen(&mut self) -> BCEN_W {
        BCEN_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 = "Master Bus Clock Enable 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 [mbclk_en](index.html) module"]
pub struct MBCLK_EN_SPEC;
impl crate::RegisterSpec for MBCLK_EN_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [mbclk_en::R](R) reader structure"]
impl crate::Readable for MBCLK_EN_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [mbclk_en::W](W) writer structure"]
impl crate::Writable for MBCLK_EN_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets MBCLK_EN to value 0"]
impl crate::Resettable for MBCLK_EN_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
