pub type R = crate::R<HFXOCTRL1rs>;
pub type W = crate::W<HFXOCTRL1rs>;
pub type PeakdetthrR = crate::FieldReader;
pub type PeakdetthrW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type ReglvlR = crate::FieldReader;
pub type ReglvlW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type XtibiasenR = crate::BitReader;
pub type XtibiasenW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn peakdetthr(&self) -> PeakdetthrR {
PeakdetthrR::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn reglvl(&self) -> ReglvlR {
ReglvlR::new(((self.bits >> 4) & 7) as u8)
}
#[inline(always)]
pub fn xtibiasen(&self) -> XtibiasenR {
XtibiasenR::new(((self.bits >> 9) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("HFXOCTRL1")
.field("peakdetthr", &self.peakdetthr())
.field("reglvl", &self.reglvl())
.field("xtibiasen", &self.xtibiasen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn peakdetthr(&mut self) -> PeakdetthrW<'_, HFXOCTRL1rs> {
PeakdetthrW::new(self, 0)
}
#[inline(always)]
pub fn reglvl(&mut self) -> ReglvlW<'_, HFXOCTRL1rs> {
ReglvlW::new(self, 4)
}
#[inline(always)]
pub fn xtibiasen(&mut self) -> XtibiasenW<'_, HFXOCTRL1rs> {
XtibiasenW::new(self, 9)
}
}
pub struct HFXOCTRL1rs;
impl crate::RegisterSpec for HFXOCTRL1rs {
type Ux = u32;
}
impl crate::Readable for HFXOCTRL1rs {}
impl crate::Writable for HFXOCTRL1rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for HFXOCTRL1rs {
const RESET_VALUE: u32 = 0x0240;
}