///Register `DBGCR` reader
pub type R = crate::R<DBGCRrs>;
///Register `DBGCR` writer
pub type W = crate::W<DBGCRrs>;
///Field `AP_UNLOCK` reader - access port unlock
pub type AP_UNLOCK_R = crate::FieldReader;
///Field `AP_UNLOCK` writer - access port unlock
pub type AP_UNLOCK_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
///Field `DBG_UNLOCK` reader - debug unlock when DBG_AUTH_HDPL is reached
pub type DBG_UNLOCK_R = crate::FieldReader;
///Field `DBG_UNLOCK` writer - debug unlock when DBG_AUTH_HDPL is reached
pub type DBG_UNLOCK_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
///Field `DBG_AUTH_HDPL` reader - authenticated debug temporal isolation level
pub type DBG_AUTH_HDPL_R = crate::FieldReader;
///Field `DBG_AUTH_HDPL` writer - authenticated debug temporal isolation level
pub type DBG_AUTH_HDPL_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
///Field `DBG_AUTH_SEC` reader - control debug opening secure/non-secure
pub type DBG_AUTH_SEC_R = crate::FieldReader;
///Field `DBG_AUTH_SEC` writer - control debug opening secure/non-secure
pub type DBG_AUTH_SEC_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
impl R {
    ///Bits 0:7 - access port unlock
    #[inline(always)]
    pub fn ap_unlock(&self) -> AP_UNLOCK_R {
        AP_UNLOCK_R::new((self.bits & 0xff) as u8)
    }
    ///Bits 8:15 - debug unlock when DBG_AUTH_HDPL is reached
    #[inline(always)]
    pub fn dbg_unlock(&self) -> DBG_UNLOCK_R {
        DBG_UNLOCK_R::new(((self.bits >> 8) & 0xff) as u8)
    }
    ///Bits 16:23 - authenticated debug temporal isolation level
    #[inline(always)]
    pub fn dbg_auth_hdpl(&self) -> DBG_AUTH_HDPL_R {
        DBG_AUTH_HDPL_R::new(((self.bits >> 16) & 0xff) as u8)
    }
    ///Bits 24:31 - control debug opening secure/non-secure
    #[inline(always)]
    pub fn dbg_auth_sec(&self) -> DBG_AUTH_SEC_R {
        DBG_AUTH_SEC_R::new(((self.bits >> 24) & 0xff) as u8)
    }
}
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("DBGCR")
            .field("ap_unlock", &self.ap_unlock())
            .field("dbg_unlock", &self.dbg_unlock())
            .field("dbg_auth_hdpl", &self.dbg_auth_hdpl())
            .field("dbg_auth_sec", &self.dbg_auth_sec())
            .finish()
    }
}
impl W {
    ///Bits 0:7 - access port unlock
    #[inline(always)]
    pub fn ap_unlock(&mut self) -> AP_UNLOCK_W<DBGCRrs> {
        AP_UNLOCK_W::new(self, 0)
    }
    ///Bits 8:15 - debug unlock when DBG_AUTH_HDPL is reached
    #[inline(always)]
    pub fn dbg_unlock(&mut self) -> DBG_UNLOCK_W<DBGCRrs> {
        DBG_UNLOCK_W::new(self, 8)
    }
    ///Bits 16:23 - authenticated debug temporal isolation level
    #[inline(always)]
    pub fn dbg_auth_hdpl(&mut self) -> DBG_AUTH_HDPL_W<DBGCRrs> {
        DBG_AUTH_HDPL_W::new(self, 16)
    }
    ///Bits 24:31 - control debug opening secure/non-secure
    #[inline(always)]
    pub fn dbg_auth_sec(&mut self) -> DBG_AUTH_SEC_W<DBGCRrs> {
        DBG_AUTH_SEC_W::new(self, 24)
    }
}
/**SBS debug control register

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