///Register `MPCWM2BCFGR` reader
pub type R = crate::R<MPCWM2BCFGRrs>;
///Register `MPCWM2BCFGR` writer
pub type W = crate::W<MPCWM2BCFGRrs>;
///Field `SREN` reader - subregion B enable
pub type SREN_R = crate::BitReader;
///Field `SREN` writer - subregion B enable
pub type SREN_W<'a, REG> = crate::BitWriter<'a, REG>;
///Field `SRLOCK` reader - subregion B lock
pub type SRLOCK_R = crate::BitReader;
///Field `SRLOCK` writer - subregion B lock
pub type SRLOCK_W<'a, REG> = crate::BitWriter<'a, REG>;
///Field `SEC` reader - Secure subregion B of base region x
pub type SEC_R = crate::BitReader;
///Field `SEC` writer - Secure subregion B of base region x
pub type SEC_W<'a, REG> = crate::BitWriter<'a, REG>;
///Field `PRIV` reader - Privileged subregion B of base region x
pub type PRIV_R = crate::BitReader;
///Field `PRIV` writer - Privileged subregion B of base region x
pub type PRIV_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
    ///Bit 0 - subregion B enable
    #[inline(always)]
    pub fn sren(&self) -> SREN_R {
        SREN_R::new((self.bits & 1) != 0)
    }
    ///Bit 1 - subregion B lock
    #[inline(always)]
    pub fn srlock(&self) -> SRLOCK_R {
        SRLOCK_R::new(((self.bits >> 1) & 1) != 0)
    }
    ///Bit 8 - Secure subregion B of base region x
    #[inline(always)]
    pub fn sec(&self) -> SEC_R {
        SEC_R::new(((self.bits >> 8) & 1) != 0)
    }
    ///Bit 9 - Privileged subregion B of base region x
    #[inline(always)]
    pub fn priv_(&self) -> PRIV_R {
        PRIV_R::new(((self.bits >> 9) & 1) != 0)
    }
}
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("MPCWM2BCFGR")
            .field("sren", &self.sren())
            .field("srlock", &self.srlock())
            .field("sec", &self.sec())
            .field("priv_", &self.priv_())
            .finish()
    }
}
impl W {
    ///Bit 0 - subregion B enable
    #[inline(always)]
    pub fn sren(&mut self) -> SREN_W<MPCWM2BCFGRrs> {
        SREN_W::new(self, 0)
    }
    ///Bit 1 - subregion B lock
    #[inline(always)]
    pub fn srlock(&mut self) -> SRLOCK_W<MPCWM2BCFGRrs> {
        SRLOCK_W::new(self, 1)
    }
    ///Bit 8 - Secure subregion B of base region x
    #[inline(always)]
    pub fn sec(&mut self) -> SEC_W<MPCWM2BCFGRrs> {
        SEC_W::new(self, 8)
    }
    ///Bit 9 - Privileged subregion B of base region x
    #[inline(always)]
    pub fn priv_(&mut self) -> PRIV_W<MPCWM2BCFGRrs> {
        PRIV_W::new(self, 9)
    }
}
/**GTZC1 TZSC memory 2 subregion B watermark configuration register

You can [`read`](crate::Reg::read) this register and get [`mpcwm2bcfgr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mpcwm2bcfgr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).*/
pub struct MPCWM2BCFGRrs;
impl crate::RegisterSpec for MPCWM2BCFGRrs {
    type Ux = u32;
}
///`read()` method returns [`mpcwm2bcfgr::R`](R) reader structure
impl crate::Readable for MPCWM2BCFGRrs {}
///`write(|w| ..)` method takes [`mpcwm2bcfgr::W`](W) writer structure
impl crate::Writable for MPCWM2BCFGRrs {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
///`reset()` method sets MPCWM2BCFGR to value 0
impl crate::Resettable for MPCWM2BCFGRrs {
    const RESET_VALUE: u32 = 0;
}
