summaryrefslogtreecommitdiff
path: root/src/divas/ctrla.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/divas/ctrla.rs')
-rw-r--r--src/divas/ctrla.rs158
1 files changed, 158 insertions, 0 deletions
diff --git a/src/divas/ctrla.rs b/src/divas/ctrla.rs
new file mode 100644
index 0000000..2914e9c
--- /dev/null
+++ b/src/divas/ctrla.rs
@@ -0,0 +1,158 @@
+#[doc = "Register `CTRLA` reader"]
+pub struct R(crate::R<CTRLA_SPEC>);
+impl core::ops::Deref for R {
+ type Target = crate::R<CTRLA_SPEC>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+impl From<crate::R<CTRLA_SPEC>> for R {
+ #[inline(always)]
+ fn from(reader: crate::R<CTRLA_SPEC>) -> Self {
+ R(reader)
+ }
+}
+#[doc = "Register `CTRLA` writer"]
+pub struct W(crate::W<CTRLA_SPEC>);
+impl core::ops::Deref for W {
+ type Target = crate::W<CTRLA_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<CTRLA_SPEC>> for W {
+ #[inline(always)]
+ fn from(writer: crate::W<CTRLA_SPEC>) -> Self {
+ W(writer)
+ }
+}
+#[doc = "Field `SIGNED` reader - Signed"]
+pub struct SIGNED_R(crate::FieldReader<bool, bool>);
+impl SIGNED_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ SIGNED_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for SIGNED_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `SIGNED` writer - Signed"]
+pub struct SIGNED_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> SIGNED_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 `DLZ` reader - Disable Leading Zero Optimization"]
+pub struct DLZ_R(crate::FieldReader<bool, bool>);
+impl DLZ_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ DLZ_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for DLZ_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `DLZ` writer - Disable Leading Zero Optimization"]
+pub struct DLZ_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> DLZ_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
+ }
+}
+impl R {
+ #[doc = "Bit 0 - Signed"]
+ #[inline(always)]
+ pub fn signed(&self) -> SIGNED_R {
+ SIGNED_R::new((self.bits & 0x01) != 0)
+ }
+ #[doc = "Bit 1 - Disable Leading Zero Optimization"]
+ #[inline(always)]
+ pub fn dlz(&self) -> DLZ_R {
+ DLZ_R::new(((self.bits >> 1) & 0x01) != 0)
+ }
+}
+impl W {
+ #[doc = "Bit 0 - Signed"]
+ #[inline(always)]
+ pub fn signed(&mut self) -> SIGNED_W {
+ SIGNED_W { w: self }
+ }
+ #[doc = "Bit 1 - Disable Leading Zero Optimization"]
+ #[inline(always)]
+ pub fn dlz(&mut self) -> DLZ_W {
+ DLZ_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\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 = u8;
+}
+#[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
+ }
+}