pub type R = crate::R<TDTRrs>;
pub type W = crate::W<TDTRrs>;
pub type DLC_R = crate::FieldReader;
pub type DLC_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type TGT_R = crate::BitReader;
pub type TGT_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TIME_R = crate::FieldReader<u16>;
pub type TIME_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
impl R {
#[inline(always)]
pub fn dlc(&self) -> DLC_R {
DLC_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn tgt(&self) -> TGT_R {
TGT_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn time(&self) -> TIME_R {
TIME_R::new(((self.bits >> 16) & 0xffff) as u16)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TDTR")
.field("time", &self.time())
.field("tgt", &self.tgt())
.field("dlc", &self.dlc())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dlc(&mut self) -> DLC_W<TDTRrs> {
DLC_W::new(self, 0)
}
#[inline(always)]
pub fn tgt(&mut self) -> TGT_W<TDTRrs> {
TGT_W::new(self, 8)
}
#[inline(always)]
pub fn time(&mut self) -> TIME_W<TDTRrs> {
TIME_W::new(self, 16)
}
}
pub struct TDTRrs;
impl crate::RegisterSpec for TDTRrs {
type Ux = u32;
}
impl crate::Readable for TDTRrs {}
impl crate::Writable for TDTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for TDTRrs {}