pub type R = crate::R<TWCRrs>;
pub type W = crate::W<TWCRrs>;
pub type TOTALH_R = crate::FieldReader<u16>;
pub type TOTALH_W<'a, REG> = crate::FieldWriter<'a, REG, 11, u16, crate::Safe>;
pub type TOTALW_R = crate::FieldReader<u16>;
pub type TOTALW_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16, crate::Safe>;
impl R {
#[inline(always)]
pub fn totalh(&self) -> TOTALH_R {
TOTALH_R::new((self.bits & 0x07ff) as u16)
}
#[inline(always)]
pub fn totalw(&self) -> TOTALW_R {
TOTALW_R::new(((self.bits >> 16) & 0x0fff) as u16)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TWCR")
.field("totalw", &self.totalw())
.field("totalh", &self.totalh())
.finish()
}
}
impl W {
#[inline(always)]
pub fn totalh(&mut self) -> TOTALH_W<TWCRrs> {
TOTALH_W::new(self, 0)
}
#[inline(always)]
pub fn totalw(&mut self) -> TOTALW_W<TWCRrs> {
TOTALW_W::new(self, 16)
}
}
pub struct TWCRrs;
impl crate::RegisterSpec for TWCRrs {
type Ux = u32;
}
impl crate::Readable for TWCRrs {}
impl crate::Writable for TWCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for TWCRrs {}