summaryrefslogtreecommitdiff
path: root/src/dac/data.rs
diff options
context:
space:
mode:
authorArne Dußin2021-11-06 11:50:33 +0100
committerArne Dußin2021-11-06 11:50:33 +0100
commit0666a6ba1dbd66cf8b93c113e362ccbcd99152a0 (patch)
treea184284dbd2316f4624f092e4e7521ea8c90855b /src/dac/data.rs
downloadsamc21-0666a6ba1dbd66cf8b93c113e362ccbcd99152a0.tar.gz
samc21-0666a6ba1dbd66cf8b93c113e362ccbcd99152a0.zip
Initial commit
Diffstat (limited to 'src/dac/data.rs')
-rw-r--r--src/dac/data.rs62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/dac/data.rs b/src/dac/data.rs
new file mode 100644
index 0000000..00261e9
--- /dev/null
+++ b/src/dac/data.rs
@@ -0,0 +1,62 @@
+#[doc = "Register `DATA` writer"]
+pub struct W(crate::W<DATA_SPEC>);
+impl core::ops::Deref for W {
+ type Target = crate::W<DATA_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<DATA_SPEC>> for W {
+ #[inline(always)]
+ fn from(writer: crate::W<DATA_SPEC>) -> Self {
+ W(writer)
+ }
+}
+#[doc = "Field `DATA` writer - Data value to be converted"]
+pub struct DATA_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> DATA_W<'a> {
+ #[doc = r"Writes raw bits to the field"]
+ #[inline(always)]
+ pub unsafe fn bits(self, value: u16) -> &'a mut W {
+ self.w.bits = (self.w.bits & !0xffff) | (value as u16 & 0xffff);
+ self.w
+ }
+}
+impl W {
+ #[doc = "Bits 0:15 - Data value to be converted"]
+ #[inline(always)]
+ pub fn data(&mut self) -> DATA_W {
+ DATA_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 = "Data\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [data](index.html) module"]
+pub struct DATA_SPEC;
+impl crate::RegisterSpec for DATA_SPEC {
+ type Ux = u16;
+}
+#[doc = "`write(|w| ..)` method takes [data::W](W) writer structure"]
+impl crate::Writable for DATA_SPEC {
+ type Writer = W;
+}
+#[doc = "`reset()` method sets DATA to value 0"]
+impl crate::Resettable for DATA_SPEC {
+ #[inline(always)]
+ fn reset_value() -> Self::Ux {
+ 0
+ }
+}