pub type R = crate::R<GUSBCFGrs>;
pub type W = crate::W<GUSBCFGrs>;
pub type TOCAL_R = crate::FieldReader;
pub type TOCAL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type PHYSEL_R = crate::BitReader;
pub type PHYSEL_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SRPCAP_R = crate::BitReader;
pub type SRPCAP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type HNPCAP_R = crate::BitReader;
pub type HNPCAP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TRDT_R = crate::FieldReader;
pub type TRDT_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type PHYLPC_R = crate::BitReader;
pub type PHYLPC_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TSDPS_R = crate::BitReader;
pub type TSDPS_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type FHMOD_R = crate::BitReader;
pub type FHMOD_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type FDMOD_R = crate::BitReader;
pub type FDMOD_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn tocal(&self) -> TOCAL_R {
TOCAL_R::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn physel(&self) -> PHYSEL_R {
PHYSEL_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn srpcap(&self) -> SRPCAP_R {
SRPCAP_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn hnpcap(&self) -> HNPCAP_R {
HNPCAP_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn trdt(&self) -> TRDT_R {
TRDT_R::new(((self.bits >> 10) & 0x0f) as u8)
}
#[inline(always)]
pub fn phylpc(&self) -> PHYLPC_R {
PHYLPC_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn tsdps(&self) -> TSDPS_R {
TSDPS_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn fhmod(&self) -> FHMOD_R {
FHMOD_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn fdmod(&self) -> FDMOD_R {
FDMOD_R::new(((self.bits >> 30) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GUSBCFG")
.field("tocal", &self.tocal())
.field("physel", &self.physel())
.field("srpcap", &self.srpcap())
.field("hnpcap", &self.hnpcap())
.field("trdt", &self.trdt())
.field("phylpc", &self.phylpc())
.field("tsdps", &self.tsdps())
.field("fhmod", &self.fhmod())
.field("fdmod", &self.fdmod())
.finish()
}
}
impl W {
#[inline(always)]
pub fn tocal(&mut self) -> TOCAL_W<GUSBCFGrs> {
TOCAL_W::new(self, 0)
}
#[inline(always)]
pub fn physel(&mut self) -> PHYSEL_W<GUSBCFGrs> {
PHYSEL_W::new(self, 6)
}
#[inline(always)]
pub fn srpcap(&mut self) -> SRPCAP_W<GUSBCFGrs> {
SRPCAP_W::new(self, 8)
}
#[inline(always)]
pub fn hnpcap(&mut self) -> HNPCAP_W<GUSBCFGrs> {
HNPCAP_W::new(self, 9)
}
#[inline(always)]
pub fn trdt(&mut self) -> TRDT_W<GUSBCFGrs> {
TRDT_W::new(self, 10)
}
#[inline(always)]
pub fn phylpc(&mut self) -> PHYLPC_W<GUSBCFGrs> {
PHYLPC_W::new(self, 15)
}
#[inline(always)]
pub fn tsdps(&mut self) -> TSDPS_W<GUSBCFGrs> {
TSDPS_W::new(self, 22)
}
#[inline(always)]
pub fn fhmod(&mut self) -> FHMOD_W<GUSBCFGrs> {
FHMOD_W::new(self, 29)
}
#[inline(always)]
pub fn fdmod(&mut self) -> FDMOD_W<GUSBCFGrs> {
FDMOD_W::new(self, 30)
}
}
pub struct GUSBCFGrs;
impl crate::RegisterSpec for GUSBCFGrs {
type Ux = u32;
}
impl crate::Readable for GUSBCFGrs {}
impl crate::Writable for GUSBCFGrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for GUSBCFGrs {
const RESET_VALUE: u32 = 0x1400;
}