#[doc = "Register `MR` reader"]
pub struct R(crate::R<MR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<MR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<MR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<MR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `MR` writer"]
pub struct W(crate::W<MR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<MR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<MR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<MR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `TRGEN` reader - Trigger Enable"]
pub type TRGEN_R = crate::BitReader<bool>;
#[doc = "Field `TRGEN` writer - Trigger Enable"]
pub type TRGEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
#[doc = "Field `TRGSEL` reader - Trigger Selection"]
pub type TRGSEL_R = crate::FieldReader<u8, u8>;
#[doc = "Field `TRGSEL` writer - Trigger Selection"]
pub type TRGSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MR_SPEC, u8, u8, 3, O>;
#[doc = "Field `DACEN` reader - DAC Enable"]
pub type DACEN_R = crate::BitReader<bool>;
#[doc = "Field `DACEN` writer - DAC Enable"]
pub type DACEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
#[doc = "Field `WORD` reader - Word Transfer"]
pub type WORD_R = crate::BitReader<bool>;
#[doc = "Field `WORD` writer - Word Transfer"]
pub type WORD_W<'a, const O: u8> = crate::BitWriter<'a, u32, MR_SPEC, bool, O>;
#[doc = "Field `STARTUP` reader - Startup Time Selection"]
pub type STARTUP_R = crate::FieldReader<u8, u8>;
#[doc = "Field `STARTUP` writer - Startup Time Selection"]
pub type STARTUP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MR_SPEC, u8, u8, 8, O>;
#[doc = "Field `CLKDIV` reader - Clock Divider for Internal Trigger"]
pub type CLKDIV_R = crate::FieldReader<u16, u16>;
#[doc = "Field `CLKDIV` writer - Clock Divider for Internal Trigger"]
pub type CLKDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MR_SPEC, u16, u16, 16, O>;
impl R {
#[doc = "Bit 0 - Trigger Enable"]
#[inline(always)]
pub fn trgen(&self) -> TRGEN_R {
TRGEN_R::new((self.bits & 1) != 0)
}
#[doc = "Bits 1:3 - Trigger Selection"]
#[inline(always)]
pub fn trgsel(&self) -> TRGSEL_R {
TRGSEL_R::new(((self.bits >> 1) & 7) as u8)
}
#[doc = "Bit 4 - DAC Enable"]
#[inline(always)]
pub fn dacen(&self) -> DACEN_R {
DACEN_R::new(((self.bits >> 4) & 1) != 0)
}
#[doc = "Bit 5 - Word Transfer"]
#[inline(always)]
pub fn word(&self) -> WORD_R {
WORD_R::new(((self.bits >> 5) & 1) != 0)
}
#[doc = "Bits 8:15 - Startup Time Selection"]
#[inline(always)]
pub fn startup(&self) -> STARTUP_R {
STARTUP_R::new(((self.bits >> 8) & 0xff) as u8)
}
#[doc = "Bits 16:31 - Clock Divider for Internal Trigger"]
#[inline(always)]
pub fn clkdiv(&self) -> CLKDIV_R {
CLKDIV_R::new(((self.bits >> 16) & 0xffff) as u16)
}
}
impl W {
#[doc = "Bit 0 - Trigger Enable"]
#[inline(always)]
#[must_use]
pub fn trgen(&mut self) -> TRGEN_W<0> {
TRGEN_W::new(self)
}
#[doc = "Bits 1:3 - Trigger Selection"]
#[inline(always)]
#[must_use]
pub fn trgsel(&mut self) -> TRGSEL_W<1> {
TRGSEL_W::new(self)
}
#[doc = "Bit 4 - DAC Enable"]
#[inline(always)]
#[must_use]
pub fn dacen(&mut self) -> DACEN_W<4> {
DACEN_W::new(self)
}
#[doc = "Bit 5 - Word Transfer"]
#[inline(always)]
#[must_use]
pub fn word(&mut self) -> WORD_W<5> {
WORD_W::new(self)
}
#[doc = "Bits 8:15 - Startup Time Selection"]
#[inline(always)]
#[must_use]
pub fn startup(&mut self) -> STARTUP_W<8> {
STARTUP_W::new(self)
}
#[doc = "Bits 16:31 - Clock Divider for Internal Trigger"]
#[inline(always)]
#[must_use]
pub fn clkdiv(&mut self) -> CLKDIV_W<16> {
CLKDIV_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Mode Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mr](index.html) module"]
pub struct MR_SPEC;
impl crate::RegisterSpec for MR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [mr::R](R) reader structure"]
impl crate::Readable for MR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [mr::W](W) writer structure"]
impl crate::Writable for MR_SPEC {
type Writer = W;
const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets MR to value 0"]
impl crate::Resettable for MR_SPEC {
const RESET_VALUE: Self::Ux = 0;
}