pub type R = crate::R<OPAMP2_CSRrs>;
pub type W = crate::W<OPAMP2_CSRrs>;
pub type OPAEN_R = crate::BitReader;
pub type OPAEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type FORCE_VP_R = crate::BitReader;
pub type FORCE_VP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type VM_SEL_R = crate::FieldReader;
pub type VM_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type OPAHSM_R = crate::BitReader;
pub type OPAHSM_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type CALON_R = crate::BitReader;
pub type CALON_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type CALSEL_R = crate::FieldReader;
pub type CALSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type PGA_GAIN_R = crate::FieldReader;
pub type PGA_GAIN_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type USERTRIM_R = crate::BitReader;
pub type USERTRIM_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TSTREF_R = crate::BitReader;
pub type TSTREF_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type CALOUT_R = crate::BitReader;
pub type CALOUT_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn opaen(&self) -> OPAEN_R {
OPAEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn force_vp(&self) -> FORCE_VP_R {
FORCE_VP_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn vm_sel(&self) -> VM_SEL_R {
VM_SEL_R::new(((self.bits >> 5) & 3) as u8)
}
#[inline(always)]
pub fn opahsm(&self) -> OPAHSM_R {
OPAHSM_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn calon(&self) -> CALON_R {
CALON_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn calsel(&self) -> CALSEL_R {
CALSEL_R::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn pga_gain(&self) -> PGA_GAIN_R {
PGA_GAIN_R::new(((self.bits >> 14) & 0x0f) as u8)
}
#[inline(always)]
pub fn usertrim(&self) -> USERTRIM_R {
USERTRIM_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn tstref(&self) -> TSTREF_R {
TSTREF_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn calout(&self) -> CALOUT_R {
CALOUT_R::new(((self.bits >> 30) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OPAMP2_CSR")
.field("opaen", &self.opaen())
.field("force_vp", &self.force_vp())
.field("vm_sel", &self.vm_sel())
.field("opahsm", &self.opahsm())
.field("calon", &self.calon())
.field("calsel", &self.calsel())
.field("pga_gain", &self.pga_gain())
.field("usertrim", &self.usertrim())
.field("tstref", &self.tstref())
.field("calout", &self.calout())
.finish()
}
}
impl W {
#[inline(always)]
pub fn opaen(&mut self) -> OPAEN_W<OPAMP2_CSRrs> {
OPAEN_W::new(self, 0)
}
#[inline(always)]
pub fn force_vp(&mut self) -> FORCE_VP_W<OPAMP2_CSRrs> {
FORCE_VP_W::new(self, 1)
}
#[inline(always)]
pub fn vm_sel(&mut self) -> VM_SEL_W<OPAMP2_CSRrs> {
VM_SEL_W::new(self, 5)
}
#[inline(always)]
pub fn opahsm(&mut self) -> OPAHSM_W<OPAMP2_CSRrs> {
OPAHSM_W::new(self, 8)
}
#[inline(always)]
pub fn calon(&mut self) -> CALON_W<OPAMP2_CSRrs> {
CALON_W::new(self, 11)
}
#[inline(always)]
pub fn calsel(&mut self) -> CALSEL_W<OPAMP2_CSRrs> {
CALSEL_W::new(self, 12)
}
#[inline(always)]
pub fn pga_gain(&mut self) -> PGA_GAIN_W<OPAMP2_CSRrs> {
PGA_GAIN_W::new(self, 14)
}
#[inline(always)]
pub fn usertrim(&mut self) -> USERTRIM_W<OPAMP2_CSRrs> {
USERTRIM_W::new(self, 18)
}
#[inline(always)]
pub fn tstref(&mut self) -> TSTREF_W<OPAMP2_CSRrs> {
TSTREF_W::new(self, 29)
}
#[inline(always)]
pub fn calout(&mut self) -> CALOUT_W<OPAMP2_CSRrs> {
CALOUT_W::new(self, 30)
}
}
pub struct OPAMP2_CSRrs;
impl crate::RegisterSpec for OPAMP2_CSRrs {
type Ux = u32;
}
impl crate::Readable for OPAMP2_CSRrs {}
impl crate::Writable for OPAMP2_CSRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for OPAMP2_CSRrs {}