pub type R = crate::R<CSRrs>;
pub type W = crate::W<CSRrs>;
pub type FUNC_R = crate::FieldReader;
pub type FUNC_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type PRECISION_R = crate::FieldReader;
pub type PRECISION_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type SCALE_R = crate::FieldReader;
pub type SCALE_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type IEN_R = crate::BitReader;
pub type IEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type DMAREN_R = crate::BitReader;
pub type DMAREN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type DMAWEN_R = crate::BitReader;
pub type DMAWEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type NRES_R = crate::BitReader;
pub type NRES_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type NARGS_R = crate::BitReader;
pub type NARGS_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type RESSIZE_R = crate::BitReader;
pub type RESSIZE_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ARGSIZE_R = crate::BitReader;
pub type ARGSIZE_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type RRDY_R = crate::BitReader;
impl R {
#[inline(always)]
pub fn func(&self) -> FUNC_R {
FUNC_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn precision(&self) -> PRECISION_R {
PRECISION_R::new(((self.bits >> 4) & 0x0f) as u8)
}
#[inline(always)]
pub fn scale(&self) -> SCALE_R {
SCALE_R::new(((self.bits >> 8) & 7) as u8)
}
#[inline(always)]
pub fn ien(&self) -> IEN_R {
IEN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn dmaren(&self) -> DMAREN_R {
DMAREN_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn dmawen(&self) -> DMAWEN_R {
DMAWEN_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn nres(&self) -> NRES_R {
NRES_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn nargs(&self) -> NARGS_R {
NARGS_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn ressize(&self) -> RESSIZE_R {
RESSIZE_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn argsize(&self) -> ARGSIZE_R {
ARGSIZE_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn rrdy(&self) -> RRDY_R {
RRDY_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CSR")
.field("func", &self.func())
.field("precision", &self.precision())
.field("scale", &self.scale())
.field("ien", &self.ien())
.field("dmaren", &self.dmaren())
.field("dmawen", &self.dmawen())
.field("nres", &self.nres())
.field("nargs", &self.nargs())
.field("ressize", &self.ressize())
.field("argsize", &self.argsize())
.field("rrdy", &self.rrdy())
.finish()
}
}
impl W {
#[inline(always)]
pub fn func(&mut self) -> FUNC_W<CSRrs> {
FUNC_W::new(self, 0)
}
#[inline(always)]
pub fn precision(&mut self) -> PRECISION_W<CSRrs> {
PRECISION_W::new(self, 4)
}
#[inline(always)]
pub fn scale(&mut self) -> SCALE_W<CSRrs> {
SCALE_W::new(self, 8)
}
#[inline(always)]
pub fn ien(&mut self) -> IEN_W<CSRrs> {
IEN_W::new(self, 16)
}
#[inline(always)]
pub fn dmaren(&mut self) -> DMAREN_W<CSRrs> {
DMAREN_W::new(self, 17)
}
#[inline(always)]
pub fn dmawen(&mut self) -> DMAWEN_W<CSRrs> {
DMAWEN_W::new(self, 18)
}
#[inline(always)]
pub fn nres(&mut self) -> NRES_W<CSRrs> {
NRES_W::new(self, 19)
}
#[inline(always)]
pub fn nargs(&mut self) -> NARGS_W<CSRrs> {
NARGS_W::new(self, 20)
}
#[inline(always)]
pub fn ressize(&mut self) -> RESSIZE_W<CSRrs> {
RESSIZE_W::new(self, 21)
}
#[inline(always)]
pub fn argsize(&mut self) -> ARGSIZE_W<CSRrs> {
ARGSIZE_W::new(self, 22)
}
}
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 {
const RESET_VALUE: u32 = 0x50;
}