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/divas | |
| download | samc21-0666a6ba1dbd66cf8b93c113e362ccbcd99152a0.tar.gz samc21-0666a6ba1dbd66cf8b93c113e362ccbcd99152a0.zip | |
Initial commit
Diffstat (limited to 'src/divas')
| -rw-r--r-- | src/divas/ctrla.rs | 158 | ||||
| -rw-r--r-- | src/divas/dividend.rs | 102 | ||||
| -rw-r--r-- | src/divas/divisor.rs | 102 | ||||
| -rw-r--r-- | src/divas/rem.rs | 52 | ||||
| -rw-r--r-- | src/divas/result.rs | 52 | ||||
| -rw-r--r-- | src/divas/sqrnum.rs | 102 | ||||
| -rw-r--r-- | src/divas/status.rs | 158 |
7 files changed, 726 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 + } +} diff --git a/src/divas/dividend.rs b/src/divas/dividend.rs new file mode 100644 index 0000000..7728b58 --- /dev/null +++ b/src/divas/dividend.rs @@ -0,0 +1,102 @@ +#[doc = "Register `DIVIDEND` reader"] +pub struct R(crate::R<DIVIDEND_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<DIVIDEND_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<DIVIDEND_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<DIVIDEND_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Register `DIVIDEND` writer"] +pub struct W(crate::W<DIVIDEND_SPEC>); +impl core::ops::Deref for W { + type Target = crate::W<DIVIDEND_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<DIVIDEND_SPEC>> for W { + #[inline(always)] + fn from(writer: crate::W<DIVIDEND_SPEC>) -> Self { + W(writer) + } +} +#[doc = "Field `DIVIDEND` reader - DIVIDEND"] +pub struct DIVIDEND_R(crate::FieldReader<u32, u32>); +impl DIVIDEND_R { + pub(crate) fn new(bits: u32) -> Self { + DIVIDEND_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DIVIDEND_R { + type Target = crate::FieldReader<u32, u32>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DIVIDEND` writer - DIVIDEND"] +pub struct DIVIDEND_W<'a> { + w: &'a mut W, +} +impl<'a> DIVIDEND_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 & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - DIVIDEND"] + #[inline(always)] + pub fn dividend(&self) -> DIVIDEND_R { + DIVIDEND_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - DIVIDEND"] + #[inline(always)] + pub fn dividend(&mut self) -> DIVIDEND_W { + DIVIDEND_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 = "Dividend\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 [dividend](index.html) module"] +pub struct DIVIDEND_SPEC; +impl crate::RegisterSpec for DIVIDEND_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dividend::R](R) reader structure"] +impl crate::Readable for DIVIDEND_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dividend::W](W) writer structure"] +impl crate::Writable for DIVIDEND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIVIDEND to value 0"] +impl crate::Resettable for DIVIDEND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/divas/divisor.rs b/src/divas/divisor.rs new file mode 100644 index 0000000..3f9c240 --- /dev/null +++ b/src/divas/divisor.rs @@ -0,0 +1,102 @@ +#[doc = "Register `DIVISOR` reader"] +pub struct R(crate::R<DIVISOR_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<DIVISOR_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<DIVISOR_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<DIVISOR_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Register `DIVISOR` writer"] +pub struct W(crate::W<DIVISOR_SPEC>); +impl core::ops::Deref for W { + type Target = crate::W<DIVISOR_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<DIVISOR_SPEC>> for W { + #[inline(always)] + fn from(writer: crate::W<DIVISOR_SPEC>) -> Self { + W(writer) + } +} +#[doc = "Field `DIVISOR` reader - DIVISOR"] +pub struct DIVISOR_R(crate::FieldReader<u32, u32>); +impl DIVISOR_R { + pub(crate) fn new(bits: u32) -> Self { + DIVISOR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DIVISOR_R { + type Target = crate::FieldReader<u32, u32>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DIVISOR` writer - DIVISOR"] +pub struct DIVISOR_W<'a> { + w: &'a mut W, +} +impl<'a> DIVISOR_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 & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - DIVISOR"] + #[inline(always)] + pub fn divisor(&self) -> DIVISOR_R { + DIVISOR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - DIVISOR"] + #[inline(always)] + pub fn divisor(&mut self) -> DIVISOR_W { + DIVISOR_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 = "Divisor\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 [divisor](index.html) module"] +pub struct DIVISOR_SPEC; +impl crate::RegisterSpec for DIVISOR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [divisor::R](R) reader structure"] +impl crate::Readable for DIVISOR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [divisor::W](W) writer structure"] +impl crate::Writable for DIVISOR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIVISOR to value 0"] +impl crate::Resettable for DIVISOR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/divas/rem.rs b/src/divas/rem.rs new file mode 100644 index 0000000..598889a --- /dev/null +++ b/src/divas/rem.rs @@ -0,0 +1,52 @@ +#[doc = "Register `REM` reader"] +pub struct R(crate::R<REM_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<REM_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<REM_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<REM_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Field `REM` reader - REM"] +pub struct REM_R(crate::FieldReader<u32, u32>); +impl REM_R { + pub(crate) fn new(bits: u32) -> Self { + REM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for REM_R { + type Target = crate::FieldReader<u32, u32>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - REM"] + #[inline(always)] + pub fn rem(&self) -> REM_R { + REM_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Remainder\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 [rem](index.html) module"] +pub struct REM_SPEC; +impl crate::RegisterSpec for REM_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rem::R](R) reader structure"] +impl crate::Readable for REM_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets REM to value 0"] +impl crate::Resettable for REM_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/divas/result.rs b/src/divas/result.rs new file mode 100644 index 0000000..739ba04 --- /dev/null +++ b/src/divas/result.rs @@ -0,0 +1,52 @@ +#[doc = "Register `RESULT` reader"] +pub struct R(crate::R<RESULT_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<RESULT_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<RESULT_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<RESULT_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Field `RESULT` reader - RESULT"] +pub struct RESULT_R(crate::FieldReader<u32, u32>); +impl RESULT_R { + pub(crate) fn new(bits: u32) -> Self { + RESULT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RESULT_R { + type Target = crate::FieldReader<u32, u32>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - RESULT"] + #[inline(always)] + pub fn result(&self) -> RESULT_R { + RESULT_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Result\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 [result](index.html) module"] +pub struct RESULT_SPEC; +impl crate::RegisterSpec for RESULT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [result::R](R) reader structure"] +impl crate::Readable for RESULT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RESULT to value 0"] +impl crate::Resettable for RESULT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/divas/sqrnum.rs b/src/divas/sqrnum.rs new file mode 100644 index 0000000..4bf2214 --- /dev/null +++ b/src/divas/sqrnum.rs @@ -0,0 +1,102 @@ +#[doc = "Register `SQRNUM` reader"] +pub struct R(crate::R<SQRNUM_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<SQRNUM_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<SQRNUM_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<SQRNUM_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Register `SQRNUM` writer"] +pub struct W(crate::W<SQRNUM_SPEC>); +impl core::ops::Deref for W { + type Target = crate::W<SQRNUM_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<SQRNUM_SPEC>> for W { + #[inline(always)] + fn from(writer: crate::W<SQRNUM_SPEC>) -> Self { + W(writer) + } +} +#[doc = "Field `SQRNUM` reader - Square Root Input"] +pub struct SQRNUM_R(crate::FieldReader<u32, u32>); +impl SQRNUM_R { + pub(crate) fn new(bits: u32) -> Self { + SQRNUM_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SQRNUM_R { + type Target = crate::FieldReader<u32, u32>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SQRNUM` writer - Square Root Input"] +pub struct SQRNUM_W<'a> { + w: &'a mut W, +} +impl<'a> SQRNUM_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 & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Square Root Input"] + #[inline(always)] + pub fn sqrnum(&self) -> SQRNUM_R { + SQRNUM_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Square Root Input"] + #[inline(always)] + pub fn sqrnum(&mut self) -> SQRNUM_W { + SQRNUM_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 = "Square Root Input\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 [sqrnum](index.html) module"] +pub struct SQRNUM_SPEC; +impl crate::RegisterSpec for SQRNUM_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sqrnum::R](R) reader structure"] +impl crate::Readable for SQRNUM_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sqrnum::W](W) writer structure"] +impl crate::Writable for SQRNUM_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SQRNUM to value 0"] +impl crate::Resettable for SQRNUM_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/divas/status.rs b/src/divas/status.rs new file mode 100644 index 0000000..f88f29f --- /dev/null +++ b/src/divas/status.rs @@ -0,0 +1,158 @@ +#[doc = "Register `STATUS` reader"] +pub struct R(crate::R<STATUS_SPEC>); +impl core::ops::Deref for R { + type Target = crate::R<STATUS_SPEC>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From<crate::R<STATUS_SPEC>> for R { + #[inline(always)] + fn from(reader: crate::R<STATUS_SPEC>) -> Self { + R(reader) + } +} +#[doc = "Register `STATUS` writer"] +pub struct W(crate::W<STATUS_SPEC>); +impl core::ops::Deref for W { + type Target = crate::W<STATUS_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<STATUS_SPEC>> for W { + #[inline(always)] + fn from(writer: crate::W<STATUS_SPEC>) -> Self { + W(writer) + } +} +#[doc = "Field `BUSY` reader - DIVAS Accelerator Busy"] +pub struct BUSY_R(crate::FieldReader<bool, bool>); +impl BUSY_R { + pub(crate) fn new(bits: bool) -> Self { + BUSY_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BUSY_R { + type Target = crate::FieldReader<bool, bool>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BUSY` writer - DIVAS Accelerator Busy"] +pub struct BUSY_W<'a> { + w: &'a mut W, +} +impl<'a> BUSY_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 `DBZ` reader - Writing a one to this bit clears DBZ to zero"] +pub struct DBZ_R(crate::FieldReader<bool, bool>); +impl DBZ_R { + pub(crate) fn new(bits: bool) -> Self { + DBZ_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DBZ_R { + type Target = crate::FieldReader<bool, bool>; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DBZ` writer - Writing a one to this bit clears DBZ to zero"] +pub struct DBZ_W<'a> { + w: &'a mut W, +} +impl<'a> DBZ_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 - DIVAS Accelerator Busy"] + #[inline(always)] + pub fn busy(&self) -> BUSY_R { + BUSY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Writing a one to this bit clears DBZ to zero"] + #[inline(always)] + pub fn dbz(&self) -> DBZ_R { + DBZ_R::new(((self.bits >> 1) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - DIVAS Accelerator Busy"] + #[inline(always)] + pub fn busy(&mut self) -> BUSY_W { + BUSY_W { w: self } + } + #[doc = "Bit 1 - Writing a one to this bit clears DBZ to zero"] + #[inline(always)] + pub fn dbz(&mut self) -> DBZ_W { + DBZ_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 = "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 = u8; +} +#[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 0"] +impl crate::Resettable for STATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} |
