From 0666a6ba1dbd66cf8b93c113e362ccbcd99152a0 Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Sat, 6 Nov 2021 11:50:33 +0100 Subject: Initial commit --- src/tcc0/cc.rs | 103 ++++ src/tcc0/cc_dith4_mode.rs | 139 +++++ src/tcc0/cc_dith5_mode.rs | 139 +++++ src/tcc0/cc_dith6_mode.rs | 139 +++++ src/tcc0/ccbuf.rs | 103 ++++ src/tcc0/ccbuf_dith4_mode.rs | 139 +++++ src/tcc0/ccbuf_dith5_mode.rs | 139 +++++ src/tcc0/ccbuf_dith6_mode.rs | 139 +++++ src/tcc0/count.rs | 102 ++++ src/tcc0/count_dith4_mode.rs | 102 ++++ src/tcc0/count_dith5_mode.rs | 102 ++++ src/tcc0/count_dith6_mode.rs | 102 ++++ src/tcc0/ctrla.rs | 898 +++++++++++++++++++++++++++++ src/tcc0/ctrlbclr.rs | 452 +++++++++++++++ src/tcc0/ctrlbset.rs | 452 +++++++++++++++ src/tcc0/dbgctrl.rs | 158 ++++++ src/tcc0/drvctrl.rs | 1242 +++++++++++++++++++++++++++++++++++++++++ src/tcc0/evctrl.rs | 1193 +++++++++++++++++++++++++++++++++++++++ src/tcc0/fctrla.rs | 929 ++++++++++++++++++++++++++++++ src/tcc0/fctrlb.rs | 929 ++++++++++++++++++++++++++++++ src/tcc0/intenclr.rs | 710 +++++++++++++++++++++++ src/tcc0/intenset.rs | 710 +++++++++++++++++++++++ src/tcc0/intflag.rs | 710 +++++++++++++++++++++++ src/tcc0/patt.rs | 802 ++++++++++++++++++++++++++ src/tcc0/pattbuf.rs | 802 ++++++++++++++++++++++++++ src/tcc0/per.rs | 102 ++++ src/tcc0/per_dith4_mode.rs | 138 +++++ src/tcc0/per_dith5_mode.rs | 138 +++++ src/tcc0/per_dith6_mode.rs | 138 +++++ src/tcc0/perbuf.rs | 102 ++++ src/tcc0/perbuf_dith4_mode.rs | 138 +++++ src/tcc0/perbuf_dith5_mode.rs | 138 +++++ src/tcc0/perbuf_dith6_mode.rs | 138 +++++ src/tcc0/status.rs | 1124 +++++++++++++++++++++++++++++++++++++ src/tcc0/syncbusy.rs | 261 +++++++++ src/tcc0/wave.rs | 925 ++++++++++++++++++++++++++++++ src/tcc0/wexctrl.rs | 358 ++++++++++++ 37 files changed, 15135 insertions(+) create mode 100644 src/tcc0/cc.rs create mode 100644 src/tcc0/cc_dith4_mode.rs create mode 100644 src/tcc0/cc_dith5_mode.rs create mode 100644 src/tcc0/cc_dith6_mode.rs create mode 100644 src/tcc0/ccbuf.rs create mode 100644 src/tcc0/ccbuf_dith4_mode.rs create mode 100644 src/tcc0/ccbuf_dith5_mode.rs create mode 100644 src/tcc0/ccbuf_dith6_mode.rs create mode 100644 src/tcc0/count.rs create mode 100644 src/tcc0/count_dith4_mode.rs create mode 100644 src/tcc0/count_dith5_mode.rs create mode 100644 src/tcc0/count_dith6_mode.rs create mode 100644 src/tcc0/ctrla.rs create mode 100644 src/tcc0/ctrlbclr.rs create mode 100644 src/tcc0/ctrlbset.rs create mode 100644 src/tcc0/dbgctrl.rs create mode 100644 src/tcc0/drvctrl.rs create mode 100644 src/tcc0/evctrl.rs create mode 100644 src/tcc0/fctrla.rs create mode 100644 src/tcc0/fctrlb.rs create mode 100644 src/tcc0/intenclr.rs create mode 100644 src/tcc0/intenset.rs create mode 100644 src/tcc0/intflag.rs create mode 100644 src/tcc0/patt.rs create mode 100644 src/tcc0/pattbuf.rs create mode 100644 src/tcc0/per.rs create mode 100644 src/tcc0/per_dith4_mode.rs create mode 100644 src/tcc0/per_dith5_mode.rs create mode 100644 src/tcc0/per_dith6_mode.rs create mode 100644 src/tcc0/perbuf.rs create mode 100644 src/tcc0/perbuf_dith4_mode.rs create mode 100644 src/tcc0/perbuf_dith5_mode.rs create mode 100644 src/tcc0/perbuf_dith6_mode.rs create mode 100644 src/tcc0/status.rs create mode 100644 src/tcc0/syncbusy.rs create mode 100644 src/tcc0/wave.rs create mode 100644 src/tcc0/wexctrl.rs (limited to 'src/tcc0') diff --git a/src/tcc0/cc.rs b/src/tcc0/cc.rs new file mode 100644 index 0000000..564777f --- /dev/null +++ b/src/tcc0/cc.rs @@ -0,0 +1,103 @@ +#[doc = "Register `CC[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CC[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CC` reader - Channel Compare/Capture Value"] +pub struct CC_R(crate::FieldReader); +impl CC_R { + pub(crate) fn new(bits: u32) -> Self { + CC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC` writer - Channel Compare/Capture Value"] +pub struct CC_W<'a> { + w: &'a mut W, +} +impl<'a> CC_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:23 - Channel Compare/Capture Value"] + #[inline(always)] + pub fn cc(&self) -> CC_R { + CC_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:23 - Channel Compare/Capture Value"] + #[inline(always)] + pub fn cc(&mut self) -> CC_W { + CC_W { w: 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 = "Compare and Capture\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 [cc](index.html) module"] +pub struct CC_SPEC; +impl crate::RegisterSpec for CC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cc::R](R) reader structure"] +impl crate::Readable for CC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cc::W](W) writer structure"] +impl crate::Writable for CC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CC[%s] +to value 0"] +impl crate::Resettable for CC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/cc_dith4_mode.rs b/src/tcc0/cc_dith4_mode.rs new file mode 100644 index 0000000..2b017aa --- /dev/null +++ b/src/tcc0/cc_dith4_mode.rs @@ -0,0 +1,139 @@ +#[doc = "Register `CC_DITH4_MODE[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CC_DITH4_MODE[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DITHER` reader - Dithering Cycle Number"] +pub struct DITHER_R(crate::FieldReader); +impl DITHER_R { + pub(crate) fn new(bits: u8) -> Self { + DITHER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHER` writer - Dithering Cycle Number"] +pub struct DITHER_W<'a> { + w: &'a mut W, +} +impl<'a> DITHER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +#[doc = "Field `CC` reader - Channel Compare/Capture Value"] +pub struct CC_R(crate::FieldReader); +impl CC_R { + pub(crate) fn new(bits: u32) -> Self { + CC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC` writer - Channel Compare/Capture Value"] +pub struct CC_W<'a> { + w: &'a mut W, +} +impl<'a> CC_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x000f_ffff << 4)) | ((value as u32 & 0x000f_ffff) << 4); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&self) -> DITHER_R { + DITHER_R::new((self.bits & 0x0f) as u8) + } + #[doc = "Bits 4:23 - Channel Compare/Capture Value"] + #[inline(always)] + pub fn cc(&self) -> CC_R { + CC_R::new(((self.bits >> 4) & 0x000f_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:3 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&mut self) -> DITHER_W { + DITHER_W { w: self } + } + #[doc = "Bits 4:23 - Channel Compare/Capture Value"] + #[inline(always)] + pub fn cc(&mut self) -> CC_W { + CC_W { w: 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 = "Compare and Capture\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 [cc_dith4_mode](index.html) module"] +pub struct CC_DITH4_MODE_SPEC; +impl crate::RegisterSpec for CC_DITH4_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cc_dith4_mode::R](R) reader structure"] +impl crate::Readable for CC_DITH4_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cc_dith4_mode::W](W) writer structure"] +impl crate::Writable for CC_DITH4_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CC_DITH4_MODE[%s] +to value 0"] +impl crate::Resettable for CC_DITH4_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/cc_dith5_mode.rs b/src/tcc0/cc_dith5_mode.rs new file mode 100644 index 0000000..b766592 --- /dev/null +++ b/src/tcc0/cc_dith5_mode.rs @@ -0,0 +1,139 @@ +#[doc = "Register `CC_DITH5_MODE[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CC_DITH5_MODE[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DITHER` reader - Dithering Cycle Number"] +pub struct DITHER_R(crate::FieldReader); +impl DITHER_R { + pub(crate) fn new(bits: u8) -> Self { + DITHER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHER` writer - Dithering Cycle Number"] +pub struct DITHER_W<'a> { + w: &'a mut W, +} +impl<'a> DITHER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Field `CC` reader - Channel Compare/Capture Value"] +pub struct CC_R(crate::FieldReader); +impl CC_R { + pub(crate) fn new(bits: u32) -> Self { + CC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC` writer - Channel Compare/Capture Value"] +pub struct CC_W<'a> { + w: &'a mut W, +} +impl<'a> CC_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0007_ffff << 5)) | ((value as u32 & 0x0007_ffff) << 5); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&self) -> DITHER_R { + DITHER_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bits 5:23 - Channel Compare/Capture Value"] + #[inline(always)] + pub fn cc(&self) -> CC_R { + CC_R::new(((self.bits >> 5) & 0x0007_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:4 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&mut self) -> DITHER_W { + DITHER_W { w: self } + } + #[doc = "Bits 5:23 - Channel Compare/Capture Value"] + #[inline(always)] + pub fn cc(&mut self) -> CC_W { + CC_W { w: 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 = "Compare and Capture\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 [cc_dith5_mode](index.html) module"] +pub struct CC_DITH5_MODE_SPEC; +impl crate::RegisterSpec for CC_DITH5_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cc_dith5_mode::R](R) reader structure"] +impl crate::Readable for CC_DITH5_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cc_dith5_mode::W](W) writer structure"] +impl crate::Writable for CC_DITH5_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CC_DITH5_MODE[%s] +to value 0"] +impl crate::Resettable for CC_DITH5_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/cc_dith6_mode.rs b/src/tcc0/cc_dith6_mode.rs new file mode 100644 index 0000000..108bcbb --- /dev/null +++ b/src/tcc0/cc_dith6_mode.rs @@ -0,0 +1,139 @@ +#[doc = "Register `CC_DITH6_MODE[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CC_DITH6_MODE[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DITHER` reader - Dithering Cycle Number"] +pub struct DITHER_R(crate::FieldReader); +impl DITHER_R { + pub(crate) fn new(bits: u8) -> Self { + DITHER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHER` writer - Dithering Cycle Number"] +pub struct DITHER_W<'a> { + w: &'a mut W, +} +impl<'a> DITHER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); + self.w + } +} +#[doc = "Field `CC` reader - Channel Compare/Capture Value"] +pub struct CC_R(crate::FieldReader); +impl CC_R { + pub(crate) fn new(bits: u32) -> Self { + CC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC` writer - Channel Compare/Capture Value"] +pub struct CC_W<'a> { + w: &'a mut W, +} +impl<'a> CC_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0003_ffff << 6)) | ((value as u32 & 0x0003_ffff) << 6); + self.w + } +} +impl R { + #[doc = "Bits 0:5 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&self) -> DITHER_R { + DITHER_R::new((self.bits & 0x3f) as u8) + } + #[doc = "Bits 6:23 - Channel Compare/Capture Value"] + #[inline(always)] + pub fn cc(&self) -> CC_R { + CC_R::new(((self.bits >> 6) & 0x0003_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:5 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&mut self) -> DITHER_W { + DITHER_W { w: self } + } + #[doc = "Bits 6:23 - Channel Compare/Capture Value"] + #[inline(always)] + pub fn cc(&mut self) -> CC_W { + CC_W { w: 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 = "Compare and Capture\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 [cc_dith6_mode](index.html) module"] +pub struct CC_DITH6_MODE_SPEC; +impl crate::RegisterSpec for CC_DITH6_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cc_dith6_mode::R](R) reader structure"] +impl crate::Readable for CC_DITH6_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cc_dith6_mode::W](W) writer structure"] +impl crate::Writable for CC_DITH6_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CC_DITH6_MODE[%s] +to value 0"] +impl crate::Resettable for CC_DITH6_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/ccbuf.rs b/src/tcc0/ccbuf.rs new file mode 100644 index 0000000..aeade05 --- /dev/null +++ b/src/tcc0/ccbuf.rs @@ -0,0 +1,103 @@ +#[doc = "Register `CCBUF[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CCBUF[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CCBUF` reader - Channel Compare/Capture Buffer Value"] +pub struct CCBUF_R(crate::FieldReader); +impl CCBUF_R { + pub(crate) fn new(bits: u32) -> Self { + CCBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CCBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCBUF` writer - Channel Compare/Capture Buffer Value"] +pub struct CCBUF_W<'a> { + w: &'a mut W, +} +impl<'a> CCBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:23 - Channel Compare/Capture Buffer Value"] + #[inline(always)] + pub fn ccbuf(&self) -> CCBUF_R { + CCBUF_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:23 - Channel Compare/Capture Buffer Value"] + #[inline(always)] + pub fn ccbuf(&mut self) -> CCBUF_W { + CCBUF_W { w: 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 = "Compare and Capture Buffer\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 [ccbuf](index.html) module"] +pub struct CCBUF_SPEC; +impl crate::RegisterSpec for CCBUF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ccbuf::R](R) reader structure"] +impl crate::Readable for CCBUF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ccbuf::W](W) writer structure"] +impl crate::Writable for CCBUF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CCBUF[%s] +to value 0"] +impl crate::Resettable for CCBUF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/ccbuf_dith4_mode.rs b/src/tcc0/ccbuf_dith4_mode.rs new file mode 100644 index 0000000..17ef2f9 --- /dev/null +++ b/src/tcc0/ccbuf_dith4_mode.rs @@ -0,0 +1,139 @@ +#[doc = "Register `CCBUF_DITH4_MODE[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CCBUF_DITH4_MODE[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CCBUF` reader - Channel Compare/Capture Buffer Value"] +pub struct CCBUF_R(crate::FieldReader); +impl CCBUF_R { + pub(crate) fn new(bits: u8) -> Self { + CCBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CCBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCBUF` writer - Channel Compare/Capture Buffer Value"] +pub struct CCBUF_W<'a> { + w: &'a mut W, +} +impl<'a> CCBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +#[doc = "Field `DITHERBUF` reader - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_R(crate::FieldReader); +impl DITHERBUF_R { + pub(crate) fn new(bits: u32) -> Self { + DITHERBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHERBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHERBUF` writer - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_W<'a> { + w: &'a mut W, +} +impl<'a> DITHERBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x000f_ffff << 4)) | ((value as u32 & 0x000f_ffff) << 4); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Channel Compare/Capture Buffer Value"] + #[inline(always)] + pub fn ccbuf(&self) -> CCBUF_R { + CCBUF_R::new((self.bits & 0x0f) as u8) + } + #[doc = "Bits 4:23 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&self) -> DITHERBUF_R { + DITHERBUF_R::new(((self.bits >> 4) & 0x000f_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:3 - Channel Compare/Capture Buffer Value"] + #[inline(always)] + pub fn ccbuf(&mut self) -> CCBUF_W { + CCBUF_W { w: self } + } + #[doc = "Bits 4:23 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&mut self) -> DITHERBUF_W { + DITHERBUF_W { w: 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 = "Compare and Capture Buffer\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 [ccbuf_dith4_mode](index.html) module"] +pub struct CCBUF_DITH4_MODE_SPEC; +impl crate::RegisterSpec for CCBUF_DITH4_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ccbuf_dith4_mode::R](R) reader structure"] +impl crate::Readable for CCBUF_DITH4_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ccbuf_dith4_mode::W](W) writer structure"] +impl crate::Writable for CCBUF_DITH4_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CCBUF_DITH4_MODE[%s] +to value 0"] +impl crate::Resettable for CCBUF_DITH4_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/ccbuf_dith5_mode.rs b/src/tcc0/ccbuf_dith5_mode.rs new file mode 100644 index 0000000..6bc31ed --- /dev/null +++ b/src/tcc0/ccbuf_dith5_mode.rs @@ -0,0 +1,139 @@ +#[doc = "Register `CCBUF_DITH5_MODE[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CCBUF_DITH5_MODE[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DITHERBUF` reader - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_R(crate::FieldReader); +impl DITHERBUF_R { + pub(crate) fn new(bits: u8) -> Self { + DITHERBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHERBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHERBUF` writer - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_W<'a> { + w: &'a mut W, +} +impl<'a> DITHERBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Field `CCBUF` reader - Channel Compare/Capture Buffer Value"] +pub struct CCBUF_R(crate::FieldReader); +impl CCBUF_R { + pub(crate) fn new(bits: u32) -> Self { + CCBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CCBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCBUF` writer - Channel Compare/Capture Buffer Value"] +pub struct CCBUF_W<'a> { + w: &'a mut W, +} +impl<'a> CCBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0007_ffff << 5)) | ((value as u32 & 0x0007_ffff) << 5); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&self) -> DITHERBUF_R { + DITHERBUF_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bits 5:23 - Channel Compare/Capture Buffer Value"] + #[inline(always)] + pub fn ccbuf(&self) -> CCBUF_R { + CCBUF_R::new(((self.bits >> 5) & 0x0007_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:4 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&mut self) -> DITHERBUF_W { + DITHERBUF_W { w: self } + } + #[doc = "Bits 5:23 - Channel Compare/Capture Buffer Value"] + #[inline(always)] + pub fn ccbuf(&mut self) -> CCBUF_W { + CCBUF_W { w: 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 = "Compare and Capture Buffer\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 [ccbuf_dith5_mode](index.html) module"] +pub struct CCBUF_DITH5_MODE_SPEC; +impl crate::RegisterSpec for CCBUF_DITH5_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ccbuf_dith5_mode::R](R) reader structure"] +impl crate::Readable for CCBUF_DITH5_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ccbuf_dith5_mode::W](W) writer structure"] +impl crate::Writable for CCBUF_DITH5_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CCBUF_DITH5_MODE[%s] +to value 0"] +impl crate::Resettable for CCBUF_DITH5_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/ccbuf_dith6_mode.rs b/src/tcc0/ccbuf_dith6_mode.rs new file mode 100644 index 0000000..e5fcff0 --- /dev/null +++ b/src/tcc0/ccbuf_dith6_mode.rs @@ -0,0 +1,139 @@ +#[doc = "Register `CCBUF_DITH6_MODE[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CCBUF_DITH6_MODE[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DITHERBUF` reader - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_R(crate::FieldReader); +impl DITHERBUF_R { + pub(crate) fn new(bits: u8) -> Self { + DITHERBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHERBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHERBUF` writer - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_W<'a> { + w: &'a mut W, +} +impl<'a> DITHERBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); + self.w + } +} +#[doc = "Field `CCBUF` reader - Channel Compare/Capture Buffer Value"] +pub struct CCBUF_R(crate::FieldReader); +impl CCBUF_R { + pub(crate) fn new(bits: u32) -> Self { + CCBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CCBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCBUF` writer - Channel Compare/Capture Buffer Value"] +pub struct CCBUF_W<'a> { + w: &'a mut W, +} +impl<'a> CCBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0003_ffff << 6)) | ((value as u32 & 0x0003_ffff) << 6); + self.w + } +} +impl R { + #[doc = "Bits 0:5 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&self) -> DITHERBUF_R { + DITHERBUF_R::new((self.bits & 0x3f) as u8) + } + #[doc = "Bits 6:23 - Channel Compare/Capture Buffer Value"] + #[inline(always)] + pub fn ccbuf(&self) -> CCBUF_R { + CCBUF_R::new(((self.bits >> 6) & 0x0003_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:5 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&mut self) -> DITHERBUF_W { + DITHERBUF_W { w: self } + } + #[doc = "Bits 6:23 - Channel Compare/Capture Buffer Value"] + #[inline(always)] + pub fn ccbuf(&mut self) -> CCBUF_W { + CCBUF_W { w: 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 = "Compare and Capture Buffer\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 [ccbuf_dith6_mode](index.html) module"] +pub struct CCBUF_DITH6_MODE_SPEC; +impl crate::RegisterSpec for CCBUF_DITH6_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ccbuf_dith6_mode::R](R) reader structure"] +impl crate::Readable for CCBUF_DITH6_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ccbuf_dith6_mode::W](W) writer structure"] +impl crate::Writable for CCBUF_DITH6_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CCBUF_DITH6_MODE[%s] +to value 0"] +impl crate::Resettable for CCBUF_DITH6_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/count.rs b/src/tcc0/count.rs new file mode 100644 index 0000000..45fccfe --- /dev/null +++ b/src/tcc0/count.rs @@ -0,0 +1,102 @@ +#[doc = "Register `COUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `COUNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `COUNT` reader - Counter Value"] +pub struct COUNT_R(crate::FieldReader); +impl COUNT_R { + pub(crate) fn new(bits: u32) -> Self { + COUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for COUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COUNT` writer - Counter Value"] +pub struct COUNT_W<'a> { + w: &'a mut W, +} +impl<'a> COUNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:23 - Counter Value"] + #[inline(always)] + pub fn count(&self) -> COUNT_R { + COUNT_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:23 - Counter Value"] + #[inline(always)] + pub fn count(&mut self) -> COUNT_W { + COUNT_W { w: 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 = "Count\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 [count](index.html) module"] +pub struct COUNT_SPEC; +impl crate::RegisterSpec for COUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [count::R](R) reader structure"] +impl crate::Readable for COUNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [count::W](W) writer structure"] +impl crate::Writable for COUNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets COUNT to value 0"] +impl crate::Resettable for COUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/count_dith4_mode.rs b/src/tcc0/count_dith4_mode.rs new file mode 100644 index 0000000..0c890ad --- /dev/null +++ b/src/tcc0/count_dith4_mode.rs @@ -0,0 +1,102 @@ +#[doc = "Register `COUNT_DITH4_MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `COUNT_DITH4_MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `COUNT` reader - Counter Value"] +pub struct COUNT_R(crate::FieldReader); +impl COUNT_R { + pub(crate) fn new(bits: u32) -> Self { + COUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for COUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COUNT` writer - Counter Value"] +pub struct COUNT_W<'a> { + w: &'a mut W, +} +impl<'a> COUNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x000f_ffff << 4)) | ((value as u32 & 0x000f_ffff) << 4); + self.w + } +} +impl R { + #[doc = "Bits 4:23 - Counter Value"] + #[inline(always)] + pub fn count(&self) -> COUNT_R { + COUNT_R::new(((self.bits >> 4) & 0x000f_ffff) as u32) + } +} +impl W { + #[doc = "Bits 4:23 - Counter Value"] + #[inline(always)] + pub fn count(&mut self) -> COUNT_W { + COUNT_W { w: 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 = "Count\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 [count_dith4_mode](index.html) module"] +pub struct COUNT_DITH4_MODE_SPEC; +impl crate::RegisterSpec for COUNT_DITH4_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [count_dith4_mode::R](R) reader structure"] +impl crate::Readable for COUNT_DITH4_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [count_dith4_mode::W](W) writer structure"] +impl crate::Writable for COUNT_DITH4_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets COUNT_DITH4_MODE to value 0"] +impl crate::Resettable for COUNT_DITH4_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/count_dith5_mode.rs b/src/tcc0/count_dith5_mode.rs new file mode 100644 index 0000000..9b13b46 --- /dev/null +++ b/src/tcc0/count_dith5_mode.rs @@ -0,0 +1,102 @@ +#[doc = "Register `COUNT_DITH5_MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `COUNT_DITH5_MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `COUNT` reader - Counter Value"] +pub struct COUNT_R(crate::FieldReader); +impl COUNT_R { + pub(crate) fn new(bits: u32) -> Self { + COUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for COUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COUNT` writer - Counter Value"] +pub struct COUNT_W<'a> { + w: &'a mut W, +} +impl<'a> COUNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0007_ffff << 5)) | ((value as u32 & 0x0007_ffff) << 5); + self.w + } +} +impl R { + #[doc = "Bits 5:23 - Counter Value"] + #[inline(always)] + pub fn count(&self) -> COUNT_R { + COUNT_R::new(((self.bits >> 5) & 0x0007_ffff) as u32) + } +} +impl W { + #[doc = "Bits 5:23 - Counter Value"] + #[inline(always)] + pub fn count(&mut self) -> COUNT_W { + COUNT_W { w: 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 = "Count\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 [count_dith5_mode](index.html) module"] +pub struct COUNT_DITH5_MODE_SPEC; +impl crate::RegisterSpec for COUNT_DITH5_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [count_dith5_mode::R](R) reader structure"] +impl crate::Readable for COUNT_DITH5_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [count_dith5_mode::W](W) writer structure"] +impl crate::Writable for COUNT_DITH5_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets COUNT_DITH5_MODE to value 0"] +impl crate::Resettable for COUNT_DITH5_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/count_dith6_mode.rs b/src/tcc0/count_dith6_mode.rs new file mode 100644 index 0000000..f8a0e5b --- /dev/null +++ b/src/tcc0/count_dith6_mode.rs @@ -0,0 +1,102 @@ +#[doc = "Register `COUNT_DITH6_MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `COUNT_DITH6_MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `COUNT` reader - Counter Value"] +pub struct COUNT_R(crate::FieldReader); +impl COUNT_R { + pub(crate) fn new(bits: u32) -> Self { + COUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for COUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COUNT` writer - Counter Value"] +pub struct COUNT_W<'a> { + w: &'a mut W, +} +impl<'a> COUNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0003_ffff << 6)) | ((value as u32 & 0x0003_ffff) << 6); + self.w + } +} +impl R { + #[doc = "Bits 6:23 - Counter Value"] + #[inline(always)] + pub fn count(&self) -> COUNT_R { + COUNT_R::new(((self.bits >> 6) & 0x0003_ffff) as u32) + } +} +impl W { + #[doc = "Bits 6:23 - Counter Value"] + #[inline(always)] + pub fn count(&mut self) -> COUNT_W { + COUNT_W { w: 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 = "Count\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 [count_dith6_mode](index.html) module"] +pub struct COUNT_DITH6_MODE_SPEC; +impl crate::RegisterSpec for COUNT_DITH6_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [count_dith6_mode::R](R) reader structure"] +impl crate::Readable for COUNT_DITH6_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [count_dith6_mode::W](W) writer structure"] +impl crate::Writable for COUNT_DITH6_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets COUNT_DITH6_MODE to value 0"] +impl crate::Resettable for COUNT_DITH6_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/ctrla.rs b/src/tcc0/ctrla.rs new file mode 100644 index 0000000..7f67d6f --- /dev/null +++ b/src/tcc0/ctrla.rs @@ -0,0 +1,898 @@ +#[doc = "Register `CTRLA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CTRLA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SWRST` reader - Software Reset"] +pub struct SWRST_R(crate::FieldReader); +impl SWRST_R { + pub(crate) fn new(bits: bool) -> Self { + SWRST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SWRST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SWRST` writer - Software Reset"] +pub struct SWRST_W<'a> { + w: &'a mut W, +} +impl<'a> SWRST_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Field `ENABLE` reader - Enable"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enhanced Resolution\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum RESOLUTION_A { + #[doc = "0: Dithering is disabled"] + NONE = 0, + #[doc = "1: Dithering is done every 16 PWM frames"] + DITH4 = 1, + #[doc = "2: Dithering is done every 32 PWM frames"] + DITH5 = 2, + #[doc = "3: Dithering is done every 64 PWM frames"] + DITH6 = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: RESOLUTION_A) -> Self { + variant as _ + } +} +#[doc = "Field `RESOLUTION` reader - Enhanced Resolution"] +pub struct RESOLUTION_R(crate::FieldReader); +impl RESOLUTION_R { + pub(crate) fn new(bits: u8) -> Self { + RESOLUTION_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RESOLUTION_A { + match self.bits { + 0 => RESOLUTION_A::NONE, + 1 => RESOLUTION_A::DITH4, + 2 => RESOLUTION_A::DITH5, + 3 => RESOLUTION_A::DITH6, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `NONE`"] + #[inline(always)] + pub fn is_none(&self) -> bool { + **self == RESOLUTION_A::NONE + } + #[doc = "Checks if the value of the field is `DITH4`"] + #[inline(always)] + pub fn is_dith4(&self) -> bool { + **self == RESOLUTION_A::DITH4 + } + #[doc = "Checks if the value of the field is `DITH5`"] + #[inline(always)] + pub fn is_dith5(&self) -> bool { + **self == RESOLUTION_A::DITH5 + } + #[doc = "Checks if the value of the field is `DITH6`"] + #[inline(always)] + pub fn is_dith6(&self) -> bool { + **self == RESOLUTION_A::DITH6 + } +} +impl core::ops::Deref for RESOLUTION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RESOLUTION` writer - Enhanced Resolution"] +pub struct RESOLUTION_W<'a> { + w: &'a mut W, +} +impl<'a> RESOLUTION_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RESOLUTION_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Dithering is disabled"] + #[inline(always)] + pub fn none(self) -> &'a mut W { + self.variant(RESOLUTION_A::NONE) + } + #[doc = "Dithering is done every 16 PWM frames"] + #[inline(always)] + pub fn dith4(self) -> &'a mut W { + self.variant(RESOLUTION_A::DITH4) + } + #[doc = "Dithering is done every 32 PWM frames"] + #[inline(always)] + pub fn dith5(self) -> &'a mut W { + self.variant(RESOLUTION_A::DITH5) + } + #[doc = "Dithering is done every 64 PWM frames"] + #[inline(always)] + pub fn dith6(self) -> &'a mut W { + self.variant(RESOLUTION_A::DITH6) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 5)) | ((value as u32 & 0x03) << 5); + self.w + } +} +#[doc = "Prescaler\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum PRESCALER_A { + #[doc = "0: No division"] + DIV1 = 0, + #[doc = "1: Divide by 2"] + DIV2 = 1, + #[doc = "2: Divide by 4"] + DIV4 = 2, + #[doc = "3: Divide by 8"] + DIV8 = 3, + #[doc = "4: Divide by 16"] + DIV16 = 4, + #[doc = "5: Divide by 64"] + DIV64 = 5, + #[doc = "6: Divide by 256"] + DIV256 = 6, + #[doc = "7: Divide by 1024"] + DIV1024 = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: PRESCALER_A) -> Self { + variant as _ + } +} +#[doc = "Field `PRESCALER` reader - Prescaler"] +pub struct PRESCALER_R(crate::FieldReader); +impl PRESCALER_R { + pub(crate) fn new(bits: u8) -> Self { + PRESCALER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRESCALER_A { + match self.bits { + 0 => PRESCALER_A::DIV1, + 1 => PRESCALER_A::DIV2, + 2 => PRESCALER_A::DIV4, + 3 => PRESCALER_A::DIV8, + 4 => PRESCALER_A::DIV16, + 5 => PRESCALER_A::DIV64, + 6 => PRESCALER_A::DIV256, + 7 => PRESCALER_A::DIV1024, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `DIV1`"] + #[inline(always)] + pub fn is_div1(&self) -> bool { + **self == PRESCALER_A::DIV1 + } + #[doc = "Checks if the value of the field is `DIV2`"] + #[inline(always)] + pub fn is_div2(&self) -> bool { + **self == PRESCALER_A::DIV2 + } + #[doc = "Checks if the value of the field is `DIV4`"] + #[inline(always)] + pub fn is_div4(&self) -> bool { + **self == PRESCALER_A::DIV4 + } + #[doc = "Checks if the value of the field is `DIV8`"] + #[inline(always)] + pub fn is_div8(&self) -> bool { + **self == PRESCALER_A::DIV8 + } + #[doc = "Checks if the value of the field is `DIV16`"] + #[inline(always)] + pub fn is_div16(&self) -> bool { + **self == PRESCALER_A::DIV16 + } + #[doc = "Checks if the value of the field is `DIV64`"] + #[inline(always)] + pub fn is_div64(&self) -> bool { + **self == PRESCALER_A::DIV64 + } + #[doc = "Checks if the value of the field is `DIV256`"] + #[inline(always)] + pub fn is_div256(&self) -> bool { + **self == PRESCALER_A::DIV256 + } + #[doc = "Checks if the value of the field is `DIV1024`"] + #[inline(always)] + pub fn is_div1024(&self) -> bool { + **self == PRESCALER_A::DIV1024 + } +} +impl core::ops::Deref for PRESCALER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRESCALER` writer - Prescaler"] +pub struct PRESCALER_W<'a> { + w: &'a mut W, +} +impl<'a> PRESCALER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRESCALER_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "No division"] + #[inline(always)] + pub fn div1(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV1) + } + #[doc = "Divide by 2"] + #[inline(always)] + pub fn div2(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV2) + } + #[doc = "Divide by 4"] + #[inline(always)] + pub fn div4(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV4) + } + #[doc = "Divide by 8"] + #[inline(always)] + pub fn div8(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV8) + } + #[doc = "Divide by 16"] + #[inline(always)] + pub fn div16(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV16) + } + #[doc = "Divide by 64"] + #[inline(always)] + pub fn div64(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV64) + } + #[doc = "Divide by 256"] + #[inline(always)] + pub fn div256(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV256) + } + #[doc = "Divide by 1024"] + #[inline(always)] + pub fn div1024(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV1024) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); + self.w + } +} +#[doc = "Field `RUNSTDBY` reader - Run in Standby"] +pub struct RUNSTDBY_R(crate::FieldReader); +impl RUNSTDBY_R { + pub(crate) fn new(bits: bool) -> Self { + RUNSTDBY_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RUNSTDBY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RUNSTDBY` writer - Run in Standby"] +pub struct RUNSTDBY_W<'a> { + w: &'a mut W, +} +impl<'a> RUNSTDBY_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Prescaler and Counter Synchronization Selection\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum PRESCSYNC_A { + #[doc = "0: Reload or reset counter on next GCLK"] + GCLK = 0, + #[doc = "1: Reload or reset counter on next prescaler clock"] + PRESC = 1, + #[doc = "2: Reload or reset counter on next GCLK and reset prescaler counter"] + RESYNC = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: PRESCSYNC_A) -> Self { + variant as _ + } +} +#[doc = "Field `PRESCSYNC` reader - Prescaler and Counter Synchronization Selection"] +pub struct PRESCSYNC_R(crate::FieldReader); +impl PRESCSYNC_R { + pub(crate) fn new(bits: u8) -> Self { + PRESCSYNC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(PRESCSYNC_A::GCLK), + 1 => Some(PRESCSYNC_A::PRESC), + 2 => Some(PRESCSYNC_A::RESYNC), + _ => None, + } + } + #[doc = "Checks if the value of the field is `GCLK`"] + #[inline(always)] + pub fn is_gclk(&self) -> bool { + **self == PRESCSYNC_A::GCLK + } + #[doc = "Checks if the value of the field is `PRESC`"] + #[inline(always)] + pub fn is_presc(&self) -> bool { + **self == PRESCSYNC_A::PRESC + } + #[doc = "Checks if the value of the field is `RESYNC`"] + #[inline(always)] + pub fn is_resync(&self) -> bool { + **self == PRESCSYNC_A::RESYNC + } +} +impl core::ops::Deref for PRESCSYNC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRESCSYNC` writer - Prescaler and Counter Synchronization Selection"] +pub struct PRESCSYNC_W<'a> { + w: &'a mut W, +} +impl<'a> PRESCSYNC_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRESCSYNC_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Reload or reset counter on next GCLK"] + #[inline(always)] + pub fn gclk(self) -> &'a mut W { + self.variant(PRESCSYNC_A::GCLK) + } + #[doc = "Reload or reset counter on next prescaler clock"] + #[inline(always)] + pub fn presc(self) -> &'a mut W { + self.variant(PRESCSYNC_A::PRESC) + } + #[doc = "Reload or reset counter on next GCLK and reset prescaler counter"] + #[inline(always)] + pub fn resync(self) -> &'a mut W { + self.variant(PRESCSYNC_A::RESYNC) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12); + self.w + } +} +#[doc = "Field `ALOCK` reader - Auto Lock"] +pub struct ALOCK_R(crate::FieldReader); +impl ALOCK_R { + pub(crate) fn new(bits: bool) -> Self { + ALOCK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ALOCK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ALOCK` writer - Auto Lock"] +pub struct ALOCK_W<'a> { + w: &'a mut W, +} +impl<'a> ALOCK_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Field `MSYNC` reader - Master Synchronization (only for TCC Slave Instance)"] +pub struct MSYNC_R(crate::FieldReader); +impl MSYNC_R { + pub(crate) fn new(bits: bool) -> Self { + MSYNC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MSYNC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MSYNC` writer - Master Synchronization (only for TCC Slave Instance)"] +pub struct MSYNC_W<'a> { + w: &'a mut W, +} +impl<'a> MSYNC_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Field `DMAOS` reader - DMA One-shot Trigger Mode"] +pub struct DMAOS_R(crate::FieldReader); +impl DMAOS_R { + pub(crate) fn new(bits: bool) -> Self { + DMAOS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DMAOS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DMAOS` writer - DMA One-shot Trigger Mode"] +pub struct DMAOS_W<'a> { + w: &'a mut W, +} +impl<'a> DMAOS_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Field `CPTEN0` reader - Capture Channel 0 Enable"] +pub struct CPTEN0_R(crate::FieldReader); +impl CPTEN0_R { + pub(crate) fn new(bits: bool) -> Self { + CPTEN0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CPTEN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CPTEN0` writer - Capture Channel 0 Enable"] +pub struct CPTEN0_W<'a> { + w: &'a mut W, +} +impl<'a> CPTEN0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Field `CPTEN1` reader - Capture Channel 1 Enable"] +pub struct CPTEN1_R(crate::FieldReader); +impl CPTEN1_R { + pub(crate) fn new(bits: bool) -> Self { + CPTEN1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CPTEN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CPTEN1` writer - Capture Channel 1 Enable"] +pub struct CPTEN1_W<'a> { + w: &'a mut W, +} +impl<'a> CPTEN1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Field `CPTEN2` reader - Capture Channel 2 Enable"] +pub struct CPTEN2_R(crate::FieldReader); +impl CPTEN2_R { + pub(crate) fn new(bits: bool) -> Self { + CPTEN2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CPTEN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CPTEN2` writer - Capture Channel 2 Enable"] +pub struct CPTEN2_W<'a> { + w: &'a mut W, +} +impl<'a> CPTEN2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Field `CPTEN3` reader - Capture Channel 3 Enable"] +pub struct CPTEN3_R(crate::FieldReader); +impl CPTEN3_R { + pub(crate) fn new(bits: bool) -> Self { + CPTEN3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CPTEN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CPTEN3` writer - Capture Channel 3 Enable"] +pub struct CPTEN3_W<'a> { + w: &'a mut W, +} +impl<'a> CPTEN3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bit 0 - Software Reset"] + #[inline(always)] + pub fn swrst(&self) -> SWRST_R { + SWRST_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bits 5:6 - Enhanced Resolution"] + #[inline(always)] + pub fn resolution(&self) -> RESOLUTION_R { + RESOLUTION_R::new(((self.bits >> 5) & 0x03) as u8) + } + #[doc = "Bits 8:10 - Prescaler"] + #[inline(always)] + pub fn prescaler(&self) -> PRESCALER_R { + PRESCALER_R::new(((self.bits >> 8) & 0x07) as u8) + } + #[doc = "Bit 11 - Run in Standby"] + #[inline(always)] + pub fn runstdby(&self) -> RUNSTDBY_R { + RUNSTDBY_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bits 12:13 - Prescaler and Counter Synchronization Selection"] + #[inline(always)] + pub fn prescsync(&self) -> PRESCSYNC_R { + PRESCSYNC_R::new(((self.bits >> 12) & 0x03) as u8) + } + #[doc = "Bit 14 - Auto Lock"] + #[inline(always)] + pub fn alock(&self) -> ALOCK_R { + ALOCK_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Master Synchronization (only for TCC Slave Instance)"] + #[inline(always)] + pub fn msync(&self) -> MSYNC_R { + MSYNC_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 23 - DMA One-shot Trigger Mode"] + #[inline(always)] + pub fn dmaos(&self) -> DMAOS_R { + DMAOS_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Capture Channel 0 Enable"] + #[inline(always)] + pub fn cpten0(&self) -> CPTEN0_R { + CPTEN0_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Capture Channel 1 Enable"] + #[inline(always)] + pub fn cpten1(&self) -> CPTEN1_R { + CPTEN1_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Capture Channel 2 Enable"] + #[inline(always)] + pub fn cpten2(&self) -> CPTEN2_R { + CPTEN2_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Capture Channel 3 Enable"] + #[inline(always)] + pub fn cpten3(&self) -> CPTEN3_R { + CPTEN3_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Software Reset"] + #[inline(always)] + pub fn swrst(&mut self) -> SWRST_W { + SWRST_W { w: self } + } + #[doc = "Bit 1 - Enable"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Bits 5:6 - Enhanced Resolution"] + #[inline(always)] + pub fn resolution(&mut self) -> RESOLUTION_W { + RESOLUTION_W { w: self } + } + #[doc = "Bits 8:10 - Prescaler"] + #[inline(always)] + pub fn prescaler(&mut self) -> PRESCALER_W { + PRESCALER_W { w: self } + } + #[doc = "Bit 11 - Run in Standby"] + #[inline(always)] + pub fn runstdby(&mut self) -> RUNSTDBY_W { + RUNSTDBY_W { w: self } + } + #[doc = "Bits 12:13 - Prescaler and Counter Synchronization Selection"] + #[inline(always)] + pub fn prescsync(&mut self) -> PRESCSYNC_W { + PRESCSYNC_W { w: self } + } + #[doc = "Bit 14 - Auto Lock"] + #[inline(always)] + pub fn alock(&mut self) -> ALOCK_W { + ALOCK_W { w: self } + } + #[doc = "Bit 15 - Master Synchronization (only for TCC Slave Instance)"] + #[inline(always)] + pub fn msync(&mut self) -> MSYNC_W { + MSYNC_W { w: self } + } + #[doc = "Bit 23 - DMA One-shot Trigger Mode"] + #[inline(always)] + pub fn dmaos(&mut self) -> DMAOS_W { + DMAOS_W { w: self } + } + #[doc = "Bit 24 - Capture Channel 0 Enable"] + #[inline(always)] + pub fn cpten0(&mut self) -> CPTEN0_W { + CPTEN0_W { w: self } + } + #[doc = "Bit 25 - Capture Channel 1 Enable"] + #[inline(always)] + pub fn cpten1(&mut self) -> CPTEN1_W { + CPTEN1_W { w: self } + } + #[doc = "Bit 26 - Capture Channel 2 Enable"] + #[inline(always)] + pub fn cpten2(&mut self) -> CPTEN2_W { + CPTEN2_W { w: self } + } + #[doc = "Bit 27 - Capture Channel 3 Enable"] + #[inline(always)] + pub fn cpten3(&mut self) -> CPTEN3_W { + CPTEN3_W { w: 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 = "Control A\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 [ctrla](index.html) module"] +pub struct CTRLA_SPEC; +impl crate::RegisterSpec for CTRLA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ctrla::R](R) reader structure"] +impl crate::Readable for CTRLA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ctrla::W](W) writer structure"] +impl crate::Writable for CTRLA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTRLA to value 0"] +impl crate::Resettable for CTRLA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/ctrlbclr.rs b/src/tcc0/ctrlbclr.rs new file mode 100644 index 0000000..ffd87e7 --- /dev/null +++ b/src/tcc0/ctrlbclr.rs @@ -0,0 +1,452 @@ +#[doc = "Register `CTRLBCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CTRLBCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DIR` reader - Counter Direction"] +pub struct DIR_R(crate::FieldReader); +impl DIR_R { + pub(crate) fn new(bits: bool) -> Self { + DIR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DIR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DIR` writer - Counter Direction"] +pub struct DIR_W<'a> { + w: &'a mut W, +} +impl<'a> DIR_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u8 & 0x01); + self.w + } +} +#[doc = "Field `LUPD` reader - Lock Update"] +pub struct LUPD_R(crate::FieldReader); +impl LUPD_R { + pub(crate) fn new(bits: bool) -> Self { + LUPD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LUPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LUPD` writer - Lock Update"] +pub struct LUPD_W<'a> { + w: &'a mut W, +} +impl<'a> LUPD_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u8 & 0x01) << 1); + self.w + } +} +#[doc = "Field `ONESHOT` reader - One-Shot"] +pub struct ONESHOT_R(crate::FieldReader); +impl ONESHOT_R { + pub(crate) fn new(bits: bool) -> Self { + ONESHOT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ONESHOT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ONESHOT` writer - One-Shot"] +pub struct ONESHOT_W<'a> { + w: &'a mut W, +} +impl<'a> ONESHOT_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u8 & 0x01) << 2); + self.w + } +} +#[doc = "Ramp Index Command\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum IDXCMD_A { + #[doc = "0: Command disabled: Index toggles between cycles A and B"] + DISABLE = 0, + #[doc = "1: Set index: cycle B will be forced in the next cycle"] + SET = 1, + #[doc = "2: Clear index: cycle A will be forced in the next cycle"] + CLEAR = 2, + #[doc = "3: Hold index: the next cycle will be the same as the current cycle"] + HOLD = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: IDXCMD_A) -> Self { + variant as _ + } +} +#[doc = "Field `IDXCMD` reader - Ramp Index Command"] +pub struct IDXCMD_R(crate::FieldReader); +impl IDXCMD_R { + pub(crate) fn new(bits: u8) -> Self { + IDXCMD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IDXCMD_A { + match self.bits { + 0 => IDXCMD_A::DISABLE, + 1 => IDXCMD_A::SET, + 2 => IDXCMD_A::CLEAR, + 3 => IDXCMD_A::HOLD, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == IDXCMD_A::DISABLE + } + #[doc = "Checks if the value of the field is `SET`"] + #[inline(always)] + pub fn is_set(&self) -> bool { + **self == IDXCMD_A::SET + } + #[doc = "Checks if the value of the field is `CLEAR`"] + #[inline(always)] + pub fn is_clear(&self) -> bool { + **self == IDXCMD_A::CLEAR + } + #[doc = "Checks if the value of the field is `HOLD`"] + #[inline(always)] + pub fn is_hold(&self) -> bool { + **self == IDXCMD_A::HOLD + } +} +impl core::ops::Deref for IDXCMD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IDXCMD` writer - Ramp Index Command"] +pub struct IDXCMD_W<'a> { + w: &'a mut W, +} +impl<'a> IDXCMD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IDXCMD_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Command disabled: Index toggles between cycles A and B"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(IDXCMD_A::DISABLE) + } + #[doc = "Set index: cycle B will be forced in the next cycle"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(IDXCMD_A::SET) + } + #[doc = "Clear index: cycle A will be forced in the next cycle"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(IDXCMD_A::CLEAR) + } + #[doc = "Hold index: the next cycle will be the same as the current cycle"] + #[inline(always)] + pub fn hold(self) -> &'a mut W { + self.variant(IDXCMD_A::HOLD) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 3)) | ((value as u8 & 0x03) << 3); + self.w + } +} +#[doc = "TCC Command\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum CMD_A { + #[doc = "0: No action"] + NONE = 0, + #[doc = "1: Clear start, restart or retrigger"] + RETRIGGER = 1, + #[doc = "2: Force stop"] + STOP = 2, + #[doc = "3: Force update or double buffered registers"] + UPDATE = 3, + #[doc = "4: Force COUNT read synchronization"] + READSYNC = 4, + #[doc = "5: One-shot DMA trigger"] + DMAOS = 5, +} +impl From for u8 { + #[inline(always)] + fn from(variant: CMD_A) -> Self { + variant as _ + } +} +#[doc = "Field `CMD` reader - TCC Command"] +pub struct CMD_R(crate::FieldReader); +impl CMD_R { + pub(crate) fn new(bits: u8) -> Self { + CMD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(CMD_A::NONE), + 1 => Some(CMD_A::RETRIGGER), + 2 => Some(CMD_A::STOP), + 3 => Some(CMD_A::UPDATE), + 4 => Some(CMD_A::READSYNC), + 5 => Some(CMD_A::DMAOS), + _ => None, + } + } + #[doc = "Checks if the value of the field is `NONE`"] + #[inline(always)] + pub fn is_none(&self) -> bool { + **self == CMD_A::NONE + } + #[doc = "Checks if the value of the field is `RETRIGGER`"] + #[inline(always)] + pub fn is_retrigger(&self) -> bool { + **self == CMD_A::RETRIGGER + } + #[doc = "Checks if the value of the field is `STOP`"] + #[inline(always)] + pub fn is_stop(&self) -> bool { + **self == CMD_A::STOP + } + #[doc = "Checks if the value of the field is `UPDATE`"] + #[inline(always)] + pub fn is_update(&self) -> bool { + **self == CMD_A::UPDATE + } + #[doc = "Checks if the value of the field is `READSYNC`"] + #[inline(always)] + pub fn is_readsync(&self) -> bool { + **self == CMD_A::READSYNC + } + #[doc = "Checks if the value of the field is `DMAOS`"] + #[inline(always)] + pub fn is_dmaos(&self) -> bool { + **self == CMD_A::DMAOS + } +} +impl core::ops::Deref for CMD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMD` writer - TCC Command"] +pub struct CMD_W<'a> { + w: &'a mut W, +} +impl<'a> CMD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CMD_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "No action"] + #[inline(always)] + pub fn none(self) -> &'a mut W { + self.variant(CMD_A::NONE) + } + #[doc = "Clear start, restart or retrigger"] + #[inline(always)] + pub fn retrigger(self) -> &'a mut W { + self.variant(CMD_A::RETRIGGER) + } + #[doc = "Force stop"] + #[inline(always)] + pub fn stop(self) -> &'a mut W { + self.variant(CMD_A::STOP) + } + #[doc = "Force update or double buffered registers"] + #[inline(always)] + pub fn update(self) -> &'a mut W { + self.variant(CMD_A::UPDATE) + } + #[doc = "Force COUNT read synchronization"] + #[inline(always)] + pub fn readsync(self) -> &'a mut W { + self.variant(CMD_A::READSYNC) + } + #[doc = "One-shot DMA trigger"] + #[inline(always)] + pub fn dmaos(self) -> &'a mut W { + self.variant(CMD_A::DMAOS) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 5)) | ((value as u8 & 0x07) << 5); + self.w + } +} +impl R { + #[doc = "Bit 0 - Counter Direction"] + #[inline(always)] + pub fn dir(&self) -> DIR_R { + DIR_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Lock Update"] + #[inline(always)] + pub fn lupd(&self) -> LUPD_R { + LUPD_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - One-Shot"] + #[inline(always)] + pub fn oneshot(&self) -> ONESHOT_R { + ONESHOT_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bits 3:4 - Ramp Index Command"] + #[inline(always)] + pub fn idxcmd(&self) -> IDXCMD_R { + IDXCMD_R::new(((self.bits >> 3) & 0x03) as u8) + } + #[doc = "Bits 5:7 - TCC Command"] + #[inline(always)] + pub fn cmd(&self) -> CMD_R { + CMD_R::new(((self.bits >> 5) & 0x07) as u8) + } +} +impl W { + #[doc = "Bit 0 - Counter Direction"] + #[inline(always)] + pub fn dir(&mut self) -> DIR_W { + DIR_W { w: self } + } + #[doc = "Bit 1 - Lock Update"] + #[inline(always)] + pub fn lupd(&mut self) -> LUPD_W { + LUPD_W { w: self } + } + #[doc = "Bit 2 - One-Shot"] + #[inline(always)] + pub fn oneshot(&mut self) -> ONESHOT_W { + ONESHOT_W { w: self } + } + #[doc = "Bits 3:4 - Ramp Index Command"] + #[inline(always)] + pub fn idxcmd(&mut self) -> IDXCMD_W { + IDXCMD_W { w: self } + } + #[doc = "Bits 5:7 - TCC Command"] + #[inline(always)] + pub fn cmd(&mut self) -> CMD_W { + CMD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Control B Clear\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 [ctrlbclr](index.html) module"] +pub struct CTRLBCLR_SPEC; +impl crate::RegisterSpec for CTRLBCLR_SPEC { + type Ux = u8; +} +#[doc = "`read()` method returns [ctrlbclr::R](R) reader structure"] +impl crate::Readable for CTRLBCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ctrlbclr::W](W) writer structure"] +impl crate::Writable for CTRLBCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTRLBCLR to value 0"] +impl crate::Resettable for CTRLBCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/ctrlbset.rs b/src/tcc0/ctrlbset.rs new file mode 100644 index 0000000..837fb37 --- /dev/null +++ b/src/tcc0/ctrlbset.rs @@ -0,0 +1,452 @@ +#[doc = "Register `CTRLBSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CTRLBSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DIR` reader - Counter Direction"] +pub struct DIR_R(crate::FieldReader); +impl DIR_R { + pub(crate) fn new(bits: bool) -> Self { + DIR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DIR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DIR` writer - Counter Direction"] +pub struct DIR_W<'a> { + w: &'a mut W, +} +impl<'a> DIR_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u8 & 0x01); + self.w + } +} +#[doc = "Field `LUPD` reader - Lock Update"] +pub struct LUPD_R(crate::FieldReader); +impl LUPD_R { + pub(crate) fn new(bits: bool) -> Self { + LUPD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LUPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LUPD` writer - Lock Update"] +pub struct LUPD_W<'a> { + w: &'a mut W, +} +impl<'a> LUPD_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u8 & 0x01) << 1); + self.w + } +} +#[doc = "Field `ONESHOT` reader - One-Shot"] +pub struct ONESHOT_R(crate::FieldReader); +impl ONESHOT_R { + pub(crate) fn new(bits: bool) -> Self { + ONESHOT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ONESHOT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ONESHOT` writer - One-Shot"] +pub struct ONESHOT_W<'a> { + w: &'a mut W, +} +impl<'a> ONESHOT_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u8 & 0x01) << 2); + self.w + } +} +#[doc = "Ramp Index Command\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum IDXCMD_A { + #[doc = "0: Command disabled: Index toggles between cycles A and B"] + DISABLE = 0, + #[doc = "1: Set index: cycle B will be forced in the next cycle"] + SET = 1, + #[doc = "2: Clear index: cycle A will be forced in the next cycle"] + CLEAR = 2, + #[doc = "3: Hold index: the next cycle will be the same as the current cycle"] + HOLD = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: IDXCMD_A) -> Self { + variant as _ + } +} +#[doc = "Field `IDXCMD` reader - Ramp Index Command"] +pub struct IDXCMD_R(crate::FieldReader); +impl IDXCMD_R { + pub(crate) fn new(bits: u8) -> Self { + IDXCMD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IDXCMD_A { + match self.bits { + 0 => IDXCMD_A::DISABLE, + 1 => IDXCMD_A::SET, + 2 => IDXCMD_A::CLEAR, + 3 => IDXCMD_A::HOLD, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == IDXCMD_A::DISABLE + } + #[doc = "Checks if the value of the field is `SET`"] + #[inline(always)] + pub fn is_set(&self) -> bool { + **self == IDXCMD_A::SET + } + #[doc = "Checks if the value of the field is `CLEAR`"] + #[inline(always)] + pub fn is_clear(&self) -> bool { + **self == IDXCMD_A::CLEAR + } + #[doc = "Checks if the value of the field is `HOLD`"] + #[inline(always)] + pub fn is_hold(&self) -> bool { + **self == IDXCMD_A::HOLD + } +} +impl core::ops::Deref for IDXCMD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IDXCMD` writer - Ramp Index Command"] +pub struct IDXCMD_W<'a> { + w: &'a mut W, +} +impl<'a> IDXCMD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IDXCMD_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Command disabled: Index toggles between cycles A and B"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(IDXCMD_A::DISABLE) + } + #[doc = "Set index: cycle B will be forced in the next cycle"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(IDXCMD_A::SET) + } + #[doc = "Clear index: cycle A will be forced in the next cycle"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(IDXCMD_A::CLEAR) + } + #[doc = "Hold index: the next cycle will be the same as the current cycle"] + #[inline(always)] + pub fn hold(self) -> &'a mut W { + self.variant(IDXCMD_A::HOLD) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 3)) | ((value as u8 & 0x03) << 3); + self.w + } +} +#[doc = "TCC Command\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum CMD_A { + #[doc = "0: No action"] + NONE = 0, + #[doc = "1: Clear start, restart or retrigger"] + RETRIGGER = 1, + #[doc = "2: Force stop"] + STOP = 2, + #[doc = "3: Force update or double buffered registers"] + UPDATE = 3, + #[doc = "4: Force COUNT read synchronization"] + READSYNC = 4, + #[doc = "5: One-shot DMA trigger"] + DMAOS = 5, +} +impl From for u8 { + #[inline(always)] + fn from(variant: CMD_A) -> Self { + variant as _ + } +} +#[doc = "Field `CMD` reader - TCC Command"] +pub struct CMD_R(crate::FieldReader); +impl CMD_R { + pub(crate) fn new(bits: u8) -> Self { + CMD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(CMD_A::NONE), + 1 => Some(CMD_A::RETRIGGER), + 2 => Some(CMD_A::STOP), + 3 => Some(CMD_A::UPDATE), + 4 => Some(CMD_A::READSYNC), + 5 => Some(CMD_A::DMAOS), + _ => None, + } + } + #[doc = "Checks if the value of the field is `NONE`"] + #[inline(always)] + pub fn is_none(&self) -> bool { + **self == CMD_A::NONE + } + #[doc = "Checks if the value of the field is `RETRIGGER`"] + #[inline(always)] + pub fn is_retrigger(&self) -> bool { + **self == CMD_A::RETRIGGER + } + #[doc = "Checks if the value of the field is `STOP`"] + #[inline(always)] + pub fn is_stop(&self) -> bool { + **self == CMD_A::STOP + } + #[doc = "Checks if the value of the field is `UPDATE`"] + #[inline(always)] + pub fn is_update(&self) -> bool { + **self == CMD_A::UPDATE + } + #[doc = "Checks if the value of the field is `READSYNC`"] + #[inline(always)] + pub fn is_readsync(&self) -> bool { + **self == CMD_A::READSYNC + } + #[doc = "Checks if the value of the field is `DMAOS`"] + #[inline(always)] + pub fn is_dmaos(&self) -> bool { + **self == CMD_A::DMAOS + } +} +impl core::ops::Deref for CMD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMD` writer - TCC Command"] +pub struct CMD_W<'a> { + w: &'a mut W, +} +impl<'a> CMD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CMD_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "No action"] + #[inline(always)] + pub fn none(self) -> &'a mut W { + self.variant(CMD_A::NONE) + } + #[doc = "Clear start, restart or retrigger"] + #[inline(always)] + pub fn retrigger(self) -> &'a mut W { + self.variant(CMD_A::RETRIGGER) + } + #[doc = "Force stop"] + #[inline(always)] + pub fn stop(self) -> &'a mut W { + self.variant(CMD_A::STOP) + } + #[doc = "Force update or double buffered registers"] + #[inline(always)] + pub fn update(self) -> &'a mut W { + self.variant(CMD_A::UPDATE) + } + #[doc = "Force COUNT read synchronization"] + #[inline(always)] + pub fn readsync(self) -> &'a mut W { + self.variant(CMD_A::READSYNC) + } + #[doc = "One-shot DMA trigger"] + #[inline(always)] + pub fn dmaos(self) -> &'a mut W { + self.variant(CMD_A::DMAOS) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 5)) | ((value as u8 & 0x07) << 5); + self.w + } +} +impl R { + #[doc = "Bit 0 - Counter Direction"] + #[inline(always)] + pub fn dir(&self) -> DIR_R { + DIR_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Lock Update"] + #[inline(always)] + pub fn lupd(&self) -> LUPD_R { + LUPD_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - One-Shot"] + #[inline(always)] + pub fn oneshot(&self) -> ONESHOT_R { + ONESHOT_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bits 3:4 - Ramp Index Command"] + #[inline(always)] + pub fn idxcmd(&self) -> IDXCMD_R { + IDXCMD_R::new(((self.bits >> 3) & 0x03) as u8) + } + #[doc = "Bits 5:7 - TCC Command"] + #[inline(always)] + pub fn cmd(&self) -> CMD_R { + CMD_R::new(((self.bits >> 5) & 0x07) as u8) + } +} +impl W { + #[doc = "Bit 0 - Counter Direction"] + #[inline(always)] + pub fn dir(&mut self) -> DIR_W { + DIR_W { w: self } + } + #[doc = "Bit 1 - Lock Update"] + #[inline(always)] + pub fn lupd(&mut self) -> LUPD_W { + LUPD_W { w: self } + } + #[doc = "Bit 2 - One-Shot"] + #[inline(always)] + pub fn oneshot(&mut self) -> ONESHOT_W { + ONESHOT_W { w: self } + } + #[doc = "Bits 3:4 - Ramp Index Command"] + #[inline(always)] + pub fn idxcmd(&mut self) -> IDXCMD_W { + IDXCMD_W { w: self } + } + #[doc = "Bits 5:7 - TCC Command"] + #[inline(always)] + pub fn cmd(&mut self) -> CMD_W { + CMD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Control B Set\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 [ctrlbset](index.html) module"] +pub struct CTRLBSET_SPEC; +impl crate::RegisterSpec for CTRLBSET_SPEC { + type Ux = u8; +} +#[doc = "`read()` method returns [ctrlbset::R](R) reader structure"] +impl crate::Readable for CTRLBSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ctrlbset::W](W) writer structure"] +impl crate::Writable for CTRLBSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTRLBSET to value 0"] +impl crate::Resettable for CTRLBSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/dbgctrl.rs b/src/tcc0/dbgctrl.rs new file mode 100644 index 0000000..46b0c3f --- /dev/null +++ b/src/tcc0/dbgctrl.rs @@ -0,0 +1,158 @@ +#[doc = "Register `DBGCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DBGCTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DBGRUN` reader - Debug Running Mode"] +pub struct DBGRUN_R(crate::FieldReader); +impl DBGRUN_R { + pub(crate) fn new(bits: bool) -> Self { + DBGRUN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DBGRUN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DBGRUN` writer - Debug Running Mode"] +pub struct DBGRUN_W<'a> { + w: &'a mut W, +} +impl<'a> DBGRUN_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u8 & 0x01); + self.w + } +} +#[doc = "Field `FDDBD` reader - Fault Detection on Debug Break Detection"] +pub struct FDDBD_R(crate::FieldReader); +impl FDDBD_R { + pub(crate) fn new(bits: bool) -> Self { + FDDBD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FDDBD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FDDBD` writer - Fault Detection on Debug Break Detection"] +pub struct FDDBD_W<'a> { + w: &'a mut W, +} +impl<'a> FDDBD_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u8 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Debug Running Mode"] + #[inline(always)] + pub fn dbgrun(&self) -> DBGRUN_R { + DBGRUN_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 2 - Fault Detection on Debug Break Detection"] + #[inline(always)] + pub fn fddbd(&self) -> FDDBD_R { + FDDBD_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Debug Running Mode"] + #[inline(always)] + pub fn dbgrun(&mut self) -> DBGRUN_W { + DBGRUN_W { w: self } + } + #[doc = "Bit 2 - Fault Detection on Debug Break Detection"] + #[inline(always)] + pub fn fddbd(&mut self) -> FDDBD_W { + FDDBD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Debug Control\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 [dbgctrl](index.html) module"] +pub struct DBGCTRL_SPEC; +impl crate::RegisterSpec for DBGCTRL_SPEC { + type Ux = u8; +} +#[doc = "`read()` method returns [dbgctrl::R](R) reader structure"] +impl crate::Readable for DBGCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dbgctrl::W](W) writer structure"] +impl crate::Writable for DBGCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DBGCTRL to value 0"] +impl crate::Resettable for DBGCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/drvctrl.rs b/src/tcc0/drvctrl.rs new file mode 100644 index 0000000..ef37abb --- /dev/null +++ b/src/tcc0/drvctrl.rs @@ -0,0 +1,1242 @@ +#[doc = "Register `DRVCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DRVCTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `NRE0` reader - Non-Recoverable State 0 Output Enable"] +pub struct NRE0_R(crate::FieldReader); +impl NRE0_R { + pub(crate) fn new(bits: bool) -> Self { + NRE0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRE0` writer - Non-Recoverable State 0 Output Enable"] +pub struct NRE0_W<'a> { + w: &'a mut W, +} +impl<'a> NRE0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Field `NRE1` reader - Non-Recoverable State 1 Output Enable"] +pub struct NRE1_R(crate::FieldReader); +impl NRE1_R { + pub(crate) fn new(bits: bool) -> Self { + NRE1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRE1` writer - Non-Recoverable State 1 Output Enable"] +pub struct NRE1_W<'a> { + w: &'a mut W, +} +impl<'a> NRE1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Field `NRE2` reader - Non-Recoverable State 2 Output Enable"] +pub struct NRE2_R(crate::FieldReader); +impl NRE2_R { + pub(crate) fn new(bits: bool) -> Self { + NRE2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRE2` writer - Non-Recoverable State 2 Output Enable"] +pub struct NRE2_W<'a> { + w: &'a mut W, +} +impl<'a> NRE2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Field `NRE3` reader - Non-Recoverable State 3 Output Enable"] +pub struct NRE3_R(crate::FieldReader); +impl NRE3_R { + pub(crate) fn new(bits: bool) -> Self { + NRE3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRE3` writer - Non-Recoverable State 3 Output Enable"] +pub struct NRE3_W<'a> { + w: &'a mut W, +} +impl<'a> NRE3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Field `NRE4` reader - Non-Recoverable State 4 Output Enable"] +pub struct NRE4_R(crate::FieldReader); +impl NRE4_R { + pub(crate) fn new(bits: bool) -> Self { + NRE4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRE4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRE4` writer - Non-Recoverable State 4 Output Enable"] +pub struct NRE4_W<'a> { + w: &'a mut W, +} +impl<'a> NRE4_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Field `NRE5` reader - Non-Recoverable State 5 Output Enable"] +pub struct NRE5_R(crate::FieldReader); +impl NRE5_R { + pub(crate) fn new(bits: bool) -> Self { + NRE5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRE5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRE5` writer - Non-Recoverable State 5 Output Enable"] +pub struct NRE5_W<'a> { + w: &'a mut W, +} +impl<'a> NRE5_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Field `NRE6` reader - Non-Recoverable State 6 Output Enable"] +pub struct NRE6_R(crate::FieldReader); +impl NRE6_R { + pub(crate) fn new(bits: bool) -> Self { + NRE6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRE6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRE6` writer - Non-Recoverable State 6 Output Enable"] +pub struct NRE6_W<'a> { + w: &'a mut W, +} +impl<'a> NRE6_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Field `NRE7` reader - Non-Recoverable State 7 Output Enable"] +pub struct NRE7_R(crate::FieldReader); +impl NRE7_R { + pub(crate) fn new(bits: bool) -> Self { + NRE7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRE7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRE7` writer - Non-Recoverable State 7 Output Enable"] +pub struct NRE7_W<'a> { + w: &'a mut W, +} +impl<'a> NRE7_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Field `NRV0` reader - Non-Recoverable State 0 Output Value"] +pub struct NRV0_R(crate::FieldReader); +impl NRV0_R { + pub(crate) fn new(bits: bool) -> Self { + NRV0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRV0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRV0` writer - Non-Recoverable State 0 Output Value"] +pub struct NRV0_W<'a> { + w: &'a mut W, +} +impl<'a> NRV0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Field `NRV1` reader - Non-Recoverable State 1 Output Value"] +pub struct NRV1_R(crate::FieldReader); +impl NRV1_R { + pub(crate) fn new(bits: bool) -> Self { + NRV1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRV1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRV1` writer - Non-Recoverable State 1 Output Value"] +pub struct NRV1_W<'a> { + w: &'a mut W, +} +impl<'a> NRV1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Field `NRV2` reader - Non-Recoverable State 2 Output Value"] +pub struct NRV2_R(crate::FieldReader); +impl NRV2_R { + pub(crate) fn new(bits: bool) -> Self { + NRV2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRV2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRV2` writer - Non-Recoverable State 2 Output Value"] +pub struct NRV2_W<'a> { + w: &'a mut W, +} +impl<'a> NRV2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Field `NRV3` reader - Non-Recoverable State 3 Output Value"] +pub struct NRV3_R(crate::FieldReader); +impl NRV3_R { + pub(crate) fn new(bits: bool) -> Self { + NRV3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRV3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRV3` writer - Non-Recoverable State 3 Output Value"] +pub struct NRV3_W<'a> { + w: &'a mut W, +} +impl<'a> NRV3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Field `NRV4` reader - Non-Recoverable State 4 Output Value"] +pub struct NRV4_R(crate::FieldReader); +impl NRV4_R { + pub(crate) fn new(bits: bool) -> Self { + NRV4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRV4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRV4` writer - Non-Recoverable State 4 Output Value"] +pub struct NRV4_W<'a> { + w: &'a mut W, +} +impl<'a> NRV4_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Field `NRV5` reader - Non-Recoverable State 5 Output Value"] +pub struct NRV5_R(crate::FieldReader); +impl NRV5_R { + pub(crate) fn new(bits: bool) -> Self { + NRV5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRV5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRV5` writer - Non-Recoverable State 5 Output Value"] +pub struct NRV5_W<'a> { + w: &'a mut W, +} +impl<'a> NRV5_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Field `NRV6` reader - Non-Recoverable State 6 Output Value"] +pub struct NRV6_R(crate::FieldReader); +impl NRV6_R { + pub(crate) fn new(bits: bool) -> Self { + NRV6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRV6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRV6` writer - Non-Recoverable State 6 Output Value"] +pub struct NRV6_W<'a> { + w: &'a mut W, +} +impl<'a> NRV6_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Field `NRV7` reader - Non-Recoverable State 7 Output Value"] +pub struct NRV7_R(crate::FieldReader); +impl NRV7_R { + pub(crate) fn new(bits: bool) -> Self { + NRV7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRV7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRV7` writer - Non-Recoverable State 7 Output Value"] +pub struct NRV7_W<'a> { + w: &'a mut W, +} +impl<'a> NRV7_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Field `INVEN0` reader - Output Waveform 0 Inversion"] +pub struct INVEN0_R(crate::FieldReader); +impl INVEN0_R { + pub(crate) fn new(bits: bool) -> Self { + INVEN0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INVEN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INVEN0` writer - Output Waveform 0 Inversion"] +pub struct INVEN0_W<'a> { + w: &'a mut W, +} +impl<'a> INVEN0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Field `INVEN1` reader - Output Waveform 1 Inversion"] +pub struct INVEN1_R(crate::FieldReader); +impl INVEN1_R { + pub(crate) fn new(bits: bool) -> Self { + INVEN1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INVEN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INVEN1` writer - Output Waveform 1 Inversion"] +pub struct INVEN1_W<'a> { + w: &'a mut W, +} +impl<'a> INVEN1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Field `INVEN2` reader - Output Waveform 2 Inversion"] +pub struct INVEN2_R(crate::FieldReader); +impl INVEN2_R { + pub(crate) fn new(bits: bool) -> Self { + INVEN2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INVEN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INVEN2` writer - Output Waveform 2 Inversion"] +pub struct INVEN2_W<'a> { + w: &'a mut W, +} +impl<'a> INVEN2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Field `INVEN3` reader - Output Waveform 3 Inversion"] +pub struct INVEN3_R(crate::FieldReader); +impl INVEN3_R { + pub(crate) fn new(bits: bool) -> Self { + INVEN3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INVEN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INVEN3` writer - Output Waveform 3 Inversion"] +pub struct INVEN3_W<'a> { + w: &'a mut W, +} +impl<'a> INVEN3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Field `INVEN4` reader - Output Waveform 4 Inversion"] +pub struct INVEN4_R(crate::FieldReader); +impl INVEN4_R { + pub(crate) fn new(bits: bool) -> Self { + INVEN4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INVEN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INVEN4` writer - Output Waveform 4 Inversion"] +pub struct INVEN4_W<'a> { + w: &'a mut W, +} +impl<'a> INVEN4_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Field `INVEN5` reader - Output Waveform 5 Inversion"] +pub struct INVEN5_R(crate::FieldReader); +impl INVEN5_R { + pub(crate) fn new(bits: bool) -> Self { + INVEN5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INVEN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INVEN5` writer - Output Waveform 5 Inversion"] +pub struct INVEN5_W<'a> { + w: &'a mut W, +} +impl<'a> INVEN5_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Field `INVEN6` reader - Output Waveform 6 Inversion"] +pub struct INVEN6_R(crate::FieldReader); +impl INVEN6_R { + pub(crate) fn new(bits: bool) -> Self { + INVEN6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INVEN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INVEN6` writer - Output Waveform 6 Inversion"] +pub struct INVEN6_W<'a> { + w: &'a mut W, +} +impl<'a> INVEN6_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Field `INVEN7` reader - Output Waveform 7 Inversion"] +pub struct INVEN7_R(crate::FieldReader); +impl INVEN7_R { + pub(crate) fn new(bits: bool) -> Self { + INVEN7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INVEN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INVEN7` writer - Output Waveform 7 Inversion"] +pub struct INVEN7_W<'a> { + w: &'a mut W, +} +impl<'a> INVEN7_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Field `FILTERVAL0` reader - Non-Recoverable Fault Input 0 Filter Value"] +pub struct FILTERVAL0_R(crate::FieldReader); +impl FILTERVAL0_R { + pub(crate) fn new(bits: u8) -> Self { + FILTERVAL0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FILTERVAL0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FILTERVAL0` writer - Non-Recoverable Fault Input 0 Filter Value"] +pub struct FILTERVAL0_W<'a> { + w: &'a mut W, +} +impl<'a> FILTERVAL0_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); + self.w + } +} +#[doc = "Field `FILTERVAL1` reader - Non-Recoverable Fault Input 1 Filter Value"] +pub struct FILTERVAL1_R(crate::FieldReader); +impl FILTERVAL1_R { + pub(crate) fn new(bits: u8) -> Self { + FILTERVAL1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FILTERVAL1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FILTERVAL1` writer - Non-Recoverable Fault Input 1 Filter Value"] +pub struct FILTERVAL1_W<'a> { + w: &'a mut W, +} +impl<'a> FILTERVAL1_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0f << 28)) | ((value as u32 & 0x0f) << 28); + self.w + } +} +impl R { + #[doc = "Bit 0 - Non-Recoverable State 0 Output Enable"] + #[inline(always)] + pub fn nre0(&self) -> NRE0_R { + NRE0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Non-Recoverable State 1 Output Enable"] + #[inline(always)] + pub fn nre1(&self) -> NRE1_R { + NRE1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Non-Recoverable State 2 Output Enable"] + #[inline(always)] + pub fn nre2(&self) -> NRE2_R { + NRE2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Non-Recoverable State 3 Output Enable"] + #[inline(always)] + pub fn nre3(&self) -> NRE3_R { + NRE3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Non-Recoverable State 4 Output Enable"] + #[inline(always)] + pub fn nre4(&self) -> NRE4_R { + NRE4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Non-Recoverable State 5 Output Enable"] + #[inline(always)] + pub fn nre5(&self) -> NRE5_R { + NRE5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Non-Recoverable State 6 Output Enable"] + #[inline(always)] + pub fn nre6(&self) -> NRE6_R { + NRE6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Non-Recoverable State 7 Output Enable"] + #[inline(always)] + pub fn nre7(&self) -> NRE7_R { + NRE7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Non-Recoverable State 0 Output Value"] + #[inline(always)] + pub fn nrv0(&self) -> NRV0_R { + NRV0_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Non-Recoverable State 1 Output Value"] + #[inline(always)] + pub fn nrv1(&self) -> NRV1_R { + NRV1_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Non-Recoverable State 2 Output Value"] + #[inline(always)] + pub fn nrv2(&self) -> NRV2_R { + NRV2_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Non-Recoverable State 3 Output Value"] + #[inline(always)] + pub fn nrv3(&self) -> NRV3_R { + NRV3_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Non-Recoverable State 4 Output Value"] + #[inline(always)] + pub fn nrv4(&self) -> NRV4_R { + NRV4_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Non-Recoverable State 5 Output Value"] + #[inline(always)] + pub fn nrv5(&self) -> NRV5_R { + NRV5_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Non-Recoverable State 6 Output Value"] + #[inline(always)] + pub fn nrv6(&self) -> NRV6_R { + NRV6_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Non-Recoverable State 7 Output Value"] + #[inline(always)] + pub fn nrv7(&self) -> NRV7_R { + NRV7_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Output Waveform 0 Inversion"] + #[inline(always)] + pub fn inven0(&self) -> INVEN0_R { + INVEN0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Output Waveform 1 Inversion"] + #[inline(always)] + pub fn inven1(&self) -> INVEN1_R { + INVEN1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Output Waveform 2 Inversion"] + #[inline(always)] + pub fn inven2(&self) -> INVEN2_R { + INVEN2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Output Waveform 3 Inversion"] + #[inline(always)] + pub fn inven3(&self) -> INVEN3_R { + INVEN3_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Output Waveform 4 Inversion"] + #[inline(always)] + pub fn inven4(&self) -> INVEN4_R { + INVEN4_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Output Waveform 5 Inversion"] + #[inline(always)] + pub fn inven5(&self) -> INVEN5_R { + INVEN5_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Output Waveform 6 Inversion"] + #[inline(always)] + pub fn inven6(&self) -> INVEN6_R { + INVEN6_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Output Waveform 7 Inversion"] + #[inline(always)] + pub fn inven7(&self) -> INVEN7_R { + INVEN7_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bits 24:27 - Non-Recoverable Fault Input 0 Filter Value"] + #[inline(always)] + pub fn filterval0(&self) -> FILTERVAL0_R { + FILTERVAL0_R::new(((self.bits >> 24) & 0x0f) as u8) + } + #[doc = "Bits 28:31 - Non-Recoverable Fault Input 1 Filter Value"] + #[inline(always)] + pub fn filterval1(&self) -> FILTERVAL1_R { + FILTERVAL1_R::new(((self.bits >> 28) & 0x0f) as u8) + } +} +impl W { + #[doc = "Bit 0 - Non-Recoverable State 0 Output Enable"] + #[inline(always)] + pub fn nre0(&mut self) -> NRE0_W { + NRE0_W { w: self } + } + #[doc = "Bit 1 - Non-Recoverable State 1 Output Enable"] + #[inline(always)] + pub fn nre1(&mut self) -> NRE1_W { + NRE1_W { w: self } + } + #[doc = "Bit 2 - Non-Recoverable State 2 Output Enable"] + #[inline(always)] + pub fn nre2(&mut self) -> NRE2_W { + NRE2_W { w: self } + } + #[doc = "Bit 3 - Non-Recoverable State 3 Output Enable"] + #[inline(always)] + pub fn nre3(&mut self) -> NRE3_W { + NRE3_W { w: self } + } + #[doc = "Bit 4 - Non-Recoverable State 4 Output Enable"] + #[inline(always)] + pub fn nre4(&mut self) -> NRE4_W { + NRE4_W { w: self } + } + #[doc = "Bit 5 - Non-Recoverable State 5 Output Enable"] + #[inline(always)] + pub fn nre5(&mut self) -> NRE5_W { + NRE5_W { w: self } + } + #[doc = "Bit 6 - Non-Recoverable State 6 Output Enable"] + #[inline(always)] + pub fn nre6(&mut self) -> NRE6_W { + NRE6_W { w: self } + } + #[doc = "Bit 7 - Non-Recoverable State 7 Output Enable"] + #[inline(always)] + pub fn nre7(&mut self) -> NRE7_W { + NRE7_W { w: self } + } + #[doc = "Bit 8 - Non-Recoverable State 0 Output Value"] + #[inline(always)] + pub fn nrv0(&mut self) -> NRV0_W { + NRV0_W { w: self } + } + #[doc = "Bit 9 - Non-Recoverable State 1 Output Value"] + #[inline(always)] + pub fn nrv1(&mut self) -> NRV1_W { + NRV1_W { w: self } + } + #[doc = "Bit 10 - Non-Recoverable State 2 Output Value"] + #[inline(always)] + pub fn nrv2(&mut self) -> NRV2_W { + NRV2_W { w: self } + } + #[doc = "Bit 11 - Non-Recoverable State 3 Output Value"] + #[inline(always)] + pub fn nrv3(&mut self) -> NRV3_W { + NRV3_W { w: self } + } + #[doc = "Bit 12 - Non-Recoverable State 4 Output Value"] + #[inline(always)] + pub fn nrv4(&mut self) -> NRV4_W { + NRV4_W { w: self } + } + #[doc = "Bit 13 - Non-Recoverable State 5 Output Value"] + #[inline(always)] + pub fn nrv5(&mut self) -> NRV5_W { + NRV5_W { w: self } + } + #[doc = "Bit 14 - Non-Recoverable State 6 Output Value"] + #[inline(always)] + pub fn nrv6(&mut self) -> NRV6_W { + NRV6_W { w: self } + } + #[doc = "Bit 15 - Non-Recoverable State 7 Output Value"] + #[inline(always)] + pub fn nrv7(&mut self) -> NRV7_W { + NRV7_W { w: self } + } + #[doc = "Bit 16 - Output Waveform 0 Inversion"] + #[inline(always)] + pub fn inven0(&mut self) -> INVEN0_W { + INVEN0_W { w: self } + } + #[doc = "Bit 17 - Output Waveform 1 Inversion"] + #[inline(always)] + pub fn inven1(&mut self) -> INVEN1_W { + INVEN1_W { w: self } + } + #[doc = "Bit 18 - Output Waveform 2 Inversion"] + #[inline(always)] + pub fn inven2(&mut self) -> INVEN2_W { + INVEN2_W { w: self } + } + #[doc = "Bit 19 - Output Waveform 3 Inversion"] + #[inline(always)] + pub fn inven3(&mut self) -> INVEN3_W { + INVEN3_W { w: self } + } + #[doc = "Bit 20 - Output Waveform 4 Inversion"] + #[inline(always)] + pub fn inven4(&mut self) -> INVEN4_W { + INVEN4_W { w: self } + } + #[doc = "Bit 21 - Output Waveform 5 Inversion"] + #[inline(always)] + pub fn inven5(&mut self) -> INVEN5_W { + INVEN5_W { w: self } + } + #[doc = "Bit 22 - Output Waveform 6 Inversion"] + #[inline(always)] + pub fn inven6(&mut self) -> INVEN6_W { + INVEN6_W { w: self } + } + #[doc = "Bit 23 - Output Waveform 7 Inversion"] + #[inline(always)] + pub fn inven7(&mut self) -> INVEN7_W { + INVEN7_W { w: self } + } + #[doc = "Bits 24:27 - Non-Recoverable Fault Input 0 Filter Value"] + #[inline(always)] + pub fn filterval0(&mut self) -> FILTERVAL0_W { + FILTERVAL0_W { w: self } + } + #[doc = "Bits 28:31 - Non-Recoverable Fault Input 1 Filter Value"] + #[inline(always)] + pub fn filterval1(&mut self) -> FILTERVAL1_W { + FILTERVAL1_W { w: 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 = "Driver Control\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 [drvctrl](index.html) module"] +pub struct DRVCTRL_SPEC; +impl crate::RegisterSpec for DRVCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [drvctrl::R](R) reader structure"] +impl crate::Readable for DRVCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [drvctrl::W](W) writer structure"] +impl crate::Writable for DRVCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DRVCTRL to value 0"] +impl crate::Resettable for DRVCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/evctrl.rs b/src/tcc0/evctrl.rs new file mode 100644 index 0000000..3252760 --- /dev/null +++ b/src/tcc0/evctrl.rs @@ -0,0 +1,1193 @@ +#[doc = "Register `EVCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVCTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Timer/counter Input Event0 Action\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum EVACT0_A { + #[doc = "0: Event action disabled"] + OFF = 0, + #[doc = "1: Start, restart or re-trigger counter on event"] + RETRIGGER = 1, + #[doc = "2: Count on event"] + COUNTEV = 2, + #[doc = "3: Start counter on event"] + START = 3, + #[doc = "4: Increment counter on event"] + INC = 4, + #[doc = "5: Count on active state of asynchronous event"] + COUNT = 5, + #[doc = "6: Stamp capture"] + STAMP = 6, + #[doc = "7: Non-recoverable fault"] + FAULT = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: EVACT0_A) -> Self { + variant as _ + } +} +#[doc = "Field `EVACT0` reader - Timer/counter Input Event0 Action"] +pub struct EVACT0_R(crate::FieldReader); +impl EVACT0_R { + pub(crate) fn new(bits: u8) -> Self { + EVACT0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> EVACT0_A { + match self.bits { + 0 => EVACT0_A::OFF, + 1 => EVACT0_A::RETRIGGER, + 2 => EVACT0_A::COUNTEV, + 3 => EVACT0_A::START, + 4 => EVACT0_A::INC, + 5 => EVACT0_A::COUNT, + 6 => EVACT0_A::STAMP, + 7 => EVACT0_A::FAULT, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `OFF`"] + #[inline(always)] + pub fn is_off(&self) -> bool { + **self == EVACT0_A::OFF + } + #[doc = "Checks if the value of the field is `RETRIGGER`"] + #[inline(always)] + pub fn is_retrigger(&self) -> bool { + **self == EVACT0_A::RETRIGGER + } + #[doc = "Checks if the value of the field is `COUNTEV`"] + #[inline(always)] + pub fn is_countev(&self) -> bool { + **self == EVACT0_A::COUNTEV + } + #[doc = "Checks if the value of the field is `START`"] + #[inline(always)] + pub fn is_start(&self) -> bool { + **self == EVACT0_A::START + } + #[doc = "Checks if the value of the field is `INC`"] + #[inline(always)] + pub fn is_inc(&self) -> bool { + **self == EVACT0_A::INC + } + #[doc = "Checks if the value of the field is `COUNT`"] + #[inline(always)] + pub fn is_count(&self) -> bool { + **self == EVACT0_A::COUNT + } + #[doc = "Checks if the value of the field is `STAMP`"] + #[inline(always)] + pub fn is_stamp(&self) -> bool { + **self == EVACT0_A::STAMP + } + #[doc = "Checks if the value of the field is `FAULT`"] + #[inline(always)] + pub fn is_fault(&self) -> bool { + **self == EVACT0_A::FAULT + } +} +impl core::ops::Deref for EVACT0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EVACT0` writer - Timer/counter Input Event0 Action"] +pub struct EVACT0_W<'a> { + w: &'a mut W, +} +impl<'a> EVACT0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: EVACT0_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Event action disabled"] + #[inline(always)] + pub fn off(self) -> &'a mut W { + self.variant(EVACT0_A::OFF) + } + #[doc = "Start, restart or re-trigger counter on event"] + #[inline(always)] + pub fn retrigger(self) -> &'a mut W { + self.variant(EVACT0_A::RETRIGGER) + } + #[doc = "Count on event"] + #[inline(always)] + pub fn countev(self) -> &'a mut W { + self.variant(EVACT0_A::COUNTEV) + } + #[doc = "Start counter on event"] + #[inline(always)] + pub fn start(self) -> &'a mut W { + self.variant(EVACT0_A::START) + } + #[doc = "Increment counter on event"] + #[inline(always)] + pub fn inc(self) -> &'a mut W { + self.variant(EVACT0_A::INC) + } + #[doc = "Count on active state of asynchronous event"] + #[inline(always)] + pub fn count(self) -> &'a mut W { + self.variant(EVACT0_A::COUNT) + } + #[doc = "Stamp capture"] + #[inline(always)] + pub fn stamp(self) -> &'a mut W { + self.variant(EVACT0_A::STAMP) + } + #[doc = "Non-recoverable fault"] + #[inline(always)] + pub fn fault(self) -> &'a mut W { + self.variant(EVACT0_A::FAULT) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +#[doc = "Timer/counter Input Event1 Action\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum EVACT1_A { + #[doc = "0: Event action disabled"] + OFF = 0, + #[doc = "1: Re-trigger counter on event"] + RETRIGGER = 1, + #[doc = "2: Direction control"] + DIR = 2, + #[doc = "3: Stop counter on event"] + STOP = 3, + #[doc = "4: Decrement counter on event"] + DEC = 4, + #[doc = "5: Period capture value in CC0 register, pulse width capture value in CC1 register"] + PPW = 5, + #[doc = "6: Period capture value in CC1 register, pulse width capture value in CC0 register"] + PWP = 6, + #[doc = "7: Non-recoverable fault"] + FAULT = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: EVACT1_A) -> Self { + variant as _ + } +} +#[doc = "Field `EVACT1` reader - Timer/counter Input Event1 Action"] +pub struct EVACT1_R(crate::FieldReader); +impl EVACT1_R { + pub(crate) fn new(bits: u8) -> Self { + EVACT1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> EVACT1_A { + match self.bits { + 0 => EVACT1_A::OFF, + 1 => EVACT1_A::RETRIGGER, + 2 => EVACT1_A::DIR, + 3 => EVACT1_A::STOP, + 4 => EVACT1_A::DEC, + 5 => EVACT1_A::PPW, + 6 => EVACT1_A::PWP, + 7 => EVACT1_A::FAULT, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `OFF`"] + #[inline(always)] + pub fn is_off(&self) -> bool { + **self == EVACT1_A::OFF + } + #[doc = "Checks if the value of the field is `RETRIGGER`"] + #[inline(always)] + pub fn is_retrigger(&self) -> bool { + **self == EVACT1_A::RETRIGGER + } + #[doc = "Checks if the value of the field is `DIR`"] + #[inline(always)] + pub fn is_dir(&self) -> bool { + **self == EVACT1_A::DIR + } + #[doc = "Checks if the value of the field is `STOP`"] + #[inline(always)] + pub fn is_stop(&self) -> bool { + **self == EVACT1_A::STOP + } + #[doc = "Checks if the value of the field is `DEC`"] + #[inline(always)] + pub fn is_dec(&self) -> bool { + **self == EVACT1_A::DEC + } + #[doc = "Checks if the value of the field is `PPW`"] + #[inline(always)] + pub fn is_ppw(&self) -> bool { + **self == EVACT1_A::PPW + } + #[doc = "Checks if the value of the field is `PWP`"] + #[inline(always)] + pub fn is_pwp(&self) -> bool { + **self == EVACT1_A::PWP + } + #[doc = "Checks if the value of the field is `FAULT`"] + #[inline(always)] + pub fn is_fault(&self) -> bool { + **self == EVACT1_A::FAULT + } +} +impl core::ops::Deref for EVACT1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EVACT1` writer - Timer/counter Input Event1 Action"] +pub struct EVACT1_W<'a> { + w: &'a mut W, +} +impl<'a> EVACT1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: EVACT1_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Event action disabled"] + #[inline(always)] + pub fn off(self) -> &'a mut W { + self.variant(EVACT1_A::OFF) + } + #[doc = "Re-trigger counter on event"] + #[inline(always)] + pub fn retrigger(self) -> &'a mut W { + self.variant(EVACT1_A::RETRIGGER) + } + #[doc = "Direction control"] + #[inline(always)] + pub fn dir(self) -> &'a mut W { + self.variant(EVACT1_A::DIR) + } + #[doc = "Stop counter on event"] + #[inline(always)] + pub fn stop(self) -> &'a mut W { + self.variant(EVACT1_A::STOP) + } + #[doc = "Decrement counter on event"] + #[inline(always)] + pub fn dec(self) -> &'a mut W { + self.variant(EVACT1_A::DEC) + } + #[doc = "Period capture value in CC0 register, pulse width capture value in CC1 register"] + #[inline(always)] + pub fn ppw(self) -> &'a mut W { + self.variant(EVACT1_A::PPW) + } + #[doc = "Period capture value in CC1 register, pulse width capture value in CC0 register"] + #[inline(always)] + pub fn pwp(self) -> &'a mut W { + self.variant(EVACT1_A::PWP) + } + #[doc = "Non-recoverable fault"] + #[inline(always)] + pub fn fault(self) -> &'a mut W { + self.variant(EVACT1_A::FAULT) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 3)) | ((value as u32 & 0x07) << 3); + self.w + } +} +#[doc = "Timer/counter Output Event Mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum CNTSEL_A { + #[doc = "0: An interrupt/event is generated when a new counter cycle starts"] + START = 0, + #[doc = "1: An interrupt/event is generated when a counter cycle ends"] + END = 1, + #[doc = "2: An interrupt/event is generated when a counter cycle ends, except for the first and last cycles"] + BETWEEN = 2, + #[doc = "3: An interrupt/event is generated when a new counter cycle starts or a counter cycle ends"] + BOUNDARY = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: CNTSEL_A) -> Self { + variant as _ + } +} +#[doc = "Field `CNTSEL` reader - Timer/counter Output Event Mode"] +pub struct CNTSEL_R(crate::FieldReader); +impl CNTSEL_R { + pub(crate) fn new(bits: u8) -> Self { + CNTSEL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CNTSEL_A { + match self.bits { + 0 => CNTSEL_A::START, + 1 => CNTSEL_A::END, + 2 => CNTSEL_A::BETWEEN, + 3 => CNTSEL_A::BOUNDARY, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `START`"] + #[inline(always)] + pub fn is_start(&self) -> bool { + **self == CNTSEL_A::START + } + #[doc = "Checks if the value of the field is `END`"] + #[inline(always)] + pub fn is_end(&self) -> bool { + **self == CNTSEL_A::END + } + #[doc = "Checks if the value of the field is `BETWEEN`"] + #[inline(always)] + pub fn is_between(&self) -> bool { + **self == CNTSEL_A::BETWEEN + } + #[doc = "Checks if the value of the field is `BOUNDARY`"] + #[inline(always)] + pub fn is_boundary(&self) -> bool { + **self == CNTSEL_A::BOUNDARY + } +} +impl core::ops::Deref for CNTSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CNTSEL` writer - Timer/counter Output Event Mode"] +pub struct CNTSEL_W<'a> { + w: &'a mut W, +} +impl<'a> CNTSEL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CNTSEL_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "An interrupt/event is generated when a new counter cycle starts"] + #[inline(always)] + pub fn start(self) -> &'a mut W { + self.variant(CNTSEL_A::START) + } + #[doc = "An interrupt/event is generated when a counter cycle ends"] + #[inline(always)] + pub fn end(self) -> &'a mut W { + self.variant(CNTSEL_A::END) + } + #[doc = "An interrupt/event is generated when a counter cycle ends, except for the first and last cycles"] + #[inline(always)] + pub fn between(self) -> &'a mut W { + self.variant(CNTSEL_A::BETWEEN) + } + #[doc = "An interrupt/event is generated when a new counter cycle starts or a counter cycle ends"] + #[inline(always)] + pub fn boundary(self) -> &'a mut W { + self.variant(CNTSEL_A::BOUNDARY) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); + self.w + } +} +#[doc = "Field `OVFEO` reader - Overflow/Underflow Output Event Enable"] +pub struct OVFEO_R(crate::FieldReader); +impl OVFEO_R { + pub(crate) fn new(bits: bool) -> Self { + OVFEO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OVFEO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVFEO` writer - Overflow/Underflow Output Event Enable"] +pub struct OVFEO_W<'a> { + w: &'a mut W, +} +impl<'a> OVFEO_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Field `TRGEO` reader - Retrigger Output Event Enable"] +pub struct TRGEO_R(crate::FieldReader); +impl TRGEO_R { + pub(crate) fn new(bits: bool) -> Self { + TRGEO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRGEO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRGEO` writer - Retrigger Output Event Enable"] +pub struct TRGEO_W<'a> { + w: &'a mut W, +} +impl<'a> TRGEO_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Field `CNTEO` reader - Timer/counter Output Event Enable"] +pub struct CNTEO_R(crate::FieldReader); +impl CNTEO_R { + pub(crate) fn new(bits: bool) -> Self { + CNTEO_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CNTEO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CNTEO` writer - Timer/counter Output Event Enable"] +pub struct CNTEO_W<'a> { + w: &'a mut W, +} +impl<'a> CNTEO_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Field `TCINV0` reader - Inverted Event 0 Input Enable"] +pub struct TCINV0_R(crate::FieldReader); +impl TCINV0_R { + pub(crate) fn new(bits: bool) -> Self { + TCINV0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TCINV0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TCINV0` writer - Inverted Event 0 Input Enable"] +pub struct TCINV0_W<'a> { + w: &'a mut W, +} +impl<'a> TCINV0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Field `TCINV1` reader - Inverted Event 1 Input Enable"] +pub struct TCINV1_R(crate::FieldReader); +impl TCINV1_R { + pub(crate) fn new(bits: bool) -> Self { + TCINV1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TCINV1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TCINV1` writer - Inverted Event 1 Input Enable"] +pub struct TCINV1_W<'a> { + w: &'a mut W, +} +impl<'a> TCINV1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Field `TCEI0` reader - Timer/counter Event 0 Input Enable"] +pub struct TCEI0_R(crate::FieldReader); +impl TCEI0_R { + pub(crate) fn new(bits: bool) -> Self { + TCEI0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TCEI0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TCEI0` writer - Timer/counter Event 0 Input Enable"] +pub struct TCEI0_W<'a> { + w: &'a mut W, +} +impl<'a> TCEI0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Field `TCEI1` reader - Timer/counter Event 1 Input Enable"] +pub struct TCEI1_R(crate::FieldReader); +impl TCEI1_R { + pub(crate) fn new(bits: bool) -> Self { + TCEI1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TCEI1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TCEI1` writer - Timer/counter Event 1 Input Enable"] +pub struct TCEI1_W<'a> { + w: &'a mut W, +} +impl<'a> TCEI1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Field `MCEI0` reader - Match or Capture Channel 0 Event Input Enable"] +pub struct MCEI0_R(crate::FieldReader); +impl MCEI0_R { + pub(crate) fn new(bits: bool) -> Self { + MCEI0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MCEI0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCEI0` writer - Match or Capture Channel 0 Event Input Enable"] +pub struct MCEI0_W<'a> { + w: &'a mut W, +} +impl<'a> MCEI0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Field `MCEI1` reader - Match or Capture Channel 1 Event Input Enable"] +pub struct MCEI1_R(crate::FieldReader); +impl MCEI1_R { + pub(crate) fn new(bits: bool) -> Self { + MCEI1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MCEI1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCEI1` writer - Match or Capture Channel 1 Event Input Enable"] +pub struct MCEI1_W<'a> { + w: &'a mut W, +} +impl<'a> MCEI1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Field `MCEI2` reader - Match or Capture Channel 2 Event Input Enable"] +pub struct MCEI2_R(crate::FieldReader); +impl MCEI2_R { + pub(crate) fn new(bits: bool) -> Self { + MCEI2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MCEI2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCEI2` writer - Match or Capture Channel 2 Event Input Enable"] +pub struct MCEI2_W<'a> { + w: &'a mut W, +} +impl<'a> MCEI2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Field `MCEI3` reader - Match or Capture Channel 3 Event Input Enable"] +pub struct MCEI3_R(crate::FieldReader); +impl MCEI3_R { + pub(crate) fn new(bits: bool) -> Self { + MCEI3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MCEI3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCEI3` writer - Match or Capture Channel 3 Event Input Enable"] +pub struct MCEI3_W<'a> { + w: &'a mut W, +} +impl<'a> MCEI3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Field `MCEO0` reader - Match or Capture Channel 0 Event Output Enable"] +pub struct MCEO0_R(crate::FieldReader); +impl MCEO0_R { + pub(crate) fn new(bits: bool) -> Self { + MCEO0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MCEO0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCEO0` writer - Match or Capture Channel 0 Event Output Enable"] +pub struct MCEO0_W<'a> { + w: &'a mut W, +} +impl<'a> MCEO0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Field `MCEO1` reader - Match or Capture Channel 1 Event Output Enable"] +pub struct MCEO1_R(crate::FieldReader); +impl MCEO1_R { + pub(crate) fn new(bits: bool) -> Self { + MCEO1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MCEO1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCEO1` writer - Match or Capture Channel 1 Event Output Enable"] +pub struct MCEO1_W<'a> { + w: &'a mut W, +} +impl<'a> MCEO1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Field `MCEO2` reader - Match or Capture Channel 2 Event Output Enable"] +pub struct MCEO2_R(crate::FieldReader); +impl MCEO2_R { + pub(crate) fn new(bits: bool) -> Self { + MCEO2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MCEO2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCEO2` writer - Match or Capture Channel 2 Event Output Enable"] +pub struct MCEO2_W<'a> { + w: &'a mut W, +} +impl<'a> MCEO2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Field `MCEO3` reader - Match or Capture Channel 3 Event Output Enable"] +pub struct MCEO3_R(crate::FieldReader); +impl MCEO3_R { + pub(crate) fn new(bits: bool) -> Self { + MCEO3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MCEO3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCEO3` writer - Match or Capture Channel 3 Event Output Enable"] +pub struct MCEO3_W<'a> { + w: &'a mut W, +} +impl<'a> MCEO3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - Timer/counter Input Event0 Action"] + #[inline(always)] + pub fn evact0(&self) -> EVACT0_R { + EVACT0_R::new((self.bits & 0x07) as u8) + } + #[doc = "Bits 3:5 - Timer/counter Input Event1 Action"] + #[inline(always)] + pub fn evact1(&self) -> EVACT1_R { + EVACT1_R::new(((self.bits >> 3) & 0x07) as u8) + } + #[doc = "Bits 6:7 - Timer/counter Output Event Mode"] + #[inline(always)] + pub fn cntsel(&self) -> CNTSEL_R { + CNTSEL_R::new(((self.bits >> 6) & 0x03) as u8) + } + #[doc = "Bit 8 - Overflow/Underflow Output Event Enable"] + #[inline(always)] + pub fn ovfeo(&self) -> OVFEO_R { + OVFEO_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Retrigger Output Event Enable"] + #[inline(always)] + pub fn trgeo(&self) -> TRGEO_R { + TRGEO_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Timer/counter Output Event Enable"] + #[inline(always)] + pub fn cnteo(&self) -> CNTEO_R { + CNTEO_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 12 - Inverted Event 0 Input Enable"] + #[inline(always)] + pub fn tcinv0(&self) -> TCINV0_R { + TCINV0_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Inverted Event 1 Input Enable"] + #[inline(always)] + pub fn tcinv1(&self) -> TCINV1_R { + TCINV1_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Timer/counter Event 0 Input Enable"] + #[inline(always)] + pub fn tcei0(&self) -> TCEI0_R { + TCEI0_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Timer/counter Event 1 Input Enable"] + #[inline(always)] + pub fn tcei1(&self) -> TCEI1_R { + TCEI1_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Match or Capture Channel 0 Event Input Enable"] + #[inline(always)] + pub fn mcei0(&self) -> MCEI0_R { + MCEI0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Match or Capture Channel 1 Event Input Enable"] + #[inline(always)] + pub fn mcei1(&self) -> MCEI1_R { + MCEI1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Match or Capture Channel 2 Event Input Enable"] + #[inline(always)] + pub fn mcei2(&self) -> MCEI2_R { + MCEI2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Match or Capture Channel 3 Event Input Enable"] + #[inline(always)] + pub fn mcei3(&self) -> MCEI3_R { + MCEI3_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 24 - Match or Capture Channel 0 Event Output Enable"] + #[inline(always)] + pub fn mceo0(&self) -> MCEO0_R { + MCEO0_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Match or Capture Channel 1 Event Output Enable"] + #[inline(always)] + pub fn mceo1(&self) -> MCEO1_R { + MCEO1_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Match or Capture Channel 2 Event Output Enable"] + #[inline(always)] + pub fn mceo2(&self) -> MCEO2_R { + MCEO2_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Match or Capture Channel 3 Event Output Enable"] + #[inline(always)] + pub fn mceo3(&self) -> MCEO3_R { + MCEO3_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:2 - Timer/counter Input Event0 Action"] + #[inline(always)] + pub fn evact0(&mut self) -> EVACT0_W { + EVACT0_W { w: self } + } + #[doc = "Bits 3:5 - Timer/counter Input Event1 Action"] + #[inline(always)] + pub fn evact1(&mut self) -> EVACT1_W { + EVACT1_W { w: self } + } + #[doc = "Bits 6:7 - Timer/counter Output Event Mode"] + #[inline(always)] + pub fn cntsel(&mut self) -> CNTSEL_W { + CNTSEL_W { w: self } + } + #[doc = "Bit 8 - Overflow/Underflow Output Event Enable"] + #[inline(always)] + pub fn ovfeo(&mut self) -> OVFEO_W { + OVFEO_W { w: self } + } + #[doc = "Bit 9 - Retrigger Output Event Enable"] + #[inline(always)] + pub fn trgeo(&mut self) -> TRGEO_W { + TRGEO_W { w: self } + } + #[doc = "Bit 10 - Timer/counter Output Event Enable"] + #[inline(always)] + pub fn cnteo(&mut self) -> CNTEO_W { + CNTEO_W { w: self } + } + #[doc = "Bit 12 - Inverted Event 0 Input Enable"] + #[inline(always)] + pub fn tcinv0(&mut self) -> TCINV0_W { + TCINV0_W { w: self } + } + #[doc = "Bit 13 - Inverted Event 1 Input Enable"] + #[inline(always)] + pub fn tcinv1(&mut self) -> TCINV1_W { + TCINV1_W { w: self } + } + #[doc = "Bit 14 - Timer/counter Event 0 Input Enable"] + #[inline(always)] + pub fn tcei0(&mut self) -> TCEI0_W { + TCEI0_W { w: self } + } + #[doc = "Bit 15 - Timer/counter Event 1 Input Enable"] + #[inline(always)] + pub fn tcei1(&mut self) -> TCEI1_W { + TCEI1_W { w: self } + } + #[doc = "Bit 16 - Match or Capture Channel 0 Event Input Enable"] + #[inline(always)] + pub fn mcei0(&mut self) -> MCEI0_W { + MCEI0_W { w: self } + } + #[doc = "Bit 17 - Match or Capture Channel 1 Event Input Enable"] + #[inline(always)] + pub fn mcei1(&mut self) -> MCEI1_W { + MCEI1_W { w: self } + } + #[doc = "Bit 18 - Match or Capture Channel 2 Event Input Enable"] + #[inline(always)] + pub fn mcei2(&mut self) -> MCEI2_W { + MCEI2_W { w: self } + } + #[doc = "Bit 19 - Match or Capture Channel 3 Event Input Enable"] + #[inline(always)] + pub fn mcei3(&mut self) -> MCEI3_W { + MCEI3_W { w: self } + } + #[doc = "Bit 24 - Match or Capture Channel 0 Event Output Enable"] + #[inline(always)] + pub fn mceo0(&mut self) -> MCEO0_W { + MCEO0_W { w: self } + } + #[doc = "Bit 25 - Match or Capture Channel 1 Event Output Enable"] + #[inline(always)] + pub fn mceo1(&mut self) -> MCEO1_W { + MCEO1_W { w: self } + } + #[doc = "Bit 26 - Match or Capture Channel 2 Event Output Enable"] + #[inline(always)] + pub fn mceo2(&mut self) -> MCEO2_W { + MCEO2_W { w: self } + } + #[doc = "Bit 27 - Match or Capture Channel 3 Event Output Enable"] + #[inline(always)] + pub fn mceo3(&mut self) -> MCEO3_W { + MCEO3_W { w: 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 = "Event Control\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 [evctrl](index.html) module"] +pub struct EVCTRL_SPEC; +impl crate::RegisterSpec for EVCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [evctrl::R](R) reader structure"] +impl crate::Readable for EVCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [evctrl::W](W) writer structure"] +impl crate::Writable for EVCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVCTRL to value 0"] +impl crate::Resettable for EVCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/fctrla.rs b/src/tcc0/fctrla.rs new file mode 100644 index 0000000..01625b7 --- /dev/null +++ b/src/tcc0/fctrla.rs @@ -0,0 +1,929 @@ +#[doc = "Register `FCTRLA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FCTRLA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Fault A Source\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum SRC_A { + #[doc = "0: Fault input disabled"] + DISABLE = 0, + #[doc = "1: MCEx (x=0,1) event input"] + ENABLE = 1, + #[doc = "2: Inverted MCEx (x=0,1) event input"] + INVERT = 2, + #[doc = "3: Alternate fault (A or B) state at the end of the previous period"] + ALTFAULT = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: SRC_A) -> Self { + variant as _ + } +} +#[doc = "Field `SRC` reader - Fault A Source"] +pub struct SRC_R(crate::FieldReader); +impl SRC_R { + pub(crate) fn new(bits: u8) -> Self { + SRC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SRC_A { + match self.bits { + 0 => SRC_A::DISABLE, + 1 => SRC_A::ENABLE, + 2 => SRC_A::INVERT, + 3 => SRC_A::ALTFAULT, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == SRC_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == SRC_A::ENABLE + } + #[doc = "Checks if the value of the field is `INVERT`"] + #[inline(always)] + pub fn is_invert(&self) -> bool { + **self == SRC_A::INVERT + } + #[doc = "Checks if the value of the field is `ALTFAULT`"] + #[inline(always)] + pub fn is_altfault(&self) -> bool { + **self == SRC_A::ALTFAULT + } +} +impl core::ops::Deref for SRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRC` writer - Fault A Source"] +pub struct SRC_W<'a> { + w: &'a mut W, +} +impl<'a> SRC_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SRC_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Fault input disabled"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(SRC_A::DISABLE) + } + #[doc = "MCEx (x=0,1) event input"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(SRC_A::ENABLE) + } + #[doc = "Inverted MCEx (x=0,1) event input"] + #[inline(always)] + pub fn invert(self) -> &'a mut W { + self.variant(SRC_A::INVERT) + } + #[doc = "Alternate fault (A or B) state at the end of the previous period"] + #[inline(always)] + pub fn altfault(self) -> &'a mut W { + self.variant(SRC_A::ALTFAULT) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +#[doc = "Field `KEEP` reader - Fault A Keeper"] +pub struct KEEP_R(crate::FieldReader); +impl KEEP_R { + pub(crate) fn new(bits: bool) -> Self { + KEEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for KEEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `KEEP` writer - Fault A Keeper"] +pub struct KEEP_W<'a> { + w: &'a mut W, +} +impl<'a> KEEP_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Field `QUAL` reader - Fault A Qualification"] +pub struct QUAL_R(crate::FieldReader); +impl QUAL_R { + pub(crate) fn new(bits: bool) -> Self { + QUAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for QUAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `QUAL` writer - Fault A Qualification"] +pub struct QUAL_W<'a> { + w: &'a mut W, +} +impl<'a> QUAL_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Fault A Blanking Mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum BLANK_A { + #[doc = "0: Blanking applied from start of the ramp"] + START = 0, + #[doc = "1: Blanking applied from rising edge of the output waveform"] + RISE = 1, + #[doc = "2: Blanking applied from falling edge of the output waveform"] + FALL = 2, + #[doc = "3: Blanking applied from each toggle of the output waveform"] + BOTH = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: BLANK_A) -> Self { + variant as _ + } +} +#[doc = "Field `BLANK` reader - Fault A Blanking Mode"] +pub struct BLANK_R(crate::FieldReader); +impl BLANK_R { + pub(crate) fn new(bits: u8) -> Self { + BLANK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BLANK_A { + match self.bits { + 0 => BLANK_A::START, + 1 => BLANK_A::RISE, + 2 => BLANK_A::FALL, + 3 => BLANK_A::BOTH, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `START`"] + #[inline(always)] + pub fn is_start(&self) -> bool { + **self == BLANK_A::START + } + #[doc = "Checks if the value of the field is `RISE`"] + #[inline(always)] + pub fn is_rise(&self) -> bool { + **self == BLANK_A::RISE + } + #[doc = "Checks if the value of the field is `FALL`"] + #[inline(always)] + pub fn is_fall(&self) -> bool { + **self == BLANK_A::FALL + } + #[doc = "Checks if the value of the field is `BOTH`"] + #[inline(always)] + pub fn is_both(&self) -> bool { + **self == BLANK_A::BOTH + } +} +impl core::ops::Deref for BLANK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BLANK` writer - Fault A Blanking Mode"] +pub struct BLANK_W<'a> { + w: &'a mut W, +} +impl<'a> BLANK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BLANK_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Blanking applied from start of the ramp"] + #[inline(always)] + pub fn start(self) -> &'a mut W { + self.variant(BLANK_A::START) + } + #[doc = "Blanking applied from rising edge of the output waveform"] + #[inline(always)] + pub fn rise(self) -> &'a mut W { + self.variant(BLANK_A::RISE) + } + #[doc = "Blanking applied from falling edge of the output waveform"] + #[inline(always)] + pub fn fall(self) -> &'a mut W { + self.variant(BLANK_A::FALL) + } + #[doc = "Blanking applied from each toggle of the output waveform"] + #[inline(always)] + pub fn both(self) -> &'a mut W { + self.variant(BLANK_A::BOTH) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 5)) | ((value as u32 & 0x03) << 5); + self.w + } +} +#[doc = "Field `RESTART` reader - Fault A Restart"] +pub struct RESTART_R(crate::FieldReader); +impl RESTART_R { + pub(crate) fn new(bits: bool) -> Self { + RESTART_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RESTART_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RESTART` writer - Fault A Restart"] +pub struct RESTART_W<'a> { + w: &'a mut W, +} +impl<'a> RESTART_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Fault A Halt Mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum HALT_A { + #[doc = "0: Halt action disabled"] + DISABLE = 0, + #[doc = "1: Hardware halt action"] + HW = 1, + #[doc = "2: Software halt action"] + SW = 2, + #[doc = "3: Non-recoverable fault"] + NR = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: HALT_A) -> Self { + variant as _ + } +} +#[doc = "Field `HALT` reader - Fault A Halt Mode"] +pub struct HALT_R(crate::FieldReader); +impl HALT_R { + pub(crate) fn new(bits: u8) -> Self { + HALT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> HALT_A { + match self.bits { + 0 => HALT_A::DISABLE, + 1 => HALT_A::HW, + 2 => HALT_A::SW, + 3 => HALT_A::NR, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == HALT_A::DISABLE + } + #[doc = "Checks if the value of the field is `HW`"] + #[inline(always)] + pub fn is_hw(&self) -> bool { + **self == HALT_A::HW + } + #[doc = "Checks if the value of the field is `SW`"] + #[inline(always)] + pub fn is_sw(&self) -> bool { + **self == HALT_A::SW + } + #[doc = "Checks if the value of the field is `NR`"] + #[inline(always)] + pub fn is_nr(&self) -> bool { + **self == HALT_A::NR + } +} +impl core::ops::Deref for HALT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HALT` writer - Fault A Halt Mode"] +pub struct HALT_W<'a> { + w: &'a mut W, +} +impl<'a> HALT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: HALT_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Halt action disabled"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(HALT_A::DISABLE) + } + #[doc = "Hardware halt action"] + #[inline(always)] + pub fn hw(self) -> &'a mut W { + self.variant(HALT_A::HW) + } + #[doc = "Software halt action"] + #[inline(always)] + pub fn sw(self) -> &'a mut W { + self.variant(HALT_A::SW) + } + #[doc = "Non-recoverable fault"] + #[inline(always)] + pub fn nr(self) -> &'a mut W { + self.variant(HALT_A::NR) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); + self.w + } +} +#[doc = "Fault A Capture Channel\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum CHSEL_A { + #[doc = "0: Capture value stored in channel 0"] + CC0 = 0, + #[doc = "1: Capture value stored in channel 1"] + CC1 = 1, + #[doc = "2: Capture value stored in channel 2"] + CC2 = 2, + #[doc = "3: Capture value stored in channel 3"] + CC3 = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: CHSEL_A) -> Self { + variant as _ + } +} +#[doc = "Field `CHSEL` reader - Fault A Capture Channel"] +pub struct CHSEL_R(crate::FieldReader); +impl CHSEL_R { + pub(crate) fn new(bits: u8) -> Self { + CHSEL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CHSEL_A { + match self.bits { + 0 => CHSEL_A::CC0, + 1 => CHSEL_A::CC1, + 2 => CHSEL_A::CC2, + 3 => CHSEL_A::CC3, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `CC0`"] + #[inline(always)] + pub fn is_cc0(&self) -> bool { + **self == CHSEL_A::CC0 + } + #[doc = "Checks if the value of the field is `CC1`"] + #[inline(always)] + pub fn is_cc1(&self) -> bool { + **self == CHSEL_A::CC1 + } + #[doc = "Checks if the value of the field is `CC2`"] + #[inline(always)] + pub fn is_cc2(&self) -> bool { + **self == CHSEL_A::CC2 + } + #[doc = "Checks if the value of the field is `CC3`"] + #[inline(always)] + pub fn is_cc3(&self) -> bool { + **self == CHSEL_A::CC3 + } +} +impl core::ops::Deref for CHSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHSEL` writer - Fault A Capture Channel"] +pub struct CHSEL_W<'a> { + w: &'a mut W, +} +impl<'a> CHSEL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CHSEL_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Capture value stored in channel 0"] + #[inline(always)] + pub fn cc0(self) -> &'a mut W { + self.variant(CHSEL_A::CC0) + } + #[doc = "Capture value stored in channel 1"] + #[inline(always)] + pub fn cc1(self) -> &'a mut W { + self.variant(CHSEL_A::CC1) + } + #[doc = "Capture value stored in channel 2"] + #[inline(always)] + pub fn cc2(self) -> &'a mut W { + self.variant(CHSEL_A::CC2) + } + #[doc = "Capture value stored in channel 3"] + #[inline(always)] + pub fn cc3(self) -> &'a mut W { + self.variant(CHSEL_A::CC3) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); + self.w + } +} +#[doc = "Fault A Capture Action\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum CAPTURE_A { + #[doc = "0: No capture"] + DISABLE = 0, + #[doc = "1: Capture on fault"] + CAPT = 1, + #[doc = "2: Minimum capture"] + CAPTMIN = 2, + #[doc = "3: Maximum capture"] + CAPTMAX = 3, + #[doc = "4: Minimum local detection"] + LOCMIN = 4, + #[doc = "5: Maximum local detection"] + LOCMAX = 5, + #[doc = "6: Minimum and maximum local detection"] + DERIV0 = 6, + #[doc = "7: Capture with ramp index as MSB value"] + CAPTMARK = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: CAPTURE_A) -> Self { + variant as _ + } +} +#[doc = "Field `CAPTURE` reader - Fault A Capture Action"] +pub struct CAPTURE_R(crate::FieldReader); +impl CAPTURE_R { + pub(crate) fn new(bits: u8) -> Self { + CAPTURE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CAPTURE_A { + match self.bits { + 0 => CAPTURE_A::DISABLE, + 1 => CAPTURE_A::CAPT, + 2 => CAPTURE_A::CAPTMIN, + 3 => CAPTURE_A::CAPTMAX, + 4 => CAPTURE_A::LOCMIN, + 5 => CAPTURE_A::LOCMAX, + 6 => CAPTURE_A::DERIV0, + 7 => CAPTURE_A::CAPTMARK, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == CAPTURE_A::DISABLE + } + #[doc = "Checks if the value of the field is `CAPT`"] + #[inline(always)] + pub fn is_capt(&self) -> bool { + **self == CAPTURE_A::CAPT + } + #[doc = "Checks if the value of the field is `CAPTMIN`"] + #[inline(always)] + pub fn is_captmin(&self) -> bool { + **self == CAPTURE_A::CAPTMIN + } + #[doc = "Checks if the value of the field is `CAPTMAX`"] + #[inline(always)] + pub fn is_captmax(&self) -> bool { + **self == CAPTURE_A::CAPTMAX + } + #[doc = "Checks if the value of the field is `LOCMIN`"] + #[inline(always)] + pub fn is_locmin(&self) -> bool { + **self == CAPTURE_A::LOCMIN + } + #[doc = "Checks if the value of the field is `LOCMAX`"] + #[inline(always)] + pub fn is_locmax(&self) -> bool { + **self == CAPTURE_A::LOCMAX + } + #[doc = "Checks if the value of the field is `DERIV0`"] + #[inline(always)] + pub fn is_deriv0(&self) -> bool { + **self == CAPTURE_A::DERIV0 + } + #[doc = "Checks if the value of the field is `CAPTMARK`"] + #[inline(always)] + pub fn is_captmark(&self) -> bool { + **self == CAPTURE_A::CAPTMARK + } +} +impl core::ops::Deref for CAPTURE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CAPTURE` writer - Fault A Capture Action"] +pub struct CAPTURE_W<'a> { + w: &'a mut W, +} +impl<'a> CAPTURE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CAPTURE_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "No capture"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(CAPTURE_A::DISABLE) + } + #[doc = "Capture on fault"] + #[inline(always)] + pub fn capt(self) -> &'a mut W { + self.variant(CAPTURE_A::CAPT) + } + #[doc = "Minimum capture"] + #[inline(always)] + pub fn captmin(self) -> &'a mut W { + self.variant(CAPTURE_A::CAPTMIN) + } + #[doc = "Maximum capture"] + #[inline(always)] + pub fn captmax(self) -> &'a mut W { + self.variant(CAPTURE_A::CAPTMAX) + } + #[doc = "Minimum local detection"] + #[inline(always)] + pub fn locmin(self) -> &'a mut W { + self.variant(CAPTURE_A::LOCMIN) + } + #[doc = "Maximum local detection"] + #[inline(always)] + pub fn locmax(self) -> &'a mut W { + self.variant(CAPTURE_A::LOCMAX) + } + #[doc = "Minimum and maximum local detection"] + #[inline(always)] + pub fn deriv0(self) -> &'a mut W { + self.variant(CAPTURE_A::DERIV0) + } + #[doc = "Capture with ramp index as MSB value"] + #[inline(always)] + pub fn captmark(self) -> &'a mut W { + self.variant(CAPTURE_A::CAPTMARK) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); + self.w + } +} +#[doc = "Field `BLANKPRESC` reader - Fault A Blanking Prescaler"] +pub struct BLANKPRESC_R(crate::FieldReader); +impl BLANKPRESC_R { + pub(crate) fn new(bits: bool) -> Self { + BLANKPRESC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BLANKPRESC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BLANKPRESC` writer - Fault A Blanking Prescaler"] +pub struct BLANKPRESC_W<'a> { + w: &'a mut W, +} +impl<'a> BLANKPRESC_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Field `BLANKVAL` reader - Fault A Blanking Time"] +pub struct BLANKVAL_R(crate::FieldReader); +impl BLANKVAL_R { + pub(crate) fn new(bits: u8) -> Self { + BLANKVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BLANKVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BLANKVAL` writer - Fault A Blanking Time"] +pub struct BLANKVAL_W<'a> { + w: &'a mut W, +} +impl<'a> BLANKVAL_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); + self.w + } +} +#[doc = "Field `FILTERVAL` reader - Fault A Filter Value"] +pub struct FILTERVAL_R(crate::FieldReader); +impl FILTERVAL_R { + pub(crate) fn new(bits: u8) -> Self { + FILTERVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FILTERVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FILTERVAL` writer - Fault A Filter Value"] +pub struct FILTERVAL_W<'a> { + w: &'a mut W, +} +impl<'a> FILTERVAL_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Fault A Source"] + #[inline(always)] + pub fn src(&self) -> SRC_R { + SRC_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bit 3 - Fault A Keeper"] + #[inline(always)] + pub fn keep(&self) -> KEEP_R { + KEEP_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Fault A Qualification"] + #[inline(always)] + pub fn qual(&self) -> QUAL_R { + QUAL_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bits 5:6 - Fault A Blanking Mode"] + #[inline(always)] + pub fn blank(&self) -> BLANK_R { + BLANK_R::new(((self.bits >> 5) & 0x03) as u8) + } + #[doc = "Bit 7 - Fault A Restart"] + #[inline(always)] + pub fn restart(&self) -> RESTART_R { + RESTART_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bits 8:9 - Fault A Halt Mode"] + #[inline(always)] + pub fn halt(&self) -> HALT_R { + HALT_R::new(((self.bits >> 8) & 0x03) as u8) + } + #[doc = "Bits 10:11 - Fault A Capture Channel"] + #[inline(always)] + pub fn chsel(&self) -> CHSEL_R { + CHSEL_R::new(((self.bits >> 10) & 0x03) as u8) + } + #[doc = "Bits 12:14 - Fault A Capture Action"] + #[inline(always)] + pub fn capture(&self) -> CAPTURE_R { + CAPTURE_R::new(((self.bits >> 12) & 0x07) as u8) + } + #[doc = "Bit 15 - Fault A Blanking Prescaler"] + #[inline(always)] + pub fn blankpresc(&self) -> BLANKPRESC_R { + BLANKPRESC_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bits 16:23 - Fault A Blanking Time"] + #[inline(always)] + pub fn blankval(&self) -> BLANKVAL_R { + BLANKVAL_R::new(((self.bits >> 16) & 0xff) as u8) + } + #[doc = "Bits 24:27 - Fault A Filter Value"] + #[inline(always)] + pub fn filterval(&self) -> FILTERVAL_R { + FILTERVAL_R::new(((self.bits >> 24) & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Fault A Source"] + #[inline(always)] + pub fn src(&mut self) -> SRC_W { + SRC_W { w: self } + } + #[doc = "Bit 3 - Fault A Keeper"] + #[inline(always)] + pub fn keep(&mut self) -> KEEP_W { + KEEP_W { w: self } + } + #[doc = "Bit 4 - Fault A Qualification"] + #[inline(always)] + pub fn qual(&mut self) -> QUAL_W { + QUAL_W { w: self } + } + #[doc = "Bits 5:6 - Fault A Blanking Mode"] + #[inline(always)] + pub fn blank(&mut self) -> BLANK_W { + BLANK_W { w: self } + } + #[doc = "Bit 7 - Fault A Restart"] + #[inline(always)] + pub fn restart(&mut self) -> RESTART_W { + RESTART_W { w: self } + } + #[doc = "Bits 8:9 - Fault A Halt Mode"] + #[inline(always)] + pub fn halt(&mut self) -> HALT_W { + HALT_W { w: self } + } + #[doc = "Bits 10:11 - Fault A Capture Channel"] + #[inline(always)] + pub fn chsel(&mut self) -> CHSEL_W { + CHSEL_W { w: self } + } + #[doc = "Bits 12:14 - Fault A Capture Action"] + #[inline(always)] + pub fn capture(&mut self) -> CAPTURE_W { + CAPTURE_W { w: self } + } + #[doc = "Bit 15 - Fault A Blanking Prescaler"] + #[inline(always)] + pub fn blankpresc(&mut self) -> BLANKPRESC_W { + BLANKPRESC_W { w: self } + } + #[doc = "Bits 16:23 - Fault A Blanking Time"] + #[inline(always)] + pub fn blankval(&mut self) -> BLANKVAL_W { + BLANKVAL_W { w: self } + } + #[doc = "Bits 24:27 - Fault A Filter Value"] + #[inline(always)] + pub fn filterval(&mut self) -> FILTERVAL_W { + FILTERVAL_W { w: 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 = "Recoverable Fault A Configuration\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 [fctrla](index.html) module"] +pub struct FCTRLA_SPEC; +impl crate::RegisterSpec for FCTRLA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fctrla::R](R) reader structure"] +impl crate::Readable for FCTRLA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fctrla::W](W) writer structure"] +impl crate::Writable for FCTRLA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FCTRLA to value 0"] +impl crate::Resettable for FCTRLA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/fctrlb.rs b/src/tcc0/fctrlb.rs new file mode 100644 index 0000000..fcc3847 --- /dev/null +++ b/src/tcc0/fctrlb.rs @@ -0,0 +1,929 @@ +#[doc = "Register `FCTRLB` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FCTRLB` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Fault B Source\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum SRC_A { + #[doc = "0: Fault input disabled"] + DISABLE = 0, + #[doc = "1: MCEx (x=0,1) event input"] + ENABLE = 1, + #[doc = "2: Inverted MCEx (x=0,1) event input"] + INVERT = 2, + #[doc = "3: Alternate fault (A or B) state at the end of the previous period"] + ALTFAULT = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: SRC_A) -> Self { + variant as _ + } +} +#[doc = "Field `SRC` reader - Fault B Source"] +pub struct SRC_R(crate::FieldReader); +impl SRC_R { + pub(crate) fn new(bits: u8) -> Self { + SRC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SRC_A { + match self.bits { + 0 => SRC_A::DISABLE, + 1 => SRC_A::ENABLE, + 2 => SRC_A::INVERT, + 3 => SRC_A::ALTFAULT, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == SRC_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == SRC_A::ENABLE + } + #[doc = "Checks if the value of the field is `INVERT`"] + #[inline(always)] + pub fn is_invert(&self) -> bool { + **self == SRC_A::INVERT + } + #[doc = "Checks if the value of the field is `ALTFAULT`"] + #[inline(always)] + pub fn is_altfault(&self) -> bool { + **self == SRC_A::ALTFAULT + } +} +impl core::ops::Deref for SRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRC` writer - Fault B Source"] +pub struct SRC_W<'a> { + w: &'a mut W, +} +impl<'a> SRC_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SRC_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Fault input disabled"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(SRC_A::DISABLE) + } + #[doc = "MCEx (x=0,1) event input"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(SRC_A::ENABLE) + } + #[doc = "Inverted MCEx (x=0,1) event input"] + #[inline(always)] + pub fn invert(self) -> &'a mut W { + self.variant(SRC_A::INVERT) + } + #[doc = "Alternate fault (A or B) state at the end of the previous period"] + #[inline(always)] + pub fn altfault(self) -> &'a mut W { + self.variant(SRC_A::ALTFAULT) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +#[doc = "Field `KEEP` reader - Fault B Keeper"] +pub struct KEEP_R(crate::FieldReader); +impl KEEP_R { + pub(crate) fn new(bits: bool) -> Self { + KEEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for KEEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `KEEP` writer - Fault B Keeper"] +pub struct KEEP_W<'a> { + w: &'a mut W, +} +impl<'a> KEEP_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Field `QUAL` reader - Fault B Qualification"] +pub struct QUAL_R(crate::FieldReader); +impl QUAL_R { + pub(crate) fn new(bits: bool) -> Self { + QUAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for QUAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `QUAL` writer - Fault B Qualification"] +pub struct QUAL_W<'a> { + w: &'a mut W, +} +impl<'a> QUAL_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Fault B Blanking Mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum BLANK_A { + #[doc = "0: Blanking applied from start of the ramp"] + START = 0, + #[doc = "1: Blanking applied from rising edge of the output waveform"] + RISE = 1, + #[doc = "2: Blanking applied from falling edge of the output waveform"] + FALL = 2, + #[doc = "3: Blanking applied from each toggle of the output waveform"] + BOTH = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: BLANK_A) -> Self { + variant as _ + } +} +#[doc = "Field `BLANK` reader - Fault B Blanking Mode"] +pub struct BLANK_R(crate::FieldReader); +impl BLANK_R { + pub(crate) fn new(bits: u8) -> Self { + BLANK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BLANK_A { + match self.bits { + 0 => BLANK_A::START, + 1 => BLANK_A::RISE, + 2 => BLANK_A::FALL, + 3 => BLANK_A::BOTH, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `START`"] + #[inline(always)] + pub fn is_start(&self) -> bool { + **self == BLANK_A::START + } + #[doc = "Checks if the value of the field is `RISE`"] + #[inline(always)] + pub fn is_rise(&self) -> bool { + **self == BLANK_A::RISE + } + #[doc = "Checks if the value of the field is `FALL`"] + #[inline(always)] + pub fn is_fall(&self) -> bool { + **self == BLANK_A::FALL + } + #[doc = "Checks if the value of the field is `BOTH`"] + #[inline(always)] + pub fn is_both(&self) -> bool { + **self == BLANK_A::BOTH + } +} +impl core::ops::Deref for BLANK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BLANK` writer - Fault B Blanking Mode"] +pub struct BLANK_W<'a> { + w: &'a mut W, +} +impl<'a> BLANK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BLANK_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Blanking applied from start of the ramp"] + #[inline(always)] + pub fn start(self) -> &'a mut W { + self.variant(BLANK_A::START) + } + #[doc = "Blanking applied from rising edge of the output waveform"] + #[inline(always)] + pub fn rise(self) -> &'a mut W { + self.variant(BLANK_A::RISE) + } + #[doc = "Blanking applied from falling edge of the output waveform"] + #[inline(always)] + pub fn fall(self) -> &'a mut W { + self.variant(BLANK_A::FALL) + } + #[doc = "Blanking applied from each toggle of the output waveform"] + #[inline(always)] + pub fn both(self) -> &'a mut W { + self.variant(BLANK_A::BOTH) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 5)) | ((value as u32 & 0x03) << 5); + self.w + } +} +#[doc = "Field `RESTART` reader - Fault B Restart"] +pub struct RESTART_R(crate::FieldReader); +impl RESTART_R { + pub(crate) fn new(bits: bool) -> Self { + RESTART_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RESTART_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RESTART` writer - Fault B Restart"] +pub struct RESTART_W<'a> { + w: &'a mut W, +} +impl<'a> RESTART_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Fault B Halt Mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum HALT_A { + #[doc = "0: Halt action disabled"] + DISABLE = 0, + #[doc = "1: Hardware halt action"] + HW = 1, + #[doc = "2: Software halt action"] + SW = 2, + #[doc = "3: Non-recoverable fault"] + NR = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: HALT_A) -> Self { + variant as _ + } +} +#[doc = "Field `HALT` reader - Fault B Halt Mode"] +pub struct HALT_R(crate::FieldReader); +impl HALT_R { + pub(crate) fn new(bits: u8) -> Self { + HALT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> HALT_A { + match self.bits { + 0 => HALT_A::DISABLE, + 1 => HALT_A::HW, + 2 => HALT_A::SW, + 3 => HALT_A::NR, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == HALT_A::DISABLE + } + #[doc = "Checks if the value of the field is `HW`"] + #[inline(always)] + pub fn is_hw(&self) -> bool { + **self == HALT_A::HW + } + #[doc = "Checks if the value of the field is `SW`"] + #[inline(always)] + pub fn is_sw(&self) -> bool { + **self == HALT_A::SW + } + #[doc = "Checks if the value of the field is `NR`"] + #[inline(always)] + pub fn is_nr(&self) -> bool { + **self == HALT_A::NR + } +} +impl core::ops::Deref for HALT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HALT` writer - Fault B Halt Mode"] +pub struct HALT_W<'a> { + w: &'a mut W, +} +impl<'a> HALT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: HALT_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Halt action disabled"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(HALT_A::DISABLE) + } + #[doc = "Hardware halt action"] + #[inline(always)] + pub fn hw(self) -> &'a mut W { + self.variant(HALT_A::HW) + } + #[doc = "Software halt action"] + #[inline(always)] + pub fn sw(self) -> &'a mut W { + self.variant(HALT_A::SW) + } + #[doc = "Non-recoverable fault"] + #[inline(always)] + pub fn nr(self) -> &'a mut W { + self.variant(HALT_A::NR) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); + self.w + } +} +#[doc = "Fault B Capture Channel\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum CHSEL_A { + #[doc = "0: Capture value stored in channel 0"] + CC0 = 0, + #[doc = "1: Capture value stored in channel 1"] + CC1 = 1, + #[doc = "2: Capture value stored in channel 2"] + CC2 = 2, + #[doc = "3: Capture value stored in channel 3"] + CC3 = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: CHSEL_A) -> Self { + variant as _ + } +} +#[doc = "Field `CHSEL` reader - Fault B Capture Channel"] +pub struct CHSEL_R(crate::FieldReader); +impl CHSEL_R { + pub(crate) fn new(bits: u8) -> Self { + CHSEL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CHSEL_A { + match self.bits { + 0 => CHSEL_A::CC0, + 1 => CHSEL_A::CC1, + 2 => CHSEL_A::CC2, + 3 => CHSEL_A::CC3, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `CC0`"] + #[inline(always)] + pub fn is_cc0(&self) -> bool { + **self == CHSEL_A::CC0 + } + #[doc = "Checks if the value of the field is `CC1`"] + #[inline(always)] + pub fn is_cc1(&self) -> bool { + **self == CHSEL_A::CC1 + } + #[doc = "Checks if the value of the field is `CC2`"] + #[inline(always)] + pub fn is_cc2(&self) -> bool { + **self == CHSEL_A::CC2 + } + #[doc = "Checks if the value of the field is `CC3`"] + #[inline(always)] + pub fn is_cc3(&self) -> bool { + **self == CHSEL_A::CC3 + } +} +impl core::ops::Deref for CHSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHSEL` writer - Fault B Capture Channel"] +pub struct CHSEL_W<'a> { + w: &'a mut W, +} +impl<'a> CHSEL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CHSEL_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Capture value stored in channel 0"] + #[inline(always)] + pub fn cc0(self) -> &'a mut W { + self.variant(CHSEL_A::CC0) + } + #[doc = "Capture value stored in channel 1"] + #[inline(always)] + pub fn cc1(self) -> &'a mut W { + self.variant(CHSEL_A::CC1) + } + #[doc = "Capture value stored in channel 2"] + #[inline(always)] + pub fn cc2(self) -> &'a mut W { + self.variant(CHSEL_A::CC2) + } + #[doc = "Capture value stored in channel 3"] + #[inline(always)] + pub fn cc3(self) -> &'a mut W { + self.variant(CHSEL_A::CC3) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 10)) | ((value as u32 & 0x03) << 10); + self.w + } +} +#[doc = "Fault B Capture Action\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum CAPTURE_A { + #[doc = "0: No capture"] + DISABLE = 0, + #[doc = "1: Capture on fault"] + CAPT = 1, + #[doc = "2: Minimum capture"] + CAPTMIN = 2, + #[doc = "3: Maximum capture"] + CAPTMAX = 3, + #[doc = "4: Minimum local detection"] + LOCMIN = 4, + #[doc = "5: Maximum local detection"] + LOCMAX = 5, + #[doc = "6: Minimum and maximum local detection"] + DERIV0 = 6, + #[doc = "7: Capture with ramp index as MSB value"] + CAPTMARK = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: CAPTURE_A) -> Self { + variant as _ + } +} +#[doc = "Field `CAPTURE` reader - Fault B Capture Action"] +pub struct CAPTURE_R(crate::FieldReader); +impl CAPTURE_R { + pub(crate) fn new(bits: u8) -> Self { + CAPTURE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CAPTURE_A { + match self.bits { + 0 => CAPTURE_A::DISABLE, + 1 => CAPTURE_A::CAPT, + 2 => CAPTURE_A::CAPTMIN, + 3 => CAPTURE_A::CAPTMAX, + 4 => CAPTURE_A::LOCMIN, + 5 => CAPTURE_A::LOCMAX, + 6 => CAPTURE_A::DERIV0, + 7 => CAPTURE_A::CAPTMARK, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == CAPTURE_A::DISABLE + } + #[doc = "Checks if the value of the field is `CAPT`"] + #[inline(always)] + pub fn is_capt(&self) -> bool { + **self == CAPTURE_A::CAPT + } + #[doc = "Checks if the value of the field is `CAPTMIN`"] + #[inline(always)] + pub fn is_captmin(&self) -> bool { + **self == CAPTURE_A::CAPTMIN + } + #[doc = "Checks if the value of the field is `CAPTMAX`"] + #[inline(always)] + pub fn is_captmax(&self) -> bool { + **self == CAPTURE_A::CAPTMAX + } + #[doc = "Checks if the value of the field is `LOCMIN`"] + #[inline(always)] + pub fn is_locmin(&self) -> bool { + **self == CAPTURE_A::LOCMIN + } + #[doc = "Checks if the value of the field is `LOCMAX`"] + #[inline(always)] + pub fn is_locmax(&self) -> bool { + **self == CAPTURE_A::LOCMAX + } + #[doc = "Checks if the value of the field is `DERIV0`"] + #[inline(always)] + pub fn is_deriv0(&self) -> bool { + **self == CAPTURE_A::DERIV0 + } + #[doc = "Checks if the value of the field is `CAPTMARK`"] + #[inline(always)] + pub fn is_captmark(&self) -> bool { + **self == CAPTURE_A::CAPTMARK + } +} +impl core::ops::Deref for CAPTURE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CAPTURE` writer - Fault B Capture Action"] +pub struct CAPTURE_W<'a> { + w: &'a mut W, +} +impl<'a> CAPTURE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CAPTURE_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "No capture"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(CAPTURE_A::DISABLE) + } + #[doc = "Capture on fault"] + #[inline(always)] + pub fn capt(self) -> &'a mut W { + self.variant(CAPTURE_A::CAPT) + } + #[doc = "Minimum capture"] + #[inline(always)] + pub fn captmin(self) -> &'a mut W { + self.variant(CAPTURE_A::CAPTMIN) + } + #[doc = "Maximum capture"] + #[inline(always)] + pub fn captmax(self) -> &'a mut W { + self.variant(CAPTURE_A::CAPTMAX) + } + #[doc = "Minimum local detection"] + #[inline(always)] + pub fn locmin(self) -> &'a mut W { + self.variant(CAPTURE_A::LOCMIN) + } + #[doc = "Maximum local detection"] + #[inline(always)] + pub fn locmax(self) -> &'a mut W { + self.variant(CAPTURE_A::LOCMAX) + } + #[doc = "Minimum and maximum local detection"] + #[inline(always)] + pub fn deriv0(self) -> &'a mut W { + self.variant(CAPTURE_A::DERIV0) + } + #[doc = "Capture with ramp index as MSB value"] + #[inline(always)] + pub fn captmark(self) -> &'a mut W { + self.variant(CAPTURE_A::CAPTMARK) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12); + self.w + } +} +#[doc = "Field `BLANKPRESC` reader - Fault B Blanking Prescaler"] +pub struct BLANKPRESC_R(crate::FieldReader); +impl BLANKPRESC_R { + pub(crate) fn new(bits: bool) -> Self { + BLANKPRESC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BLANKPRESC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BLANKPRESC` writer - Fault B Blanking Prescaler"] +pub struct BLANKPRESC_W<'a> { + w: &'a mut W, +} +impl<'a> BLANKPRESC_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Field `BLANKVAL` reader - Fault B Blanking Time"] +pub struct BLANKVAL_R(crate::FieldReader); +impl BLANKVAL_R { + pub(crate) fn new(bits: u8) -> Self { + BLANKVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BLANKVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BLANKVAL` writer - Fault B Blanking Time"] +pub struct BLANKVAL_W<'a> { + w: &'a mut W, +} +impl<'a> BLANKVAL_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); + self.w + } +} +#[doc = "Field `FILTERVAL` reader - Fault B Filter Value"] +pub struct FILTERVAL_R(crate::FieldReader); +impl FILTERVAL_R { + pub(crate) fn new(bits: u8) -> Self { + FILTERVAL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FILTERVAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FILTERVAL` writer - Fault B Filter Value"] +pub struct FILTERVAL_W<'a> { + w: &'a mut W, +} +impl<'a> FILTERVAL_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Fault B Source"] + #[inline(always)] + pub fn src(&self) -> SRC_R { + SRC_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bit 3 - Fault B Keeper"] + #[inline(always)] + pub fn keep(&self) -> KEEP_R { + KEEP_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Fault B Qualification"] + #[inline(always)] + pub fn qual(&self) -> QUAL_R { + QUAL_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bits 5:6 - Fault B Blanking Mode"] + #[inline(always)] + pub fn blank(&self) -> BLANK_R { + BLANK_R::new(((self.bits >> 5) & 0x03) as u8) + } + #[doc = "Bit 7 - Fault B Restart"] + #[inline(always)] + pub fn restart(&self) -> RESTART_R { + RESTART_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bits 8:9 - Fault B Halt Mode"] + #[inline(always)] + pub fn halt(&self) -> HALT_R { + HALT_R::new(((self.bits >> 8) & 0x03) as u8) + } + #[doc = "Bits 10:11 - Fault B Capture Channel"] + #[inline(always)] + pub fn chsel(&self) -> CHSEL_R { + CHSEL_R::new(((self.bits >> 10) & 0x03) as u8) + } + #[doc = "Bits 12:14 - Fault B Capture Action"] + #[inline(always)] + pub fn capture(&self) -> CAPTURE_R { + CAPTURE_R::new(((self.bits >> 12) & 0x07) as u8) + } + #[doc = "Bit 15 - Fault B Blanking Prescaler"] + #[inline(always)] + pub fn blankpresc(&self) -> BLANKPRESC_R { + BLANKPRESC_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bits 16:23 - Fault B Blanking Time"] + #[inline(always)] + pub fn blankval(&self) -> BLANKVAL_R { + BLANKVAL_R::new(((self.bits >> 16) & 0xff) as u8) + } + #[doc = "Bits 24:27 - Fault B Filter Value"] + #[inline(always)] + pub fn filterval(&self) -> FILTERVAL_R { + FILTERVAL_R::new(((self.bits >> 24) & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Fault B Source"] + #[inline(always)] + pub fn src(&mut self) -> SRC_W { + SRC_W { w: self } + } + #[doc = "Bit 3 - Fault B Keeper"] + #[inline(always)] + pub fn keep(&mut self) -> KEEP_W { + KEEP_W { w: self } + } + #[doc = "Bit 4 - Fault B Qualification"] + #[inline(always)] + pub fn qual(&mut self) -> QUAL_W { + QUAL_W { w: self } + } + #[doc = "Bits 5:6 - Fault B Blanking Mode"] + #[inline(always)] + pub fn blank(&mut self) -> BLANK_W { + BLANK_W { w: self } + } + #[doc = "Bit 7 - Fault B Restart"] + #[inline(always)] + pub fn restart(&mut self) -> RESTART_W { + RESTART_W { w: self } + } + #[doc = "Bits 8:9 - Fault B Halt Mode"] + #[inline(always)] + pub fn halt(&mut self) -> HALT_W { + HALT_W { w: self } + } + #[doc = "Bits 10:11 - Fault B Capture Channel"] + #[inline(always)] + pub fn chsel(&mut self) -> CHSEL_W { + CHSEL_W { w: self } + } + #[doc = "Bits 12:14 - Fault B Capture Action"] + #[inline(always)] + pub fn capture(&mut self) -> CAPTURE_W { + CAPTURE_W { w: self } + } + #[doc = "Bit 15 - Fault B Blanking Prescaler"] + #[inline(always)] + pub fn blankpresc(&mut self) -> BLANKPRESC_W { + BLANKPRESC_W { w: self } + } + #[doc = "Bits 16:23 - Fault B Blanking Time"] + #[inline(always)] + pub fn blankval(&mut self) -> BLANKVAL_W { + BLANKVAL_W { w: self } + } + #[doc = "Bits 24:27 - Fault B Filter Value"] + #[inline(always)] + pub fn filterval(&mut self) -> FILTERVAL_W { + FILTERVAL_W { w: 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 = "Recoverable Fault B Configuration\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 [fctrlb](index.html) module"] +pub struct FCTRLB_SPEC; +impl crate::RegisterSpec for FCTRLB_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fctrlb::R](R) reader structure"] +impl crate::Readable for FCTRLB_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [fctrlb::W](W) writer structure"] +impl crate::Writable for FCTRLB_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FCTRLB to value 0"] +impl crate::Resettable for FCTRLB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/intenclr.rs b/src/tcc0/intenclr.rs new file mode 100644 index 0000000..f739234 --- /dev/null +++ b/src/tcc0/intenclr.rs @@ -0,0 +1,710 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `OVF` reader - Overflow Interrupt Enable"] +pub struct OVF_R(crate::FieldReader); +impl OVF_R { + pub(crate) fn new(bits: bool) -> Self { + OVF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OVF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVF` writer - Overflow Interrupt Enable"] +pub struct OVF_W<'a> { + w: &'a mut W, +} +impl<'a> OVF_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Field `TRG` reader - Retrigger Interrupt Enable"] +pub struct TRG_R(crate::FieldReader); +impl TRG_R { + pub(crate) fn new(bits: bool) -> Self { + TRG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRG` writer - Retrigger Interrupt Enable"] +pub struct TRG_W<'a> { + w: &'a mut W, +} +impl<'a> TRG_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Field `CNT` reader - Counter Interrupt Enable"] +pub struct CNT_R(crate::FieldReader); +impl CNT_R { + pub(crate) fn new(bits: bool) -> Self { + CNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CNT` writer - Counter Interrupt Enable"] +pub struct CNT_W<'a> { + w: &'a mut W, +} +impl<'a> CNT_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Field `ERR` reader - Error Interrupt Enable"] +pub struct ERR_R(crate::FieldReader); +impl ERR_R { + pub(crate) fn new(bits: bool) -> Self { + ERR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERR` writer - Error Interrupt Enable"] +pub struct ERR_W<'a> { + w: &'a mut W, +} +impl<'a> ERR_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Field `UFS` reader - Non-Recoverable Update Fault Interrupt Enable"] +pub struct UFS_R(crate::FieldReader); +impl UFS_R { + pub(crate) fn new(bits: bool) -> Self { + UFS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UFS` writer - Non-Recoverable Update Fault Interrupt Enable"] +pub struct UFS_W<'a> { + w: &'a mut W, +} +impl<'a> UFS_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Field `DFS` reader - Non-Recoverable Debug Fault Interrupt Enable"] +pub struct DFS_R(crate::FieldReader); +impl DFS_R { + pub(crate) fn new(bits: bool) -> Self { + DFS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DFS` writer - Non-Recoverable Debug Fault Interrupt Enable"] +pub struct DFS_W<'a> { + w: &'a mut W, +} +impl<'a> DFS_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Field `FAULTA` reader - Recoverable Fault A Interrupt Enable"] +pub struct FAULTA_R(crate::FieldReader); +impl FAULTA_R { + pub(crate) fn new(bits: bool) -> Self { + FAULTA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULTA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULTA` writer - Recoverable Fault A Interrupt Enable"] +pub struct FAULTA_W<'a> { + w: &'a mut W, +} +impl<'a> FAULTA_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Field `FAULTB` reader - Recoverable Fault B Interrupt Enable"] +pub struct FAULTB_R(crate::FieldReader); +impl FAULTB_R { + pub(crate) fn new(bits: bool) -> Self { + FAULTB_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULTB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULTB` writer - Recoverable Fault B Interrupt Enable"] +pub struct FAULTB_W<'a> { + w: &'a mut W, +} +impl<'a> FAULTB_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Field `FAULT0` reader - Non-Recoverable Fault 0 Interrupt Enable"] +pub struct FAULT0_R(crate::FieldReader); +impl FAULT0_R { + pub(crate) fn new(bits: bool) -> Self { + FAULT0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULT0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULT0` writer - Non-Recoverable Fault 0 Interrupt Enable"] +pub struct FAULT0_W<'a> { + w: &'a mut W, +} +impl<'a> FAULT0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Field `FAULT1` reader - Non-Recoverable Fault 1 Interrupt Enable"] +pub struct FAULT1_R(crate::FieldReader); +impl FAULT1_R { + pub(crate) fn new(bits: bool) -> Self { + FAULT1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULT1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULT1` writer - Non-Recoverable Fault 1 Interrupt Enable"] +pub struct FAULT1_W<'a> { + w: &'a mut W, +} +impl<'a> FAULT1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Field `MC0` reader - Match or Capture Channel 0 Interrupt Enable"] +pub struct MC0_R(crate::FieldReader); +impl MC0_R { + pub(crate) fn new(bits: bool) -> Self { + MC0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC0` writer - Match or Capture Channel 0 Interrupt Enable"] +pub struct MC0_W<'a> { + w: &'a mut W, +} +impl<'a> MC0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Field `MC1` reader - Match or Capture Channel 1 Interrupt Enable"] +pub struct MC1_R(crate::FieldReader); +impl MC1_R { + pub(crate) fn new(bits: bool) -> Self { + MC1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC1` writer - Match or Capture Channel 1 Interrupt Enable"] +pub struct MC1_W<'a> { + w: &'a mut W, +} +impl<'a> MC1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Field `MC2` reader - Match or Capture Channel 2 Interrupt Enable"] +pub struct MC2_R(crate::FieldReader); +impl MC2_R { + pub(crate) fn new(bits: bool) -> Self { + MC2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC2` writer - Match or Capture Channel 2 Interrupt Enable"] +pub struct MC2_W<'a> { + w: &'a mut W, +} +impl<'a> MC2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Field `MC3` reader - Match or Capture Channel 3 Interrupt Enable"] +pub struct MC3_R(crate::FieldReader); +impl MC3_R { + pub(crate) fn new(bits: bool) -> Self { + MC3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC3` writer - Match or Capture Channel 3 Interrupt Enable"] +pub struct MC3_W<'a> { + w: &'a mut W, +} +impl<'a> MC3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +impl R { + #[doc = "Bit 0 - Overflow Interrupt Enable"] + #[inline(always)] + pub fn ovf(&self) -> OVF_R { + OVF_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Retrigger Interrupt Enable"] + #[inline(always)] + pub fn trg(&self) -> TRG_R { + TRG_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Counter Interrupt Enable"] + #[inline(always)] + pub fn cnt(&self) -> CNT_R { + CNT_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Error Interrupt Enable"] + #[inline(always)] + pub fn err(&self) -> ERR_R { + ERR_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 10 - Non-Recoverable Update Fault Interrupt Enable"] + #[inline(always)] + pub fn ufs(&self) -> UFS_R { + UFS_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Non-Recoverable Debug Fault Interrupt Enable"] + #[inline(always)] + pub fn dfs(&self) -> DFS_R { + DFS_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Recoverable Fault A Interrupt Enable"] + #[inline(always)] + pub fn faulta(&self) -> FAULTA_R { + FAULTA_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Recoverable Fault B Interrupt Enable"] + #[inline(always)] + pub fn faultb(&self) -> FAULTB_R { + FAULTB_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Non-Recoverable Fault 0 Interrupt Enable"] + #[inline(always)] + pub fn fault0(&self) -> FAULT0_R { + FAULT0_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Non-Recoverable Fault 1 Interrupt Enable"] + #[inline(always)] + pub fn fault1(&self) -> FAULT1_R { + FAULT1_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Match or Capture Channel 0 Interrupt Enable"] + #[inline(always)] + pub fn mc0(&self) -> MC0_R { + MC0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Match or Capture Channel 1 Interrupt Enable"] + #[inline(always)] + pub fn mc1(&self) -> MC1_R { + MC1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Match or Capture Channel 2 Interrupt Enable"] + #[inline(always)] + pub fn mc2(&self) -> MC2_R { + MC2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Match or Capture Channel 3 Interrupt Enable"] + #[inline(always)] + pub fn mc3(&self) -> MC3_R { + MC3_R::new(((self.bits >> 19) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Overflow Interrupt Enable"] + #[inline(always)] + pub fn ovf(&mut self) -> OVF_W { + OVF_W { w: self } + } + #[doc = "Bit 1 - Retrigger Interrupt Enable"] + #[inline(always)] + pub fn trg(&mut self) -> TRG_W { + TRG_W { w: self } + } + #[doc = "Bit 2 - Counter Interrupt Enable"] + #[inline(always)] + pub fn cnt(&mut self) -> CNT_W { + CNT_W { w: self } + } + #[doc = "Bit 3 - Error Interrupt Enable"] + #[inline(always)] + pub fn err(&mut self) -> ERR_W { + ERR_W { w: self } + } + #[doc = "Bit 10 - Non-Recoverable Update Fault Interrupt Enable"] + #[inline(always)] + pub fn ufs(&mut self) -> UFS_W { + UFS_W { w: self } + } + #[doc = "Bit 11 - Non-Recoverable Debug Fault Interrupt Enable"] + #[inline(always)] + pub fn dfs(&mut self) -> DFS_W { + DFS_W { w: self } + } + #[doc = "Bit 12 - Recoverable Fault A Interrupt Enable"] + #[inline(always)] + pub fn faulta(&mut self) -> FAULTA_W { + FAULTA_W { w: self } + } + #[doc = "Bit 13 - Recoverable Fault B Interrupt Enable"] + #[inline(always)] + pub fn faultb(&mut self) -> FAULTB_W { + FAULTB_W { w: self } + } + #[doc = "Bit 14 - Non-Recoverable Fault 0 Interrupt Enable"] + #[inline(always)] + pub fn fault0(&mut self) -> FAULT0_W { + FAULT0_W { w: self } + } + #[doc = "Bit 15 - Non-Recoverable Fault 1 Interrupt Enable"] + #[inline(always)] + pub fn fault1(&mut self) -> FAULT1_W { + FAULT1_W { w: self } + } + #[doc = "Bit 16 - Match or Capture Channel 0 Interrupt Enable"] + #[inline(always)] + pub fn mc0(&mut self) -> MC0_W { + MC0_W { w: self } + } + #[doc = "Bit 17 - Match or Capture Channel 1 Interrupt Enable"] + #[inline(always)] + pub fn mc1(&mut self) -> MC1_W { + MC1_W { w: self } + } + #[doc = "Bit 18 - Match or Capture Channel 2 Interrupt Enable"] + #[inline(always)] + pub fn mc2(&mut self) -> MC2_W { + MC2_W { w: self } + } + #[doc = "Bit 19 - Match or Capture Channel 3 Interrupt Enable"] + #[inline(always)] + pub fn mc3(&mut self) -> MC3_W { + MC3_W { w: 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 = "Interrupt Enable Clear\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 [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/intenset.rs b/src/tcc0/intenset.rs new file mode 100644 index 0000000..e45aeac --- /dev/null +++ b/src/tcc0/intenset.rs @@ -0,0 +1,710 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `OVF` reader - Overflow Interrupt Enable"] +pub struct OVF_R(crate::FieldReader); +impl OVF_R { + pub(crate) fn new(bits: bool) -> Self { + OVF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OVF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVF` writer - Overflow Interrupt Enable"] +pub struct OVF_W<'a> { + w: &'a mut W, +} +impl<'a> OVF_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Field `TRG` reader - Retrigger Interrupt Enable"] +pub struct TRG_R(crate::FieldReader); +impl TRG_R { + pub(crate) fn new(bits: bool) -> Self { + TRG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRG` writer - Retrigger Interrupt Enable"] +pub struct TRG_W<'a> { + w: &'a mut W, +} +impl<'a> TRG_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Field `CNT` reader - Counter Interrupt Enable"] +pub struct CNT_R(crate::FieldReader); +impl CNT_R { + pub(crate) fn new(bits: bool) -> Self { + CNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CNT` writer - Counter Interrupt Enable"] +pub struct CNT_W<'a> { + w: &'a mut W, +} +impl<'a> CNT_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Field `ERR` reader - Error Interrupt Enable"] +pub struct ERR_R(crate::FieldReader); +impl ERR_R { + pub(crate) fn new(bits: bool) -> Self { + ERR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERR` writer - Error Interrupt Enable"] +pub struct ERR_W<'a> { + w: &'a mut W, +} +impl<'a> ERR_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Field `UFS` reader - Non-Recoverable Update Fault Interrupt Enable"] +pub struct UFS_R(crate::FieldReader); +impl UFS_R { + pub(crate) fn new(bits: bool) -> Self { + UFS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UFS` writer - Non-Recoverable Update Fault Interrupt Enable"] +pub struct UFS_W<'a> { + w: &'a mut W, +} +impl<'a> UFS_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Field `DFS` reader - Non-Recoverable Debug Fault Interrupt Enable"] +pub struct DFS_R(crate::FieldReader); +impl DFS_R { + pub(crate) fn new(bits: bool) -> Self { + DFS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DFS` writer - Non-Recoverable Debug Fault Interrupt Enable"] +pub struct DFS_W<'a> { + w: &'a mut W, +} +impl<'a> DFS_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Field `FAULTA` reader - Recoverable Fault A Interrupt Enable"] +pub struct FAULTA_R(crate::FieldReader); +impl FAULTA_R { + pub(crate) fn new(bits: bool) -> Self { + FAULTA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULTA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULTA` writer - Recoverable Fault A Interrupt Enable"] +pub struct FAULTA_W<'a> { + w: &'a mut W, +} +impl<'a> FAULTA_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Field `FAULTB` reader - Recoverable Fault B Interrupt Enable"] +pub struct FAULTB_R(crate::FieldReader); +impl FAULTB_R { + pub(crate) fn new(bits: bool) -> Self { + FAULTB_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULTB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULTB` writer - Recoverable Fault B Interrupt Enable"] +pub struct FAULTB_W<'a> { + w: &'a mut W, +} +impl<'a> FAULTB_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Field `FAULT0` reader - Non-Recoverable Fault 0 Interrupt Enable"] +pub struct FAULT0_R(crate::FieldReader); +impl FAULT0_R { + pub(crate) fn new(bits: bool) -> Self { + FAULT0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULT0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULT0` writer - Non-Recoverable Fault 0 Interrupt Enable"] +pub struct FAULT0_W<'a> { + w: &'a mut W, +} +impl<'a> FAULT0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Field `FAULT1` reader - Non-Recoverable Fault 1 Interrupt Enable"] +pub struct FAULT1_R(crate::FieldReader); +impl FAULT1_R { + pub(crate) fn new(bits: bool) -> Self { + FAULT1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULT1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULT1` writer - Non-Recoverable Fault 1 Interrupt Enable"] +pub struct FAULT1_W<'a> { + w: &'a mut W, +} +impl<'a> FAULT1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Field `MC0` reader - Match or Capture Channel 0 Interrupt Enable"] +pub struct MC0_R(crate::FieldReader); +impl MC0_R { + pub(crate) fn new(bits: bool) -> Self { + MC0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC0` writer - Match or Capture Channel 0 Interrupt Enable"] +pub struct MC0_W<'a> { + w: &'a mut W, +} +impl<'a> MC0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Field `MC1` reader - Match or Capture Channel 1 Interrupt Enable"] +pub struct MC1_R(crate::FieldReader); +impl MC1_R { + pub(crate) fn new(bits: bool) -> Self { + MC1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC1` writer - Match or Capture Channel 1 Interrupt Enable"] +pub struct MC1_W<'a> { + w: &'a mut W, +} +impl<'a> MC1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Field `MC2` reader - Match or Capture Channel 2 Interrupt Enable"] +pub struct MC2_R(crate::FieldReader); +impl MC2_R { + pub(crate) fn new(bits: bool) -> Self { + MC2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC2` writer - Match or Capture Channel 2 Interrupt Enable"] +pub struct MC2_W<'a> { + w: &'a mut W, +} +impl<'a> MC2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Field `MC3` reader - Match or Capture Channel 3 Interrupt Enable"] +pub struct MC3_R(crate::FieldReader); +impl MC3_R { + pub(crate) fn new(bits: bool) -> Self { + MC3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC3` writer - Match or Capture Channel 3 Interrupt Enable"] +pub struct MC3_W<'a> { + w: &'a mut W, +} +impl<'a> MC3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +impl R { + #[doc = "Bit 0 - Overflow Interrupt Enable"] + #[inline(always)] + pub fn ovf(&self) -> OVF_R { + OVF_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Retrigger Interrupt Enable"] + #[inline(always)] + pub fn trg(&self) -> TRG_R { + TRG_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Counter Interrupt Enable"] + #[inline(always)] + pub fn cnt(&self) -> CNT_R { + CNT_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Error Interrupt Enable"] + #[inline(always)] + pub fn err(&self) -> ERR_R { + ERR_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 10 - Non-Recoverable Update Fault Interrupt Enable"] + #[inline(always)] + pub fn ufs(&self) -> UFS_R { + UFS_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Non-Recoverable Debug Fault Interrupt Enable"] + #[inline(always)] + pub fn dfs(&self) -> DFS_R { + DFS_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Recoverable Fault A Interrupt Enable"] + #[inline(always)] + pub fn faulta(&self) -> FAULTA_R { + FAULTA_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Recoverable Fault B Interrupt Enable"] + #[inline(always)] + pub fn faultb(&self) -> FAULTB_R { + FAULTB_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Non-Recoverable Fault 0 Interrupt Enable"] + #[inline(always)] + pub fn fault0(&self) -> FAULT0_R { + FAULT0_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Non-Recoverable Fault 1 Interrupt Enable"] + #[inline(always)] + pub fn fault1(&self) -> FAULT1_R { + FAULT1_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Match or Capture Channel 0 Interrupt Enable"] + #[inline(always)] + pub fn mc0(&self) -> MC0_R { + MC0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Match or Capture Channel 1 Interrupt Enable"] + #[inline(always)] + pub fn mc1(&self) -> MC1_R { + MC1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Match or Capture Channel 2 Interrupt Enable"] + #[inline(always)] + pub fn mc2(&self) -> MC2_R { + MC2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Match or Capture Channel 3 Interrupt Enable"] + #[inline(always)] + pub fn mc3(&self) -> MC3_R { + MC3_R::new(((self.bits >> 19) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Overflow Interrupt Enable"] + #[inline(always)] + pub fn ovf(&mut self) -> OVF_W { + OVF_W { w: self } + } + #[doc = "Bit 1 - Retrigger Interrupt Enable"] + #[inline(always)] + pub fn trg(&mut self) -> TRG_W { + TRG_W { w: self } + } + #[doc = "Bit 2 - Counter Interrupt Enable"] + #[inline(always)] + pub fn cnt(&mut self) -> CNT_W { + CNT_W { w: self } + } + #[doc = "Bit 3 - Error Interrupt Enable"] + #[inline(always)] + pub fn err(&mut self) -> ERR_W { + ERR_W { w: self } + } + #[doc = "Bit 10 - Non-Recoverable Update Fault Interrupt Enable"] + #[inline(always)] + pub fn ufs(&mut self) -> UFS_W { + UFS_W { w: self } + } + #[doc = "Bit 11 - Non-Recoverable Debug Fault Interrupt Enable"] + #[inline(always)] + pub fn dfs(&mut self) -> DFS_W { + DFS_W { w: self } + } + #[doc = "Bit 12 - Recoverable Fault A Interrupt Enable"] + #[inline(always)] + pub fn faulta(&mut self) -> FAULTA_W { + FAULTA_W { w: self } + } + #[doc = "Bit 13 - Recoverable Fault B Interrupt Enable"] + #[inline(always)] + pub fn faultb(&mut self) -> FAULTB_W { + FAULTB_W { w: self } + } + #[doc = "Bit 14 - Non-Recoverable Fault 0 Interrupt Enable"] + #[inline(always)] + pub fn fault0(&mut self) -> FAULT0_W { + FAULT0_W { w: self } + } + #[doc = "Bit 15 - Non-Recoverable Fault 1 Interrupt Enable"] + #[inline(always)] + pub fn fault1(&mut self) -> FAULT1_W { + FAULT1_W { w: self } + } + #[doc = "Bit 16 - Match or Capture Channel 0 Interrupt Enable"] + #[inline(always)] + pub fn mc0(&mut self) -> MC0_W { + MC0_W { w: self } + } + #[doc = "Bit 17 - Match or Capture Channel 1 Interrupt Enable"] + #[inline(always)] + pub fn mc1(&mut self) -> MC1_W { + MC1_W { w: self } + } + #[doc = "Bit 18 - Match or Capture Channel 2 Interrupt Enable"] + #[inline(always)] + pub fn mc2(&mut self) -> MC2_W { + MC2_W { w: self } + } + #[doc = "Bit 19 - Match or Capture Channel 3 Interrupt Enable"] + #[inline(always)] + pub fn mc3(&mut self) -> MC3_W { + MC3_W { w: 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 = "Interrupt Enable Set\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 [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/intflag.rs b/src/tcc0/intflag.rs new file mode 100644 index 0000000..31e09ba --- /dev/null +++ b/src/tcc0/intflag.rs @@ -0,0 +1,710 @@ +#[doc = "Register `INTFLAG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTFLAG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `OVF` reader - Overflow"] +pub struct OVF_R(crate::FieldReader); +impl OVF_R { + pub(crate) fn new(bits: bool) -> Self { + OVF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OVF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVF` writer - Overflow"] +pub struct OVF_W<'a> { + w: &'a mut W, +} +impl<'a> OVF_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Field `TRG` reader - Retrigger"] +pub struct TRG_R(crate::FieldReader); +impl TRG_R { + pub(crate) fn new(bits: bool) -> Self { + TRG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TRG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRG` writer - Retrigger"] +pub struct TRG_W<'a> { + w: &'a mut W, +} +impl<'a> TRG_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Field `CNT` reader - Counter"] +pub struct CNT_R(crate::FieldReader); +impl CNT_R { + pub(crate) fn new(bits: bool) -> Self { + CNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CNT` writer - Counter"] +pub struct CNT_W<'a> { + w: &'a mut W, +} +impl<'a> CNT_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Field `ERR` reader - Error"] +pub struct ERR_R(crate::FieldReader); +impl ERR_R { + pub(crate) fn new(bits: bool) -> Self { + ERR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ERR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERR` writer - Error"] +pub struct ERR_W<'a> { + w: &'a mut W, +} +impl<'a> ERR_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Field `UFS` reader - Non-Recoverable Update Fault"] +pub struct UFS_R(crate::FieldReader); +impl UFS_R { + pub(crate) fn new(bits: bool) -> Self { + UFS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UFS` writer - Non-Recoverable Update Fault"] +pub struct UFS_W<'a> { + w: &'a mut W, +} +impl<'a> UFS_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Field `DFS` reader - Non-Recoverable Debug Fault"] +pub struct DFS_R(crate::FieldReader); +impl DFS_R { + pub(crate) fn new(bits: bool) -> Self { + DFS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DFS` writer - Non-Recoverable Debug Fault"] +pub struct DFS_W<'a> { + w: &'a mut W, +} +impl<'a> DFS_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Field `FAULTA` reader - Recoverable Fault A"] +pub struct FAULTA_R(crate::FieldReader); +impl FAULTA_R { + pub(crate) fn new(bits: bool) -> Self { + FAULTA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULTA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULTA` writer - Recoverable Fault A"] +pub struct FAULTA_W<'a> { + w: &'a mut W, +} +impl<'a> FAULTA_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Field `FAULTB` reader - Recoverable Fault B"] +pub struct FAULTB_R(crate::FieldReader); +impl FAULTB_R { + pub(crate) fn new(bits: bool) -> Self { + FAULTB_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULTB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULTB` writer - Recoverable Fault B"] +pub struct FAULTB_W<'a> { + w: &'a mut W, +} +impl<'a> FAULTB_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Field `FAULT0` reader - Non-Recoverable Fault 0"] +pub struct FAULT0_R(crate::FieldReader); +impl FAULT0_R { + pub(crate) fn new(bits: bool) -> Self { + FAULT0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULT0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULT0` writer - Non-Recoverable Fault 0"] +pub struct FAULT0_W<'a> { + w: &'a mut W, +} +impl<'a> FAULT0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Field `FAULT1` reader - Non-Recoverable Fault 1"] +pub struct FAULT1_R(crate::FieldReader); +impl FAULT1_R { + pub(crate) fn new(bits: bool) -> Self { + FAULT1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULT1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULT1` writer - Non-Recoverable Fault 1"] +pub struct FAULT1_W<'a> { + w: &'a mut W, +} +impl<'a> FAULT1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Field `MC0` reader - Match or Capture 0"] +pub struct MC0_R(crate::FieldReader); +impl MC0_R { + pub(crate) fn new(bits: bool) -> Self { + MC0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC0` writer - Match or Capture 0"] +pub struct MC0_W<'a> { + w: &'a mut W, +} +impl<'a> MC0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Field `MC1` reader - Match or Capture 1"] +pub struct MC1_R(crate::FieldReader); +impl MC1_R { + pub(crate) fn new(bits: bool) -> Self { + MC1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC1` writer - Match or Capture 1"] +pub struct MC1_W<'a> { + w: &'a mut W, +} +impl<'a> MC1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Field `MC2` reader - Match or Capture 2"] +pub struct MC2_R(crate::FieldReader); +impl MC2_R { + pub(crate) fn new(bits: bool) -> Self { + MC2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC2` writer - Match or Capture 2"] +pub struct MC2_W<'a> { + w: &'a mut W, +} +impl<'a> MC2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Field `MC3` reader - Match or Capture 3"] +pub struct MC3_R(crate::FieldReader); +impl MC3_R { + pub(crate) fn new(bits: bool) -> Self { + MC3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MC3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MC3` writer - Match or Capture 3"] +pub struct MC3_W<'a> { + w: &'a mut W, +} +impl<'a> MC3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +impl R { + #[doc = "Bit 0 - Overflow"] + #[inline(always)] + pub fn ovf(&self) -> OVF_R { + OVF_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Retrigger"] + #[inline(always)] + pub fn trg(&self) -> TRG_R { + TRG_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Counter"] + #[inline(always)] + pub fn cnt(&self) -> CNT_R { + CNT_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Error"] + #[inline(always)] + pub fn err(&self) -> ERR_R { + ERR_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 10 - Non-Recoverable Update Fault"] + #[inline(always)] + pub fn ufs(&self) -> UFS_R { + UFS_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Non-Recoverable Debug Fault"] + #[inline(always)] + pub fn dfs(&self) -> DFS_R { + DFS_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Recoverable Fault A"] + #[inline(always)] + pub fn faulta(&self) -> FAULTA_R { + FAULTA_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Recoverable Fault B"] + #[inline(always)] + pub fn faultb(&self) -> FAULTB_R { + FAULTB_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Non-Recoverable Fault 0"] + #[inline(always)] + pub fn fault0(&self) -> FAULT0_R { + FAULT0_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Non-Recoverable Fault 1"] + #[inline(always)] + pub fn fault1(&self) -> FAULT1_R { + FAULT1_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Match or Capture 0"] + #[inline(always)] + pub fn mc0(&self) -> MC0_R { + MC0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Match or Capture 1"] + #[inline(always)] + pub fn mc1(&self) -> MC1_R { + MC1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Match or Capture 2"] + #[inline(always)] + pub fn mc2(&self) -> MC2_R { + MC2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Match or Capture 3"] + #[inline(always)] + pub fn mc3(&self) -> MC3_R { + MC3_R::new(((self.bits >> 19) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Overflow"] + #[inline(always)] + pub fn ovf(&mut self) -> OVF_W { + OVF_W { w: self } + } + #[doc = "Bit 1 - Retrigger"] + #[inline(always)] + pub fn trg(&mut self) -> TRG_W { + TRG_W { w: self } + } + #[doc = "Bit 2 - Counter"] + #[inline(always)] + pub fn cnt(&mut self) -> CNT_W { + CNT_W { w: self } + } + #[doc = "Bit 3 - Error"] + #[inline(always)] + pub fn err(&mut self) -> ERR_W { + ERR_W { w: self } + } + #[doc = "Bit 10 - Non-Recoverable Update Fault"] + #[inline(always)] + pub fn ufs(&mut self) -> UFS_W { + UFS_W { w: self } + } + #[doc = "Bit 11 - Non-Recoverable Debug Fault"] + #[inline(always)] + pub fn dfs(&mut self) -> DFS_W { + DFS_W { w: self } + } + #[doc = "Bit 12 - Recoverable Fault A"] + #[inline(always)] + pub fn faulta(&mut self) -> FAULTA_W { + FAULTA_W { w: self } + } + #[doc = "Bit 13 - Recoverable Fault B"] + #[inline(always)] + pub fn faultb(&mut self) -> FAULTB_W { + FAULTB_W { w: self } + } + #[doc = "Bit 14 - Non-Recoverable Fault 0"] + #[inline(always)] + pub fn fault0(&mut self) -> FAULT0_W { + FAULT0_W { w: self } + } + #[doc = "Bit 15 - Non-Recoverable Fault 1"] + #[inline(always)] + pub fn fault1(&mut self) -> FAULT1_W { + FAULT1_W { w: self } + } + #[doc = "Bit 16 - Match or Capture 0"] + #[inline(always)] + pub fn mc0(&mut self) -> MC0_W { + MC0_W { w: self } + } + #[doc = "Bit 17 - Match or Capture 1"] + #[inline(always)] + pub fn mc1(&mut self) -> MC1_W { + MC1_W { w: self } + } + #[doc = "Bit 18 - Match or Capture 2"] + #[inline(always)] + pub fn mc2(&mut self) -> MC2_W { + MC2_W { w: self } + } + #[doc = "Bit 19 - Match or Capture 3"] + #[inline(always)] + pub fn mc3(&mut self) -> MC3_W { + MC3_W { w: 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 = "Interrupt Flag Status and Clear\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 [intflag](index.html) module"] +pub struct INTFLAG_SPEC; +impl crate::RegisterSpec for INTFLAG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intflag::R](R) reader structure"] +impl crate::Readable for INTFLAG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intflag::W](W) writer structure"] +impl crate::Writable for INTFLAG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTFLAG to value 0"] +impl crate::Resettable for INTFLAG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/patt.rs b/src/tcc0/patt.rs new file mode 100644 index 0000000..6852ebf --- /dev/null +++ b/src/tcc0/patt.rs @@ -0,0 +1,802 @@ +#[doc = "Register `PATT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PATT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PGE0` reader - Pattern Generator 0 Output Enable"] +pub struct PGE0_R(crate::FieldReader); +impl PGE0_R { + pub(crate) fn new(bits: bool) -> Self { + PGE0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGE0` writer - Pattern Generator 0 Output Enable"] +pub struct PGE0_W<'a> { + w: &'a mut W, +} +impl<'a> PGE0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u16 & 0x01); + self.w + } +} +#[doc = "Field `PGE1` reader - Pattern Generator 1 Output Enable"] +pub struct PGE1_R(crate::FieldReader); +impl PGE1_R { + pub(crate) fn new(bits: bool) -> Self { + PGE1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGE1` writer - Pattern Generator 1 Output Enable"] +pub struct PGE1_W<'a> { + w: &'a mut W, +} +impl<'a> PGE1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u16 & 0x01) << 1); + self.w + } +} +#[doc = "Field `PGE2` reader - Pattern Generator 2 Output Enable"] +pub struct PGE2_R(crate::FieldReader); +impl PGE2_R { + pub(crate) fn new(bits: bool) -> Self { + PGE2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGE2` writer - Pattern Generator 2 Output Enable"] +pub struct PGE2_W<'a> { + w: &'a mut W, +} +impl<'a> PGE2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u16 & 0x01) << 2); + self.w + } +} +#[doc = "Field `PGE3` reader - Pattern Generator 3 Output Enable"] +pub struct PGE3_R(crate::FieldReader); +impl PGE3_R { + pub(crate) fn new(bits: bool) -> Self { + PGE3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGE3` writer - Pattern Generator 3 Output Enable"] +pub struct PGE3_W<'a> { + w: &'a mut W, +} +impl<'a> PGE3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u16 & 0x01) << 3); + self.w + } +} +#[doc = "Field `PGE4` reader - Pattern Generator 4 Output Enable"] +pub struct PGE4_R(crate::FieldReader); +impl PGE4_R { + pub(crate) fn new(bits: bool) -> Self { + PGE4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGE4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGE4` writer - Pattern Generator 4 Output Enable"] +pub struct PGE4_W<'a> { + w: &'a mut W, +} +impl<'a> PGE4_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u16 & 0x01) << 4); + self.w + } +} +#[doc = "Field `PGE5` reader - Pattern Generator 5 Output Enable"] +pub struct PGE5_R(crate::FieldReader); +impl PGE5_R { + pub(crate) fn new(bits: bool) -> Self { + PGE5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGE5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGE5` writer - Pattern Generator 5 Output Enable"] +pub struct PGE5_W<'a> { + w: &'a mut W, +} +impl<'a> PGE5_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u16 & 0x01) << 5); + self.w + } +} +#[doc = "Field `PGE6` reader - Pattern Generator 6 Output Enable"] +pub struct PGE6_R(crate::FieldReader); +impl PGE6_R { + pub(crate) fn new(bits: bool) -> Self { + PGE6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGE6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGE6` writer - Pattern Generator 6 Output Enable"] +pub struct PGE6_W<'a> { + w: &'a mut W, +} +impl<'a> PGE6_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u16 & 0x01) << 6); + self.w + } +} +#[doc = "Field `PGE7` reader - Pattern Generator 7 Output Enable"] +pub struct PGE7_R(crate::FieldReader); +impl PGE7_R { + pub(crate) fn new(bits: bool) -> Self { + PGE7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGE7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGE7` writer - Pattern Generator 7 Output Enable"] +pub struct PGE7_W<'a> { + w: &'a mut W, +} +impl<'a> PGE7_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u16 & 0x01) << 7); + self.w + } +} +#[doc = "Field `PGV0` reader - Pattern Generator 0 Output Value"] +pub struct PGV0_R(crate::FieldReader); +impl PGV0_R { + pub(crate) fn new(bits: bool) -> Self { + PGV0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGV0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGV0` writer - Pattern Generator 0 Output Value"] +pub struct PGV0_W<'a> { + w: &'a mut W, +} +impl<'a> PGV0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u16 & 0x01) << 8); + self.w + } +} +#[doc = "Field `PGV1` reader - Pattern Generator 1 Output Value"] +pub struct PGV1_R(crate::FieldReader); +impl PGV1_R { + pub(crate) fn new(bits: bool) -> Self { + PGV1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGV1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGV1` writer - Pattern Generator 1 Output Value"] +pub struct PGV1_W<'a> { + w: &'a mut W, +} +impl<'a> PGV1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u16 & 0x01) << 9); + self.w + } +} +#[doc = "Field `PGV2` reader - Pattern Generator 2 Output Value"] +pub struct PGV2_R(crate::FieldReader); +impl PGV2_R { + pub(crate) fn new(bits: bool) -> Self { + PGV2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGV2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGV2` writer - Pattern Generator 2 Output Value"] +pub struct PGV2_W<'a> { + w: &'a mut W, +} +impl<'a> PGV2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u16 & 0x01) << 10); + self.w + } +} +#[doc = "Field `PGV3` reader - Pattern Generator 3 Output Value"] +pub struct PGV3_R(crate::FieldReader); +impl PGV3_R { + pub(crate) fn new(bits: bool) -> Self { + PGV3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGV3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGV3` writer - Pattern Generator 3 Output Value"] +pub struct PGV3_W<'a> { + w: &'a mut W, +} +impl<'a> PGV3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u16 & 0x01) << 11); + self.w + } +} +#[doc = "Field `PGV4` reader - Pattern Generator 4 Output Value"] +pub struct PGV4_R(crate::FieldReader); +impl PGV4_R { + pub(crate) fn new(bits: bool) -> Self { + PGV4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGV4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGV4` writer - Pattern Generator 4 Output Value"] +pub struct PGV4_W<'a> { + w: &'a mut W, +} +impl<'a> PGV4_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u16 & 0x01) << 12); + self.w + } +} +#[doc = "Field `PGV5` reader - Pattern Generator 5 Output Value"] +pub struct PGV5_R(crate::FieldReader); +impl PGV5_R { + pub(crate) fn new(bits: bool) -> Self { + PGV5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGV5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGV5` writer - Pattern Generator 5 Output Value"] +pub struct PGV5_W<'a> { + w: &'a mut W, +} +impl<'a> PGV5_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u16 & 0x01) << 13); + self.w + } +} +#[doc = "Field `PGV6` reader - Pattern Generator 6 Output Value"] +pub struct PGV6_R(crate::FieldReader); +impl PGV6_R { + pub(crate) fn new(bits: bool) -> Self { + PGV6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGV6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGV6` writer - Pattern Generator 6 Output Value"] +pub struct PGV6_W<'a> { + w: &'a mut W, +} +impl<'a> PGV6_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u16 & 0x01) << 14); + self.w + } +} +#[doc = "Field `PGV7` reader - Pattern Generator 7 Output Value"] +pub struct PGV7_R(crate::FieldReader); +impl PGV7_R { + pub(crate) fn new(bits: bool) -> Self { + PGV7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGV7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGV7` writer - Pattern Generator 7 Output Value"] +pub struct PGV7_W<'a> { + w: &'a mut W, +} +impl<'a> PGV7_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u16 & 0x01) << 15); + self.w + } +} +impl R { + #[doc = "Bit 0 - Pattern Generator 0 Output Enable"] + #[inline(always)] + pub fn pge0(&self) -> PGE0_R { + PGE0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Pattern Generator 1 Output Enable"] + #[inline(always)] + pub fn pge1(&self) -> PGE1_R { + PGE1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Pattern Generator 2 Output Enable"] + #[inline(always)] + pub fn pge2(&self) -> PGE2_R { + PGE2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Pattern Generator 3 Output Enable"] + #[inline(always)] + pub fn pge3(&self) -> PGE3_R { + PGE3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Pattern Generator 4 Output Enable"] + #[inline(always)] + pub fn pge4(&self) -> PGE4_R { + PGE4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Pattern Generator 5 Output Enable"] + #[inline(always)] + pub fn pge5(&self) -> PGE5_R { + PGE5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Pattern Generator 6 Output Enable"] + #[inline(always)] + pub fn pge6(&self) -> PGE6_R { + PGE6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Pattern Generator 7 Output Enable"] + #[inline(always)] + pub fn pge7(&self) -> PGE7_R { + PGE7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Pattern Generator 0 Output Value"] + #[inline(always)] + pub fn pgv0(&self) -> PGV0_R { + PGV0_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Pattern Generator 1 Output Value"] + #[inline(always)] + pub fn pgv1(&self) -> PGV1_R { + PGV1_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Pattern Generator 2 Output Value"] + #[inline(always)] + pub fn pgv2(&self) -> PGV2_R { + PGV2_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Pattern Generator 3 Output Value"] + #[inline(always)] + pub fn pgv3(&self) -> PGV3_R { + PGV3_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Pattern Generator 4 Output Value"] + #[inline(always)] + pub fn pgv4(&self) -> PGV4_R { + PGV4_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Pattern Generator 5 Output Value"] + #[inline(always)] + pub fn pgv5(&self) -> PGV5_R { + PGV5_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Pattern Generator 6 Output Value"] + #[inline(always)] + pub fn pgv6(&self) -> PGV6_R { + PGV6_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Pattern Generator 7 Output Value"] + #[inline(always)] + pub fn pgv7(&self) -> PGV7_R { + PGV7_R::new(((self.bits >> 15) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Pattern Generator 0 Output Enable"] + #[inline(always)] + pub fn pge0(&mut self) -> PGE0_W { + PGE0_W { w: self } + } + #[doc = "Bit 1 - Pattern Generator 1 Output Enable"] + #[inline(always)] + pub fn pge1(&mut self) -> PGE1_W { + PGE1_W { w: self } + } + #[doc = "Bit 2 - Pattern Generator 2 Output Enable"] + #[inline(always)] + pub fn pge2(&mut self) -> PGE2_W { + PGE2_W { w: self } + } + #[doc = "Bit 3 - Pattern Generator 3 Output Enable"] + #[inline(always)] + pub fn pge3(&mut self) -> PGE3_W { + PGE3_W { w: self } + } + #[doc = "Bit 4 - Pattern Generator 4 Output Enable"] + #[inline(always)] + pub fn pge4(&mut self) -> PGE4_W { + PGE4_W { w: self } + } + #[doc = "Bit 5 - Pattern Generator 5 Output Enable"] + #[inline(always)] + pub fn pge5(&mut self) -> PGE5_W { + PGE5_W { w: self } + } + #[doc = "Bit 6 - Pattern Generator 6 Output Enable"] + #[inline(always)] + pub fn pge6(&mut self) -> PGE6_W { + PGE6_W { w: self } + } + #[doc = "Bit 7 - Pattern Generator 7 Output Enable"] + #[inline(always)] + pub fn pge7(&mut self) -> PGE7_W { + PGE7_W { w: self } + } + #[doc = "Bit 8 - Pattern Generator 0 Output Value"] + #[inline(always)] + pub fn pgv0(&mut self) -> PGV0_W { + PGV0_W { w: self } + } + #[doc = "Bit 9 - Pattern Generator 1 Output Value"] + #[inline(always)] + pub fn pgv1(&mut self) -> PGV1_W { + PGV1_W { w: self } + } + #[doc = "Bit 10 - Pattern Generator 2 Output Value"] + #[inline(always)] + pub fn pgv2(&mut self) -> PGV2_W { + PGV2_W { w: self } + } + #[doc = "Bit 11 - Pattern Generator 3 Output Value"] + #[inline(always)] + pub fn pgv3(&mut self) -> PGV3_W { + PGV3_W { w: self } + } + #[doc = "Bit 12 - Pattern Generator 4 Output Value"] + #[inline(always)] + pub fn pgv4(&mut self) -> PGV4_W { + PGV4_W { w: self } + } + #[doc = "Bit 13 - Pattern Generator 5 Output Value"] + #[inline(always)] + pub fn pgv5(&mut self) -> PGV5_W { + PGV5_W { w: self } + } + #[doc = "Bit 14 - Pattern Generator 6 Output Value"] + #[inline(always)] + pub fn pgv6(&mut self) -> PGV6_W { + PGV6_W { w: self } + } + #[doc = "Bit 15 - Pattern Generator 7 Output Value"] + #[inline(always)] + pub fn pgv7(&mut self) -> PGV7_W { + PGV7_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pattern\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 [patt](index.html) module"] +pub struct PATT_SPEC; +impl crate::RegisterSpec for PATT_SPEC { + type Ux = u16; +} +#[doc = "`read()` method returns [patt::R](R) reader structure"] +impl crate::Readable for PATT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [patt::W](W) writer structure"] +impl crate::Writable for PATT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PATT to value 0"] +impl crate::Resettable for PATT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/pattbuf.rs b/src/tcc0/pattbuf.rs new file mode 100644 index 0000000..989a66e --- /dev/null +++ b/src/tcc0/pattbuf.rs @@ -0,0 +1,802 @@ +#[doc = "Register `PATTBUF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PATTBUF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PGEB0` reader - Pattern Generator 0 Output Enable Buffer"] +pub struct PGEB0_R(crate::FieldReader); +impl PGEB0_R { + pub(crate) fn new(bits: bool) -> Self { + PGEB0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGEB0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGEB0` writer - Pattern Generator 0 Output Enable Buffer"] +pub struct PGEB0_W<'a> { + w: &'a mut W, +} +impl<'a> PGEB0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u16 & 0x01); + self.w + } +} +#[doc = "Field `PGEB1` reader - Pattern Generator 1 Output Enable Buffer"] +pub struct PGEB1_R(crate::FieldReader); +impl PGEB1_R { + pub(crate) fn new(bits: bool) -> Self { + PGEB1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGEB1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGEB1` writer - Pattern Generator 1 Output Enable Buffer"] +pub struct PGEB1_W<'a> { + w: &'a mut W, +} +impl<'a> PGEB1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u16 & 0x01) << 1); + self.w + } +} +#[doc = "Field `PGEB2` reader - Pattern Generator 2 Output Enable Buffer"] +pub struct PGEB2_R(crate::FieldReader); +impl PGEB2_R { + pub(crate) fn new(bits: bool) -> Self { + PGEB2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGEB2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGEB2` writer - Pattern Generator 2 Output Enable Buffer"] +pub struct PGEB2_W<'a> { + w: &'a mut W, +} +impl<'a> PGEB2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u16 & 0x01) << 2); + self.w + } +} +#[doc = "Field `PGEB3` reader - Pattern Generator 3 Output Enable Buffer"] +pub struct PGEB3_R(crate::FieldReader); +impl PGEB3_R { + pub(crate) fn new(bits: bool) -> Self { + PGEB3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGEB3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGEB3` writer - Pattern Generator 3 Output Enable Buffer"] +pub struct PGEB3_W<'a> { + w: &'a mut W, +} +impl<'a> PGEB3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u16 & 0x01) << 3); + self.w + } +} +#[doc = "Field `PGEB4` reader - Pattern Generator 4 Output Enable Buffer"] +pub struct PGEB4_R(crate::FieldReader); +impl PGEB4_R { + pub(crate) fn new(bits: bool) -> Self { + PGEB4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGEB4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGEB4` writer - Pattern Generator 4 Output Enable Buffer"] +pub struct PGEB4_W<'a> { + w: &'a mut W, +} +impl<'a> PGEB4_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u16 & 0x01) << 4); + self.w + } +} +#[doc = "Field `PGEB5` reader - Pattern Generator 5 Output Enable Buffer"] +pub struct PGEB5_R(crate::FieldReader); +impl PGEB5_R { + pub(crate) fn new(bits: bool) -> Self { + PGEB5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGEB5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGEB5` writer - Pattern Generator 5 Output Enable Buffer"] +pub struct PGEB5_W<'a> { + w: &'a mut W, +} +impl<'a> PGEB5_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u16 & 0x01) << 5); + self.w + } +} +#[doc = "Field `PGEB6` reader - Pattern Generator 6 Output Enable Buffer"] +pub struct PGEB6_R(crate::FieldReader); +impl PGEB6_R { + pub(crate) fn new(bits: bool) -> Self { + PGEB6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGEB6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGEB6` writer - Pattern Generator 6 Output Enable Buffer"] +pub struct PGEB6_W<'a> { + w: &'a mut W, +} +impl<'a> PGEB6_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u16 & 0x01) << 6); + self.w + } +} +#[doc = "Field `PGEB7` reader - Pattern Generator 7 Output Enable Buffer"] +pub struct PGEB7_R(crate::FieldReader); +impl PGEB7_R { + pub(crate) fn new(bits: bool) -> Self { + PGEB7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGEB7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGEB7` writer - Pattern Generator 7 Output Enable Buffer"] +pub struct PGEB7_W<'a> { + w: &'a mut W, +} +impl<'a> PGEB7_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u16 & 0x01) << 7); + self.w + } +} +#[doc = "Field `PGVB0` reader - Pattern Generator 0 Output Enable"] +pub struct PGVB0_R(crate::FieldReader); +impl PGVB0_R { + pub(crate) fn new(bits: bool) -> Self { + PGVB0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGVB0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGVB0` writer - Pattern Generator 0 Output Enable"] +pub struct PGVB0_W<'a> { + w: &'a mut W, +} +impl<'a> PGVB0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u16 & 0x01) << 8); + self.w + } +} +#[doc = "Field `PGVB1` reader - Pattern Generator 1 Output Enable"] +pub struct PGVB1_R(crate::FieldReader); +impl PGVB1_R { + pub(crate) fn new(bits: bool) -> Self { + PGVB1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGVB1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGVB1` writer - Pattern Generator 1 Output Enable"] +pub struct PGVB1_W<'a> { + w: &'a mut W, +} +impl<'a> PGVB1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u16 & 0x01) << 9); + self.w + } +} +#[doc = "Field `PGVB2` reader - Pattern Generator 2 Output Enable"] +pub struct PGVB2_R(crate::FieldReader); +impl PGVB2_R { + pub(crate) fn new(bits: bool) -> Self { + PGVB2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGVB2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGVB2` writer - Pattern Generator 2 Output Enable"] +pub struct PGVB2_W<'a> { + w: &'a mut W, +} +impl<'a> PGVB2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u16 & 0x01) << 10); + self.w + } +} +#[doc = "Field `PGVB3` reader - Pattern Generator 3 Output Enable"] +pub struct PGVB3_R(crate::FieldReader); +impl PGVB3_R { + pub(crate) fn new(bits: bool) -> Self { + PGVB3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGVB3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGVB3` writer - Pattern Generator 3 Output Enable"] +pub struct PGVB3_W<'a> { + w: &'a mut W, +} +impl<'a> PGVB3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u16 & 0x01) << 11); + self.w + } +} +#[doc = "Field `PGVB4` reader - Pattern Generator 4 Output Enable"] +pub struct PGVB4_R(crate::FieldReader); +impl PGVB4_R { + pub(crate) fn new(bits: bool) -> Self { + PGVB4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGVB4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGVB4` writer - Pattern Generator 4 Output Enable"] +pub struct PGVB4_W<'a> { + w: &'a mut W, +} +impl<'a> PGVB4_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u16 & 0x01) << 12); + self.w + } +} +#[doc = "Field `PGVB5` reader - Pattern Generator 5 Output Enable"] +pub struct PGVB5_R(crate::FieldReader); +impl PGVB5_R { + pub(crate) fn new(bits: bool) -> Self { + PGVB5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGVB5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGVB5` writer - Pattern Generator 5 Output Enable"] +pub struct PGVB5_W<'a> { + w: &'a mut W, +} +impl<'a> PGVB5_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u16 & 0x01) << 13); + self.w + } +} +#[doc = "Field `PGVB6` reader - Pattern Generator 6 Output Enable"] +pub struct PGVB6_R(crate::FieldReader); +impl PGVB6_R { + pub(crate) fn new(bits: bool) -> Self { + PGVB6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGVB6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGVB6` writer - Pattern Generator 6 Output Enable"] +pub struct PGVB6_W<'a> { + w: &'a mut W, +} +impl<'a> PGVB6_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u16 & 0x01) << 14); + self.w + } +} +#[doc = "Field `PGVB7` reader - Pattern Generator 7 Output Enable"] +pub struct PGVB7_R(crate::FieldReader); +impl PGVB7_R { + pub(crate) fn new(bits: bool) -> Self { + PGVB7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PGVB7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PGVB7` writer - Pattern Generator 7 Output Enable"] +pub struct PGVB7_W<'a> { + w: &'a mut W, +} +impl<'a> PGVB7_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u16 & 0x01) << 15); + self.w + } +} +impl R { + #[doc = "Bit 0 - Pattern Generator 0 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb0(&self) -> PGEB0_R { + PGEB0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Pattern Generator 1 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb1(&self) -> PGEB1_R { + PGEB1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Pattern Generator 2 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb2(&self) -> PGEB2_R { + PGEB2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Pattern Generator 3 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb3(&self) -> PGEB3_R { + PGEB3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Pattern Generator 4 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb4(&self) -> PGEB4_R { + PGEB4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Pattern Generator 5 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb5(&self) -> PGEB5_R { + PGEB5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Pattern Generator 6 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb6(&self) -> PGEB6_R { + PGEB6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Pattern Generator 7 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb7(&self) -> PGEB7_R { + PGEB7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Pattern Generator 0 Output Enable"] + #[inline(always)] + pub fn pgvb0(&self) -> PGVB0_R { + PGVB0_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Pattern Generator 1 Output Enable"] + #[inline(always)] + pub fn pgvb1(&self) -> PGVB1_R { + PGVB1_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Pattern Generator 2 Output Enable"] + #[inline(always)] + pub fn pgvb2(&self) -> PGVB2_R { + PGVB2_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Pattern Generator 3 Output Enable"] + #[inline(always)] + pub fn pgvb3(&self) -> PGVB3_R { + PGVB3_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Pattern Generator 4 Output Enable"] + #[inline(always)] + pub fn pgvb4(&self) -> PGVB4_R { + PGVB4_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Pattern Generator 5 Output Enable"] + #[inline(always)] + pub fn pgvb5(&self) -> PGVB5_R { + PGVB5_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Pattern Generator 6 Output Enable"] + #[inline(always)] + pub fn pgvb6(&self) -> PGVB6_R { + PGVB6_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Pattern Generator 7 Output Enable"] + #[inline(always)] + pub fn pgvb7(&self) -> PGVB7_R { + PGVB7_R::new(((self.bits >> 15) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Pattern Generator 0 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb0(&mut self) -> PGEB0_W { + PGEB0_W { w: self } + } + #[doc = "Bit 1 - Pattern Generator 1 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb1(&mut self) -> PGEB1_W { + PGEB1_W { w: self } + } + #[doc = "Bit 2 - Pattern Generator 2 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb2(&mut self) -> PGEB2_W { + PGEB2_W { w: self } + } + #[doc = "Bit 3 - Pattern Generator 3 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb3(&mut self) -> PGEB3_W { + PGEB3_W { w: self } + } + #[doc = "Bit 4 - Pattern Generator 4 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb4(&mut self) -> PGEB4_W { + PGEB4_W { w: self } + } + #[doc = "Bit 5 - Pattern Generator 5 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb5(&mut self) -> PGEB5_W { + PGEB5_W { w: self } + } + #[doc = "Bit 6 - Pattern Generator 6 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb6(&mut self) -> PGEB6_W { + PGEB6_W { w: self } + } + #[doc = "Bit 7 - Pattern Generator 7 Output Enable Buffer"] + #[inline(always)] + pub fn pgeb7(&mut self) -> PGEB7_W { + PGEB7_W { w: self } + } + #[doc = "Bit 8 - Pattern Generator 0 Output Enable"] + #[inline(always)] + pub fn pgvb0(&mut self) -> PGVB0_W { + PGVB0_W { w: self } + } + #[doc = "Bit 9 - Pattern Generator 1 Output Enable"] + #[inline(always)] + pub fn pgvb1(&mut self) -> PGVB1_W { + PGVB1_W { w: self } + } + #[doc = "Bit 10 - Pattern Generator 2 Output Enable"] + #[inline(always)] + pub fn pgvb2(&mut self) -> PGVB2_W { + PGVB2_W { w: self } + } + #[doc = "Bit 11 - Pattern Generator 3 Output Enable"] + #[inline(always)] + pub fn pgvb3(&mut self) -> PGVB3_W { + PGVB3_W { w: self } + } + #[doc = "Bit 12 - Pattern Generator 4 Output Enable"] + #[inline(always)] + pub fn pgvb4(&mut self) -> PGVB4_W { + PGVB4_W { w: self } + } + #[doc = "Bit 13 - Pattern Generator 5 Output Enable"] + #[inline(always)] + pub fn pgvb5(&mut self) -> PGVB5_W { + PGVB5_W { w: self } + } + #[doc = "Bit 14 - Pattern Generator 6 Output Enable"] + #[inline(always)] + pub fn pgvb6(&mut self) -> PGVB6_W { + PGVB6_W { w: self } + } + #[doc = "Bit 15 - Pattern Generator 7 Output Enable"] + #[inline(always)] + pub fn pgvb7(&mut self) -> PGVB7_W { + PGVB7_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pattern Buffer\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 [pattbuf](index.html) module"] +pub struct PATTBUF_SPEC; +impl crate::RegisterSpec for PATTBUF_SPEC { + type Ux = u16; +} +#[doc = "`read()` method returns [pattbuf::R](R) reader structure"] +impl crate::Readable for PATTBUF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pattbuf::W](W) writer structure"] +impl crate::Writable for PATTBUF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PATTBUF to value 0"] +impl crate::Resettable for PATTBUF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/per.rs b/src/tcc0/per.rs new file mode 100644 index 0000000..6eb1ea4 --- /dev/null +++ b/src/tcc0/per.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PER` reader - Period Value"] +pub struct PER_R(crate::FieldReader); +impl PER_R { + pub(crate) fn new(bits: u32) -> Self { + PER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PER` writer - Period Value"] +pub struct PER_W<'a> { + w: &'a mut W, +} +impl<'a> PER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:23 - Period Value"] + #[inline(always)] + pub fn per(&self) -> PER_R { + PER_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:23 - Period Value"] + #[inline(always)] + pub fn per(&mut self) -> PER_W { + PER_W { w: 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 = "Period\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 [per](index.html) module"] +pub struct PER_SPEC; +impl crate::RegisterSpec for PER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [per::R](R) reader structure"] +impl crate::Readable for PER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [per::W](W) writer structure"] +impl crate::Writable for PER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PER to value 0xffff_ffff"] +impl crate::Resettable for PER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/tcc0/per_dith4_mode.rs b/src/tcc0/per_dith4_mode.rs new file mode 100644 index 0000000..9e9f904 --- /dev/null +++ b/src/tcc0/per_dith4_mode.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PER_DITH4_MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PER_DITH4_MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DITHER` reader - Dithering Cycle Number"] +pub struct DITHER_R(crate::FieldReader); +impl DITHER_R { + pub(crate) fn new(bits: u8) -> Self { + DITHER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHER` writer - Dithering Cycle Number"] +pub struct DITHER_W<'a> { + w: &'a mut W, +} +impl<'a> DITHER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +#[doc = "Field `PER` reader - Period Value"] +pub struct PER_R(crate::FieldReader); +impl PER_R { + pub(crate) fn new(bits: u32) -> Self { + PER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PER` writer - Period Value"] +pub struct PER_W<'a> { + w: &'a mut W, +} +impl<'a> PER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x000f_ffff << 4)) | ((value as u32 & 0x000f_ffff) << 4); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&self) -> DITHER_R { + DITHER_R::new((self.bits & 0x0f) as u8) + } + #[doc = "Bits 4:23 - Period Value"] + #[inline(always)] + pub fn per(&self) -> PER_R { + PER_R::new(((self.bits >> 4) & 0x000f_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:3 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&mut self) -> DITHER_W { + DITHER_W { w: self } + } + #[doc = "Bits 4:23 - Period Value"] + #[inline(always)] + pub fn per(&mut self) -> PER_W { + PER_W { w: 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 = "Period\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 [per_dith4_mode](index.html) module"] +pub struct PER_DITH4_MODE_SPEC; +impl crate::RegisterSpec for PER_DITH4_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [per_dith4_mode::R](R) reader structure"] +impl crate::Readable for PER_DITH4_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [per_dith4_mode::W](W) writer structure"] +impl crate::Writable for PER_DITH4_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PER_DITH4_MODE to value 0xffff_ffff"] +impl crate::Resettable for PER_DITH4_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/tcc0/per_dith5_mode.rs b/src/tcc0/per_dith5_mode.rs new file mode 100644 index 0000000..cfc9dfb --- /dev/null +++ b/src/tcc0/per_dith5_mode.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PER_DITH5_MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PER_DITH5_MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DITHER` reader - Dithering Cycle Number"] +pub struct DITHER_R(crate::FieldReader); +impl DITHER_R { + pub(crate) fn new(bits: u8) -> Self { + DITHER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHER` writer - Dithering Cycle Number"] +pub struct DITHER_W<'a> { + w: &'a mut W, +} +impl<'a> DITHER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Field `PER` reader - Period Value"] +pub struct PER_R(crate::FieldReader); +impl PER_R { + pub(crate) fn new(bits: u32) -> Self { + PER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PER` writer - Period Value"] +pub struct PER_W<'a> { + w: &'a mut W, +} +impl<'a> PER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0007_ffff << 5)) | ((value as u32 & 0x0007_ffff) << 5); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&self) -> DITHER_R { + DITHER_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bits 5:23 - Period Value"] + #[inline(always)] + pub fn per(&self) -> PER_R { + PER_R::new(((self.bits >> 5) & 0x0007_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:4 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&mut self) -> DITHER_W { + DITHER_W { w: self } + } + #[doc = "Bits 5:23 - Period Value"] + #[inline(always)] + pub fn per(&mut self) -> PER_W { + PER_W { w: 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 = "Period\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 [per_dith5_mode](index.html) module"] +pub struct PER_DITH5_MODE_SPEC; +impl crate::RegisterSpec for PER_DITH5_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [per_dith5_mode::R](R) reader structure"] +impl crate::Readable for PER_DITH5_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [per_dith5_mode::W](W) writer structure"] +impl crate::Writable for PER_DITH5_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PER_DITH5_MODE to value 0xffff_ffff"] +impl crate::Resettable for PER_DITH5_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/tcc0/per_dith6_mode.rs b/src/tcc0/per_dith6_mode.rs new file mode 100644 index 0000000..2ae8255 --- /dev/null +++ b/src/tcc0/per_dith6_mode.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PER_DITH6_MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PER_DITH6_MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DITHER` reader - Dithering Cycle Number"] +pub struct DITHER_R(crate::FieldReader); +impl DITHER_R { + pub(crate) fn new(bits: u8) -> Self { + DITHER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHER` writer - Dithering Cycle Number"] +pub struct DITHER_W<'a> { + w: &'a mut W, +} +impl<'a> DITHER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); + self.w + } +} +#[doc = "Field `PER` reader - Period Value"] +pub struct PER_R(crate::FieldReader); +impl PER_R { + pub(crate) fn new(bits: u32) -> Self { + PER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PER` writer - Period Value"] +pub struct PER_W<'a> { + w: &'a mut W, +} +impl<'a> PER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0003_ffff << 6)) | ((value as u32 & 0x0003_ffff) << 6); + self.w + } +} +impl R { + #[doc = "Bits 0:5 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&self) -> DITHER_R { + DITHER_R::new((self.bits & 0x3f) as u8) + } + #[doc = "Bits 6:23 - Period Value"] + #[inline(always)] + pub fn per(&self) -> PER_R { + PER_R::new(((self.bits >> 6) & 0x0003_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:5 - Dithering Cycle Number"] + #[inline(always)] + pub fn dither(&mut self) -> DITHER_W { + DITHER_W { w: self } + } + #[doc = "Bits 6:23 - Period Value"] + #[inline(always)] + pub fn per(&mut self) -> PER_W { + PER_W { w: 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 = "Period\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 [per_dith6_mode](index.html) module"] +pub struct PER_DITH6_MODE_SPEC; +impl crate::RegisterSpec for PER_DITH6_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [per_dith6_mode::R](R) reader structure"] +impl crate::Readable for PER_DITH6_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [per_dith6_mode::W](W) writer structure"] +impl crate::Writable for PER_DITH6_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PER_DITH6_MODE to value 0xffff_ffff"] +impl crate::Resettable for PER_DITH6_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/tcc0/perbuf.rs b/src/tcc0/perbuf.rs new file mode 100644 index 0000000..bff0aeb --- /dev/null +++ b/src/tcc0/perbuf.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PERBUF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PERBUF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PERBUF` reader - Period Buffer Value"] +pub struct PERBUF_R(crate::FieldReader); +impl PERBUF_R { + pub(crate) fn new(bits: u32) -> Self { + PERBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PERBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PERBUF` writer - Period Buffer Value"] +pub struct PERBUF_W<'a> { + w: &'a mut W, +} +impl<'a> PERBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:23 - Period Buffer Value"] + #[inline(always)] + pub fn perbuf(&self) -> PERBUF_R { + PERBUF_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:23 - Period Buffer Value"] + #[inline(always)] + pub fn perbuf(&mut self) -> PERBUF_W { + PERBUF_W { w: 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 = "Period Buffer\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 [perbuf](index.html) module"] +pub struct PERBUF_SPEC; +impl crate::RegisterSpec for PERBUF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [perbuf::R](R) reader structure"] +impl crate::Readable for PERBUF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [perbuf::W](W) writer structure"] +impl crate::Writable for PERBUF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PERBUF to value 0xffff_ffff"] +impl crate::Resettable for PERBUF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/tcc0/perbuf_dith4_mode.rs b/src/tcc0/perbuf_dith4_mode.rs new file mode 100644 index 0000000..7de95c2 --- /dev/null +++ b/src/tcc0/perbuf_dith4_mode.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PERBUF_DITH4_MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PERBUF_DITH4_MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DITHERBUF` reader - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_R(crate::FieldReader); +impl DITHERBUF_R { + pub(crate) fn new(bits: u8) -> Self { + DITHERBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHERBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHERBUF` writer - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_W<'a> { + w: &'a mut W, +} +impl<'a> DITHERBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +#[doc = "Field `PERBUF` reader - Period Buffer Value"] +pub struct PERBUF_R(crate::FieldReader); +impl PERBUF_R { + pub(crate) fn new(bits: u32) -> Self { + PERBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PERBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PERBUF` writer - Period Buffer Value"] +pub struct PERBUF_W<'a> { + w: &'a mut W, +} +impl<'a> PERBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x000f_ffff << 4)) | ((value as u32 & 0x000f_ffff) << 4); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&self) -> DITHERBUF_R { + DITHERBUF_R::new((self.bits & 0x0f) as u8) + } + #[doc = "Bits 4:23 - Period Buffer Value"] + #[inline(always)] + pub fn perbuf(&self) -> PERBUF_R { + PERBUF_R::new(((self.bits >> 4) & 0x000f_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:3 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&mut self) -> DITHERBUF_W { + DITHERBUF_W { w: self } + } + #[doc = "Bits 4:23 - Period Buffer Value"] + #[inline(always)] + pub fn perbuf(&mut self) -> PERBUF_W { + PERBUF_W { w: 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 = "Period Buffer\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 [perbuf_dith4_mode](index.html) module"] +pub struct PERBUF_DITH4_MODE_SPEC; +impl crate::RegisterSpec for PERBUF_DITH4_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [perbuf_dith4_mode::R](R) reader structure"] +impl crate::Readable for PERBUF_DITH4_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [perbuf_dith4_mode::W](W) writer structure"] +impl crate::Writable for PERBUF_DITH4_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PERBUF_DITH4_MODE to value 0xffff_ffff"] +impl crate::Resettable for PERBUF_DITH4_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/tcc0/perbuf_dith5_mode.rs b/src/tcc0/perbuf_dith5_mode.rs new file mode 100644 index 0000000..9154a32 --- /dev/null +++ b/src/tcc0/perbuf_dith5_mode.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PERBUF_DITH5_MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PERBUF_DITH5_MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DITHERBUF` reader - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_R(crate::FieldReader); +impl DITHERBUF_R { + pub(crate) fn new(bits: u8) -> Self { + DITHERBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHERBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHERBUF` writer - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_W<'a> { + w: &'a mut W, +} +impl<'a> DITHERBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Field `PERBUF` reader - Period Buffer Value"] +pub struct PERBUF_R(crate::FieldReader); +impl PERBUF_R { + pub(crate) fn new(bits: u32) -> Self { + PERBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PERBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PERBUF` writer - Period Buffer Value"] +pub struct PERBUF_W<'a> { + w: &'a mut W, +} +impl<'a> PERBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0007_ffff << 5)) | ((value as u32 & 0x0007_ffff) << 5); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&self) -> DITHERBUF_R { + DITHERBUF_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bits 5:23 - Period Buffer Value"] + #[inline(always)] + pub fn perbuf(&self) -> PERBUF_R { + PERBUF_R::new(((self.bits >> 5) & 0x0007_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:4 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&mut self) -> DITHERBUF_W { + DITHERBUF_W { w: self } + } + #[doc = "Bits 5:23 - Period Buffer Value"] + #[inline(always)] + pub fn perbuf(&mut self) -> PERBUF_W { + PERBUF_W { w: 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 = "Period Buffer\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 [perbuf_dith5_mode](index.html) module"] +pub struct PERBUF_DITH5_MODE_SPEC; +impl crate::RegisterSpec for PERBUF_DITH5_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [perbuf_dith5_mode::R](R) reader structure"] +impl crate::Readable for PERBUF_DITH5_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [perbuf_dith5_mode::W](W) writer structure"] +impl crate::Writable for PERBUF_DITH5_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PERBUF_DITH5_MODE to value 0xffff_ffff"] +impl crate::Resettable for PERBUF_DITH5_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/tcc0/perbuf_dith6_mode.rs b/src/tcc0/perbuf_dith6_mode.rs new file mode 100644 index 0000000..d3430e5 --- /dev/null +++ b/src/tcc0/perbuf_dith6_mode.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PERBUF_DITH6_MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PERBUF_DITH6_MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DITHERBUF` reader - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_R(crate::FieldReader); +impl DITHERBUF_R { + pub(crate) fn new(bits: u8) -> Self { + DITHERBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DITHERBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DITHERBUF` writer - Dithering Buffer Cycle Number"] +pub struct DITHERBUF_W<'a> { + w: &'a mut W, +} +impl<'a> DITHERBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); + self.w + } +} +#[doc = "Field `PERBUF` reader - Period Buffer Value"] +pub struct PERBUF_R(crate::FieldReader); +impl PERBUF_R { + pub(crate) fn new(bits: u32) -> Self { + PERBUF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PERBUF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PERBUF` writer - Period Buffer Value"] +pub struct PERBUF_W<'a> { + w: &'a mut W, +} +impl<'a> PERBUF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0003_ffff << 6)) | ((value as u32 & 0x0003_ffff) << 6); + self.w + } +} +impl R { + #[doc = "Bits 0:5 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&self) -> DITHERBUF_R { + DITHERBUF_R::new((self.bits & 0x3f) as u8) + } + #[doc = "Bits 6:23 - Period Buffer Value"] + #[inline(always)] + pub fn perbuf(&self) -> PERBUF_R { + PERBUF_R::new(((self.bits >> 6) & 0x0003_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:5 - Dithering Buffer Cycle Number"] + #[inline(always)] + pub fn ditherbuf(&mut self) -> DITHERBUF_W { + DITHERBUF_W { w: self } + } + #[doc = "Bits 6:23 - Period Buffer Value"] + #[inline(always)] + pub fn perbuf(&mut self) -> PERBUF_W { + PERBUF_W { w: 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 = "Period Buffer\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 [perbuf_dith6_mode](index.html) module"] +pub struct PERBUF_DITH6_MODE_SPEC; +impl crate::RegisterSpec for PERBUF_DITH6_MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [perbuf_dith6_mode::R](R) reader structure"] +impl crate::Readable for PERBUF_DITH6_MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [perbuf_dith6_mode::W](W) writer structure"] +impl crate::Writable for PERBUF_DITH6_MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PERBUF_DITH6_MODE to value 0xffff_ffff"] +impl crate::Resettable for PERBUF_DITH6_MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/tcc0/status.rs b/src/tcc0/status.rs new file mode 100644 index 0000000..11c65f4 --- /dev/null +++ b/src/tcc0/status.rs @@ -0,0 +1,1124 @@ +#[doc = "Register `STATUS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `STATUS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `STOP` reader - Stop"] +pub struct STOP_R(crate::FieldReader); +impl STOP_R { + pub(crate) fn new(bits: bool) -> Self { + STOP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STOP` writer - Stop"] +pub struct STOP_W<'a> { + w: &'a mut W, +} +impl<'a> STOP_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Field `IDX` reader - Ramp"] +pub struct IDX_R(crate::FieldReader); +impl IDX_R { + pub(crate) fn new(bits: bool) -> Self { + IDX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for IDX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IDX` writer - Ramp"] +pub struct IDX_W<'a> { + w: &'a mut W, +} +impl<'a> IDX_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Field `UFS` reader - Non-recoverable Update Fault State"] +pub struct UFS_R(crate::FieldReader); +impl UFS_R { + pub(crate) fn new(bits: bool) -> Self { + UFS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UFS` writer - Non-recoverable Update Fault State"] +pub struct UFS_W<'a> { + w: &'a mut W, +} +impl<'a> UFS_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Field `DFS` reader - Non-Recoverable Debug Fault State"] +pub struct DFS_R(crate::FieldReader); +impl DFS_R { + pub(crate) fn new(bits: bool) -> Self { + DFS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DFS` writer - Non-Recoverable Debug Fault State"] +pub struct DFS_W<'a> { + w: &'a mut W, +} +impl<'a> DFS_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Field `SLAVE` reader - Slave"] +pub struct SLAVE_R(crate::FieldReader); +impl SLAVE_R { + pub(crate) fn new(bits: bool) -> Self { + SLAVE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SLAVE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SLAVE` writer - Slave"] +pub struct SLAVE_W<'a> { + w: &'a mut W, +} +impl<'a> SLAVE_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Field `PATTBUFV` reader - Pattern Buffer Valid"] +pub struct PATTBUFV_R(crate::FieldReader); +impl PATTBUFV_R { + pub(crate) fn new(bits: bool) -> Self { + PATTBUFV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PATTBUFV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PATTBUFV` writer - Pattern Buffer Valid"] +pub struct PATTBUFV_W<'a> { + w: &'a mut W, +} +impl<'a> PATTBUFV_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Field `PERBUFV` reader - Period Buffer Valid"] +pub struct PERBUFV_R(crate::FieldReader); +impl PERBUFV_R { + pub(crate) fn new(bits: bool) -> Self { + PERBUFV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PERBUFV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PERBUFV` writer - Period Buffer Valid"] +pub struct PERBUFV_W<'a> { + w: &'a mut W, +} +impl<'a> PERBUFV_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Field `FAULTAIN` reader - Recoverable Fault A Input"] +pub struct FAULTAIN_R(crate::FieldReader); +impl FAULTAIN_R { + pub(crate) fn new(bits: bool) -> Self { + FAULTAIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULTAIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULTAIN` writer - Recoverable Fault A Input"] +pub struct FAULTAIN_W<'a> { + w: &'a mut W, +} +impl<'a> FAULTAIN_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Field `FAULTBIN` reader - Recoverable Fault B Input"] +pub struct FAULTBIN_R(crate::FieldReader); +impl FAULTBIN_R { + pub(crate) fn new(bits: bool) -> Self { + FAULTBIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULTBIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULTBIN` writer - Recoverable Fault B Input"] +pub struct FAULTBIN_W<'a> { + w: &'a mut W, +} +impl<'a> FAULTBIN_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Field `FAULT0IN` reader - Non-Recoverable Fault0 Input"] +pub struct FAULT0IN_R(crate::FieldReader); +impl FAULT0IN_R { + pub(crate) fn new(bits: bool) -> Self { + FAULT0IN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULT0IN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULT0IN` writer - Non-Recoverable Fault0 Input"] +pub struct FAULT0IN_W<'a> { + w: &'a mut W, +} +impl<'a> FAULT0IN_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Field `FAULT1IN` reader - Non-Recoverable Fault1 Input"] +pub struct FAULT1IN_R(crate::FieldReader); +impl FAULT1IN_R { + pub(crate) fn new(bits: bool) -> Self { + FAULT1IN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULT1IN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULT1IN` writer - Non-Recoverable Fault1 Input"] +pub struct FAULT1IN_W<'a> { + w: &'a mut W, +} +impl<'a> FAULT1IN_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Field `FAULTA` reader - Recoverable Fault A State"] +pub struct FAULTA_R(crate::FieldReader); +impl FAULTA_R { + pub(crate) fn new(bits: bool) -> Self { + FAULTA_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULTA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULTA` writer - Recoverable Fault A State"] +pub struct FAULTA_W<'a> { + w: &'a mut W, +} +impl<'a> FAULTA_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Field `FAULTB` reader - Recoverable Fault B State"] +pub struct FAULTB_R(crate::FieldReader); +impl FAULTB_R { + pub(crate) fn new(bits: bool) -> Self { + FAULTB_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULTB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULTB` writer - Recoverable Fault B State"] +pub struct FAULTB_W<'a> { + w: &'a mut W, +} +impl<'a> FAULTB_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Field `FAULT0` reader - Non-Recoverable Fault 0 State"] +pub struct FAULT0_R(crate::FieldReader); +impl FAULT0_R { + pub(crate) fn new(bits: bool) -> Self { + FAULT0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULT0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULT0` writer - Non-Recoverable Fault 0 State"] +pub struct FAULT0_W<'a> { + w: &'a mut W, +} +impl<'a> FAULT0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Field `FAULT1` reader - Non-Recoverable Fault 1 State"] +pub struct FAULT1_R(crate::FieldReader); +impl FAULT1_R { + pub(crate) fn new(bits: bool) -> Self { + FAULT1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FAULT1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FAULT1` writer - Non-Recoverable Fault 1 State"] +pub struct FAULT1_W<'a> { + w: &'a mut W, +} +impl<'a> FAULT1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Field `CCBUFV0` reader - Compare Channel 0 Buffer Valid"] +pub struct CCBUFV0_R(crate::FieldReader); +impl CCBUFV0_R { + pub(crate) fn new(bits: bool) -> Self { + CCBUFV0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CCBUFV0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCBUFV0` writer - Compare Channel 0 Buffer Valid"] +pub struct CCBUFV0_W<'a> { + w: &'a mut W, +} +impl<'a> CCBUFV0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Field `CCBUFV1` reader - Compare Channel 1 Buffer Valid"] +pub struct CCBUFV1_R(crate::FieldReader); +impl CCBUFV1_R { + pub(crate) fn new(bits: bool) -> Self { + CCBUFV1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CCBUFV1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCBUFV1` writer - Compare Channel 1 Buffer Valid"] +pub struct CCBUFV1_W<'a> { + w: &'a mut W, +} +impl<'a> CCBUFV1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Field `CCBUFV2` reader - Compare Channel 2 Buffer Valid"] +pub struct CCBUFV2_R(crate::FieldReader); +impl CCBUFV2_R { + pub(crate) fn new(bits: bool) -> Self { + CCBUFV2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CCBUFV2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCBUFV2` writer - Compare Channel 2 Buffer Valid"] +pub struct CCBUFV2_W<'a> { + w: &'a mut W, +} +impl<'a> CCBUFV2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Field `CCBUFV3` reader - Compare Channel 3 Buffer Valid"] +pub struct CCBUFV3_R(crate::FieldReader); +impl CCBUFV3_R { + pub(crate) fn new(bits: bool) -> Self { + CCBUFV3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CCBUFV3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CCBUFV3` writer - Compare Channel 3 Buffer Valid"] +pub struct CCBUFV3_W<'a> { + w: &'a mut W, +} +impl<'a> CCBUFV3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Field `CMP0` reader - Compare Channel 0 Value"] +pub struct CMP0_R(crate::FieldReader); +impl CMP0_R { + pub(crate) fn new(bits: bool) -> Self { + CMP0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP0` writer - Compare Channel 0 Value"] +pub struct CMP0_W<'a> { + w: &'a mut W, +} +impl<'a> CMP0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Field `CMP1` reader - Compare Channel 1 Value"] +pub struct CMP1_R(crate::FieldReader); +impl CMP1_R { + pub(crate) fn new(bits: bool) -> Self { + CMP1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP1` writer - Compare Channel 1 Value"] +pub struct CMP1_W<'a> { + w: &'a mut W, +} +impl<'a> CMP1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Field `CMP2` reader - Compare Channel 2 Value"] +pub struct CMP2_R(crate::FieldReader); +impl CMP2_R { + pub(crate) fn new(bits: bool) -> Self { + CMP2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP2` writer - Compare Channel 2 Value"] +pub struct CMP2_W<'a> { + w: &'a mut W, +} +impl<'a> CMP2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Field `CMP3` reader - Compare Channel 3 Value"] +pub struct CMP3_R(crate::FieldReader); +impl CMP3_R { + pub(crate) fn new(bits: bool) -> Self { + CMP3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CMP3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CMP3` writer - Compare Channel 3 Value"] +pub struct CMP3_W<'a> { + w: &'a mut W, +} +impl<'a> CMP3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bit 0 - Stop"] + #[inline(always)] + pub fn stop(&self) -> STOP_R { + STOP_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Ramp"] + #[inline(always)] + pub fn idx(&self) -> IDX_R { + IDX_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Non-recoverable Update Fault State"] + #[inline(always)] + pub fn ufs(&self) -> UFS_R { + UFS_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Non-Recoverable Debug Fault State"] + #[inline(always)] + pub fn dfs(&self) -> DFS_R { + DFS_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Slave"] + #[inline(always)] + pub fn slave(&self) -> SLAVE_R { + SLAVE_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Pattern Buffer Valid"] + #[inline(always)] + pub fn pattbufv(&self) -> PATTBUFV_R { + PATTBUFV_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 7 - Period Buffer Valid"] + #[inline(always)] + pub fn perbufv(&self) -> PERBUFV_R { + PERBUFV_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Recoverable Fault A Input"] + #[inline(always)] + pub fn faultain(&self) -> FAULTAIN_R { + FAULTAIN_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Recoverable Fault B Input"] + #[inline(always)] + pub fn faultbin(&self) -> FAULTBIN_R { + FAULTBIN_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Non-Recoverable Fault0 Input"] + #[inline(always)] + pub fn fault0in(&self) -> FAULT0IN_R { + FAULT0IN_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Non-Recoverable Fault1 Input"] + #[inline(always)] + pub fn fault1in(&self) -> FAULT1IN_R { + FAULT1IN_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Recoverable Fault A State"] + #[inline(always)] + pub fn faulta(&self) -> FAULTA_R { + FAULTA_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Recoverable Fault B State"] + #[inline(always)] + pub fn faultb(&self) -> FAULTB_R { + FAULTB_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Non-Recoverable Fault 0 State"] + #[inline(always)] + pub fn fault0(&self) -> FAULT0_R { + FAULT0_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Non-Recoverable Fault 1 State"] + #[inline(always)] + pub fn fault1(&self) -> FAULT1_R { + FAULT1_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Compare Channel 0 Buffer Valid"] + #[inline(always)] + pub fn ccbufv0(&self) -> CCBUFV0_R { + CCBUFV0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Compare Channel 1 Buffer Valid"] + #[inline(always)] + pub fn ccbufv1(&self) -> CCBUFV1_R { + CCBUFV1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Compare Channel 2 Buffer Valid"] + #[inline(always)] + pub fn ccbufv2(&self) -> CCBUFV2_R { + CCBUFV2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Compare Channel 3 Buffer Valid"] + #[inline(always)] + pub fn ccbufv3(&self) -> CCBUFV3_R { + CCBUFV3_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 24 - Compare Channel 0 Value"] + #[inline(always)] + pub fn cmp0(&self) -> CMP0_R { + CMP0_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Compare Channel 1 Value"] + #[inline(always)] + pub fn cmp1(&self) -> CMP1_R { + CMP1_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Compare Channel 2 Value"] + #[inline(always)] + pub fn cmp2(&self) -> CMP2_R { + CMP2_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Compare Channel 3 Value"] + #[inline(always)] + pub fn cmp3(&self) -> CMP3_R { + CMP3_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Stop"] + #[inline(always)] + pub fn stop(&mut self) -> STOP_W { + STOP_W { w: self } + } + #[doc = "Bit 1 - Ramp"] + #[inline(always)] + pub fn idx(&mut self) -> IDX_W { + IDX_W { w: self } + } + #[doc = "Bit 2 - Non-recoverable Update Fault State"] + #[inline(always)] + pub fn ufs(&mut self) -> UFS_W { + UFS_W { w: self } + } + #[doc = "Bit 3 - Non-Recoverable Debug Fault State"] + #[inline(always)] + pub fn dfs(&mut self) -> DFS_W { + DFS_W { w: self } + } + #[doc = "Bit 4 - Slave"] + #[inline(always)] + pub fn slave(&mut self) -> SLAVE_W { + SLAVE_W { w: self } + } + #[doc = "Bit 5 - Pattern Buffer Valid"] + #[inline(always)] + pub fn pattbufv(&mut self) -> PATTBUFV_W { + PATTBUFV_W { w: self } + } + #[doc = "Bit 7 - Period Buffer Valid"] + #[inline(always)] + pub fn perbufv(&mut self) -> PERBUFV_W { + PERBUFV_W { w: self } + } + #[doc = "Bit 8 - Recoverable Fault A Input"] + #[inline(always)] + pub fn faultain(&mut self) -> FAULTAIN_W { + FAULTAIN_W { w: self } + } + #[doc = "Bit 9 - Recoverable Fault B Input"] + #[inline(always)] + pub fn faultbin(&mut self) -> FAULTBIN_W { + FAULTBIN_W { w: self } + } + #[doc = "Bit 10 - Non-Recoverable Fault0 Input"] + #[inline(always)] + pub fn fault0in(&mut self) -> FAULT0IN_W { + FAULT0IN_W { w: self } + } + #[doc = "Bit 11 - Non-Recoverable Fault1 Input"] + #[inline(always)] + pub fn fault1in(&mut self) -> FAULT1IN_W { + FAULT1IN_W { w: self } + } + #[doc = "Bit 12 - Recoverable Fault A State"] + #[inline(always)] + pub fn faulta(&mut self) -> FAULTA_W { + FAULTA_W { w: self } + } + #[doc = "Bit 13 - Recoverable Fault B State"] + #[inline(always)] + pub fn faultb(&mut self) -> FAULTB_W { + FAULTB_W { w: self } + } + #[doc = "Bit 14 - Non-Recoverable Fault 0 State"] + #[inline(always)] + pub fn fault0(&mut self) -> FAULT0_W { + FAULT0_W { w: self } + } + #[doc = "Bit 15 - Non-Recoverable Fault 1 State"] + #[inline(always)] + pub fn fault1(&mut self) -> FAULT1_W { + FAULT1_W { w: self } + } + #[doc = "Bit 16 - Compare Channel 0 Buffer Valid"] + #[inline(always)] + pub fn ccbufv0(&mut self) -> CCBUFV0_W { + CCBUFV0_W { w: self } + } + #[doc = "Bit 17 - Compare Channel 1 Buffer Valid"] + #[inline(always)] + pub fn ccbufv1(&mut self) -> CCBUFV1_W { + CCBUFV1_W { w: self } + } + #[doc = "Bit 18 - Compare Channel 2 Buffer Valid"] + #[inline(always)] + pub fn ccbufv2(&mut self) -> CCBUFV2_W { + CCBUFV2_W { w: self } + } + #[doc = "Bit 19 - Compare Channel 3 Buffer Valid"] + #[inline(always)] + pub fn ccbufv3(&mut self) -> CCBUFV3_W { + CCBUFV3_W { w: self } + } + #[doc = "Bit 24 - Compare Channel 0 Value"] + #[inline(always)] + pub fn cmp0(&mut self) -> CMP0_W { + CMP0_W { w: self } + } + #[doc = "Bit 25 - Compare Channel 1 Value"] + #[inline(always)] + pub fn cmp1(&mut self) -> CMP1_W { + CMP1_W { w: self } + } + #[doc = "Bit 26 - Compare Channel 2 Value"] + #[inline(always)] + pub fn cmp2(&mut self) -> CMP2_W { + CMP2_W { w: self } + } + #[doc = "Bit 27 - Compare Channel 3 Value"] + #[inline(always)] + pub fn cmp3(&mut self) -> CMP3_W { + CMP3_W { w: 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 = "Status\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 [status](index.html) module"] +pub struct STATUS_SPEC; +impl crate::RegisterSpec for STATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [status::R](R) reader structure"] +impl crate::Readable for STATUS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [status::W](W) writer structure"] +impl crate::Writable for STATUS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets STATUS to value 0x01"] +impl crate::Resettable for STATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/tcc0/syncbusy.rs b/src/tcc0/syncbusy.rs new file mode 100644 index 0000000..f9c51bf --- /dev/null +++ b/src/tcc0/syncbusy.rs @@ -0,0 +1,261 @@ +#[doc = "Register `SYNCBUSY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `SWRST` reader - Swrst Busy"] +pub struct SWRST_R(crate::FieldReader); +impl SWRST_R { + pub(crate) fn new(bits: bool) -> Self { + SWRST_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SWRST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` reader - Enable Busy"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTRLB` reader - Ctrlb Busy"] +pub struct CTRLB_R(crate::FieldReader); +impl CTRLB_R { + pub(crate) fn new(bits: bool) -> Self { + CTRLB_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTRLB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STATUS` reader - Status Busy"] +pub struct STATUS_R(crate::FieldReader); +impl STATUS_R { + pub(crate) fn new(bits: bool) -> Self { + STATUS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STATUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COUNT` reader - Count Busy"] +pub struct COUNT_R(crate::FieldReader); +impl COUNT_R { + pub(crate) fn new(bits: bool) -> Self { + COUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for COUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PATT` reader - Pattern Busy"] +pub struct PATT_R(crate::FieldReader); +impl PATT_R { + pub(crate) fn new(bits: bool) -> Self { + PATT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PATT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WAVE` reader - Wave Busy"] +pub struct WAVE_R(crate::FieldReader); +impl WAVE_R { + pub(crate) fn new(bits: bool) -> Self { + WAVE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for WAVE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PER` reader - Period Busy"] +pub struct PER_R(crate::FieldReader); +impl PER_R { + pub(crate) fn new(bits: bool) -> Self { + PER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC0` reader - Compare Channel 0 Busy"] +pub struct CC0_R(crate::FieldReader); +impl CC0_R { + pub(crate) fn new(bits: bool) -> Self { + CC0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC1` reader - Compare Channel 1 Busy"] +pub struct CC1_R(crate::FieldReader); +impl CC1_R { + pub(crate) fn new(bits: bool) -> Self { + CC1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC2` reader - Compare Channel 2 Busy"] +pub struct CC2_R(crate::FieldReader); +impl CC2_R { + pub(crate) fn new(bits: bool) -> Self { + CC2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC3` reader - Compare Channel 3 Busy"] +pub struct CC3_R(crate::FieldReader); +impl CC3_R { + pub(crate) fn new(bits: bool) -> Self { + CC3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - Swrst Busy"] + #[inline(always)] + pub fn swrst(&self) -> SWRST_R { + SWRST_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable Busy"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Ctrlb Busy"] + #[inline(always)] + pub fn ctrlb(&self) -> CTRLB_R { + CTRLB_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Status Busy"] + #[inline(always)] + pub fn status(&self) -> STATUS_R { + STATUS_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Count Busy"] + #[inline(always)] + pub fn count(&self) -> COUNT_R { + COUNT_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Pattern Busy"] + #[inline(always)] + pub fn patt(&self) -> PATT_R { + PATT_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Wave Busy"] + #[inline(always)] + pub fn wave(&self) -> WAVE_R { + WAVE_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Period Busy"] + #[inline(always)] + pub fn per(&self) -> PER_R { + PER_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Compare Channel 0 Busy"] + #[inline(always)] + pub fn cc0(&self) -> CC0_R { + CC0_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Compare Channel 1 Busy"] + #[inline(always)] + pub fn cc1(&self) -> CC1_R { + CC1_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Compare Channel 2 Busy"] + #[inline(always)] + pub fn cc2(&self) -> CC2_R { + CC2_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Compare Channel 3 Busy"] + #[inline(always)] + pub fn cc3(&self) -> CC3_R { + CC3_R::new(((self.bits >> 11) & 0x01) != 0) + } +} +#[doc = "Synchronization Busy\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [syncbusy](index.html) module"] +pub struct SYNCBUSY_SPEC; +impl crate::RegisterSpec for SYNCBUSY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [syncbusy::R](R) reader structure"] +impl crate::Readable for SYNCBUSY_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets SYNCBUSY to value 0"] +impl crate::Resettable for SYNCBUSY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/wave.rs b/src/tcc0/wave.rs new file mode 100644 index 0000000..508243c --- /dev/null +++ b/src/tcc0/wave.rs @@ -0,0 +1,925 @@ +#[doc = "Register `WAVE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `WAVE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Waveform Generation\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum WAVEGEN_A { + #[doc = "0: Normal frequency"] + NFRQ = 0, + #[doc = "1: Match frequency"] + MFRQ = 1, + #[doc = "2: Normal PWM"] + NPWM = 2, + #[doc = "4: Dual-slope critical"] + DSCRITICAL = 4, + #[doc = "5: Dual-slope with interrupt/event condition when COUNT reaches ZERO"] + DSBOTTOM = 5, + #[doc = "6: Dual-slope with interrupt/event condition when COUNT reaches ZERO or TOP"] + DSBOTH = 6, + #[doc = "7: Dual-slope with interrupt/event condition when COUNT reaches TOP"] + DSTOP = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: WAVEGEN_A) -> Self { + variant as _ + } +} +#[doc = "Field `WAVEGEN` reader - Waveform Generation"] +pub struct WAVEGEN_R(crate::FieldReader); +impl WAVEGEN_R { + pub(crate) fn new(bits: u8) -> Self { + WAVEGEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(WAVEGEN_A::NFRQ), + 1 => Some(WAVEGEN_A::MFRQ), + 2 => Some(WAVEGEN_A::NPWM), + 4 => Some(WAVEGEN_A::DSCRITICAL), + 5 => Some(WAVEGEN_A::DSBOTTOM), + 6 => Some(WAVEGEN_A::DSBOTH), + 7 => Some(WAVEGEN_A::DSTOP), + _ => None, + } + } + #[doc = "Checks if the value of the field is `NFRQ`"] + #[inline(always)] + pub fn is_nfrq(&self) -> bool { + **self == WAVEGEN_A::NFRQ + } + #[doc = "Checks if the value of the field is `MFRQ`"] + #[inline(always)] + pub fn is_mfrq(&self) -> bool { + **self == WAVEGEN_A::MFRQ + } + #[doc = "Checks if the value of the field is `NPWM`"] + #[inline(always)] + pub fn is_npwm(&self) -> bool { + **self == WAVEGEN_A::NPWM + } + #[doc = "Checks if the value of the field is `DSCRITICAL`"] + #[inline(always)] + pub fn is_dscritical(&self) -> bool { + **self == WAVEGEN_A::DSCRITICAL + } + #[doc = "Checks if the value of the field is `DSBOTTOM`"] + #[inline(always)] + pub fn is_dsbottom(&self) -> bool { + **self == WAVEGEN_A::DSBOTTOM + } + #[doc = "Checks if the value of the field is `DSBOTH`"] + #[inline(always)] + pub fn is_dsboth(&self) -> bool { + **self == WAVEGEN_A::DSBOTH + } + #[doc = "Checks if the value of the field is `DSTOP`"] + #[inline(always)] + pub fn is_dstop(&self) -> bool { + **self == WAVEGEN_A::DSTOP + } +} +impl core::ops::Deref for WAVEGEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WAVEGEN` writer - Waveform Generation"] +pub struct WAVEGEN_W<'a> { + w: &'a mut W, +} +impl<'a> WAVEGEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: WAVEGEN_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Normal frequency"] + #[inline(always)] + pub fn nfrq(self) -> &'a mut W { + self.variant(WAVEGEN_A::NFRQ) + } + #[doc = "Match frequency"] + #[inline(always)] + pub fn mfrq(self) -> &'a mut W { + self.variant(WAVEGEN_A::MFRQ) + } + #[doc = "Normal PWM"] + #[inline(always)] + pub fn npwm(self) -> &'a mut W { + self.variant(WAVEGEN_A::NPWM) + } + #[doc = "Dual-slope critical"] + #[inline(always)] + pub fn dscritical(self) -> &'a mut W { + self.variant(WAVEGEN_A::DSCRITICAL) + } + #[doc = "Dual-slope with interrupt/event condition when COUNT reaches ZERO"] + #[inline(always)] + pub fn dsbottom(self) -> &'a mut W { + self.variant(WAVEGEN_A::DSBOTTOM) + } + #[doc = "Dual-slope with interrupt/event condition when COUNT reaches ZERO or TOP"] + #[inline(always)] + pub fn dsboth(self) -> &'a mut W { + self.variant(WAVEGEN_A::DSBOTH) + } + #[doc = "Dual-slope with interrupt/event condition when COUNT reaches TOP"] + #[inline(always)] + pub fn dstop(self) -> &'a mut W { + self.variant(WAVEGEN_A::DSTOP) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +#[doc = "Ramp Mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum RAMP_A { + #[doc = "0: RAMP1 operation"] + RAMP1 = 0, + #[doc = "1: Alternative RAMP2 operation"] + RAMP2A = 1, + #[doc = "2: RAMP2 operation"] + RAMP2 = 2, + #[doc = "3: Critical RAMP2 operation"] + RAMP2C = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: RAMP_A) -> Self { + variant as _ + } +} +#[doc = "Field `RAMP` reader - Ramp Mode"] +pub struct RAMP_R(crate::FieldReader); +impl RAMP_R { + pub(crate) fn new(bits: u8) -> Self { + RAMP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RAMP_A { + match self.bits { + 0 => RAMP_A::RAMP1, + 1 => RAMP_A::RAMP2A, + 2 => RAMP_A::RAMP2, + 3 => RAMP_A::RAMP2C, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `RAMP1`"] + #[inline(always)] + pub fn is_ramp1(&self) -> bool { + **self == RAMP_A::RAMP1 + } + #[doc = "Checks if the value of the field is `RAMP2A`"] + #[inline(always)] + pub fn is_ramp2a(&self) -> bool { + **self == RAMP_A::RAMP2A + } + #[doc = "Checks if the value of the field is `RAMP2`"] + #[inline(always)] + pub fn is_ramp2(&self) -> bool { + **self == RAMP_A::RAMP2 + } + #[doc = "Checks if the value of the field is `RAMP2C`"] + #[inline(always)] + pub fn is_ramp2c(&self) -> bool { + **self == RAMP_A::RAMP2C + } +} +impl core::ops::Deref for RAMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RAMP` writer - Ramp Mode"] +pub struct RAMP_W<'a> { + w: &'a mut W, +} +impl<'a> RAMP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RAMP_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "RAMP1 operation"] + #[inline(always)] + pub fn ramp1(self) -> &'a mut W { + self.variant(RAMP_A::RAMP1) + } + #[doc = "Alternative RAMP2 operation"] + #[inline(always)] + pub fn ramp2a(self) -> &'a mut W { + self.variant(RAMP_A::RAMP2A) + } + #[doc = "RAMP2 operation"] + #[inline(always)] + pub fn ramp2(self) -> &'a mut W { + self.variant(RAMP_A::RAMP2) + } + #[doc = "Critical RAMP2 operation"] + #[inline(always)] + pub fn ramp2c(self) -> &'a mut W { + self.variant(RAMP_A::RAMP2C) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); + self.w + } +} +#[doc = "Field `CIPEREN` reader - Circular period Enable"] +pub struct CIPEREN_R(crate::FieldReader); +impl CIPEREN_R { + pub(crate) fn new(bits: bool) -> Self { + CIPEREN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CIPEREN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CIPEREN` writer - Circular period Enable"] +pub struct CIPEREN_W<'a> { + w: &'a mut W, +} +impl<'a> CIPEREN_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Field `CICCEN0` reader - Circular Channel 0 Enable"] +pub struct CICCEN0_R(crate::FieldReader); +impl CICCEN0_R { + pub(crate) fn new(bits: bool) -> Self { + CICCEN0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CICCEN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CICCEN0` writer - Circular Channel 0 Enable"] +pub struct CICCEN0_W<'a> { + w: &'a mut W, +} +impl<'a> CICCEN0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Field `CICCEN1` reader - Circular Channel 1 Enable"] +pub struct CICCEN1_R(crate::FieldReader); +impl CICCEN1_R { + pub(crate) fn new(bits: bool) -> Self { + CICCEN1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CICCEN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CICCEN1` writer - Circular Channel 1 Enable"] +pub struct CICCEN1_W<'a> { + w: &'a mut W, +} +impl<'a> CICCEN1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Field `CICCEN2` reader - Circular Channel 2 Enable"] +pub struct CICCEN2_R(crate::FieldReader); +impl CICCEN2_R { + pub(crate) fn new(bits: bool) -> Self { + CICCEN2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CICCEN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CICCEN2` writer - Circular Channel 2 Enable"] +pub struct CICCEN2_W<'a> { + w: &'a mut W, +} +impl<'a> CICCEN2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Field `CICCEN3` reader - Circular Channel 3 Enable"] +pub struct CICCEN3_R(crate::FieldReader); +impl CICCEN3_R { + pub(crate) fn new(bits: bool) -> Self { + CICCEN3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CICCEN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CICCEN3` writer - Circular Channel 3 Enable"] +pub struct CICCEN3_W<'a> { + w: &'a mut W, +} +impl<'a> CICCEN3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Field `POL0` reader - Channel 0 Polarity"] +pub struct POL0_R(crate::FieldReader); +impl POL0_R { + pub(crate) fn new(bits: bool) -> Self { + POL0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for POL0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `POL0` writer - Channel 0 Polarity"] +pub struct POL0_W<'a> { + w: &'a mut W, +} +impl<'a> POL0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Field `POL1` reader - Channel 1 Polarity"] +pub struct POL1_R(crate::FieldReader); +impl POL1_R { + pub(crate) fn new(bits: bool) -> Self { + POL1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for POL1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `POL1` writer - Channel 1 Polarity"] +pub struct POL1_W<'a> { + w: &'a mut W, +} +impl<'a> POL1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Field `POL2` reader - Channel 2 Polarity"] +pub struct POL2_R(crate::FieldReader); +impl POL2_R { + pub(crate) fn new(bits: bool) -> Self { + POL2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for POL2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `POL2` writer - Channel 2 Polarity"] +pub struct POL2_W<'a> { + w: &'a mut W, +} +impl<'a> POL2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Field `POL3` reader - Channel 3 Polarity"] +pub struct POL3_R(crate::FieldReader); +impl POL3_R { + pub(crate) fn new(bits: bool) -> Self { + POL3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for POL3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `POL3` writer - Channel 3 Polarity"] +pub struct POL3_W<'a> { + w: &'a mut W, +} +impl<'a> POL3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Field `SWAP0` reader - Swap DTI Output Pair 0"] +pub struct SWAP0_R(crate::FieldReader); +impl SWAP0_R { + pub(crate) fn new(bits: bool) -> Self { + SWAP0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SWAP0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SWAP0` writer - Swap DTI Output Pair 0"] +pub struct SWAP0_W<'a> { + w: &'a mut W, +} +impl<'a> SWAP0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Field `SWAP1` reader - Swap DTI Output Pair 1"] +pub struct SWAP1_R(crate::FieldReader); +impl SWAP1_R { + pub(crate) fn new(bits: bool) -> Self { + SWAP1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SWAP1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SWAP1` writer - Swap DTI Output Pair 1"] +pub struct SWAP1_W<'a> { + w: &'a mut W, +} +impl<'a> SWAP1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Field `SWAP2` reader - Swap DTI Output Pair 2"] +pub struct SWAP2_R(crate::FieldReader); +impl SWAP2_R { + pub(crate) fn new(bits: bool) -> Self { + SWAP2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SWAP2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SWAP2` writer - Swap DTI Output Pair 2"] +pub struct SWAP2_W<'a> { + w: &'a mut W, +} +impl<'a> SWAP2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Field `SWAP3` reader - Swap DTI Output Pair 3"] +pub struct SWAP3_R(crate::FieldReader); +impl SWAP3_R { + pub(crate) fn new(bits: bool) -> Self { + SWAP3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SWAP3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SWAP3` writer - Swap DTI Output Pair 3"] +pub struct SWAP3_W<'a> { + w: &'a mut W, +} +impl<'a> SWAP3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - Waveform Generation"] + #[inline(always)] + pub fn wavegen(&self) -> WAVEGEN_R { + WAVEGEN_R::new((self.bits & 0x07) as u8) + } + #[doc = "Bits 4:5 - Ramp Mode"] + #[inline(always)] + pub fn ramp(&self) -> RAMP_R { + RAMP_R::new(((self.bits >> 4) & 0x03) as u8) + } + #[doc = "Bit 7 - Circular period Enable"] + #[inline(always)] + pub fn ciperen(&self) -> CIPEREN_R { + CIPEREN_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Circular Channel 0 Enable"] + #[inline(always)] + pub fn ciccen0(&self) -> CICCEN0_R { + CICCEN0_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Circular Channel 1 Enable"] + #[inline(always)] + pub fn ciccen1(&self) -> CICCEN1_R { + CICCEN1_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Circular Channel 2 Enable"] + #[inline(always)] + pub fn ciccen2(&self) -> CICCEN2_R { + CICCEN2_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Circular Channel 3 Enable"] + #[inline(always)] + pub fn ciccen3(&self) -> CICCEN3_R { + CICCEN3_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 16 - Channel 0 Polarity"] + #[inline(always)] + pub fn pol0(&self) -> POL0_R { + POL0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Channel 1 Polarity"] + #[inline(always)] + pub fn pol1(&self) -> POL1_R { + POL1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Channel 2 Polarity"] + #[inline(always)] + pub fn pol2(&self) -> POL2_R { + POL2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Channel 3 Polarity"] + #[inline(always)] + pub fn pol3(&self) -> POL3_R { + POL3_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 24 - Swap DTI Output Pair 0"] + #[inline(always)] + pub fn swap0(&self) -> SWAP0_R { + SWAP0_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Swap DTI Output Pair 1"] + #[inline(always)] + pub fn swap1(&self) -> SWAP1_R { + SWAP1_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Swap DTI Output Pair 2"] + #[inline(always)] + pub fn swap2(&self) -> SWAP2_R { + SWAP2_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Swap DTI Output Pair 3"] + #[inline(always)] + pub fn swap3(&self) -> SWAP3_R { + SWAP3_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:2 - Waveform Generation"] + #[inline(always)] + pub fn wavegen(&mut self) -> WAVEGEN_W { + WAVEGEN_W { w: self } + } + #[doc = "Bits 4:5 - Ramp Mode"] + #[inline(always)] + pub fn ramp(&mut self) -> RAMP_W { + RAMP_W { w: self } + } + #[doc = "Bit 7 - Circular period Enable"] + #[inline(always)] + pub fn ciperen(&mut self) -> CIPEREN_W { + CIPEREN_W { w: self } + } + #[doc = "Bit 8 - Circular Channel 0 Enable"] + #[inline(always)] + pub fn ciccen0(&mut self) -> CICCEN0_W { + CICCEN0_W { w: self } + } + #[doc = "Bit 9 - Circular Channel 1 Enable"] + #[inline(always)] + pub fn ciccen1(&mut self) -> CICCEN1_W { + CICCEN1_W { w: self } + } + #[doc = "Bit 10 - Circular Channel 2 Enable"] + #[inline(always)] + pub fn ciccen2(&mut self) -> CICCEN2_W { + CICCEN2_W { w: self } + } + #[doc = "Bit 11 - Circular Channel 3 Enable"] + #[inline(always)] + pub fn ciccen3(&mut self) -> CICCEN3_W { + CICCEN3_W { w: self } + } + #[doc = "Bit 16 - Channel 0 Polarity"] + #[inline(always)] + pub fn pol0(&mut self) -> POL0_W { + POL0_W { w: self } + } + #[doc = "Bit 17 - Channel 1 Polarity"] + #[inline(always)] + pub fn pol1(&mut self) -> POL1_W { + POL1_W { w: self } + } + #[doc = "Bit 18 - Channel 2 Polarity"] + #[inline(always)] + pub fn pol2(&mut self) -> POL2_W { + POL2_W { w: self } + } + #[doc = "Bit 19 - Channel 3 Polarity"] + #[inline(always)] + pub fn pol3(&mut self) -> POL3_W { + POL3_W { w: self } + } + #[doc = "Bit 24 - Swap DTI Output Pair 0"] + #[inline(always)] + pub fn swap0(&mut self) -> SWAP0_W { + SWAP0_W { w: self } + } + #[doc = "Bit 25 - Swap DTI Output Pair 1"] + #[inline(always)] + pub fn swap1(&mut self) -> SWAP1_W { + SWAP1_W { w: self } + } + #[doc = "Bit 26 - Swap DTI Output Pair 2"] + #[inline(always)] + pub fn swap2(&mut self) -> SWAP2_W { + SWAP2_W { w: self } + } + #[doc = "Bit 27 - Swap DTI Output Pair 3"] + #[inline(always)] + pub fn swap3(&mut self) -> SWAP3_W { + SWAP3_W { w: 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 = "Waveform Control\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 [wave](index.html) module"] +pub struct WAVE_SPEC; +impl crate::RegisterSpec for WAVE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [wave::R](R) reader structure"] +impl crate::Readable for WAVE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [wave::W](W) writer structure"] +impl crate::Writable for WAVE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets WAVE to value 0"] +impl crate::Resettable for WAVE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/tcc0/wexctrl.rs b/src/tcc0/wexctrl.rs new file mode 100644 index 0000000..8c8b840 --- /dev/null +++ b/src/tcc0/wexctrl.rs @@ -0,0 +1,358 @@ +#[doc = "Register `WEXCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `WEXCTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[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> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `OTMX` reader - Output Matrix"] +pub struct OTMX_R(crate::FieldReader); +impl OTMX_R { + pub(crate) fn new(bits: u8) -> Self { + OTMX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OTMX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OTMX` writer - Output Matrix"] +pub struct OTMX_W<'a> { + w: &'a mut W, +} +impl<'a> OTMX_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +#[doc = "Field `DTIEN0` reader - Dead-time Insertion Generator 0 Enable"] +pub struct DTIEN0_R(crate::FieldReader); +impl DTIEN0_R { + pub(crate) fn new(bits: bool) -> Self { + DTIEN0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DTIEN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DTIEN0` writer - Dead-time Insertion Generator 0 Enable"] +pub struct DTIEN0_W<'a> { + w: &'a mut W, +} +impl<'a> DTIEN0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Field `DTIEN1` reader - Dead-time Insertion Generator 1 Enable"] +pub struct DTIEN1_R(crate::FieldReader); +impl DTIEN1_R { + pub(crate) fn new(bits: bool) -> Self { + DTIEN1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DTIEN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DTIEN1` writer - Dead-time Insertion Generator 1 Enable"] +pub struct DTIEN1_W<'a> { + w: &'a mut W, +} +impl<'a> DTIEN1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Field `DTIEN2` reader - Dead-time Insertion Generator 2 Enable"] +pub struct DTIEN2_R(crate::FieldReader); +impl DTIEN2_R { + pub(crate) fn new(bits: bool) -> Self { + DTIEN2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DTIEN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DTIEN2` writer - Dead-time Insertion Generator 2 Enable"] +pub struct DTIEN2_W<'a> { + w: &'a mut W, +} +impl<'a> DTIEN2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Field `DTIEN3` reader - Dead-time Insertion Generator 3 Enable"] +pub struct DTIEN3_R(crate::FieldReader); +impl DTIEN3_R { + pub(crate) fn new(bits: bool) -> Self { + DTIEN3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DTIEN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DTIEN3` writer - Dead-time Insertion Generator 3 Enable"] +pub struct DTIEN3_W<'a> { + w: &'a mut W, +} +impl<'a> DTIEN3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Field `DTLS` reader - Dead-time Low Side Outputs Value"] +pub struct DTLS_R(crate::FieldReader); +impl DTLS_R { + pub(crate) fn new(bits: u8) -> Self { + DTLS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DTLS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DTLS` writer - Dead-time Low Side Outputs Value"] +pub struct DTLS_W<'a> { + w: &'a mut W, +} +impl<'a> DTLS_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); + self.w + } +} +#[doc = "Field `DTHS` reader - Dead-time High Side Outputs Value"] +pub struct DTHS_R(crate::FieldReader); +impl DTHS_R { + pub(crate) fn new(bits: u8) -> Self { + DTHS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DTHS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DTHS` writer - Dead-time High Side Outputs Value"] +pub struct DTHS_W<'a> { + w: &'a mut W, +} +impl<'a> DTHS_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Output Matrix"] + #[inline(always)] + pub fn otmx(&self) -> OTMX_R { + OTMX_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bit 8 - Dead-time Insertion Generator 0 Enable"] + #[inline(always)] + pub fn dtien0(&self) -> DTIEN0_R { + DTIEN0_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Dead-time Insertion Generator 1 Enable"] + #[inline(always)] + pub fn dtien1(&self) -> DTIEN1_R { + DTIEN1_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Dead-time Insertion Generator 2 Enable"] + #[inline(always)] + pub fn dtien2(&self) -> DTIEN2_R { + DTIEN2_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Dead-time Insertion Generator 3 Enable"] + #[inline(always)] + pub fn dtien3(&self) -> DTIEN3_R { + DTIEN3_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bits 16:23 - Dead-time Low Side Outputs Value"] + #[inline(always)] + pub fn dtls(&self) -> DTLS_R { + DTLS_R::new(((self.bits >> 16) & 0xff) as u8) + } + #[doc = "Bits 24:31 - Dead-time High Side Outputs Value"] + #[inline(always)] + pub fn dths(&self) -> DTHS_R { + DTHS_R::new(((self.bits >> 24) & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Output Matrix"] + #[inline(always)] + pub fn otmx(&mut self) -> OTMX_W { + OTMX_W { w: self } + } + #[doc = "Bit 8 - Dead-time Insertion Generator 0 Enable"] + #[inline(always)] + pub fn dtien0(&mut self) -> DTIEN0_W { + DTIEN0_W { w: self } + } + #[doc = "Bit 9 - Dead-time Insertion Generator 1 Enable"] + #[inline(always)] + pub fn dtien1(&mut self) -> DTIEN1_W { + DTIEN1_W { w: self } + } + #[doc = "Bit 10 - Dead-time Insertion Generator 2 Enable"] + #[inline(always)] + pub fn dtien2(&mut self) -> DTIEN2_W { + DTIEN2_W { w: self } + } + #[doc = "Bit 11 - Dead-time Insertion Generator 3 Enable"] + #[inline(always)] + pub fn dtien3(&mut self) -> DTIEN3_W { + DTIEN3_W { w: self } + } + #[doc = "Bits 16:23 - Dead-time Low Side Outputs Value"] + #[inline(always)] + pub fn dtls(&mut self) -> DTLS_W { + DTLS_W { w: self } + } + #[doc = "Bits 24:31 - Dead-time High Side Outputs Value"] + #[inline(always)] + pub fn dths(&mut self) -> DTHS_W { + DTHS_W { w: 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 = "Waveform Extension Configuration\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 [wexctrl](index.html) module"] +pub struct WEXCTRL_SPEC; +impl crate::RegisterSpec for WEXCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [wexctrl::R](R) reader structure"] +impl crate::Readable for WEXCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [wexctrl::W](W) writer structure"] +impl crate::Writable for WEXCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets WEXCTRL to value 0"] +impl crate::Resettable for WEXCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} -- cgit v1.2.3-70-g09d2