pub type R = crate::R<CR2rs>;
pub type W = crate::W<CR2rs>;
pub type PVDE_R = crate::BitReader;
pub type PVDE_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type PVDFT_R = crate::FieldReader;
pub type PVDFT_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type PVDRT_R = crate::FieldReader;
pub type PVDRT_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type PVMENDAC_R = crate::BitReader;
pub type PVMENDAC_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type PVMENUSB_R = crate::BitReader;
pub type PVMENUSB_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type IOSV_R = crate::BitReader;
pub type IOSV_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type USV_R = crate::BitReader;
pub type USV_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn pvde(&self) -> PVDE_R {
PVDE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn pvdft(&self) -> PVDFT_R {
PVDFT_R::new(((self.bits >> 1) & 7) as u8)
}
#[inline(always)]
pub fn pvdrt(&self) -> PVDRT_R {
PVDRT_R::new(((self.bits >> 4) & 7) as u8)
}
#[inline(always)]
pub fn pvmendac(&self) -> PVMENDAC_R {
PVMENDAC_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn pvmenusb(&self) -> PVMENUSB_R {
PVMENUSB_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn iosv(&self) -> IOSV_R {
IOSV_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn usv(&self) -> USV_R {
USV_R::new(((self.bits >> 10) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR2")
.field("pvde", &self.pvde())
.field("pvdft", &self.pvdft())
.field("pvdrt", &self.pvdrt())
.field("pvmendac", &self.pvmendac())
.field("pvmenusb", &self.pvmenusb())
.field("iosv", &self.iosv())
.field("usv", &self.usv())
.finish()
}
}
impl W {
#[inline(always)]
pub fn pvde(&mut self) -> PVDE_W<CR2rs> {
PVDE_W::new(self, 0)
}
#[inline(always)]
pub fn pvdft(&mut self) -> PVDFT_W<CR2rs> {
PVDFT_W::new(self, 1)
}
#[inline(always)]
pub fn pvdrt(&mut self) -> PVDRT_W<CR2rs> {
PVDRT_W::new(self, 4)
}
#[inline(always)]
pub fn pvmendac(&mut self) -> PVMENDAC_W<CR2rs> {
PVMENDAC_W::new(self, 7)
}
#[inline(always)]
pub fn pvmenusb(&mut self) -> PVMENUSB_W<CR2rs> {
PVMENUSB_W::new(self, 8)
}
#[inline(always)]
pub fn iosv(&mut self) -> IOSV_W<CR2rs> {
IOSV_W::new(self, 9)
}
#[inline(always)]
pub fn usv(&mut self) -> USV_W<CR2rs> {
USV_W::new(self, 10)
}
}
pub struct CR2rs;
impl crate::RegisterSpec for CR2rs {
type Ux = u32;
}
impl crate::Readable for CR2rs {}
impl crate::Writable for CR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CR2rs {}