pub type R = crate::R<PRAR_PRGrs>;
pub type W = crate::W<PRAR_PRGrs>;
pub type PROT_AREA_START_R = crate::FieldReader<u16>;
pub type PROT_AREA_START_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>;
pub type PROT_AREA_END_R = crate::FieldReader<u16>;
pub type PROT_AREA_END_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>;
pub type DMEP_R = crate::BitReader;
pub type DMEP_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn prot_area_start(&self) -> PROT_AREA_START_R {
PROT_AREA_START_R::new((self.bits & 0x0fff) as u16)
}
#[inline(always)]
pub fn prot_area_end(&self) -> PROT_AREA_END_R {
PROT_AREA_END_R::new(((self.bits >> 16) & 0x0fff) as u16)
}
#[inline(always)]
pub fn dmep(&self) -> DMEP_R {
DMEP_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("PRAR_PRG")
.field("prot_area_start", &self.prot_area_start())
.field("prot_area_end", &self.prot_area_end())
.field("dmep", &self.dmep())
.finish()
}
}
impl W {
#[inline(always)]
pub fn prot_area_start(&mut self) -> PROT_AREA_START_W<PRAR_PRGrs> {
PROT_AREA_START_W::new(self, 0)
}
#[inline(always)]
pub fn prot_area_end(&mut self) -> PROT_AREA_END_W<PRAR_PRGrs> {
PROT_AREA_END_W::new(self, 16)
}
#[inline(always)]
pub fn dmep(&mut self) -> DMEP_W<PRAR_PRGrs> {
DMEP_W::new(self, 31)
}
}
pub struct PRAR_PRGrs;
impl crate::RegisterSpec for PRAR_PRGrs {
type Ux = u32;
}
impl crate::Readable for PRAR_PRGrs {}
impl crate::Writable for PRAR_PRGrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for PRAR_PRGrs {}