pub type R = crate::R<DCKCFGRrs>;
pub type W = crate::W<DCKCFGRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TIMPRE {
Mul1or2 = 0,
Mul1or4 = 1,
}
impl From<TIMPRE> for bool {
#[inline(always)]
fn from(variant: TIMPRE) -> Self {
variant as u8 != 0
}
}
pub type TIMPRE_R = crate::BitReader<TIMPRE>;
impl TIMPRE_R {
#[inline(always)]
pub const fn variant(&self) -> TIMPRE {
match self.bits {
false => TIMPRE::Mul1or2,
true => TIMPRE::Mul1or4,
}
}
#[inline(always)]
pub fn is_mul1or2(&self) -> bool {
*self == TIMPRE::Mul1or2
}
#[inline(always)]
pub fn is_mul1or4(&self) -> bool {
*self == TIMPRE::Mul1or4
}
}
pub type TIMPRE_W<'a, REG> = crate::BitWriter<'a, REG, TIMPRE>;
impl<'a, REG> TIMPRE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn mul1or2(self) -> &'a mut crate::W<REG> {
self.variant(TIMPRE::Mul1or2)
}
#[inline(always)]
pub fn mul1or4(self) -> &'a mut crate::W<REG> {
self.variant(TIMPRE::Mul1or4)
}
}
impl R {
#[inline(always)]
pub fn timpre(&self) -> TIMPRE_R {
TIMPRE_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("DCKCFGR")
.field("timpre", &self.timpre())
.finish()
}
}
impl W {
#[inline(always)]
pub fn timpre(&mut self) -> TIMPRE_W<DCKCFGRrs> {
TIMPRE_W::new(self, 24)
}
}
pub struct DCKCFGRrs;
impl crate::RegisterSpec for DCKCFGRrs {
type Ux = u32;
}
impl crate::Readable for DCKCFGRrs {}
impl crate::Writable for DCKCFGRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for DCKCFGRrs {}