#[doc = r" Value read from the register"]
pub struct R {
bits: u32,
}
impl super::PRAR_CUR2 {
#[doc = r" Reads the contents of the register"]
#[inline]
pub fn read(&self) -> R {
R {
bits: self.register.get(),
}
}
}
#[doc = r" Value of the field"]
pub struct PROT_AREA_START2R {
bits: u16,
}
impl PROT_AREA_START2R {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u16 {
self.bits
}
}
#[doc = r" Value of the field"]
pub struct PROT_AREA_END2R {
bits: u16,
}
impl PROT_AREA_END2R {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bits(&self) -> u16 {
self.bits
}
}
#[doc = r" Value of the field"]
pub struct DMEP2R {
bits: bool,
}
impl DMEP2R {
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
impl R {
#[doc = r" Value of the register as raw bits"]
#[inline]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bits 0:11 - Bank 2 lowest PCROP protected address"]
#[inline]
pub fn prot_area_start2(&self) -> PROT_AREA_START2R {
let bits = {
const MASK: u16 = 4095;
const OFFSET: u8 = 0;
((self.bits >> OFFSET) & MASK as u32) as u16
};
PROT_AREA_START2R { bits }
}
#[doc = "Bits 16:27 - Bank 2 highest PCROP protected address"]
#[inline]
pub fn prot_area_end2(&self) -> PROT_AREA_END2R {
let bits = {
const MASK: u16 = 4095;
const OFFSET: u8 = 16;
((self.bits >> OFFSET) & MASK as u32) as u16
};
PROT_AREA_END2R { bits }
}
#[doc = "Bit 31 - Bank 2 PCROP protected erase enable option status bit"]
#[inline]
pub fn dmep2(&self) -> DMEP2R {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 31;
((self.bits >> OFFSET) & MASK as u32) != 0
};
DMEP2R { bits }
}
}