pub type R = crate::R<HFCOREPRESCrs>;
pub type W = crate::W<HFCOREPRESCrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u16)]
pub enum PRESC {
Nodivision = 0,
}
impl From<PRESC> for u16 {
#[inline(always)]
fn from(variant: PRESC) -> Self {
variant as _
}
}
impl crate::FieldSpec for PRESC {
type Ux = u16;
}
impl crate::IsEnum for PRESC {}
pub type PrescR = crate::FieldReader<PRESC>;
impl PrescR {
#[inline(always)]
pub const fn variant(&self) -> Option<PRESC> {
match self.bits {
0 => Some(PRESC::Nodivision),
_ => None,
}
}
#[inline(always)]
pub fn is_nodivision(&self) -> bool {
*self == PRESC::Nodivision
}
}
pub type PrescW<'a, REG> = crate::FieldWriter<'a, REG, 9, PRESC>;
impl<'a, REG> PrescW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u16>,
{
#[inline(always)]
pub fn nodivision(self) -> &'a mut crate::W<REG> {
self.variant(PRESC::Nodivision)
}
}
impl R {
#[inline(always)]
pub fn presc(&self) -> PrescR {
PrescR::new(((self.bits >> 8) & 0x01ff) as u16)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("HFCOREPRESC")
.field("presc", &self.presc())
.finish()
}
}
impl W {
#[inline(always)]
pub fn presc(&mut self) -> PrescW<'_, HFCOREPRESCrs> {
PrescW::new(self, 8)
}
}
pub struct HFCOREPRESCrs;
impl crate::RegisterSpec for HFCOREPRESCrs {
type Ux = u32;
}
impl crate::Readable for HFCOREPRESCrs {}
impl crate::Writable for HFCOREPRESCrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for HFCOREPRESCrs {}