pub type R = crate::R<ACR1rs>;
pub type W = crate::W<ACR1rs>;
pub type MODE_R = crate::FieldReader;
pub type MODE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type PRTCFG_R = crate::FieldReader;
pub type PRTCFG_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type DS_R = crate::FieldReader;
pub type DS_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type LSBFIRST_R = crate::BitReader;
pub type LSBFIRST_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type CKSTR_R = crate::BitReader;
pub type CKSTR_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SYNCEN_R = crate::FieldReader;
pub type SYNCEN_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type MONO_R = crate::BitReader;
pub type MONO_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type OUTDRIV_R = crate::BitReader;
pub type OUTDRIV_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SAIEN_R = crate::BitReader;
pub type SAIEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type DMAEN_R = crate::BitReader;
pub type DMAEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type NODIV_R = crate::BitReader;
pub type NODIV_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type MCKDIV_R = crate::FieldReader;
pub type MCKDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
pub type OSR_R = crate::BitReader;
pub type OSR_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type MCKEN_R = crate::BitReader;
pub type MCKEN_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn mode(&self) -> MODE_R {
MODE_R::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn prtcfg(&self) -> PRTCFG_R {
PRTCFG_R::new(((self.bits >> 2) & 3) as u8)
}
#[inline(always)]
pub fn ds(&self) -> DS_R {
DS_R::new(((self.bits >> 5) & 7) as u8)
}
#[inline(always)]
pub fn lsbfirst(&self) -> LSBFIRST_R {
LSBFIRST_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn ckstr(&self) -> CKSTR_R {
CKSTR_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn syncen(&self) -> SYNCEN_R {
SYNCEN_R::new(((self.bits >> 10) & 3) as u8)
}
#[inline(always)]
pub fn mono(&self) -> MONO_R {
MONO_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn outdriv(&self) -> OUTDRIV_R {
OUTDRIV_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn saien(&self) -> SAIEN_R {
SAIEN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn dmaen(&self) -> DMAEN_R {
DMAEN_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn nodiv(&self) -> NODIV_R {
NODIV_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn mckdiv(&self) -> MCKDIV_R {
MCKDIV_R::new(((self.bits >> 20) & 0x3f) as u8)
}
#[inline(always)]
pub fn osr(&self) -> OSR_R {
OSR_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn mcken(&self) -> MCKEN_R {
MCKEN_R::new(((self.bits >> 27) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ACR1")
.field("mode", &self.mode())
.field("prtcfg", &self.prtcfg())
.field("ds", &self.ds())
.field("lsbfirst", &self.lsbfirst())
.field("ckstr", &self.ckstr())
.field("syncen", &self.syncen())
.field("mono", &self.mono())
.field("outdriv", &self.outdriv())
.field("saien", &self.saien())
.field("dmaen", &self.dmaen())
.field("nodiv", &self.nodiv())
.field("mckdiv", &self.mckdiv())
.field("osr", &self.osr())
.field("mcken", &self.mcken())
.finish()
}
}
impl W {
#[inline(always)]
pub fn mode(&mut self) -> MODE_W<ACR1rs> {
MODE_W::new(self, 0)
}
#[inline(always)]
pub fn prtcfg(&mut self) -> PRTCFG_W<ACR1rs> {
PRTCFG_W::new(self, 2)
}
#[inline(always)]
pub fn ds(&mut self) -> DS_W<ACR1rs> {
DS_W::new(self, 5)
}
#[inline(always)]
pub fn lsbfirst(&mut self) -> LSBFIRST_W<ACR1rs> {
LSBFIRST_W::new(self, 8)
}
#[inline(always)]
pub fn ckstr(&mut self) -> CKSTR_W<ACR1rs> {
CKSTR_W::new(self, 9)
}
#[inline(always)]
pub fn syncen(&mut self) -> SYNCEN_W<ACR1rs> {
SYNCEN_W::new(self, 10)
}
#[inline(always)]
pub fn mono(&mut self) -> MONO_W<ACR1rs> {
MONO_W::new(self, 12)
}
#[inline(always)]
pub fn outdriv(&mut self) -> OUTDRIV_W<ACR1rs> {
OUTDRIV_W::new(self, 13)
}
#[inline(always)]
pub fn saien(&mut self) -> SAIEN_W<ACR1rs> {
SAIEN_W::new(self, 16)
}
#[inline(always)]
pub fn dmaen(&mut self) -> DMAEN_W<ACR1rs> {
DMAEN_W::new(self, 17)
}
#[inline(always)]
pub fn nodiv(&mut self) -> NODIV_W<ACR1rs> {
NODIV_W::new(self, 19)
}
#[inline(always)]
pub fn mckdiv(&mut self) -> MCKDIV_W<ACR1rs> {
MCKDIV_W::new(self, 20)
}
#[inline(always)]
pub fn osr(&mut self) -> OSR_W<ACR1rs> {
OSR_W::new(self, 26)
}
#[inline(always)]
pub fn mcken(&mut self) -> MCKEN_W<ACR1rs> {
MCKEN_W::new(self, 27)
}
}
pub struct ACR1rs;
impl crate::RegisterSpec for ACR1rs {
type Ux = u32;
}
impl crate::Readable for ACR1rs {}
impl crate::Writable for ACR1rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for ACR1rs {
const RESET_VALUE: u32 = 0x40;
}