summaryrefslogtreecommitdiff
path: root/src/nvmctrl
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/nvmctrl
downloadsamc21-0666a6ba1dbd66cf8b93c113e362ccbcd99152a0.tar.gz
samc21-0666a6ba1dbd66cf8b93c113e362ccbcd99152a0.zip
Initial commit
Diffstat (limited to 'src/nvmctrl')
-rw-r--r--src/nvmctrl/addr.rs102
-rw-r--r--src/nvmctrl/ctrla.rs392
-rw-r--r--src/nvmctrl/ctrlb.rs442
-rw-r--r--src/nvmctrl/intenclr.rs158
-rw-r--r--src/nvmctrl/intenset.rs158
-rw-r--r--src/nvmctrl/intflag.rs158
-rw-r--r--src/nvmctrl/lock.rs102
-rw-r--r--src/nvmctrl/param.rs301
-rw-r--r--src/nvmctrl/pbldata0.rs31
-rw-r--r--src/nvmctrl/pbldata1.rs31
-rw-r--r--src/nvmctrl/status.rs342
11 files changed, 2217 insertions, 0 deletions
diff --git a/src/nvmctrl/addr.rs b/src/nvmctrl/addr.rs
new file mode 100644
index 0000000..571313b
--- /dev/null
+++ b/src/nvmctrl/addr.rs
@@ -0,0 +1,102 @@
+#[doc = "Register `ADDR` reader"]
+pub struct R(crate::R<ADDR_SPEC>);
+impl core::ops::Deref for R {
+ type Target = crate::R<ADDR_SPEC>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+impl From<crate::R<ADDR_SPEC>> for R {
+ #[inline(always)]
+ fn from(reader: crate::R<ADDR_SPEC>) -> Self {
+ R(reader)
+ }
+}
+#[doc = "Register `ADDR` writer"]
+pub struct W(crate::W<ADDR_SPEC>);
+impl core::ops::Deref for W {
+ type Target = crate::W<ADDR_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<ADDR_SPEC>> for W {
+ #[inline(always)]
+ fn from(writer: crate::W<ADDR_SPEC>) -> Self {
+ W(writer)
+ }
+}
+#[doc = "Field `ADDR` reader - NVM Address"]
+pub struct ADDR_R(crate::FieldReader<u32, u32>);
+impl ADDR_R {
+ pub(crate) fn new(bits: u32) -> Self {
+ ADDR_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for ADDR_R {
+ type Target = crate::FieldReader<u32, u32>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `ADDR` writer - NVM Address"]
+pub struct ADDR_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> ADDR_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 & !0x003f_ffff) | (value as u32 & 0x003f_ffff);
+ self.w
+ }
+}
+impl R {
+ #[doc = "Bits 0:21 - NVM Address"]
+ #[inline(always)]
+ pub fn addr(&self) -> ADDR_R {
+ ADDR_R::new((self.bits & 0x003f_ffff) as u32)
+ }
+}
+impl W {
+ #[doc = "Bits 0:21 - NVM Address"]
+ #[inline(always)]
+ pub fn addr(&mut self) -> ADDR_W {
+ ADDR_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 = "Address\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 [addr](index.html) module"]
+pub struct ADDR_SPEC;
+impl crate::RegisterSpec for ADDR_SPEC {
+ type Ux = u32;
+}
+#[doc = "`read()` method returns [addr::R](R) reader structure"]
+impl crate::Readable for ADDR_SPEC {
+ type Reader = R;
+}
+#[doc = "`write(|w| ..)` method takes [addr::W](W) writer structure"]
+impl crate::Writable for ADDR_SPEC {
+ type Writer = W;
+}
+#[doc = "`reset()` method sets ADDR to value 0"]
+impl crate::Resettable for ADDR_SPEC {
+ #[inline(always)]
+ fn reset_value() -> Self::Ux {
+ 0
+ }
+}
diff --git a/src/nvmctrl/ctrla.rs b/src/nvmctrl/ctrla.rs
new file mode 100644
index 0000000..7699ba7
--- /dev/null
+++ b/src/nvmctrl/ctrla.rs
@@ -0,0 +1,392 @@
+#[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 = "Command\n\nValue on reset: 0"]
+#[derive(Clone, Copy, Debug, PartialEq)]
+#[repr(u8)]
+pub enum CMD_A {
+ #[doc = "2: Erase Row - Erases the row addressed by the ADDR register."]
+ ER = 2,
+ #[doc = "4: Write Page - Writes the contents of the page buffer to the page addressed by the ADDR register."]
+ WP = 4,
+ #[doc = "5: Erase Auxiliary Row - Erases the auxiliary row addressed by the ADDR register. This command can be given only when the security bit is not set and only to the user configuration row."]
+ EAR = 5,
+ #[doc = "6: Write Auxiliary Page - Writes the contents of the page buffer to the page addressed by the ADDR register. This command can be given only when the security bit is not set and only to the user configuration row."]
+ WAP = 6,
+ #[doc = "10: Security Flow Command"]
+ SF = 10,
+ #[doc = "15: Write lockbits"]
+ WL = 15,
+ #[doc = "26: RWW EEPROM area Erase Row - Erases the row addressed by the ADDR register."]
+ RWWEEER = 26,
+ #[doc = "28: RWW EEPROM Write Page - Writes the contents of the page buffer to the page addressed by the ADDR register."]
+ RWWEEWP = 28,
+ #[doc = "64: Lock Region - Locks the region containing the address location in the ADDR register."]
+ LR = 64,
+ #[doc = "65: Unlock Region - Unlocks the region containing the address location in the ADDR register."]
+ UR = 65,
+ #[doc = "66: Sets the power reduction mode."]
+ SPRM = 66,
+ #[doc = "67: Clears the power reduction mode."]
+ CPRM = 67,
+ #[doc = "68: Page Buffer Clear - Clears the page buffer."]
+ PBC = 68,
+ #[doc = "69: Set Security Bit - Sets the security bit by writing 0x00 to the first byte in the lockbit row."]
+ SSB = 69,
+ #[doc = "70: Invalidate all cache lines."]
+ INVALL = 70,
+}
+impl From<CMD_A> for u8 {
+ #[inline(always)]
+ fn from(variant: CMD_A) -> Self {
+ variant as _
+ }
+}
+#[doc = "Field `CMD` reader - Command"]
+pub struct CMD_R(crate::FieldReader<u8, CMD_A>);
+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<CMD_A> {
+ match self.bits {
+ 2 => Some(CMD_A::ER),
+ 4 => Some(CMD_A::WP),
+ 5 => Some(CMD_A::EAR),
+ 6 => Some(CMD_A::WAP),
+ 10 => Some(CMD_A::SF),
+ 15 => Some(CMD_A::WL),
+ 26 => Some(CMD_A::RWWEEER),
+ 28 => Some(CMD_A::RWWEEWP),
+ 64 => Some(CMD_A::LR),
+ 65 => Some(CMD_A::UR),
+ 66 => Some(CMD_A::SPRM),
+ 67 => Some(CMD_A::CPRM),
+ 68 => Some(CMD_A::PBC),
+ 69 => Some(CMD_A::SSB),
+ 70 => Some(CMD_A::INVALL),
+ _ => None,
+ }
+ }
+ #[doc = "Checks if the value of the field is `ER`"]
+ #[inline(always)]
+ pub fn is_er(&self) -> bool {
+ **self == CMD_A::ER
+ }
+ #[doc = "Checks if the value of the field is `WP`"]
+ #[inline(always)]
+ pub fn is_wp(&self) -> bool {
+ **self == CMD_A::WP
+ }
+ #[doc = "Checks if the value of the field is `EAR`"]
+ #[inline(always)]
+ pub fn is_ear(&self) -> bool {
+ **self == CMD_A::EAR
+ }
+ #[doc = "Checks if the value of the field is `WAP`"]
+ #[inline(always)]
+ pub fn is_wap(&self) -> bool {
+ **self == CMD_A::WAP
+ }
+ #[doc = "Checks if the value of the field is `SF`"]
+ #[inline(always)]
+ pub fn is_sf(&self) -> bool {
+ **self == CMD_A::SF
+ }
+ #[doc = "Checks if the value of the field is `WL`"]
+ #[inline(always)]
+ pub fn is_wl(&self) -> bool {
+ **self == CMD_A::WL
+ }
+ #[doc = "Checks if the value of the field is `RWWEEER`"]
+ #[inline(always)]
+ pub fn is_rwweeer(&self) -> bool {
+ **self == CMD_A::RWWEEER
+ }
+ #[doc = "Checks if the value of the field is `RWWEEWP`"]
+ #[inline(always)]
+ pub fn is_rwweewp(&self) -> bool {
+ **self == CMD_A::RWWEEWP
+ }
+ #[doc = "Checks if the value of the field is `LR`"]
+ #[inline(always)]
+ pub fn is_lr(&self) -> bool {
+ **self == CMD_A::LR
+ }
+ #[doc = "Checks if the value of the field is `UR`"]
+ #[inline(always)]
+ pub fn is_ur(&self) -> bool {
+ **self == CMD_A::UR
+ }
+ #[doc = "Checks if the value of the field is `SPRM`"]
+ #[inline(always)]
+ pub fn is_sprm(&self) -> bool {
+ **self == CMD_A::SPRM
+ }
+ #[doc = "Checks if the value of the field is `CPRM`"]
+ #[inline(always)]
+ pub fn is_cprm(&self) -> bool {
+ **self == CMD_A::CPRM
+ }
+ #[doc = "Checks if the value of the field is `PBC`"]
+ #[inline(always)]
+ pub fn is_pbc(&self) -> bool {
+ **self == CMD_A::PBC
+ }
+ #[doc = "Checks if the value of the field is `SSB`"]
+ #[inline(always)]
+ pub fn is_ssb(&self) -> bool {
+ **self == CMD_A::SSB
+ }
+ #[doc = "Checks if the value of the field is `INVALL`"]
+ #[inline(always)]
+ pub fn is_invall(&self) -> bool {
+ **self == CMD_A::INVALL
+ }
+}
+impl core::ops::Deref for CMD_R {
+ type Target = crate::FieldReader<u8, CMD_A>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `CMD` writer - 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 = "Erase Row - Erases the row addressed by the ADDR register."]
+ #[inline(always)]
+ pub fn er(self) -> &'a mut W {
+ self.variant(CMD_A::ER)
+ }
+ #[doc = "Write Page - Writes the contents of the page buffer to the page addressed by the ADDR register."]
+ #[inline(always)]
+ pub fn wp(self) -> &'a mut W {
+ self.variant(CMD_A::WP)
+ }
+ #[doc = "Erase Auxiliary Row - Erases the auxiliary row addressed by the ADDR register. This command can be given only when the security bit is not set and only to the user configuration row."]
+ #[inline(always)]
+ pub fn ear(self) -> &'a mut W {
+ self.variant(CMD_A::EAR)
+ }
+ #[doc = "Write Auxiliary Page - Writes the contents of the page buffer to the page addressed by the ADDR register. This command can be given only when the security bit is not set and only to the user configuration row."]
+ #[inline(always)]
+ pub fn wap(self) -> &'a mut W {
+ self.variant(CMD_A::WAP)
+ }
+ #[doc = "Security Flow Command"]
+ #[inline(always)]
+ pub fn sf(self) -> &'a mut W {
+ self.variant(CMD_A::SF)
+ }
+ #[doc = "Write lockbits"]
+ #[inline(always)]
+ pub fn wl(self) -> &'a mut W {
+ self.variant(CMD_A::WL)
+ }
+ #[doc = "RWW EEPROM area Erase Row - Erases the row addressed by the ADDR register."]
+ #[inline(always)]
+ pub fn rwweeer(self) -> &'a mut W {
+ self.variant(CMD_A::RWWEEER)
+ }
+ #[doc = "RWW EEPROM Write Page - Writes the contents of the page buffer to the page addressed by the ADDR register."]
+ #[inline(always)]
+ pub fn rwweewp(self) -> &'a mut W {
+ self.variant(CMD_A::RWWEEWP)
+ }
+ #[doc = "Lock Region - Locks the region containing the address location in the ADDR register."]
+ #[inline(always)]
+ pub fn lr(self) -> &'a mut W {
+ self.variant(CMD_A::LR)
+ }
+ #[doc = "Unlock Region - Unlocks the region containing the address location in the ADDR register."]
+ #[inline(always)]
+ pub fn ur(self) -> &'a mut W {
+ self.variant(CMD_A::UR)
+ }
+ #[doc = "Sets the power reduction mode."]
+ #[inline(always)]
+ pub fn sprm(self) -> &'a mut W {
+ self.variant(CMD_A::SPRM)
+ }
+ #[doc = "Clears the power reduction mode."]
+ #[inline(always)]
+ pub fn cprm(self) -> &'a mut W {
+ self.variant(CMD_A::CPRM)
+ }
+ #[doc = "Page Buffer Clear - Clears the page buffer."]
+ #[inline(always)]
+ pub fn pbc(self) -> &'a mut W {
+ self.variant(CMD_A::PBC)
+ }
+ #[doc = "Set Security Bit - Sets the security bit by writing 0x00 to the first byte in the lockbit row."]
+ #[inline(always)]
+ pub fn ssb(self) -> &'a mut W {
+ self.variant(CMD_A::SSB)
+ }
+ #[doc = "Invalidate all cache lines."]
+ #[inline(always)]
+ pub fn invall(self) -> &'a mut W {
+ self.variant(CMD_A::INVALL)
+ }
+ #[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 & !0x7f) | (value as u16 & 0x7f);
+ self.w
+ }
+}
+#[doc = "Command Execution\n\nValue on reset: 0"]
+#[derive(Clone, Copy, Debug, PartialEq)]
+#[repr(u8)]
+pub enum CMDEX_A {
+ #[doc = "165: Execution Key"]
+ KEY = 165,
+}
+impl From<CMDEX_A> for u8 {
+ #[inline(always)]
+ fn from(variant: CMDEX_A) -> Self {
+ variant as _
+ }
+}
+#[doc = "Field `CMDEX` reader - Command Execution"]
+pub struct CMDEX_R(crate::FieldReader<u8, CMDEX_A>);
+impl CMDEX_R {
+ pub(crate) fn new(bits: u8) -> Self {
+ CMDEX_R(crate::FieldReader::new(bits))
+ }
+ #[doc = r"Get enumerated values variant"]
+ #[inline(always)]
+ pub fn variant(&self) -> Option<CMDEX_A> {
+ match self.bits {
+ 165 => Some(CMDEX_A::KEY),
+ _ => None,
+ }
+ }
+ #[doc = "Checks if the value of the field is `KEY`"]
+ #[inline(always)]
+ pub fn is_key(&self) -> bool {
+ **self == CMDEX_A::KEY
+ }
+}
+impl core::ops::Deref for CMDEX_R {
+ type Target = crate::FieldReader<u8, CMDEX_A>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `CMDEX` writer - Command Execution"]
+pub struct CMDEX_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> CMDEX_W<'a> {
+ #[doc = r"Writes `variant` to the field"]
+ #[inline(always)]
+ pub fn variant(self, variant: CMDEX_A) -> &'a mut W {
+ unsafe { self.bits(variant.into()) }
+ }
+ #[doc = "Execution Key"]
+ #[inline(always)]
+ pub fn key(self) -> &'a mut W {
+ self.variant(CMDEX_A::KEY)
+ }
+ #[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 << 8)) | ((value as u16 & 0xff) << 8);
+ self.w
+ }
+}
+impl R {
+ #[doc = "Bits 0:6 - Command"]
+ #[inline(always)]
+ pub fn cmd(&self) -> CMD_R {
+ CMD_R::new((self.bits & 0x7f) as u8)
+ }
+ #[doc = "Bits 8:15 - Command Execution"]
+ #[inline(always)]
+ pub fn cmdex(&self) -> CMDEX_R {
+ CMDEX_R::new(((self.bits >> 8) & 0xff) as u8)
+ }
+}
+impl W {
+ #[doc = "Bits 0:6 - Command"]
+ #[inline(always)]
+ pub fn cmd(&mut self) -> CMD_W {
+ CMD_W { w: self }
+ }
+ #[doc = "Bits 8:15 - Command Execution"]
+ #[inline(always)]
+ pub fn cmdex(&mut self) -> CMDEX_W {
+ CMDEX_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 = "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 = u16;
+}
+#[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/nvmctrl/ctrlb.rs b/src/nvmctrl/ctrlb.rs
new file mode 100644
index 0000000..a01d90c
--- /dev/null
+++ b/src/nvmctrl/ctrlb.rs
@@ -0,0 +1,442 @@
+#[doc = "Register `CTRLB` reader"]
+pub struct R(crate::R<CTRLB_SPEC>);
+impl core::ops::Deref for R {
+ type Target = crate::R<CTRLB_SPEC>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+impl From<crate::R<CTRLB_SPEC>> for R {
+ #[inline(always)]
+ fn from(reader: crate::R<CTRLB_SPEC>) -> Self {
+ R(reader)
+ }
+}
+#[doc = "Register `CTRLB` writer"]
+pub struct W(crate::W<CTRLB_SPEC>);
+impl core::ops::Deref for W {
+ type Target = crate::W<CTRLB_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<CTRLB_SPEC>> for W {
+ #[inline(always)]
+ fn from(writer: crate::W<CTRLB_SPEC>) -> Self {
+ W(writer)
+ }
+}
+#[doc = "NVM Read Wait States\n\nValue on reset: 0"]
+#[derive(Clone, Copy, Debug, PartialEq)]
+#[repr(u8)]
+pub enum RWS_A {
+ #[doc = "0: Single Auto Wait State"]
+ SINGLE = 0,
+ #[doc = "1: Half Auto Wait State"]
+ HALF = 1,
+ #[doc = "2: Dual Auto Wait State"]
+ DUAL = 2,
+}
+impl From<RWS_A> for u8 {
+ #[inline(always)]
+ fn from(variant: RWS_A) -> Self {
+ variant as _
+ }
+}
+#[doc = "Field `RWS` reader - NVM Read Wait States"]
+pub struct RWS_R(crate::FieldReader<u8, RWS_A>);
+impl RWS_R {
+ pub(crate) fn new(bits: u8) -> Self {
+ RWS_R(crate::FieldReader::new(bits))
+ }
+ #[doc = r"Get enumerated values variant"]
+ #[inline(always)]
+ pub fn variant(&self) -> Option<RWS_A> {
+ match self.bits {
+ 0 => Some(RWS_A::SINGLE),
+ 1 => Some(RWS_A::HALF),
+ 2 => Some(RWS_A::DUAL),
+ _ => None,
+ }
+ }
+ #[doc = "Checks if the value of the field is `SINGLE`"]
+ #[inline(always)]
+ pub fn is_single(&self) -> bool {
+ **self == RWS_A::SINGLE
+ }
+ #[doc = "Checks if the value of the field is `HALF`"]
+ #[inline(always)]
+ pub fn is_half(&self) -> bool {
+ **self == RWS_A::HALF
+ }
+ #[doc = "Checks if the value of the field is `DUAL`"]
+ #[inline(always)]
+ pub fn is_dual(&self) -> bool {
+ **self == RWS_A::DUAL
+ }
+}
+impl core::ops::Deref for RWS_R {
+ type Target = crate::FieldReader<u8, RWS_A>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `RWS` writer - NVM Read Wait States"]
+pub struct RWS_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> RWS_W<'a> {
+ #[doc = r"Writes `variant` to the field"]
+ #[inline(always)]
+ pub fn variant(self, variant: RWS_A) -> &'a mut W {
+ unsafe { self.bits(variant.into()) }
+ }
+ #[doc = "Single Auto Wait State"]
+ #[inline(always)]
+ pub fn single(self) -> &'a mut W {
+ self.variant(RWS_A::SINGLE)
+ }
+ #[doc = "Half Auto Wait State"]
+ #[inline(always)]
+ pub fn half(self) -> &'a mut W {
+ self.variant(RWS_A::HALF)
+ }
+ #[doc = "Dual Auto Wait State"]
+ #[inline(always)]
+ pub fn dual(self) -> &'a mut W {
+ self.variant(RWS_A::DUAL)
+ }
+ #[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 << 1)) | ((value as u32 & 0x0f) << 1);
+ self.w
+ }
+}
+#[doc = "Field `MANW` reader - Manual Write"]
+pub struct MANW_R(crate::FieldReader<bool, bool>);
+impl MANW_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ MANW_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for MANW_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `MANW` writer - Manual Write"]
+pub struct MANW_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> MANW_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 = "Power Reduction Mode during Sleep\n\nValue on reset: 0"]
+#[derive(Clone, Copy, Debug, PartialEq)]
+#[repr(u8)]
+pub enum SLEEPPRM_A {
+ #[doc = "0: NVM block enters low-power mode when entering sleep.NVM block exits low-power mode upon first access."]
+ WAKEONACCESS = 0,
+ #[doc = "1: NVM block enters low-power mode when entering sleep.NVM block exits low-power mode when exiting sleep."]
+ WAKEUPINSTANT = 1,
+ #[doc = "3: Auto power reduction disabled."]
+ DISABLED = 3,
+}
+impl From<SLEEPPRM_A> for u8 {
+ #[inline(always)]
+ fn from(variant: SLEEPPRM_A) -> Self {
+ variant as _
+ }
+}
+#[doc = "Field `SLEEPPRM` reader - Power Reduction Mode during Sleep"]
+pub struct SLEEPPRM_R(crate::FieldReader<u8, SLEEPPRM_A>);
+impl SLEEPPRM_R {
+ pub(crate) fn new(bits: u8) -> Self {
+ SLEEPPRM_R(crate::FieldReader::new(bits))
+ }
+ #[doc = r"Get enumerated values variant"]
+ #[inline(always)]
+ pub fn variant(&self) -> Option<SLEEPPRM_A> {
+ match self.bits {
+ 0 => Some(SLEEPPRM_A::WAKEONACCESS),
+ 1 => Some(SLEEPPRM_A::WAKEUPINSTANT),
+ 3 => Some(SLEEPPRM_A::DISABLED),
+ _ => None,
+ }
+ }
+ #[doc = "Checks if the value of the field is `WAKEONACCESS`"]
+ #[inline(always)]
+ pub fn is_wakeonaccess(&self) -> bool {
+ **self == SLEEPPRM_A::WAKEONACCESS
+ }
+ #[doc = "Checks if the value of the field is `WAKEUPINSTANT`"]
+ #[inline(always)]
+ pub fn is_wakeupinstant(&self) -> bool {
+ **self == SLEEPPRM_A::WAKEUPINSTANT
+ }
+ #[doc = "Checks if the value of the field is `DISABLED`"]
+ #[inline(always)]
+ pub fn is_disabled(&self) -> bool {
+ **self == SLEEPPRM_A::DISABLED
+ }
+}
+impl core::ops::Deref for SLEEPPRM_R {
+ type Target = crate::FieldReader<u8, SLEEPPRM_A>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `SLEEPPRM` writer - Power Reduction Mode during Sleep"]
+pub struct SLEEPPRM_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> SLEEPPRM_W<'a> {
+ #[doc = r"Writes `variant` to the field"]
+ #[inline(always)]
+ pub fn variant(self, variant: SLEEPPRM_A) -> &'a mut W {
+ unsafe { self.bits(variant.into()) }
+ }
+ #[doc = "NVM block enters low-power mode when entering sleep.NVM block exits low-power mode upon first access."]
+ #[inline(always)]
+ pub fn wakeonaccess(self) -> &'a mut W {
+ self.variant(SLEEPPRM_A::WAKEONACCESS)
+ }
+ #[doc = "NVM block enters low-power mode when entering sleep.NVM block exits low-power mode when exiting sleep."]
+ #[inline(always)]
+ pub fn wakeupinstant(self) -> &'a mut W {
+ self.variant(SLEEPPRM_A::WAKEUPINSTANT)
+ }
+ #[doc = "Auto power reduction disabled."]
+ #[inline(always)]
+ pub fn disabled(self) -> &'a mut W {
+ self.variant(SLEEPPRM_A::DISABLED)
+ }
+ #[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 << 8)) | ((value as u32 & 0x03) << 8);
+ self.w
+ }
+}
+#[doc = "NVMCTRL Read Mode\n\nValue on reset: 0"]
+#[derive(Clone, Copy, Debug, PartialEq)]
+#[repr(u8)]
+pub enum READMODE_A {
+ #[doc = "0: The NVM Controller (cache system) does not insert wait states on a cache miss. Gives the best system performance."]
+ NO_MISS_PENALTY = 0,
+ #[doc = "1: Reduces power consumption of the cache system, but inserts a wait state each time there is a cache miss. This mode may not be relevant if CPU performance is required, as the application will be stalled and may lead to increase run time."]
+ LOW_POWER = 1,
+ #[doc = "2: The cache system ensures that a cache hit or miss takes the same amount of time, determined by the number of programmed flash wait states. This mode can be used for real-time applications that require deterministic execution timings."]
+ DETERMINISTIC = 2,
+}
+impl From<READMODE_A> for u8 {
+ #[inline(always)]
+ fn from(variant: READMODE_A) -> Self {
+ variant as _
+ }
+}
+#[doc = "Field `READMODE` reader - NVMCTRL Read Mode"]
+pub struct READMODE_R(crate::FieldReader<u8, READMODE_A>);
+impl READMODE_R {
+ pub(crate) fn new(bits: u8) -> Self {
+ READMODE_R(crate::FieldReader::new(bits))
+ }
+ #[doc = r"Get enumerated values variant"]
+ #[inline(always)]
+ pub fn variant(&self) -> Option<READMODE_A> {
+ match self.bits {
+ 0 => Some(READMODE_A::NO_MISS_PENALTY),
+ 1 => Some(READMODE_A::LOW_POWER),
+ 2 => Some(READMODE_A::DETERMINISTIC),
+ _ => None,
+ }
+ }
+ #[doc = "Checks if the value of the field is `NO_MISS_PENALTY`"]
+ #[inline(always)]
+ pub fn is_no_miss_penalty(&self) -> bool {
+ **self == READMODE_A::NO_MISS_PENALTY
+ }
+ #[doc = "Checks if the value of the field is `LOW_POWER`"]
+ #[inline(always)]
+ pub fn is_low_power(&self) -> bool {
+ **self == READMODE_A::LOW_POWER
+ }
+ #[doc = "Checks if the value of the field is `DETERMINISTIC`"]
+ #[inline(always)]
+ pub fn is_deterministic(&self) -> bool {
+ **self == READMODE_A::DETERMINISTIC
+ }
+}
+impl core::ops::Deref for READMODE_R {
+ type Target = crate::FieldReader<u8, READMODE_A>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `READMODE` writer - NVMCTRL Read Mode"]
+pub struct READMODE_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> READMODE_W<'a> {
+ #[doc = r"Writes `variant` to the field"]
+ #[inline(always)]
+ pub fn variant(self, variant: READMODE_A) -> &'a mut W {
+ unsafe { self.bits(variant.into()) }
+ }
+ #[doc = "The NVM Controller (cache system) does not insert wait states on a cache miss. Gives the best system performance."]
+ #[inline(always)]
+ pub fn no_miss_penalty(self) -> &'a mut W {
+ self.variant(READMODE_A::NO_MISS_PENALTY)
+ }
+ #[doc = "Reduces power consumption of the cache system, but inserts a wait state each time there is a cache miss. This mode may not be relevant if CPU performance is required, as the application will be stalled and may lead to increase run time."]
+ #[inline(always)]
+ pub fn low_power(self) -> &'a mut W {
+ self.variant(READMODE_A::LOW_POWER)
+ }
+ #[doc = "The cache system ensures that a cache hit or miss takes the same amount of time, determined by the number of programmed flash wait states. This mode can be used for real-time applications that require deterministic execution timings."]
+ #[inline(always)]
+ pub fn deterministic(self) -> &'a mut W {
+ self.variant(READMODE_A::DETERMINISTIC)
+ }
+ #[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 << 16)) | ((value as u32 & 0x03) << 16);
+ self.w
+ }
+}
+#[doc = "Field `CACHEDIS` reader - Cache Disable"]
+pub struct CACHEDIS_R(crate::FieldReader<u8, u8>);
+impl CACHEDIS_R {
+ pub(crate) fn new(bits: u8) -> Self {
+ CACHEDIS_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for CACHEDIS_R {
+ type Target = crate::FieldReader<u8, u8>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `CACHEDIS` writer - Cache Disable"]
+pub struct CACHEDIS_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> CACHEDIS_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 << 18)) | ((value as u32 & 0x03) << 18);
+ self.w
+ }
+}
+impl R {
+ #[doc = "Bits 1:4 - NVM Read Wait States"]
+ #[inline(always)]
+ pub fn rws(&self) -> RWS_R {
+ RWS_R::new(((self.bits >> 1) & 0x0f) as u8)
+ }
+ #[doc = "Bit 7 - Manual Write"]
+ #[inline(always)]
+ pub fn manw(&self) -> MANW_R {
+ MANW_R::new(((self.bits >> 7) & 0x01) != 0)
+ }
+ #[doc = "Bits 8:9 - Power Reduction Mode during Sleep"]
+ #[inline(always)]
+ pub fn sleepprm(&self) -> SLEEPPRM_R {
+ SLEEPPRM_R::new(((self.bits >> 8) & 0x03) as u8)
+ }
+ #[doc = "Bits 16:17 - NVMCTRL Read Mode"]
+ #[inline(always)]
+ pub fn readmode(&self) -> READMODE_R {
+ READMODE_R::new(((self.bits >> 16) & 0x03) as u8)
+ }
+ #[doc = "Bits 18:19 - Cache Disable"]
+ #[inline(always)]
+ pub fn cachedis(&self) -> CACHEDIS_R {
+ CACHEDIS_R::new(((self.bits >> 18) & 0x03) as u8)
+ }
+}
+impl W {
+ #[doc = "Bits 1:4 - NVM Read Wait States"]
+ #[inline(always)]
+ pub fn rws(&mut self) -> RWS_W {
+ RWS_W { w: self }
+ }
+ #[doc = "Bit 7 - Manual Write"]
+ #[inline(always)]
+ pub fn manw(&mut self) -> MANW_W {
+ MANW_W { w: self }
+ }
+ #[doc = "Bits 8:9 - Power Reduction Mode during Sleep"]
+ #[inline(always)]
+ pub fn sleepprm(&mut self) -> SLEEPPRM_W {
+ SLEEPPRM_W { w: self }
+ }
+ #[doc = "Bits 16:17 - NVMCTRL Read Mode"]
+ #[inline(always)]
+ pub fn readmode(&mut self) -> READMODE_W {
+ READMODE_W { w: self }
+ }
+ #[doc = "Bits 18:19 - Cache Disable"]
+ #[inline(always)]
+ pub fn cachedis(&mut self) -> CACHEDIS_W {
+ CACHEDIS_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 B\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 [ctrlb](index.html) module"]
+pub struct CTRLB_SPEC;
+impl crate::RegisterSpec for CTRLB_SPEC {
+ type Ux = u32;
+}
+#[doc = "`read()` method returns [ctrlb::R](R) reader structure"]
+impl crate::Readable for CTRLB_SPEC {
+ type Reader = R;
+}
+#[doc = "`write(|w| ..)` method takes [ctrlb::W](W) writer structure"]
+impl crate::Writable for CTRLB_SPEC {
+ type Writer = W;
+}
+#[doc = "`reset()` method sets CTRLB to value 0x80"]
+impl crate::Resettable for CTRLB_SPEC {
+ #[inline(always)]
+ fn reset_value() -> Self::Ux {
+ 0x80
+ }
+}
diff --git a/src/nvmctrl/intenclr.rs b/src/nvmctrl/intenclr.rs
new file mode 100644
index 0000000..97c08fc
--- /dev/null
+++ b/src/nvmctrl/intenclr.rs
@@ -0,0 +1,158 @@
+#[doc = "Register `INTENCLR` reader"]
+pub struct R(crate::R<INTENCLR_SPEC>);
+impl core::ops::Deref for R {
+ type Target = crate::R<INTENCLR_SPEC>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+impl From<crate::R<INTENCLR_SPEC>> for R {
+ #[inline(always)]
+ fn from(reader: crate::R<INTENCLR_SPEC>) -> Self {
+ R(reader)
+ }
+}
+#[doc = "Register `INTENCLR` writer"]
+pub struct W(crate::W<INTENCLR_SPEC>);
+impl core::ops::Deref for W {
+ type Target = crate::W<INTENCLR_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<INTENCLR_SPEC>> for W {
+ #[inline(always)]
+ fn from(writer: crate::W<INTENCLR_SPEC>) -> Self {
+ W(writer)
+ }
+}
+#[doc = "Field `READY` reader - NVM Ready Interrupt Enable"]
+pub struct READY_R(crate::FieldReader<bool, bool>);
+impl READY_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ READY_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for READY_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `READY` writer - NVM Ready Interrupt Enable"]
+pub struct READY_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> READY_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 `ERROR` reader - Error Interrupt Enable"]
+pub struct ERROR_R(crate::FieldReader<bool, bool>);
+impl ERROR_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ ERROR_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for ERROR_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `ERROR` writer - Error Interrupt Enable"]
+pub struct ERROR_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> ERROR_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 - NVM Ready Interrupt Enable"]
+ #[inline(always)]
+ pub fn ready(&self) -> READY_R {
+ READY_R::new((self.bits & 0x01) != 0)
+ }
+ #[doc = "Bit 1 - Error Interrupt Enable"]
+ #[inline(always)]
+ pub fn error(&self) -> ERROR_R {
+ ERROR_R::new(((self.bits >> 1) & 0x01) != 0)
+ }
+}
+impl W {
+ #[doc = "Bit 0 - NVM Ready Interrupt Enable"]
+ #[inline(always)]
+ pub fn ready(&mut self) -> READY_W {
+ READY_W { w: self }
+ }
+ #[doc = "Bit 1 - Error Interrupt Enable"]
+ #[inline(always)]
+ pub fn error(&mut self) -> ERROR_W {
+ ERROR_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 = "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 = u8;
+}
+#[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/nvmctrl/intenset.rs b/src/nvmctrl/intenset.rs
new file mode 100644
index 0000000..b50b7a7
--- /dev/null
+++ b/src/nvmctrl/intenset.rs
@@ -0,0 +1,158 @@
+#[doc = "Register `INTENSET` reader"]
+pub struct R(crate::R<INTENSET_SPEC>);
+impl core::ops::Deref for R {
+ type Target = crate::R<INTENSET_SPEC>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+impl From<crate::R<INTENSET_SPEC>> for R {
+ #[inline(always)]
+ fn from(reader: crate::R<INTENSET_SPEC>) -> Self {
+ R(reader)
+ }
+}
+#[doc = "Register `INTENSET` writer"]
+pub struct W(crate::W<INTENSET_SPEC>);
+impl core::ops::Deref for W {
+ type Target = crate::W<INTENSET_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<INTENSET_SPEC>> for W {
+ #[inline(always)]
+ fn from(writer: crate::W<INTENSET_SPEC>) -> Self {
+ W(writer)
+ }
+}
+#[doc = "Field `READY` reader - NVM Ready Interrupt Enable"]
+pub struct READY_R(crate::FieldReader<bool, bool>);
+impl READY_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ READY_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for READY_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `READY` writer - NVM Ready Interrupt Enable"]
+pub struct READY_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> READY_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 `ERROR` reader - Error Interrupt Enable"]
+pub struct ERROR_R(crate::FieldReader<bool, bool>);
+impl ERROR_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ ERROR_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for ERROR_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `ERROR` writer - Error Interrupt Enable"]
+pub struct ERROR_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> ERROR_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 - NVM Ready Interrupt Enable"]
+ #[inline(always)]
+ pub fn ready(&self) -> READY_R {
+ READY_R::new((self.bits & 0x01) != 0)
+ }
+ #[doc = "Bit 1 - Error Interrupt Enable"]
+ #[inline(always)]
+ pub fn error(&self) -> ERROR_R {
+ ERROR_R::new(((self.bits >> 1) & 0x01) != 0)
+ }
+}
+impl W {
+ #[doc = "Bit 0 - NVM Ready Interrupt Enable"]
+ #[inline(always)]
+ pub fn ready(&mut self) -> READY_W {
+ READY_W { w: self }
+ }
+ #[doc = "Bit 1 - Error Interrupt Enable"]
+ #[inline(always)]
+ pub fn error(&mut self) -> ERROR_W {
+ ERROR_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 = "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 = u8;
+}
+#[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/nvmctrl/intflag.rs b/src/nvmctrl/intflag.rs
new file mode 100644
index 0000000..d885e50
--- /dev/null
+++ b/src/nvmctrl/intflag.rs
@@ -0,0 +1,158 @@
+#[doc = "Register `INTFLAG` reader"]
+pub struct R(crate::R<INTFLAG_SPEC>);
+impl core::ops::Deref for R {
+ type Target = crate::R<INTFLAG_SPEC>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+impl From<crate::R<INTFLAG_SPEC>> for R {
+ #[inline(always)]
+ fn from(reader: crate::R<INTFLAG_SPEC>) -> Self {
+ R(reader)
+ }
+}
+#[doc = "Register `INTFLAG` writer"]
+pub struct W(crate::W<INTFLAG_SPEC>);
+impl core::ops::Deref for W {
+ type Target = crate::W<INTFLAG_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<INTFLAG_SPEC>> for W {
+ #[inline(always)]
+ fn from(writer: crate::W<INTFLAG_SPEC>) -> Self {
+ W(writer)
+ }
+}
+#[doc = "Field `READY` reader - NVM Ready"]
+pub struct READY_R(crate::FieldReader<bool, bool>);
+impl READY_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ READY_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for READY_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `READY` writer - NVM Ready"]
+pub struct READY_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> READY_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 `ERROR` reader - Error"]
+pub struct ERROR_R(crate::FieldReader<bool, bool>);
+impl ERROR_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ ERROR_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for ERROR_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `ERROR` writer - Error"]
+pub struct ERROR_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> ERROR_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 - NVM Ready"]
+ #[inline(always)]
+ pub fn ready(&self) -> READY_R {
+ READY_R::new((self.bits & 0x01) != 0)
+ }
+ #[doc = "Bit 1 - Error"]
+ #[inline(always)]
+ pub fn error(&self) -> ERROR_R {
+ ERROR_R::new(((self.bits >> 1) & 0x01) != 0)
+ }
+}
+impl W {
+ #[doc = "Bit 0 - NVM Ready"]
+ #[inline(always)]
+ pub fn ready(&mut self) -> READY_W {
+ READY_W { w: self }
+ }
+ #[doc = "Bit 1 - Error"]
+ #[inline(always)]
+ pub fn error(&mut self) -> ERROR_W {
+ ERROR_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 = "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 = u8;
+}
+#[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/nvmctrl/lock.rs b/src/nvmctrl/lock.rs
new file mode 100644
index 0000000..6cc7cbd
--- /dev/null
+++ b/src/nvmctrl/lock.rs
@@ -0,0 +1,102 @@
+#[doc = "Register `LOCK` reader"]
+pub struct R(crate::R<LOCK_SPEC>);
+impl core::ops::Deref for R {
+ type Target = crate::R<LOCK_SPEC>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+impl From<crate::R<LOCK_SPEC>> for R {
+ #[inline(always)]
+ fn from(reader: crate::R<LOCK_SPEC>) -> Self {
+ R(reader)
+ }
+}
+#[doc = "Register `LOCK` writer"]
+pub struct W(crate::W<LOCK_SPEC>);
+impl core::ops::Deref for W {
+ type Target = crate::W<LOCK_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<LOCK_SPEC>> for W {
+ #[inline(always)]
+ fn from(writer: crate::W<LOCK_SPEC>) -> Self {
+ W(writer)
+ }
+}
+#[doc = "Field `LOCK` reader - Region Lock Bits"]
+pub struct LOCK_R(crate::FieldReader<u16, u16>);
+impl LOCK_R {
+ pub(crate) fn new(bits: u16) -> Self {
+ LOCK_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for LOCK_R {
+ type Target = crate::FieldReader<u16, u16>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `LOCK` writer - Region Lock Bits"]
+pub struct LOCK_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> LOCK_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 R {
+ #[doc = "Bits 0:15 - Region Lock Bits"]
+ #[inline(always)]
+ pub fn lock(&self) -> LOCK_R {
+ LOCK_R::new((self.bits & 0xffff) as u16)
+ }
+}
+impl W {
+ #[doc = "Bits 0:15 - Region Lock Bits"]
+ #[inline(always)]
+ pub fn lock(&mut self) -> LOCK_W {
+ LOCK_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 = "Lock Section\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 [lock](index.html) module"]
+pub struct LOCK_SPEC;
+impl crate::RegisterSpec for LOCK_SPEC {
+ type Ux = u16;
+}
+#[doc = "`read()` method returns [lock::R](R) reader structure"]
+impl crate::Readable for LOCK_SPEC {
+ type Reader = R;
+}
+#[doc = "`write(|w| ..)` method takes [lock::W](W) writer structure"]
+impl crate::Writable for LOCK_SPEC {
+ type Writer = W;
+}
+#[doc = "`reset()` method sets LOCK to value 0"]
+impl crate::Resettable for LOCK_SPEC {
+ #[inline(always)]
+ fn reset_value() -> Self::Ux {
+ 0
+ }
+}
diff --git a/src/nvmctrl/param.rs b/src/nvmctrl/param.rs
new file mode 100644
index 0000000..fab076c
--- /dev/null
+++ b/src/nvmctrl/param.rs
@@ -0,0 +1,301 @@
+#[doc = "Register `PARAM` reader"]
+pub struct R(crate::R<PARAM_SPEC>);
+impl core::ops::Deref for R {
+ type Target = crate::R<PARAM_SPEC>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+impl From<crate::R<PARAM_SPEC>> for R {
+ #[inline(always)]
+ fn from(reader: crate::R<PARAM_SPEC>) -> Self {
+ R(reader)
+ }
+}
+#[doc = "Register `PARAM` writer"]
+pub struct W(crate::W<PARAM_SPEC>);
+impl core::ops::Deref for W {
+ type Target = crate::W<PARAM_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<PARAM_SPEC>> for W {
+ #[inline(always)]
+ fn from(writer: crate::W<PARAM_SPEC>) -> Self {
+ W(writer)
+ }
+}
+#[doc = "Field `NVMP` reader - NVM Pages"]
+pub struct NVMP_R(crate::FieldReader<u16, u16>);
+impl NVMP_R {
+ pub(crate) fn new(bits: u16) -> Self {
+ NVMP_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for NVMP_R {
+ type Target = crate::FieldReader<u16, u16>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `NVMP` writer - NVM Pages"]
+pub struct NVMP_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> NVMP_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 u32 & 0xffff);
+ self.w
+ }
+}
+#[doc = "Page Size\n\nValue on reset: 0"]
+#[derive(Clone, Copy, Debug, PartialEq)]
+#[repr(u8)]
+pub enum PSZ_A {
+ #[doc = "0: 8 bytes"]
+ _8 = 0,
+ #[doc = "1: 16 bytes"]
+ _16 = 1,
+ #[doc = "2: 32 bytes"]
+ _32 = 2,
+ #[doc = "3: 64 bytes"]
+ _64 = 3,
+ #[doc = "4: 128 bytes"]
+ _128 = 4,
+ #[doc = "5: 256 bytes"]
+ _256 = 5,
+ #[doc = "6: 512 bytes"]
+ _512 = 6,
+ #[doc = "7: 1024 bytes"]
+ _1024 = 7,
+}
+impl From<PSZ_A> for u8 {
+ #[inline(always)]
+ fn from(variant: PSZ_A) -> Self {
+ variant as _
+ }
+}
+#[doc = "Field `PSZ` reader - Page Size"]
+pub struct PSZ_R(crate::FieldReader<u8, PSZ_A>);
+impl PSZ_R {
+ pub(crate) fn new(bits: u8) -> Self {
+ PSZ_R(crate::FieldReader::new(bits))
+ }
+ #[doc = r"Get enumerated values variant"]
+ #[inline(always)]
+ pub fn variant(&self) -> PSZ_A {
+ match self.bits {
+ 0 => PSZ_A::_8,
+ 1 => PSZ_A::_16,
+ 2 => PSZ_A::_32,
+ 3 => PSZ_A::_64,
+ 4 => PSZ_A::_128,
+ 5 => PSZ_A::_256,
+ 6 => PSZ_A::_512,
+ 7 => PSZ_A::_1024,
+ _ => unreachable!(),
+ }
+ }
+ #[doc = "Checks if the value of the field is `_8`"]
+ #[inline(always)]
+ pub fn is_8(&self) -> bool {
+ **self == PSZ_A::_8
+ }
+ #[doc = "Checks if the value of the field is `_16`"]
+ #[inline(always)]
+ pub fn is_16(&self) -> bool {
+ **self == PSZ_A::_16
+ }
+ #[doc = "Checks if the value of the field is `_32`"]
+ #[inline(always)]
+ pub fn is_32(&self) -> bool {
+ **self == PSZ_A::_32
+ }
+ #[doc = "Checks if the value of the field is `_64`"]
+ #[inline(always)]
+ pub fn is_64(&self) -> bool {
+ **self == PSZ_A::_64
+ }
+ #[doc = "Checks if the value of the field is `_128`"]
+ #[inline(always)]
+ pub fn is_128(&self) -> bool {
+ **self == PSZ_A::_128
+ }
+ #[doc = "Checks if the value of the field is `_256`"]
+ #[inline(always)]
+ pub fn is_256(&self) -> bool {
+ **self == PSZ_A::_256
+ }
+ #[doc = "Checks if the value of the field is `_512`"]
+ #[inline(always)]
+ pub fn is_512(&self) -> bool {
+ **self == PSZ_A::_512
+ }
+ #[doc = "Checks if the value of the field is `_1024`"]
+ #[inline(always)]
+ pub fn is_1024(&self) -> bool {
+ **self == PSZ_A::_1024
+ }
+}
+impl core::ops::Deref for PSZ_R {
+ type Target = crate::FieldReader<u8, PSZ_A>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `PSZ` writer - Page Size"]
+pub struct PSZ_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> PSZ_W<'a> {
+ #[doc = r"Writes `variant` to the field"]
+ #[inline(always)]
+ pub fn variant(self, variant: PSZ_A) -> &'a mut W {
+ self.bits(variant.into())
+ }
+ #[doc = "8 bytes"]
+ #[inline(always)]
+ pub fn _8(self) -> &'a mut W {
+ self.variant(PSZ_A::_8)
+ }
+ #[doc = "16 bytes"]
+ #[inline(always)]
+ pub fn _16(self) -> &'a mut W {
+ self.variant(PSZ_A::_16)
+ }
+ #[doc = "32 bytes"]
+ #[inline(always)]
+ pub fn _32(self) -> &'a mut W {
+ self.variant(PSZ_A::_32)
+ }
+ #[doc = "64 bytes"]
+ #[inline(always)]
+ pub fn _64(self) -> &'a mut W {
+ self.variant(PSZ_A::_64)
+ }
+ #[doc = "128 bytes"]
+ #[inline(always)]
+ pub fn _128(self) -> &'a mut W {
+ self.variant(PSZ_A::_128)
+ }
+ #[doc = "256 bytes"]
+ #[inline(always)]
+ pub fn _256(self) -> &'a mut W {
+ self.variant(PSZ_A::_256)
+ }
+ #[doc = "512 bytes"]
+ #[inline(always)]
+ pub fn _512(self) -> &'a mut W {
+ self.variant(PSZ_A::_512)
+ }
+ #[doc = "1024 bytes"]
+ #[inline(always)]
+ pub fn _1024(self) -> &'a mut W {
+ self.variant(PSZ_A::_1024)
+ }
+ #[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 << 16)) | ((value as u32 & 0x07) << 16);
+ self.w
+ }
+}
+#[doc = "Field `RWWEEP` reader - RWW EEPROM Pages"]
+pub struct RWWEEP_R(crate::FieldReader<u16, u16>);
+impl RWWEEP_R {
+ pub(crate) fn new(bits: u16) -> Self {
+ RWWEEP_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for RWWEEP_R {
+ type Target = crate::FieldReader<u16, u16>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `RWWEEP` writer - RWW EEPROM Pages"]
+pub struct RWWEEP_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> RWWEEP_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 & !(0x0fff << 20)) | ((value as u32 & 0x0fff) << 20);
+ self.w
+ }
+}
+impl R {
+ #[doc = "Bits 0:15 - NVM Pages"]
+ #[inline(always)]
+ pub fn nvmp(&self) -> NVMP_R {
+ NVMP_R::new((self.bits & 0xffff) as u16)
+ }
+ #[doc = "Bits 16:18 - Page Size"]
+ #[inline(always)]
+ pub fn psz(&self) -> PSZ_R {
+ PSZ_R::new(((self.bits >> 16) & 0x07) as u8)
+ }
+ #[doc = "Bits 20:31 - RWW EEPROM Pages"]
+ #[inline(always)]
+ pub fn rwweep(&self) -> RWWEEP_R {
+ RWWEEP_R::new(((self.bits >> 20) & 0x0fff) as u16)
+ }
+}
+impl W {
+ #[doc = "Bits 0:15 - NVM Pages"]
+ #[inline(always)]
+ pub fn nvmp(&mut self) -> NVMP_W {
+ NVMP_W { w: self }
+ }
+ #[doc = "Bits 16:18 - Page Size"]
+ #[inline(always)]
+ pub fn psz(&mut self) -> PSZ_W {
+ PSZ_W { w: self }
+ }
+ #[doc = "Bits 20:31 - RWW EEPROM Pages"]
+ #[inline(always)]
+ pub fn rwweep(&mut self) -> RWWEEP_W {
+ RWWEEP_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 = "NVM Parameter\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 [param](index.html) module"]
+pub struct PARAM_SPEC;
+impl crate::RegisterSpec for PARAM_SPEC {
+ type Ux = u32;
+}
+#[doc = "`read()` method returns [param::R](R) reader structure"]
+impl crate::Readable for PARAM_SPEC {
+ type Reader = R;
+}
+#[doc = "`write(|w| ..)` method takes [param::W](W) writer structure"]
+impl crate::Writable for PARAM_SPEC {
+ type Writer = W;
+}
+#[doc = "`reset()` method sets PARAM to value 0"]
+impl crate::Resettable for PARAM_SPEC {
+ #[inline(always)]
+ fn reset_value() -> Self::Ux {
+ 0
+ }
+}
diff --git a/src/nvmctrl/pbldata0.rs b/src/nvmctrl/pbldata0.rs
new file mode 100644
index 0000000..ff2effa
--- /dev/null
+++ b/src/nvmctrl/pbldata0.rs
@@ -0,0 +1,31 @@
+#[doc = "Register `PBLDATA0` reader"]
+pub struct R(crate::R<PBLDATA0_SPEC>);
+impl core::ops::Deref for R {
+ type Target = crate::R<PBLDATA0_SPEC>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+impl From<crate::R<PBLDATA0_SPEC>> for R {
+ #[inline(always)]
+ fn from(reader: crate::R<PBLDATA0_SPEC>) -> Self {
+ R(reader)
+ }
+}
+#[doc = "Page Buffer Load Data 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 [pbldata0](index.html) module"]
+pub struct PBLDATA0_SPEC;
+impl crate::RegisterSpec for PBLDATA0_SPEC {
+ type Ux = u32;
+}
+#[doc = "`read()` method returns [pbldata0::R](R) reader structure"]
+impl crate::Readable for PBLDATA0_SPEC {
+ type Reader = R;
+}
+#[doc = "`reset()` method sets PBLDATA0 to value 0"]
+impl crate::Resettable for PBLDATA0_SPEC {
+ #[inline(always)]
+ fn reset_value() -> Self::Ux {
+ 0
+ }
+}
diff --git a/src/nvmctrl/pbldata1.rs b/src/nvmctrl/pbldata1.rs
new file mode 100644
index 0000000..9fc6404
--- /dev/null
+++ b/src/nvmctrl/pbldata1.rs
@@ -0,0 +1,31 @@
+#[doc = "Register `PBLDATA1` reader"]
+pub struct R(crate::R<PBLDATA1_SPEC>);
+impl core::ops::Deref for R {
+ type Target = crate::R<PBLDATA1_SPEC>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+impl From<crate::R<PBLDATA1_SPEC>> for R {
+ #[inline(always)]
+ fn from(reader: crate::R<PBLDATA1_SPEC>) -> Self {
+ R(reader)
+ }
+}
+#[doc = "Page Buffer Load Data 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 [pbldata1](index.html) module"]
+pub struct PBLDATA1_SPEC;
+impl crate::RegisterSpec for PBLDATA1_SPEC {
+ type Ux = u32;
+}
+#[doc = "`read()` method returns [pbldata1::R](R) reader structure"]
+impl crate::Readable for PBLDATA1_SPEC {
+ type Reader = R;
+}
+#[doc = "`reset()` method sets PBLDATA1 to value 0"]
+impl crate::Resettable for PBLDATA1_SPEC {
+ #[inline(always)]
+ fn reset_value() -> Self::Ux {
+ 0
+ }
+}
diff --git a/src/nvmctrl/status.rs b/src/nvmctrl/status.rs
new file mode 100644
index 0000000..5f84388
--- /dev/null
+++ b/src/nvmctrl/status.rs
@@ -0,0 +1,342 @@
+#[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 `PRM` reader - Power Reduction Mode"]
+pub struct PRM_R(crate::FieldReader<bool, bool>);
+impl PRM_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ PRM_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for PRM_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `PRM` writer - Power Reduction Mode"]
+pub struct PRM_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> PRM_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 `LOAD` reader - NVM Page Buffer Active Loading"]
+pub struct LOAD_R(crate::FieldReader<bool, bool>);
+impl LOAD_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ LOAD_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for LOAD_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `LOAD` writer - NVM Page Buffer Active Loading"]
+pub struct LOAD_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> LOAD_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 `PROGE` reader - Programming Error Status"]
+pub struct PROGE_R(crate::FieldReader<bool, bool>);
+impl PROGE_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ PROGE_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for PROGE_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `PROGE` writer - Programming Error Status"]
+pub struct PROGE_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> PROGE_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 `LOCKE` reader - Lock Error Status"]
+pub struct LOCKE_R(crate::FieldReader<bool, bool>);
+impl LOCKE_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ LOCKE_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for LOCKE_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `LOCKE` writer - Lock Error Status"]
+pub struct LOCKE_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> LOCKE_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 `NVME` reader - NVM Error"]
+pub struct NVME_R(crate::FieldReader<bool, bool>);
+impl NVME_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ NVME_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for NVME_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `NVME` writer - NVM Error"]
+pub struct NVME_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> NVME_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 `SB` reader - Security Bit Status"]
+pub struct SB_R(crate::FieldReader<bool, bool>);
+impl SB_R {
+ pub(crate) fn new(bits: bool) -> Self {
+ SB_R(crate::FieldReader::new(bits))
+ }
+}
+impl core::ops::Deref for SB_R {
+ type Target = crate::FieldReader<bool, bool>;
+ #[inline(always)]
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
+#[doc = "Field `SB` writer - Security Bit Status"]
+pub struct SB_W<'a> {
+ w: &'a mut W,
+}
+impl<'a> SB_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
+ }
+}
+impl R {
+ #[doc = "Bit 0 - Power Reduction Mode"]
+ #[inline(always)]
+ pub fn prm(&self) -> PRM_R {
+ PRM_R::new((self.bits & 0x01) != 0)
+ }
+ #[doc = "Bit 1 - NVM Page Buffer Active Loading"]
+ #[inline(always)]
+ pub fn load(&self) -> LOAD_R {
+ LOAD_R::new(((self.bits >> 1) & 0x01) != 0)
+ }
+ #[doc = "Bit 2 - Programming Error Status"]
+ #[inline(always)]
+ pub fn proge(&self) -> PROGE_R {
+ PROGE_R::new(((self.bits >> 2) & 0x01) != 0)
+ }
+ #[doc = "Bit 3 - Lock Error Status"]
+ #[inline(always)]
+ pub fn locke(&self) -> LOCKE_R {
+ LOCKE_R::new(((self.bits >> 3) & 0x01) != 0)
+ }
+ #[doc = "Bit 4 - NVM Error"]
+ #[inline(always)]
+ pub fn nvme(&self) -> NVME_R {
+ NVME_R::new(((self.bits >> 4) & 0x01) != 0)
+ }
+ #[doc = "Bit 8 - Security Bit Status"]
+ #[inline(always)]
+ pub fn sb(&self) -> SB_R {
+ SB_R::new(((self.bits >> 8) & 0x01) != 0)
+ }
+}
+impl W {
+ #[doc = "Bit 0 - Power Reduction Mode"]
+ #[inline(always)]
+ pub fn prm(&mut self) -> PRM_W {
+ PRM_W { w: self }
+ }
+ #[doc = "Bit 1 - NVM Page Buffer Active Loading"]
+ #[inline(always)]
+ pub fn load(&mut self) -> LOAD_W {
+ LOAD_W { w: self }
+ }
+ #[doc = "Bit 2 - Programming Error Status"]
+ #[inline(always)]
+ pub fn proge(&mut self) -> PROGE_W {
+ PROGE_W { w: self }
+ }
+ #[doc = "Bit 3 - Lock Error Status"]
+ #[inline(always)]
+ pub fn locke(&mut self) -> LOCKE_W {
+ LOCKE_W { w: self }
+ }
+ #[doc = "Bit 4 - NVM Error"]
+ #[inline(always)]
+ pub fn nvme(&mut self) -> NVME_W {
+ NVME_W { w: self }
+ }
+ #[doc = "Bit 8 - Security Bit Status"]
+ #[inline(always)]
+ pub fn sb(&mut self) -> SB_W {
+ SB_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 = "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 = u16;
+}
+#[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
+ }
+}