pub type R = crate::R<CR2rs>;
pub type W = crate::W<CR2rs>;
pub type SADD_R = crate::FieldReader<u16>;
pub type SADD_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
pub type RD_WRN_R = crate::BitReader;
pub type RD_WRN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ADD10_R = crate::BitReader;
pub type ADD10_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type HEAD10R_R = crate::BitReader;
pub type HEAD10R_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type START_R = crate::BitReader;
pub type START_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type STOP_R = crate::BitReader;
pub type STOP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type NACK_R = crate::BitReader;
pub type NACK_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type NBYTES_R = crate::FieldReader;
pub type NBYTES_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
pub type RELOAD_R = crate::BitReader;
pub type RELOAD_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type AUTOEND_R = crate::BitReader;
pub type AUTOEND_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type PECBYTE_R = crate::BitReader;
pub type PECBYTE_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn sadd(&self) -> SADD_R {
SADD_R::new((self.bits & 0x03ff) as u16)
}
#[inline(always)]
pub fn rd_wrn(&self) -> RD_WRN_R {
RD_WRN_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn add10(&self) -> ADD10_R {
ADD10_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn head10r(&self) -> HEAD10R_R {
HEAD10R_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn start(&self) -> START_R {
START_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn stop(&self) -> STOP_R {
STOP_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn nack(&self) -> NACK_R {
NACK_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn nbytes(&self) -> NBYTES_R {
NBYTES_R::new(((self.bits >> 16) & 0xff) as u8)
}
#[inline(always)]
pub fn reload(&self) -> RELOAD_R {
RELOAD_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn autoend(&self) -> AUTOEND_R {
AUTOEND_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn pecbyte(&self) -> PECBYTE_R {
PECBYTE_R::new(((self.bits >> 26) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR2")
.field("sadd", &self.sadd())
.field("rd_wrn", &self.rd_wrn())
.field("add10", &self.add10())
.field("head10r", &self.head10r())
.field("start", &self.start())
.field("stop", &self.stop())
.field("nack", &self.nack())
.field("nbytes", &self.nbytes())
.field("reload", &self.reload())
.field("autoend", &self.autoend())
.field("pecbyte", &self.pecbyte())
.finish()
}
}
impl W {
#[inline(always)]
pub fn sadd(&mut self) -> SADD_W<CR2rs> {
SADD_W::new(self, 0)
}
#[inline(always)]
pub fn rd_wrn(&mut self) -> RD_WRN_W<CR2rs> {
RD_WRN_W::new(self, 10)
}
#[inline(always)]
pub fn add10(&mut self) -> ADD10_W<CR2rs> {
ADD10_W::new(self, 11)
}
#[inline(always)]
pub fn head10r(&mut self) -> HEAD10R_W<CR2rs> {
HEAD10R_W::new(self, 12)
}
#[inline(always)]
pub fn start(&mut self) -> START_W<CR2rs> {
START_W::new(self, 13)
}
#[inline(always)]
pub fn stop(&mut self) -> STOP_W<CR2rs> {
STOP_W::new(self, 14)
}
#[inline(always)]
pub fn nack(&mut self) -> NACK_W<CR2rs> {
NACK_W::new(self, 15)
}
#[inline(always)]
pub fn nbytes(&mut self) -> NBYTES_W<CR2rs> {
NBYTES_W::new(self, 16)
}
#[inline(always)]
pub fn reload(&mut self) -> RELOAD_W<CR2rs> {
RELOAD_W::new(self, 24)
}
#[inline(always)]
pub fn autoend(&mut self) -> AUTOEND_W<CR2rs> {
AUTOEND_W::new(self, 25)
}
#[inline(always)]
pub fn pecbyte(&mut self) -> PECBYTE_W<CR2rs> {
PECBYTE_W::new(self, 26)
}
}
pub struct CR2rs;
impl crate::RegisterSpec for CR2rs {
type Ux = u32;
}
impl crate::Readable for CR2rs {}
impl crate::Writable for CR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CR2rs {}