pub type R = crate::R<HCCHAR12rs>;
pub type W = crate::W<HCCHAR12rs>;
pub type MPSIZ_R = crate::FieldReader<u16>;
pub type MPSIZ_W<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>;
pub type EPNUM_R = crate::FieldReader;
pub type EPNUM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type EPDIR_R = crate::BitReader;
pub type EPDIR_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type LSDEV_R = crate::BitReader;
pub type LSDEV_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type EPTYP_R = crate::FieldReader;
pub type EPTYP_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type MCNT_R = crate::FieldReader;
pub type MCNT_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type DAD_R = crate::FieldReader;
pub type DAD_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
pub type CHDIS_R = crate::BitReader;
pub type CHDIS_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type CHENA_R = crate::BitReader;
pub type CHENA_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn mpsiz(&self) -> MPSIZ_R {
MPSIZ_R::new((self.bits & 0x07ff) as u16)
}
#[inline(always)]
pub fn epnum(&self) -> EPNUM_R {
EPNUM_R::new(((self.bits >> 11) & 0x0f) as u8)
}
#[inline(always)]
pub fn epdir(&self) -> EPDIR_R {
EPDIR_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn lsdev(&self) -> LSDEV_R {
LSDEV_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn eptyp(&self) -> EPTYP_R {
EPTYP_R::new(((self.bits >> 18) & 3) as u8)
}
#[inline(always)]
pub fn mcnt(&self) -> MCNT_R {
MCNT_R::new(((self.bits >> 20) & 3) as u8)
}
#[inline(always)]
pub fn dad(&self) -> DAD_R {
DAD_R::new(((self.bits >> 22) & 0x7f) as u8)
}
#[inline(always)]
pub fn chdis(&self) -> CHDIS_R {
CHDIS_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn chena(&self) -> CHENA_R {
CHENA_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("HCCHAR12")
.field("mpsiz", &self.mpsiz())
.field("epnum", &self.epnum())
.field("epdir", &self.epdir())
.field("lsdev", &self.lsdev())
.field("eptyp", &self.eptyp())
.field("mcnt", &self.mcnt())
.field("dad", &self.dad())
.field("chdis", &self.chdis())
.field("chena", &self.chena())
.finish()
}
}
impl W {
#[inline(always)]
pub fn mpsiz(&mut self) -> MPSIZ_W<HCCHAR12rs> {
MPSIZ_W::new(self, 0)
}
#[inline(always)]
pub fn epnum(&mut self) -> EPNUM_W<HCCHAR12rs> {
EPNUM_W::new(self, 11)
}
#[inline(always)]
pub fn epdir(&mut self) -> EPDIR_W<HCCHAR12rs> {
EPDIR_W::new(self, 15)
}
#[inline(always)]
pub fn lsdev(&mut self) -> LSDEV_W<HCCHAR12rs> {
LSDEV_W::new(self, 17)
}
#[inline(always)]
pub fn eptyp(&mut self) -> EPTYP_W<HCCHAR12rs> {
EPTYP_W::new(self, 18)
}
#[inline(always)]
pub fn mcnt(&mut self) -> MCNT_W<HCCHAR12rs> {
MCNT_W::new(self, 20)
}
#[inline(always)]
pub fn dad(&mut self) -> DAD_W<HCCHAR12rs> {
DAD_W::new(self, 22)
}
#[inline(always)]
pub fn chdis(&mut self) -> CHDIS_W<HCCHAR12rs> {
CHDIS_W::new(self, 30)
}
#[inline(always)]
pub fn chena(&mut self) -> CHENA_W<HCCHAR12rs> {
CHENA_W::new(self, 31)
}
}
pub struct HCCHAR12rs;
impl crate::RegisterSpec for HCCHAR12rs {
type Ux = u32;
}
impl crate::Readable for HCCHAR12rs {}
impl crate::Writable for HCCHAR12rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for HCCHAR12rs {}