pub type R = crate::R<ECRrs>;
pub type W = crate::W<ECRrs>;
pub type IE_R = crate::BitReader;
pub type IE_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type IDIR_R = crate::FieldReader;
pub type IDIR_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type IBLK_R = crate::FieldReader;
pub type IBLK_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type FIDX_R = crate::BitReader;
pub type FIDX_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type IPOS_R = crate::FieldReader;
pub type IPOS_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type PW_R = crate::FieldReader;
pub type PW_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
pub type PWPRSC_R = crate::FieldReader;
pub type PWPRSC_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
impl R {
#[inline(always)]
pub fn ie(&self) -> IE_R {
IE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn idir(&self) -> IDIR_R {
IDIR_R::new(((self.bits >> 1) & 3) as u8)
}
#[inline(always)]
pub fn iblk(&self) -> IBLK_R {
IBLK_R::new(((self.bits >> 3) & 3) as u8)
}
#[inline(always)]
pub fn fidx(&self) -> FIDX_R {
FIDX_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn ipos(&self) -> IPOS_R {
IPOS_R::new(((self.bits >> 6) & 3) as u8)
}
#[inline(always)]
pub fn pw(&self) -> PW_R {
PW_R::new(((self.bits >> 16) & 0xff) as u8)
}
#[inline(always)]
pub fn pwprsc(&self) -> PWPRSC_R {
PWPRSC_R::new(((self.bits >> 24) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ECR")
.field("ie", &self.ie())
.field("idir", &self.idir())
.field("iblk", &self.iblk())
.field("fidx", &self.fidx())
.field("ipos", &self.ipos())
.field("pw", &self.pw())
.field("pwprsc", &self.pwprsc())
.finish()
}
}
impl W {
#[inline(always)]
pub fn ie(&mut self) -> IE_W<ECRrs> {
IE_W::new(self, 0)
}
#[inline(always)]
pub fn idir(&mut self) -> IDIR_W<ECRrs> {
IDIR_W::new(self, 1)
}
#[inline(always)]
pub fn iblk(&mut self) -> IBLK_W<ECRrs> {
IBLK_W::new(self, 3)
}
#[inline(always)]
pub fn fidx(&mut self) -> FIDX_W<ECRrs> {
FIDX_W::new(self, 5)
}
#[inline(always)]
pub fn ipos(&mut self) -> IPOS_W<ECRrs> {
IPOS_W::new(self, 6)
}
#[inline(always)]
pub fn pw(&mut self) -> PW_W<ECRrs> {
PW_W::new(self, 16)
}
#[inline(always)]
pub fn pwprsc(&mut self) -> PWPRSC_W<ECRrs> {
PWPRSC_W::new(self, 24)
}
}
pub struct ECRrs;
impl crate::RegisterSpec for ECRrs {
type Ux = u32;
}
impl crate::Readable for ECRrs {}
impl crate::Writable for ECRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for ECRrs {}