pub type R = crate::R<CALrs>;
pub type W = crate::W<CALrs>;
pub type SingleoffsetR = crate::FieldReader;
pub type SingleoffsetW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type SingleoffsetinvR = crate::FieldReader;
pub type SingleoffsetinvW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type SinglegainR = crate::FieldReader;
pub type SinglegainW<'a, REG> = crate::FieldWriter<'a, REG, 7>;
pub type OffsetinvmodeR = crate::BitReader;
pub type OffsetinvmodeW<'a, REG> = crate::BitWriter<'a, REG>;
pub type ScanoffsetR = crate::FieldReader;
pub type ScanoffsetW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type ScanoffsetinvR = crate::FieldReader;
pub type ScanoffsetinvW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type ScangainR = crate::FieldReader;
pub type ScangainW<'a, REG> = crate::FieldWriter<'a, REG, 7>;
pub type CalenR = crate::BitReader;
pub type CalenW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn singleoffset(&self) -> SingleoffsetR {
SingleoffsetR::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn singleoffsetinv(&self) -> SingleoffsetinvR {
SingleoffsetinvR::new(((self.bits >> 4) & 0x0f) as u8)
}
#[inline(always)]
pub fn singlegain(&self) -> SinglegainR {
SinglegainR::new(((self.bits >> 8) & 0x7f) as u8)
}
#[inline(always)]
pub fn offsetinvmode(&self) -> OffsetinvmodeR {
OffsetinvmodeR::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn scanoffset(&self) -> ScanoffsetR {
ScanoffsetR::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn scanoffsetinv(&self) -> ScanoffsetinvR {
ScanoffsetinvR::new(((self.bits >> 20) & 0x0f) as u8)
}
#[inline(always)]
pub fn scangain(&self) -> ScangainR {
ScangainR::new(((self.bits >> 24) & 0x7f) as u8)
}
#[inline(always)]
pub fn calen(&self) -> CalenR {
CalenR::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CAL")
.field("singleoffset", &self.singleoffset())
.field("singleoffsetinv", &self.singleoffsetinv())
.field("singlegain", &self.singlegain())
.field("offsetinvmode", &self.offsetinvmode())
.field("scanoffset", &self.scanoffset())
.field("scanoffsetinv", &self.scanoffsetinv())
.field("scangain", &self.scangain())
.field("calen", &self.calen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn singleoffset(&mut self) -> SingleoffsetW<'_, CALrs> {
SingleoffsetW::new(self, 0)
}
#[inline(always)]
pub fn singleoffsetinv(&mut self) -> SingleoffsetinvW<'_, CALrs> {
SingleoffsetinvW::new(self, 4)
}
#[inline(always)]
pub fn singlegain(&mut self) -> SinglegainW<'_, CALrs> {
SinglegainW::new(self, 8)
}
#[inline(always)]
pub fn offsetinvmode(&mut self) -> OffsetinvmodeW<'_, CALrs> {
OffsetinvmodeW::new(self, 15)
}
#[inline(always)]
pub fn scanoffset(&mut self) -> ScanoffsetW<'_, CALrs> {
ScanoffsetW::new(self, 16)
}
#[inline(always)]
pub fn scanoffsetinv(&mut self) -> ScanoffsetinvW<'_, CALrs> {
ScanoffsetinvW::new(self, 20)
}
#[inline(always)]
pub fn scangain(&mut self) -> ScangainW<'_, CALrs> {
ScangainW::new(self, 24)
}
#[inline(always)]
pub fn calen(&mut self) -> CalenW<'_, CALrs> {
CalenW::new(self, 31)
}
}
pub struct CALrs;
impl crate::RegisterSpec for CALrs {
type Ux = u32;
}
impl crate::Readable for CALrs {}
impl crate::Writable for CALrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CALrs {
const RESET_VALUE: u32 = 0x4078_4078;
}