pub type R = crate::R<CSRrs>;
pub type W = crate::W<CSRrs>;
pub type ENABLE_R = crate::BitReader;
pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TICKINT_R = crate::BitReader;
pub type TICKINT_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type CLKSOURCE_R = crate::BitReader;
pub type CLKSOURCE_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type COUNTFLAG_R = crate::BitReader;
pub type COUNTFLAG_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn enable(&self) -> ENABLE_R {
ENABLE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn tickint(&self) -> TICKINT_R {
TICKINT_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn clksource(&self) -> CLKSOURCE_R {
CLKSOURCE_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn countflag(&self) -> COUNTFLAG_R {
COUNTFLAG_R::new(((self.bits >> 16) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CSR")
.field("enable", &self.enable())
.field("tickint", &self.tickint())
.field("clksource", &self.clksource())
.field("countflag", &self.countflag())
.finish()
}
}
impl W {
#[inline(always)]
pub fn enable(&mut self) -> ENABLE_W<CSRrs> {
ENABLE_W::new(self, 0)
}
#[inline(always)]
pub fn tickint(&mut self) -> TICKINT_W<CSRrs> {
TICKINT_W::new(self, 1)
}
#[inline(always)]
pub fn clksource(&mut self) -> CLKSOURCE_W<CSRrs> {
CLKSOURCE_W::new(self, 2)
}
#[inline(always)]
pub fn countflag(&mut self) -> COUNTFLAG_W<CSRrs> {
COUNTFLAG_W::new(self, 16)
}
}
pub struct CSRrs;
impl crate::RegisterSpec for CSRrs {
type Ux = u32;
}
impl crate::Readable for CSRrs {}
impl crate::Writable for CSRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CSRrs {}