pub type R = crate::R<CFGR1rs>;
pub type W = crate::W<CFGR1rs>;
pub type EN_R = crate::BitReader;
pub type EN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type BRGEN_R = crate::BitReader;
pub type BRGEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SCALEN_R = crate::BitReader;
pub type SCALEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type POLARITY_R = crate::BitReader;
pub type POLARITY_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ITEN_R = crate::BitReader;
pub type ITEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type HYST_R = crate::FieldReader;
pub type HYST_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type PWRMODE_R = crate::FieldReader;
pub type PWRMODE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type INMSEL_R = crate::FieldReader;
pub type INMSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type INPSEL_R = crate::BitReader;
pub type INPSEL_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type BLANKING_R = crate::FieldReader;
pub type BLANKING_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type LOCK_R = crate::BitReader;
pub type LOCK_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn en(&self) -> EN_R {
EN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn brgen(&self) -> BRGEN_R {
BRGEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn scalen(&self) -> SCALEN_R {
SCALEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn polarity(&self) -> POLARITY_R {
POLARITY_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn iten(&self) -> ITEN_R {
ITEN_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn hyst(&self) -> HYST_R {
HYST_R::new(((self.bits >> 8) & 3) as u8)
}
#[inline(always)]
pub fn pwrmode(&self) -> PWRMODE_R {
PWRMODE_R::new(((self.bits >> 12) & 3) as u8)
}
#[inline(always)]
pub fn inmsel(&self) -> INMSEL_R {
INMSEL_R::new(((self.bits >> 16) & 7) as u8)
}
#[inline(always)]
pub fn inpsel(&self) -> INPSEL_R {
INPSEL_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn blanking(&self) -> BLANKING_R {
BLANKING_R::new(((self.bits >> 24) & 0x0f) as u8)
}
#[inline(always)]
pub fn lock(&self) -> LOCK_R {
LOCK_R::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("CFGR1")
.field("en", &self.en())
.field("brgen", &self.brgen())
.field("scalen", &self.scalen())
.field("polarity", &self.polarity())
.field("iten", &self.iten())
.field("hyst", &self.hyst())
.field("pwrmode", &self.pwrmode())
.field("inmsel", &self.inmsel())
.field("inpsel", &self.inpsel())
.field("blanking", &self.blanking())
.field("lock", &self.lock())
.finish()
}
}
impl W {
#[inline(always)]
pub fn en(&mut self) -> EN_W<CFGR1rs> {
EN_W::new(self, 0)
}
#[inline(always)]
pub fn brgen(&mut self) -> BRGEN_W<CFGR1rs> {
BRGEN_W::new(self, 1)
}
#[inline(always)]
pub fn scalen(&mut self) -> SCALEN_W<CFGR1rs> {
SCALEN_W::new(self, 2)
}
#[inline(always)]
pub fn polarity(&mut self) -> POLARITY_W<CFGR1rs> {
POLARITY_W::new(self, 3)
}
#[inline(always)]
pub fn iten(&mut self) -> ITEN_W<CFGR1rs> {
ITEN_W::new(self, 6)
}
#[inline(always)]
pub fn hyst(&mut self) -> HYST_W<CFGR1rs> {
HYST_W::new(self, 8)
}
#[inline(always)]
pub fn pwrmode(&mut self) -> PWRMODE_W<CFGR1rs> {
PWRMODE_W::new(self, 12)
}
#[inline(always)]
pub fn inmsel(&mut self) -> INMSEL_W<CFGR1rs> {
INMSEL_W::new(self, 16)
}
#[inline(always)]
pub fn inpsel(&mut self) -> INPSEL_W<CFGR1rs> {
INPSEL_W::new(self, 20)
}
#[inline(always)]
pub fn blanking(&mut self) -> BLANKING_W<CFGR1rs> {
BLANKING_W::new(self, 24)
}
#[inline(always)]
pub fn lock(&mut self) -> LOCK_W<CFGR1rs> {
LOCK_W::new(self, 31)
}
}
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 {}