pub type R = crate::R<CFGR1rs>;
pub type W = crate::W<CFGR1rs>;
pub type TS1_EN_R = crate::BitReader;
pub type TS1_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TS1_START_R = crate::BitReader;
pub type TS1_START_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TS1_INTRIG_SEL_R = crate::FieldReader;
pub type TS1_INTRIG_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type TS1_SMP_TIME_R = crate::FieldReader;
pub type TS1_SMP_TIME_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type REFCLK_SEL_R = crate::BitReader;
pub type REFCLK_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type Q_MEAS_OPT_R = crate::BitReader;
pub type Q_MEAS_OPT_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type HSREF_CLK_DIV_R = crate::FieldReader;
pub type HSREF_CLK_DIV_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
impl R {
#[inline(always)]
pub fn ts1_en(&self) -> TS1_EN_R {
TS1_EN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn ts1_start(&self) -> TS1_START_R {
TS1_START_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn ts1_intrig_sel(&self) -> TS1_INTRIG_SEL_R {
TS1_INTRIG_SEL_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn ts1_smp_time(&self) -> TS1_SMP_TIME_R {
TS1_SMP_TIME_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn refclk_sel(&self) -> REFCLK_SEL_R {
REFCLK_SEL_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn q_meas_opt(&self) -> Q_MEAS_OPT_R {
Q_MEAS_OPT_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn hsref_clk_div(&self) -> HSREF_CLK_DIV_R {
HSREF_CLK_DIV_R::new(((self.bits >> 24) & 0x7f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CFGR1")
.field("ts1_en", &self.ts1_en())
.field("ts1_start", &self.ts1_start())
.field("ts1_intrig_sel", &self.ts1_intrig_sel())
.field("ts1_smp_time", &self.ts1_smp_time())
.field("refclk_sel", &self.refclk_sel())
.field("q_meas_opt", &self.q_meas_opt())
.field("hsref_clk_div", &self.hsref_clk_div())
.finish()
}
}
impl W {
#[inline(always)]
pub fn ts1_en(&mut self) -> TS1_EN_W<CFGR1rs> {
TS1_EN_W::new(self, 0)
}
#[inline(always)]
pub fn ts1_start(&mut self) -> TS1_START_W<CFGR1rs> {
TS1_START_W::new(self, 4)
}
#[inline(always)]
pub fn ts1_intrig_sel(&mut self) -> TS1_INTRIG_SEL_W<CFGR1rs> {
TS1_INTRIG_SEL_W::new(self, 8)
}
#[inline(always)]
pub fn ts1_smp_time(&mut self) -> TS1_SMP_TIME_W<CFGR1rs> {
TS1_SMP_TIME_W::new(self, 16)
}
#[inline(always)]
pub fn refclk_sel(&mut self) -> REFCLK_SEL_W<CFGR1rs> {
REFCLK_SEL_W::new(self, 20)
}
#[inline(always)]
pub fn q_meas_opt(&mut self) -> Q_MEAS_OPT_W<CFGR1rs> {
Q_MEAS_OPT_W::new(self, 21)
}
#[inline(always)]
pub fn hsref_clk_div(&mut self) -> HSREF_CLK_DIV_W<CFGR1rs> {
HSREF_CLK_DIV_W::new(self, 24)
}
}
pub struct CFGR1rs;
impl crate::RegisterSpec for CFGR1rs {
type Ux = u32;
}
impl crate::Readable for CFGR1rs {}
impl crate::Writable for CFGR1rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CFGR1rs {}