diff options
| author | Arne Dußin | 2021-11-06 11:50:33 +0100 |
|---|---|---|
| committer | Arne Dußin | 2021-11-06 11:50:33 +0100 |
| commit | 0666a6ba1dbd66cf8b93c113e362ccbcd99152a0 (patch) | |
| tree | a184284dbd2316f4624f092e4e7521ea8c90855b /src/mtb | |
| download | samc21-0666a6ba1dbd66cf8b93c113e362ccbcd99152a0.tar.gz samc21-0666a6ba1dbd66cf8b93c113e362ccbcd99152a0.zip | |
Initial commit
Diffstat (limited to 'src/mtb')
| -rw-r--r-- | src/mtb/authstatus.rs | 31 | ||||
| -rw-r--r-- | src/mtb/base.rs | 31 | ||||
| -rw-r--r-- | src/mtb/cid0.rs | 31 | ||||
| -rw-r--r-- | src/mtb/cid1.rs | 31 | ||||
| -rw-r--r-- | src/mtb/cid2.rs | 31 | ||||
| -rw-r--r-- | src/mtb/cid3.rs | 31 | ||||
| -rw-r--r-- | src/mtb/claimclr.rs | 64 | ||||
| -rw-r--r-- | src/mtb/claimset.rs | 64 | ||||
| -rw-r--r-- | src/mtb/devarch.rs | 31 | ||||
| -rw-r--r-- | src/mtb/devid.rs | 31 | ||||
| -rw-r--r-- | src/mtb/devtype.rs | 31 | ||||
| -rw-r--r-- | src/mtb/flow.rs | 194 | ||||
| -rw-r--r-- | src/mtb/itctrl.rs | 64 | ||||
| -rw-r--r-- | src/mtb/lockaccess.rs | 64 | ||||
| -rw-r--r-- | src/mtb/lockstatus.rs | 31 | ||||
| -rw-r--r-- | src/mtb/master.rs | 378 | ||||
| -rw-r--r-- | src/mtb/pid0.rs | 31 | ||||
| -rw-r--r-- | src/mtb/pid1.rs | 31 | ||||
| -rw-r--r-- | src/mtb/pid2.rs | 31 | ||||
| -rw-r--r-- | src/mtb/pid3.rs | 31 | ||||
| -rw-r--r-- | src/mtb/pid4.rs | 31 | ||||
| -rw-r--r-- | src/mtb/pid5.rs | 31 | ||||
| -rw-r--r-- | src/mtb/pid6.rs | 31 | ||||
| -rw-r--r-- | src/mtb/pid7.rs | 31 | ||||
| -rw-r--r-- | src/mtb/position.rs | 148 |
25 files changed, 1534 insertions, 0 deletions
diff --git a/src/mtb/authstatus.rs b/src/mtb/authstatus.rs new file mode 100644 index 0000000..6fe441e --- /dev/null +++ b/src/mtb/authstatus.rs @@ -0,0 +1,31 @@ +#[doc = "Register `AUTHSTATUS` reader"] +pub struct R(crate::R<AUTHSTATUS_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<AUTHSTATUS_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<AUTHSTATUS_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<AUTHSTATUS_SPEC>) -> Self { + R(reader) + } +} +#[doc = "MTB Authentication Status\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 [authstatus](index.html) module"] +pub struct AUTHSTATUS_SPEC; +impl crate::RegisterSpec for AUTHSTATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [authstatus::R](R) reader structure"] +impl crate::Readable for AUTHSTATUS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AUTHSTATUS to value 0"] +impl crate::Resettable for AUTHSTATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/base.rs b/src/mtb/base.rs new file mode 100644 index 0000000..f59b5a9 --- /dev/null +++ b/src/mtb/base.rs @@ -0,0 +1,31 @@ +#[doc = "Register `BASE` reader"] +pub struct R(crate::R<BASE_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<BASE_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<BASE_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<BASE_SPEC>) -> Self { + R(reader) + } +} +#[doc = "MTB Base\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 [base](index.html) module"] +pub struct BASE_SPEC; +impl crate::RegisterSpec for BASE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [base::R](R) reader structure"] +impl crate::Readable for BASE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets BASE to value 0"] +impl crate::Resettable for BASE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/cid0.rs b/src/mtb/cid0.rs new file mode 100644 index 0000000..e03bd35 --- /dev/null +++ b/src/mtb/cid0.rs @@ -0,0 +1,31 @@ +#[doc = "Register `CID0` reader"] +pub struct R(crate::R<CID0_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<CID0_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<CID0_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<CID0_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Component Identification 0\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 [cid0](index.html) module"] +pub struct CID0_SPEC; +impl crate::RegisterSpec for CID0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cid0::R](R) reader structure"] +impl crate::Readable for CID0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CID0 to value 0"] +impl crate::Resettable for CID0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/cid1.rs b/src/mtb/cid1.rs new file mode 100644 index 0000000..1cafc8e --- /dev/null +++ b/src/mtb/cid1.rs @@ -0,0 +1,31 @@ +#[doc = "Register `CID1` reader"] +pub struct R(crate::R<CID1_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<CID1_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<CID1_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<CID1_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Component Identification 1\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 [cid1](index.html) module"] +pub struct CID1_SPEC; +impl crate::RegisterSpec for CID1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cid1::R](R) reader structure"] +impl crate::Readable for CID1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CID1 to value 0"] +impl crate::Resettable for CID1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/cid2.rs b/src/mtb/cid2.rs new file mode 100644 index 0000000..6a91e4e --- /dev/null +++ b/src/mtb/cid2.rs @@ -0,0 +1,31 @@ +#[doc = "Register `CID2` reader"] +pub struct R(crate::R<CID2_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<CID2_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<CID2_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<CID2_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Component Identification 2\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 [cid2](index.html) module"] +pub struct CID2_SPEC; +impl crate::RegisterSpec for CID2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cid2::R](R) reader structure"] +impl crate::Readable for CID2_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CID2 to value 0"] +impl crate::Resettable for CID2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/cid3.rs b/src/mtb/cid3.rs new file mode 100644 index 0000000..726290f --- /dev/null +++ b/src/mtb/cid3.rs @@ -0,0 +1,31 @@ +#[doc = "Register `CID3` reader"] +pub struct R(crate::R<CID3_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<CID3_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<CID3_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<CID3_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Component Identification 3\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 [cid3](index.html) module"] +pub struct CID3_SPEC; +impl crate::RegisterSpec for CID3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cid3::R](R) reader structure"] +impl crate::Readable for CID3_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CID3 to value 0"] +impl crate::Resettable for CID3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/claimclr.rs b/src/mtb/claimclr.rs new file mode 100644 index 0000000..7d0fa5d --- /dev/null +++ b/src/mtb/claimclr.rs @@ -0,0 +1,64 @@ +#[doc = "Register `CLAIMCLR` reader"] +pub struct R(crate::R<CLAIMCLR_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<CLAIMCLR_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<CLAIMCLR_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<CLAIMCLR_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Register `CLAIMCLR` writer"] +pub struct W(crate::W<CLAIMCLR_SPEC>); +impl core::ops::Deref for W { + type Target = crate::W<CLAIMCLR_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From<crate::W<CLAIMCLR_SPEC>> for W { + #[inline(always)] + fn from(writer: crate::W<CLAIMCLR_SPEC>) -> Self { + W(writer) + } +} +impl W { + #[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 = "MTB Claim 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 [claimclr](index.html) module"] +pub struct CLAIMCLR_SPEC; +impl crate::RegisterSpec for CLAIMCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [claimclr::R](R) reader structure"] +impl crate::Readable for CLAIMCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [claimclr::W](W) writer structure"] +impl crate::Writable for CLAIMCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLAIMCLR to value 0"] +impl crate::Resettable for CLAIMCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/claimset.rs b/src/mtb/claimset.rs new file mode 100644 index 0000000..d5e8ffa --- /dev/null +++ b/src/mtb/claimset.rs @@ -0,0 +1,64 @@ +#[doc = "Register `CLAIMSET` reader"] +pub struct R(crate::R<CLAIMSET_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<CLAIMSET_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<CLAIMSET_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<CLAIMSET_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Register `CLAIMSET` writer"] +pub struct W(crate::W<CLAIMSET_SPEC>); +impl core::ops::Deref for W { + type Target = crate::W<CLAIMSET_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From<crate::W<CLAIMSET_SPEC>> for W { + #[inline(always)] + fn from(writer: crate::W<CLAIMSET_SPEC>) -> Self { + W(writer) + } +} +impl W { + #[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 = "MTB Claim 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 [claimset](index.html) module"] +pub struct CLAIMSET_SPEC; +impl crate::RegisterSpec for CLAIMSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [claimset::R](R) reader structure"] +impl crate::Readable for CLAIMSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [claimset::W](W) writer structure"] +impl crate::Writable for CLAIMSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLAIMSET to value 0"] +impl crate::Resettable for CLAIMSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/devarch.rs b/src/mtb/devarch.rs new file mode 100644 index 0000000..b794807 --- /dev/null +++ b/src/mtb/devarch.rs @@ -0,0 +1,31 @@ +#[doc = "Register `DEVARCH` reader"] +pub struct R(crate::R<DEVARCH_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<DEVARCH_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<DEVARCH_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<DEVARCH_SPEC>) -> Self { + R(reader) + } +} +#[doc = "MTB Device Architecture\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 [devarch](index.html) module"] +pub struct DEVARCH_SPEC; +impl crate::RegisterSpec for DEVARCH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [devarch::R](R) reader structure"] +impl crate::Readable for DEVARCH_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DEVARCH to value 0"] +impl crate::Resettable for DEVARCH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/devid.rs b/src/mtb/devid.rs new file mode 100644 index 0000000..21c15d9 --- /dev/null +++ b/src/mtb/devid.rs @@ -0,0 +1,31 @@ +#[doc = "Register `DEVID` reader"] +pub struct R(crate::R<DEVID_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<DEVID_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<DEVID_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<DEVID_SPEC>) -> Self { + R(reader) + } +} +#[doc = "MTB Device Configuration\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 [devid](index.html) module"] +pub struct DEVID_SPEC; +impl crate::RegisterSpec for DEVID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [devid::R](R) reader structure"] +impl crate::Readable for DEVID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DEVID to value 0"] +impl crate::Resettable for DEVID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/devtype.rs b/src/mtb/devtype.rs new file mode 100644 index 0000000..c00d66b --- /dev/null +++ b/src/mtb/devtype.rs @@ -0,0 +1,31 @@ +#[doc = "Register `DEVTYPE` reader"] +pub struct R(crate::R<DEVTYPE_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<DEVTYPE_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<DEVTYPE_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<DEVTYPE_SPEC>) -> Self { + R(reader) + } +} +#[doc = "MTB Device Type\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 [devtype](index.html) module"] +pub struct DEVTYPE_SPEC; +impl crate::RegisterSpec for DEVTYPE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [devtype::R](R) reader structure"] +impl crate::Readable for DEVTYPE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DEVTYPE to value 0"] +impl crate::Resettable for DEVTYPE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/flow.rs b/src/mtb/flow.rs new file mode 100644 index 0000000..45f46a3 --- /dev/null +++ b/src/mtb/flow.rs @@ -0,0 +1,194 @@ +#[doc = "Register `FLOW` reader"] +pub struct R(crate::R<FLOW_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<FLOW_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<FLOW_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<FLOW_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Register `FLOW` writer"] +pub struct W(crate::W<FLOW_SPEC>); +impl core::ops::Deref for W { + type Target = crate::W<FLOW_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From<crate::W<FLOW_SPEC>> for W { + #[inline(always)] + fn from(writer: crate::W<FLOW_SPEC>) -> Self { + W(writer) + } +} +#[doc = "Field `AUTOSTOP` reader - Auto Stop Tracing"] +pub struct AUTOSTOP_R(crate::FieldReader<bool, bool>); +impl AUTOSTOP_R { + pub(crate) fn new(bits: bool) -> Self { + AUTOSTOP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AUTOSTOP_R { + type Target = crate::FieldReader<bool, bool>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AUTOSTOP` writer - Auto Stop Tracing"] +pub struct AUTOSTOP_W<'a> { + w: &'a mut W, +} +impl<'a> AUTOSTOP_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 `AUTOHALT` reader - Auto Halt Request"] +pub struct AUTOHALT_R(crate::FieldReader<bool, bool>); +impl AUTOHALT_R { + pub(crate) fn new(bits: bool) -> Self { + AUTOHALT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AUTOHALT_R { + type Target = crate::FieldReader<bool, bool>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AUTOHALT` writer - Auto Halt Request"] +pub struct AUTOHALT_W<'a> { + w: &'a mut W, +} +impl<'a> AUTOHALT_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 `WATERMARK` reader - Watermark value"] +pub struct WATERMARK_R(crate::FieldReader<u32, u32>); +impl WATERMARK_R { + pub(crate) fn new(bits: u32) -> Self { + WATERMARK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for WATERMARK_R { + type Target = crate::FieldReader<u32, u32>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WATERMARK` writer - Watermark value"] +pub struct WATERMARK_W<'a> { + w: &'a mut W, +} +impl<'a> WATERMARK_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 & !(0x1fff_ffff << 3)) | ((value as u32 & 0x1fff_ffff) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - Auto Stop Tracing"] + #[inline(always)] + pub fn autostop(&self) -> AUTOSTOP_R { + AUTOSTOP_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Auto Halt Request"] + #[inline(always)] + pub fn autohalt(&self) -> AUTOHALT_R { + AUTOHALT_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bits 3:31 - Watermark value"] + #[inline(always)] + pub fn watermark(&self) -> WATERMARK_R { + WATERMARK_R::new(((self.bits >> 3) & 0x1fff_ffff) as u32) + } +} +impl W { + #[doc = "Bit 0 - Auto Stop Tracing"] + #[inline(always)] + pub fn autostop(&mut self) -> AUTOSTOP_W { + AUTOSTOP_W { w: self } + } + #[doc = "Bit 1 - Auto Halt Request"] + #[inline(always)] + pub fn autohalt(&mut self) -> AUTOHALT_W { + AUTOHALT_W { w: self } + } + #[doc = "Bits 3:31 - Watermark value"] + #[inline(always)] + pub fn watermark(&mut self) -> WATERMARK_W { + WATERMARK_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 = "MTB Flow\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 [flow](index.html) module"] +pub struct FLOW_SPEC; +impl crate::RegisterSpec for FLOW_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [flow::R](R) reader structure"] +impl crate::Readable for FLOW_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [flow::W](W) writer structure"] +impl crate::Writable for FLOW_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FLOW to value 0"] +impl crate::Resettable for FLOW_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/itctrl.rs b/src/mtb/itctrl.rs new file mode 100644 index 0000000..a48364e --- /dev/null +++ b/src/mtb/itctrl.rs @@ -0,0 +1,64 @@ +#[doc = "Register `ITCTRL` reader"] +pub struct R(crate::R<ITCTRL_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<ITCTRL_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<ITCTRL_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<ITCTRL_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Register `ITCTRL` writer"] +pub struct W(crate::W<ITCTRL_SPEC>); +impl core::ops::Deref for W { + type Target = crate::W<ITCTRL_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From<crate::W<ITCTRL_SPEC>> for W { + #[inline(always)] + fn from(writer: crate::W<ITCTRL_SPEC>) -> Self { + W(writer) + } +} +impl W { + #[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 = "MTB Integration Mode 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 [itctrl](index.html) module"] +pub struct ITCTRL_SPEC; +impl crate::RegisterSpec for ITCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [itctrl::R](R) reader structure"] +impl crate::Readable for ITCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [itctrl::W](W) writer structure"] +impl crate::Writable for ITCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ITCTRL to value 0"] +impl crate::Resettable for ITCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/lockaccess.rs b/src/mtb/lockaccess.rs new file mode 100644 index 0000000..0400690 --- /dev/null +++ b/src/mtb/lockaccess.rs @@ -0,0 +1,64 @@ +#[doc = "Register `LOCKACCESS` reader"] +pub struct R(crate::R<LOCKACCESS_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<LOCKACCESS_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<LOCKACCESS_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<LOCKACCESS_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Register `LOCKACCESS` writer"] +pub struct W(crate::W<LOCKACCESS_SPEC>); +impl core::ops::Deref for W { + type Target = crate::W<LOCKACCESS_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From<crate::W<LOCKACCESS_SPEC>> for W { + #[inline(always)] + fn from(writer: crate::W<LOCKACCESS_SPEC>) -> Self { + W(writer) + } +} +impl W { + #[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 = "MTB Lock Access\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 [lockaccess](index.html) module"] +pub struct LOCKACCESS_SPEC; +impl crate::RegisterSpec for LOCKACCESS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lockaccess::R](R) reader structure"] +impl crate::Readable for LOCKACCESS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [lockaccess::W](W) writer structure"] +impl crate::Writable for LOCKACCESS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LOCKACCESS to value 0"] +impl crate::Resettable for LOCKACCESS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/lockstatus.rs b/src/mtb/lockstatus.rs new file mode 100644 index 0000000..0c68410 --- /dev/null +++ b/src/mtb/lockstatus.rs @@ -0,0 +1,31 @@ +#[doc = "Register `LOCKSTATUS` reader"] +pub struct R(crate::R<LOCKSTATUS_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<LOCKSTATUS_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<LOCKSTATUS_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<LOCKSTATUS_SPEC>) -> Self { + R(reader) + } +} +#[doc = "MTB Lock Status\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 [lockstatus](index.html) module"] +pub struct LOCKSTATUS_SPEC; +impl crate::RegisterSpec for LOCKSTATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lockstatus::R](R) reader structure"] +impl crate::Readable for LOCKSTATUS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets LOCKSTATUS to value 0"] +impl crate::Resettable for LOCKSTATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/master.rs b/src/mtb/master.rs new file mode 100644 index 0000000..bfe8eb0 --- /dev/null +++ b/src/mtb/master.rs @@ -0,0 +1,378 @@ +#[doc = "Register `MASTER` reader"] +pub struct R(crate::R<MASTER_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<MASTER_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<MASTER_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<MASTER_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Register `MASTER` writer"] +pub struct W(crate::W<MASTER_SPEC>); +impl core::ops::Deref for W { + type Target = crate::W<MASTER_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From<crate::W<MASTER_SPEC>> for W { + #[inline(always)] + fn from(writer: crate::W<MASTER_SPEC>) -> Self { + W(writer) + } +} +#[doc = "Field `MASK` reader - Maximum Value of the Trace Buffer in SRAM"] +pub struct MASK_R(crate::FieldReader<u8, u8>); +impl MASK_R { + pub(crate) fn new(bits: u8) -> Self { + MASK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MASK_R { + type Target = crate::FieldReader<u8, u8>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MASK` writer - Maximum Value of the Trace Buffer in SRAM"] +pub struct MASK_W<'a> { + w: &'a mut W, +} +impl<'a> MASK_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 `TSTARTEN` reader - Trace Start Input Enable"] +pub struct TSTARTEN_R(crate::FieldReader<bool, bool>); +impl TSTARTEN_R { + pub(crate) fn new(bits: bool) -> Self { + TSTARTEN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TSTARTEN_R { + type Target = crate::FieldReader<bool, bool>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSTARTEN` writer - Trace Start Input Enable"] +pub struct TSTARTEN_W<'a> { + w: &'a mut W, +} +impl<'a> TSTARTEN_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 `TSTOPEN` reader - Trace Stop Input Enable"] +pub struct TSTOPEN_R(crate::FieldReader<bool, bool>); +impl TSTOPEN_R { + pub(crate) fn new(bits: bool) -> Self { + TSTOPEN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TSTOPEN_R { + type Target = crate::FieldReader<bool, bool>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TSTOPEN` writer - Trace Stop Input Enable"] +pub struct TSTOPEN_W<'a> { + w: &'a mut W, +} +impl<'a> TSTOPEN_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 `SFRWPRIV` reader - Special Function Register Write Privilege"] +pub struct SFRWPRIV_R(crate::FieldReader<bool, bool>); +impl SFRWPRIV_R { + pub(crate) fn new(bits: bool) -> Self { + SFRWPRIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SFRWPRIV_R { + type Target = crate::FieldReader<bool, bool>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SFRWPRIV` writer - Special Function Register Write Privilege"] +pub struct SFRWPRIV_W<'a> { + w: &'a mut W, +} +impl<'a> SFRWPRIV_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 `RAMPRIV` reader - SRAM Privilege"] +pub struct RAMPRIV_R(crate::FieldReader<bool, bool>); +impl RAMPRIV_R { + pub(crate) fn new(bits: bool) -> Self { + RAMPRIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RAMPRIV_R { + type Target = crate::FieldReader<bool, bool>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RAMPRIV` writer - SRAM Privilege"] +pub struct RAMPRIV_W<'a> { + w: &'a mut W, +} +impl<'a> RAMPRIV_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 `HALTREQ` reader - Halt Request"] +pub struct HALTREQ_R(crate::FieldReader<bool, bool>); +impl HALTREQ_R { + pub(crate) fn new(bits: bool) -> Self { + HALTREQ_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HALTREQ_R { + type Target = crate::FieldReader<bool, bool>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HALTREQ` writer - Halt Request"] +pub struct HALTREQ_W<'a> { + w: &'a mut W, +} +impl<'a> HALTREQ_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 `EN` reader - Main Trace Enable"] +pub struct EN_R(crate::FieldReader<bool, bool>); +impl EN_R { + pub(crate) fn new(bits: bool) -> Self { + EN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EN_R { + type Target = crate::FieldReader<bool, bool>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EN` writer - Main Trace Enable"] +pub struct EN_W<'a> { + w: &'a mut W, +} +impl<'a> EN_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 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Maximum Value of the Trace Buffer in SRAM"] + #[inline(always)] + pub fn mask(&self) -> MASK_R { + MASK_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 5 - Trace Start Input Enable"] + #[inline(always)] + pub fn tstarten(&self) -> TSTARTEN_R { + TSTARTEN_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Trace Stop Input Enable"] + #[inline(always)] + pub fn tstopen(&self) -> TSTOPEN_R { + TSTOPEN_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Special Function Register Write Privilege"] + #[inline(always)] + pub fn sfrwpriv(&self) -> SFRWPRIV_R { + SFRWPRIV_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - SRAM Privilege"] + #[inline(always)] + pub fn rampriv(&self) -> RAMPRIV_R { + RAMPRIV_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Halt Request"] + #[inline(always)] + pub fn haltreq(&self) -> HALTREQ_R { + HALTREQ_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 31 - Main Trace Enable"] + #[inline(always)] + pub fn en(&self) -> EN_R { + EN_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Maximum Value of the Trace Buffer in SRAM"] + #[inline(always)] + pub fn mask(&mut self) -> MASK_W { + MASK_W { w: self } + } + #[doc = "Bit 5 - Trace Start Input Enable"] + #[inline(always)] + pub fn tstarten(&mut self) -> TSTARTEN_W { + TSTARTEN_W { w: self } + } + #[doc = "Bit 6 - Trace Stop Input Enable"] + #[inline(always)] + pub fn tstopen(&mut self) -> TSTOPEN_W { + TSTOPEN_W { w: self } + } + #[doc = "Bit 7 - Special Function Register Write Privilege"] + #[inline(always)] + pub fn sfrwpriv(&mut self) -> SFRWPRIV_W { + SFRWPRIV_W { w: self } + } + #[doc = "Bit 8 - SRAM Privilege"] + #[inline(always)] + pub fn rampriv(&mut self) -> RAMPRIV_W { + RAMPRIV_W { w: self } + } + #[doc = "Bit 9 - Halt Request"] + #[inline(always)] + pub fn haltreq(&mut self) -> HALTREQ_W { + HALTREQ_W { w: self } + } + #[doc = "Bit 31 - Main Trace Enable"] + #[inline(always)] + pub fn en(&mut self) -> EN_W { + EN_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 = "MTB Master\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 [master](index.html) module"] +pub struct MASTER_SPEC; +impl crate::RegisterSpec for MASTER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [master::R](R) reader structure"] +impl crate::Readable for MASTER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [master::W](W) writer structure"] +impl crate::Writable for MASTER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MASTER to value 0"] +impl crate::Resettable for MASTER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/pid0.rs b/src/mtb/pid0.rs new file mode 100644 index 0000000..0a71831 --- /dev/null +++ b/src/mtb/pid0.rs @@ -0,0 +1,31 @@ +#[doc = "Register `PID0` reader"] +pub struct R(crate::R<PID0_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<PID0_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<PID0_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<PID0_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Peripheral Identification 0\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 [pid0](index.html) module"] +pub struct PID0_SPEC; +impl crate::RegisterSpec for PID0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pid0::R](R) reader structure"] +impl crate::Readable for PID0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PID0 to value 0"] +impl crate::Resettable for PID0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/pid1.rs b/src/mtb/pid1.rs new file mode 100644 index 0000000..7d63819 --- /dev/null +++ b/src/mtb/pid1.rs @@ -0,0 +1,31 @@ +#[doc = "Register `PID1` reader"] +pub struct R(crate::R<PID1_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<PID1_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<PID1_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<PID1_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Peripheral Identification 1\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 [pid1](index.html) module"] +pub struct PID1_SPEC; +impl crate::RegisterSpec for PID1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pid1::R](R) reader structure"] +impl crate::Readable for PID1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PID1 to value 0"] +impl crate::Resettable for PID1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/pid2.rs b/src/mtb/pid2.rs new file mode 100644 index 0000000..74c2303 --- /dev/null +++ b/src/mtb/pid2.rs @@ -0,0 +1,31 @@ +#[doc = "Register `PID2` reader"] +pub struct R(crate::R<PID2_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<PID2_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<PID2_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<PID2_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Peripheral Identification 2\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 [pid2](index.html) module"] +pub struct PID2_SPEC; +impl crate::RegisterSpec for PID2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pid2::R](R) reader structure"] +impl crate::Readable for PID2_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PID2 to value 0"] +impl crate::Resettable for PID2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/pid3.rs b/src/mtb/pid3.rs new file mode 100644 index 0000000..e9e922a --- /dev/null +++ b/src/mtb/pid3.rs @@ -0,0 +1,31 @@ +#[doc = "Register `PID3` reader"] +pub struct R(crate::R<PID3_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<PID3_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<PID3_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<PID3_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Peripheral Identification 3\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 [pid3](index.html) module"] +pub struct PID3_SPEC; +impl crate::RegisterSpec for PID3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pid3::R](R) reader structure"] +impl crate::Readable for PID3_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PID3 to value 0"] +impl crate::Resettable for PID3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/pid4.rs b/src/mtb/pid4.rs new file mode 100644 index 0000000..89074d3 --- /dev/null +++ b/src/mtb/pid4.rs @@ -0,0 +1,31 @@ +#[doc = "Register `PID4` reader"] +pub struct R(crate::R<PID4_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<PID4_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<PID4_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<PID4_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Peripheral Identification 4\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 [pid4](index.html) module"] +pub struct PID4_SPEC; +impl crate::RegisterSpec for PID4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pid4::R](R) reader structure"] +impl crate::Readable for PID4_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PID4 to value 0"] +impl crate::Resettable for PID4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/pid5.rs b/src/mtb/pid5.rs new file mode 100644 index 0000000..d343d48 --- /dev/null +++ b/src/mtb/pid5.rs @@ -0,0 +1,31 @@ +#[doc = "Register `PID5` reader"] +pub struct R(crate::R<PID5_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<PID5_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<PID5_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<PID5_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Peripheral Identification 5\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 [pid5](index.html) module"] +pub struct PID5_SPEC; +impl crate::RegisterSpec for PID5_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pid5::R](R) reader structure"] +impl crate::Readable for PID5_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PID5 to value 0"] +impl crate::Resettable for PID5_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/pid6.rs b/src/mtb/pid6.rs new file mode 100644 index 0000000..55cc2b8 --- /dev/null +++ b/src/mtb/pid6.rs @@ -0,0 +1,31 @@ +#[doc = "Register `PID6` reader"] +pub struct R(crate::R<PID6_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<PID6_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<PID6_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<PID6_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Peripheral Identification 6\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 [pid6](index.html) module"] +pub struct PID6_SPEC; +impl crate::RegisterSpec for PID6_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pid6::R](R) reader structure"] +impl crate::Readable for PID6_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PID6 to value 0"] +impl crate::Resettable for PID6_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/pid7.rs b/src/mtb/pid7.rs new file mode 100644 index 0000000..77664d4 --- /dev/null +++ b/src/mtb/pid7.rs @@ -0,0 +1,31 @@ +#[doc = "Register `PID7` reader"] +pub struct R(crate::R<PID7_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<PID7_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<PID7_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<PID7_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Peripheral Identification 7\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 [pid7](index.html) module"] +pub struct PID7_SPEC; +impl crate::RegisterSpec for PID7_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pid7::R](R) reader structure"] +impl crate::Readable for PID7_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PID7 to value 0"] +impl crate::Resettable for PID7_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mtb/position.rs b/src/mtb/position.rs new file mode 100644 index 0000000..97ea364 --- /dev/null +++ b/src/mtb/position.rs @@ -0,0 +1,148 @@ +#[doc = "Register `POSITION` reader"] +pub struct R(crate::R<POSITION_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<POSITION_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<POSITION_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<POSITION_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Register `POSITION` writer"] +pub struct W(crate::W<POSITION_SPEC>); +impl core::ops::Deref for W { + type Target = crate::W<POSITION_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From<crate::W<POSITION_SPEC>> for W { + #[inline(always)] + fn from(writer: crate::W<POSITION_SPEC>) -> Self { + W(writer) + } +} +#[doc = "Field `WRAP` reader - Pointer Value Wraps"] +pub struct WRAP_R(crate::FieldReader<bool, bool>); +impl WRAP_R { + pub(crate) fn new(bits: bool) -> Self { + WRAP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for WRAP_R { + type Target = crate::FieldReader<bool, bool>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WRAP` writer - Pointer Value Wraps"] +pub struct WRAP_W<'a> { + w: &'a mut W, +} +impl<'a> WRAP_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 `POINTER` reader - Trace Packet Location Pointer"] +pub struct POINTER_R(crate::FieldReader<u32, u32>); +impl POINTER_R { + pub(crate) fn new(bits: u32) -> Self { + POINTER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for POINTER_R { + type Target = crate::FieldReader<u32, u32>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `POINTER` writer - Trace Packet Location Pointer"] +pub struct POINTER_W<'a> { + w: &'a mut W, +} +impl<'a> POINTER_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 & !(0x1fff_ffff << 3)) | ((value as u32 & 0x1fff_ffff) << 3); + self.w + } +} +impl R { + #[doc = "Bit 2 - Pointer Value Wraps"] + #[inline(always)] + pub fn wrap(&self) -> WRAP_R { + WRAP_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bits 3:31 - Trace Packet Location Pointer"] + #[inline(always)] + pub fn pointer(&self) -> POINTER_R { + POINTER_R::new(((self.bits >> 3) & 0x1fff_ffff) as u32) + } +} +impl W { + #[doc = "Bit 2 - Pointer Value Wraps"] + #[inline(always)] + pub fn wrap(&mut self) -> WRAP_W { + WRAP_W { w: self } + } + #[doc = "Bits 3:31 - Trace Packet Location Pointer"] + #[inline(always)] + pub fn pointer(&mut self) -> POINTER_W { + POINTER_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 = "MTB Position\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 [position](index.html) module"] +pub struct POSITION_SPEC; +impl crate::RegisterSpec for POSITION_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [position::R](R) reader structure"] +impl crate::Readable for POSITION_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [position::W](W) writer structure"] +impl crate::Writable for POSITION_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets POSITION to value 0"] +impl crate::Resettable for POSITION_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} |
