pub type R = crate::R<CCRrs>;
pub type W = crate::W<CCRrs>;
pub type CKMODE_R = crate::FieldReader;
pub type CKMODE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type PRESC_R = crate::FieldReader;
pub type PRESC_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type VREFEN_R = crate::BitReader;
pub type VREFEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type VSENSEEN_R = crate::BitReader;
pub type VSENSEEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type VBATEN_R = crate::BitReader;
pub type VBATEN_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn ckmode(&self) -> CKMODE_R {
CKMODE_R::new(((self.bits >> 16) & 3) as u8)
}
#[inline(always)]
pub fn presc(&self) -> PRESC_R {
PRESC_R::new(((self.bits >> 18) & 0x0f) as u8)
}
#[inline(always)]
pub fn vrefen(&self) -> VREFEN_R {
VREFEN_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn vsenseen(&self) -> VSENSEEN_R {
VSENSEEN_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn vbaten(&self) -> VBATEN_R {
VBATEN_R::new(((self.bits >> 24) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CCR")
.field("ckmode", &self.ckmode())
.field("presc", &self.presc())
.field("vrefen", &self.vrefen())
.field("vsenseen", &self.vsenseen())
.field("vbaten", &self.vbaten())
.finish()
}
}
impl W {
#[inline(always)]
pub fn ckmode(&mut self) -> CKMODE_W<CCRrs> {
CKMODE_W::new(self, 16)
}
#[inline(always)]
pub fn presc(&mut self) -> PRESC_W<CCRrs> {
PRESC_W::new(self, 18)
}
#[inline(always)]
pub fn vrefen(&mut self) -> VREFEN_W<CCRrs> {
VREFEN_W::new(self, 22)
}
#[inline(always)]
pub fn vsenseen(&mut self) -> VSENSEEN_W<CCRrs> {
VSENSEEN_W::new(self, 23)
}
#[inline(always)]
pub fn vbaten(&mut self) -> VBATEN_W<CCRrs> {
VBATEN_W::new(self, 24)
}
}
pub struct CCRrs;
impl crate::RegisterSpec for CCRrs {
type Ux = u32;
}
impl crate::Readable for CCRrs {}
impl crate::Writable for CCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CCRrs {}