pub type R = crate::R<VMONIO0CTRLrs>;
pub type W = crate::W<VMONIO0CTRLrs>;
pub type EnR = crate::BitReader;
pub type EnW<'a, REG> = crate::BitWriter<'a, REG>;
pub type RisewuR = crate::BitReader;
pub type RisewuW<'a, REG> = crate::BitWriter<'a, REG>;
pub type FallwuR = crate::BitReader;
pub type FallwuW<'a, REG> = crate::BitWriter<'a, REG>;
pub type RetdisR = crate::BitReader;
pub type RetdisW<'a, REG> = crate::BitWriter<'a, REG>;
pub type ThresfineR = crate::FieldReader;
pub type ThresfineW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type ThrescoarseR = crate::FieldReader;
pub type ThrescoarseW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
impl R {
#[inline(always)]
pub fn en(&self) -> EnR {
EnR::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn risewu(&self) -> RisewuR {
RisewuR::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn fallwu(&self) -> FallwuR {
FallwuR::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn retdis(&self) -> RetdisR {
RetdisR::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn thresfine(&self) -> ThresfineR {
ThresfineR::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn threscoarse(&self) -> ThrescoarseR {
ThrescoarseR::new(((self.bits >> 12) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("VMONIO0CTRL")
.field("en", &self.en())
.field("risewu", &self.risewu())
.field("fallwu", &self.fallwu())
.field("retdis", &self.retdis())
.field("thresfine", &self.thresfine())
.field("threscoarse", &self.threscoarse())
.finish()
}
}
impl W {
#[inline(always)]
pub fn en(&mut self) -> EnW<'_, VMONIO0CTRLrs> {
EnW::new(self, 0)
}
#[inline(always)]
pub fn risewu(&mut self) -> RisewuW<'_, VMONIO0CTRLrs> {
RisewuW::new(self, 2)
}
#[inline(always)]
pub fn fallwu(&mut self) -> FallwuW<'_, VMONIO0CTRLrs> {
FallwuW::new(self, 3)
}
#[inline(always)]
pub fn retdis(&mut self) -> RetdisW<'_, VMONIO0CTRLrs> {
RetdisW::new(self, 4)
}
#[inline(always)]
pub fn thresfine(&mut self) -> ThresfineW<'_, VMONIO0CTRLrs> {
ThresfineW::new(self, 8)
}
#[inline(always)]
pub fn threscoarse(&mut self) -> ThrescoarseW<'_, VMONIO0CTRLrs> {
ThrescoarseW::new(self, 12)
}
}
pub struct VMONIO0CTRLrs;
impl crate::RegisterSpec for VMONIO0CTRLrs {
type Ux = u32;
}
impl crate::Readable for VMONIO0CTRLrs {}
impl crate::Writable for VMONIO0CTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for VMONIO0CTRLrs {}