pub type R = crate::R<HFEXPPRESCrs>;
pub type W = crate::W<HFEXPPRESCrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PRESC {
Nodivision = 0,
}
impl From<PRESC> for u8 {
#[inline(always)]
fn from(variant: PRESC) -> Self {
variant as _
}
}
impl crate::FieldSpec for PRESC {
type Ux = u8;
}
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, 5, PRESC>;
impl<'a, REG> PrescW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[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) & 0x1f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("HFEXPPRESC")
.field("presc", &self.presc())
.finish()
}
}
impl W {
#[inline(always)]
pub fn presc(&mut self) -> PrescW<'_, HFEXPPRESCrs> {
PrescW::new(self, 8)
}
}
pub struct HFEXPPRESCrs;
impl crate::RegisterSpec for HFEXPPRESCrs {
type Ux = u32;
}
impl crate::Readable for HFEXPPRESCrs {}
impl crate::Writable for HFEXPPRESCrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for HFEXPPRESCrs {}