pub type R = crate::R<DIEPCTL2rs>;
pub type W = crate::W<DIEPCTL2rs>;
pub type MPSIZ_R = crate::FieldReader<u16>;
pub type MPSIZ_W<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>;
pub type USBAEP_R = crate::BitReader;
pub type USBAEP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type EONUM_DPIP_R = crate::BitReader;
pub type NAKSTS_R = crate::BitReader;
pub type EPTYP_R = crate::FieldReader;
pub type EPTYP_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type STALL_R = crate::BitReader;
pub type STALL_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TXFNUM_R = crate::FieldReader;
pub type TXFNUM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type CNAK_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SNAK_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SD0PID_SEVNFRM_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SODDFRM_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type EPDIS_R = crate::BitReader;
pub type EPDIS_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type EPENA_R = crate::BitReader;
pub type EPENA_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 usbaep(&self) -> USBAEP_R {
USBAEP_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn eonum_dpip(&self) -> EONUM_DPIP_R {
EONUM_DPIP_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn naksts(&self) -> NAKSTS_R {
NAKSTS_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 stall(&self) -> STALL_R {
STALL_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn txfnum(&self) -> TXFNUM_R {
TXFNUM_R::new(((self.bits >> 22) & 0x0f) as u8)
}
#[inline(always)]
pub fn epdis(&self) -> EPDIS_R {
EPDIS_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn epena(&self) -> EPENA_R {
EPENA_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("DIEPCTL2")
.field("mpsiz", &self.mpsiz())
.field("usbaep", &self.usbaep())
.field("eonum_dpip", &self.eonum_dpip())
.field("naksts", &self.naksts())
.field("eptyp", &self.eptyp())
.field("stall", &self.stall())
.field("txfnum", &self.txfnum())
.field("epdis", &self.epdis())
.field("epena", &self.epena())
.finish()
}
}
impl W {
#[inline(always)]
pub fn mpsiz(&mut self) -> MPSIZ_W<DIEPCTL2rs> {
MPSIZ_W::new(self, 0)
}
#[inline(always)]
pub fn usbaep(&mut self) -> USBAEP_W<DIEPCTL2rs> {
USBAEP_W::new(self, 15)
}
#[inline(always)]
pub fn eptyp(&mut self) -> EPTYP_W<DIEPCTL2rs> {
EPTYP_W::new(self, 18)
}
#[inline(always)]
pub fn stall(&mut self) -> STALL_W<DIEPCTL2rs> {
STALL_W::new(self, 21)
}
#[inline(always)]
pub fn txfnum(&mut self) -> TXFNUM_W<DIEPCTL2rs> {
TXFNUM_W::new(self, 22)
}
#[inline(always)]
pub fn cnak(&mut self) -> CNAK_W<DIEPCTL2rs> {
CNAK_W::new(self, 26)
}
#[inline(always)]
pub fn snak(&mut self) -> SNAK_W<DIEPCTL2rs> {
SNAK_W::new(self, 27)
}
#[inline(always)]
pub fn sd0pid_sevnfrm(&mut self) -> SD0PID_SEVNFRM_W<DIEPCTL2rs> {
SD0PID_SEVNFRM_W::new(self, 28)
}
#[inline(always)]
pub fn soddfrm(&mut self) -> SODDFRM_W<DIEPCTL2rs> {
SODDFRM_W::new(self, 29)
}
#[inline(always)]
pub fn epdis(&mut self) -> EPDIS_W<DIEPCTL2rs> {
EPDIS_W::new(self, 30)
}
#[inline(always)]
pub fn epena(&mut self) -> EPENA_W<DIEPCTL2rs> {
EPENA_W::new(self, 31)
}
}
pub struct DIEPCTL2rs;
impl crate::RegisterSpec for DIEPCTL2rs {
type Ux = u32;
}
impl crate::Readable for DIEPCTL2rs {}
impl crate::Writable for DIEPCTL2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for DIEPCTL2rs {}