diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3a4f40e..0db41bb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,8 +11,8 @@ jobs: continue-on-error: ${{ matrix.experimental || false }} strategy: matrix: - # All generated code should be running on stable now, MRSV is 1.59.0 - rust: [nightly, stable, 1.59.0] + # All generated code should be running on stable now, MRSV is 1.65.0 + rust: [nightly, stable, 1.65.0] include: # Nightly is only for reference and allowed to fail diff --git a/CHANGELOG.md b/CHANGELOG.md index f3fbc6a..4548bd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Changed +- Bump MSRV to 1.65.0 +- Regenerate code with `svd2rust` v0.33.4 + ## [v0.11.0] ### Changed diff --git a/Cargo.toml b/Cargo.toml index 947561a..6a97ead 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,9 +8,10 @@ description = "With svd2rust generated peripherals for Freedom E310 MCU's." keywords = ["riscv", "register", "peripheral"] license = "ISC" rust-version = "1.59" +edition = "2021" [dependencies] -critical-section = { version = "1.1.1", optional = true } +critical-section = { version = "1.1.3", optional = true } vcell = "0.1.3" [features] diff --git a/README.md b/README.md index 6666d82..9a7a380 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This project is developed and maintained by the [RISC-V team][team]. ## Minimum Supported Rust Version (MSRV) -This crate is guaranteed to compile on stable Rust 1.59.0 and up. It *might* +This crate is guaranteed to compile on stable Rust 1.65.0 and up. It *might* compile with older versions but that may change in any new patch release. ## Requirements diff --git a/build.rs b/build.rs index 597923f..d0781ac 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,4 @@ +#![doc = r" Builder file for Peripheral access crate generated by svd2rust tool"] use std::env; use std::fs::File; use std::io::Write; diff --git a/src/aonclk.rs b/src/aonclk.rs index b4b65cb..f386e4d 100644 --- a/src/aonclk.rs +++ b/src/aonclk.rs @@ -1,11 +1,19 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { _reserved0: [u8; 0x70], + lfrosccfg: Lfrosccfg, +} +impl RegisterBlock { #[doc = "0x70 - AON Clock Configuration Register"] - pub lfrosccfg: LFROSCCFG, + #[inline(always)] + pub const fn lfrosccfg(&self) -> &Lfrosccfg { + &self.lfrosccfg + } } -#[doc = "lfrosccfg (rw) register accessor: an alias for `Reg`"] -pub type LFROSCCFG = crate::Reg; +#[doc = "lfrosccfg (rw) register accessor: AON Clock Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`lfrosccfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`lfrosccfg::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@lfrosccfg`] +module"] +#[doc(alias = "lfrosccfg")] +pub type Lfrosccfg = crate::Reg; #[doc = "AON Clock Configuration Register"] pub mod lfrosccfg; diff --git a/src/aonclk/lfrosccfg.rs b/src/aonclk/lfrosccfg.rs index 024c593..2576e2a 100644 --- a/src/aonclk/lfrosccfg.rs +++ b/src/aonclk/lfrosccfg.rs @@ -1,122 +1,85 @@ #[doc = "Register `lfrosccfg` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `lfrosccfg` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `div` reader - "] -pub type DIV_R = crate::FieldReader; +pub type DivR = crate::FieldReader; #[doc = "Field `div` writer - "] -pub type DIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LFROSCCFG_SPEC, u8, u8, 6, O>; +pub type DivW<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `trim` reader - "] -pub type TRIM_R = crate::FieldReader; +pub type TrimR = crate::FieldReader; #[doc = "Field `trim` writer - "] -pub type TRIM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LFROSCCFG_SPEC, u8, u8, 5, O>; +pub type TrimW<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `enable` reader - "] -pub type ENABLE_R = crate::BitReader; +pub type EnableR = crate::BitReader; #[doc = "Field `enable` writer - "] -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, LFROSCCFG_SPEC, bool, O>; +pub type EnableW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ready` reader - "] -pub type READY_R = crate::BitReader; +pub type ReadyR = crate::BitReader; #[doc = "Field `ready` writer - "] -pub type READY_W<'a, const O: u8> = crate::BitWriter<'a, u32, LFROSCCFG_SPEC, bool, O>; +pub type ReadyW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:5"] #[inline(always)] - pub fn div(&self) -> DIV_R { - DIV_R::new((self.bits & 0x3f) as u8) + pub fn div(&self) -> DivR { + DivR::new((self.bits & 0x3f) as u8) } #[doc = "Bits 16:20"] #[inline(always)] - pub fn trim(&self) -> TRIM_R { - TRIM_R::new(((self.bits >> 16) & 0x1f) as u8) + pub fn trim(&self) -> TrimR { + TrimR::new(((self.bits >> 16) & 0x1f) as u8) } #[doc = "Bit 30"] #[inline(always)] - pub fn enable(&self) -> ENABLE_R { - ENABLE_R::new(((self.bits >> 30) & 1) != 0) + pub fn enable(&self) -> EnableR { + EnableR::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn ready(&self) -> READY_R { - READY_R::new(((self.bits >> 31) & 1) != 0) + pub fn ready(&self) -> ReadyR { + ReadyR::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bits 0:5"] #[inline(always)] - pub fn div(&mut self) -> DIV_W<0> { - DIV_W::new(self) + #[must_use] + pub fn div(&mut self) -> DivW { + DivW::new(self, 0) } #[doc = "Bits 16:20"] #[inline(always)] - pub fn trim(&mut self) -> TRIM_W<16> { - TRIM_W::new(self) + #[must_use] + pub fn trim(&mut self) -> TrimW { + TrimW::new(self, 16) } #[doc = "Bit 30"] #[inline(always)] - pub fn enable(&mut self) -> ENABLE_W<30> { - ENABLE_W::new(self) + #[must_use] + pub fn enable(&mut self) -> EnableW { + EnableW::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn ready(&mut self) -> READY_W<31> { - READY_W::new(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 + #[must_use] + pub fn ready(&mut self) -> ReadyW { + ReadyW::new(self, 31) } } -#[doc = "AON Clock Configuration Register\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 [lfrosccfg](index.html) module"] -pub struct LFROSCCFG_SPEC; -impl crate::RegisterSpec for LFROSCCFG_SPEC { +#[doc = "AON Clock Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`lfrosccfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`lfrosccfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct LfrosccfgSpec; +impl crate::RegisterSpec for LfrosccfgSpec { type Ux = u32; } -#[doc = "`read()` method returns [lfrosccfg::R](R) reader structure"] -impl crate::Readable for LFROSCCFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [lfrosccfg::W](W) writer structure"] -impl crate::Writable for LFROSCCFG_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`lfrosccfg::R`](R) reader structure"] +impl crate::Readable for LfrosccfgSpec {} +#[doc = "`write(|w| ..)` method takes [`lfrosccfg::W`](W) writer structure"] +impl crate::Writable for LfrosccfgSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets lfrosccfg to value 0"] -impl crate::Resettable for LFROSCCFG_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for LfrosccfgSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/backup.rs b/src/backup.rs index dbf9e60..2bb5056 100644 --- a/src/backup.rs +++ b/src/backup.rs @@ -1,11 +1,25 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { _reserved0: [u8; 0x80], + backup: [Backup; 16], +} +impl RegisterBlock { + #[doc = "0x80..0xc0 - Backup Register"] + #[inline(always)] + pub const fn backup(&self, n: usize) -> &Backup { + &self.backup[n] + } + #[doc = "Iterator for array of:"] #[doc = "0x80..0xc0 - Backup Register"] - pub backup: [BACKUP; 16], + #[inline(always)] + pub fn backup_iter(&self) -> impl Iterator { + self.backup.iter() + } } -#[doc = "backup (rw) register accessor: an alias for `Reg`"] -pub type BACKUP = crate::Reg; +#[doc = "backup (rw) register accessor: Backup Register\n\nYou can [`read`](crate::Reg::read) this register and get [`backup::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`backup::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@backup`] +module"] +#[doc(alias = "backup")] +pub type Backup = crate::Reg; #[doc = "Backup Register"] pub mod backup; diff --git a/src/backup/backup.rs b/src/backup/backup.rs index 85c5015..9461791 100644 --- a/src/backup/backup.rs +++ b/src/backup/backup.rs @@ -1,65 +1,28 @@ #[doc = "Register `backup[%s]` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `backup[%s]` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Backup Register\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 [backup](index.html) module"] -pub struct BACKUP_SPEC; -impl crate::RegisterSpec for BACKUP_SPEC { +impl W {} +#[doc = "Backup Register\n\nYou can [`read`](crate::Reg::read) this register and get [`backup::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`backup::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct BackupSpec; +impl crate::RegisterSpec for BackupSpec { type Ux = u32; } -#[doc = "`read()` method returns [backup::R](R) reader structure"] -impl crate::Readable for BACKUP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [backup::W](W) writer structure"] -impl crate::Writable for BACKUP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`backup::R`](R) reader structure"] +impl crate::Readable for BackupSpec {} +#[doc = "`write(|w| ..)` method takes [`backup::W`](W) writer structure"] +impl crate::Writable for BackupSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets backup[%s] to value 0"] -impl crate::Resettable for BACKUP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for BackupSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/clint.rs b/src/clint.rs index da5f1ca..4e222f0 100644 --- a/src/clint.rs +++ b/src/clint.rs @@ -1,36 +1,68 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { - #[doc = "0x00 - Hart 0 software interrupt register"] - pub msip: MSIP, + msip: Msip, _reserved1: [u8; 0x3ffc], + mtimecmp: Mtimecmp, + mtimecmph: Mtimecmph, + _reserved3: [u8; 0x7ff0], + mtime: Mtime, + mtimeh: Mtimeh, +} +impl RegisterBlock { + #[doc = "0x00 - Hart 0 software interrupt register"] + #[inline(always)] + pub const fn msip(&self) -> &Msip { + &self.msip + } #[doc = "0x4000 - Hart 0 time comparator register"] - pub mtimecmp: MTIMECMP, + #[inline(always)] + pub const fn mtimecmp(&self) -> &Mtimecmp { + &self.mtimecmp + } #[doc = "0x4004 - Hart 0 time comparator register"] - pub mtimecmph: MTIMECMPH, - _reserved3: [u8; 0x7ff0], + #[inline(always)] + pub const fn mtimecmph(&self) -> &Mtimecmph { + &self.mtimecmph + } #[doc = "0xbff8 - Timer register"] - pub mtime: MTIME, + #[inline(always)] + pub const fn mtime(&self) -> &Mtime { + &self.mtime + } #[doc = "0xbffc - Timer register"] - pub mtimeh: MTIMEH, + #[inline(always)] + pub const fn mtimeh(&self) -> &Mtimeh { + &self.mtimeh + } } -#[doc = "msip (rw) register accessor: an alias for `Reg`"] -pub type MSIP = crate::Reg; +#[doc = "msip (rw) register accessor: Hart 0 software interrupt register\n\nYou can [`read`](crate::Reg::read) this register and get [`msip::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`msip::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@msip`] +module"] +#[doc(alias = "msip")] +pub type Msip = crate::Reg; #[doc = "Hart 0 software interrupt register"] pub mod msip; -#[doc = "mtimecmp (rw) register accessor: an alias for `Reg`"] -pub type MTIMECMP = crate::Reg; +#[doc = "mtimecmp (rw) register accessor: Hart 0 time comparator register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimecmp::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimecmp::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mtimecmp`] +module"] +#[doc(alias = "mtimecmp")] +pub type Mtimecmp = crate::Reg; #[doc = "Hart 0 time comparator register"] pub mod mtimecmp; -#[doc = "mtimecmph (rw) register accessor: an alias for `Reg`"] -pub type MTIMECMPH = crate::Reg; +#[doc = "mtimecmph (rw) register accessor: Hart 0 time comparator register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimecmph::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimecmph::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mtimecmph`] +module"] +#[doc(alias = "mtimecmph")] +pub type Mtimecmph = crate::Reg; #[doc = "Hart 0 time comparator register"] pub mod mtimecmph; -#[doc = "mtime (rw) register accessor: an alias for `Reg`"] -pub type MTIME = crate::Reg; +#[doc = "mtime (rw) register accessor: Timer register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtime::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtime::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mtime`] +module"] +#[doc(alias = "mtime")] +pub type Mtime = crate::Reg; #[doc = "Timer register"] pub mod mtime; -#[doc = "mtimeh (rw) register accessor: an alias for `Reg`"] -pub type MTIMEH = crate::Reg; +#[doc = "mtimeh (rw) register accessor: Timer register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimeh::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimeh::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mtimeh`] +module"] +#[doc(alias = "mtimeh")] +pub type Mtimeh = crate::Reg; #[doc = "Timer register"] pub mod mtimeh; diff --git a/src/clint/msip.rs b/src/clint/msip.rs index 9bcf805..f8ba2bc 100644 --- a/src/clint/msip.rs +++ b/src/clint/msip.rs @@ -1,64 +1,27 @@ #[doc = "Register `msip` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `msip` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Hart 0 software interrupt register\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 [msip](index.html) module"] -pub struct MSIP_SPEC; -impl crate::RegisterSpec for MSIP_SPEC { +impl W {} +#[doc = "Hart 0 software interrupt register\n\nYou can [`read`](crate::Reg::read) this register and get [`msip::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`msip::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct MsipSpec; +impl crate::RegisterSpec for MsipSpec { type Ux = u32; } -#[doc = "`read()` method returns [msip::R](R) reader structure"] -impl crate::Readable for MSIP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [msip::W](W) writer structure"] -impl crate::Writable for MSIP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`msip::R`](R) reader structure"] +impl crate::Readable for MsipSpec {} +#[doc = "`write(|w| ..)` method takes [`msip::W`](W) writer structure"] +impl crate::Writable for MsipSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets msip to value 0"] -impl crate::Resettable for MSIP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for MsipSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/clint/mtime.rs b/src/clint/mtime.rs index ef0bcda..e8b419c 100644 --- a/src/clint/mtime.rs +++ b/src/clint/mtime.rs @@ -1,64 +1,27 @@ #[doc = "Register `mtime` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `mtime` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Timer register\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 [mtime](index.html) module"] -pub struct MTIME_SPEC; -impl crate::RegisterSpec for MTIME_SPEC { +impl W {} +#[doc = "Timer register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtime::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtime::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct MtimeSpec; +impl crate::RegisterSpec for MtimeSpec { type Ux = u32; } -#[doc = "`read()` method returns [mtime::R](R) reader structure"] -impl crate::Readable for MTIME_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mtime::W](W) writer structure"] -impl crate::Writable for MTIME_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`mtime::R`](R) reader structure"] +impl crate::Readable for MtimeSpec {} +#[doc = "`write(|w| ..)` method takes [`mtime::W`](W) writer structure"] +impl crate::Writable for MtimeSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets mtime to value 0"] -impl crate::Resettable for MTIME_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for MtimeSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/clint/mtimecmp.rs b/src/clint/mtimecmp.rs index 628088f..ad97205 100644 --- a/src/clint/mtimecmp.rs +++ b/src/clint/mtimecmp.rs @@ -1,64 +1,27 @@ #[doc = "Register `mtimecmp` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `mtimecmp` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Hart 0 time comparator register\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 [mtimecmp](index.html) module"] -pub struct MTIMECMP_SPEC; -impl crate::RegisterSpec for MTIMECMP_SPEC { +impl W {} +#[doc = "Hart 0 time comparator register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimecmp::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimecmp::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct MtimecmpSpec; +impl crate::RegisterSpec for MtimecmpSpec { type Ux = u32; } -#[doc = "`read()` method returns [mtimecmp::R](R) reader structure"] -impl crate::Readable for MTIMECMP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mtimecmp::W](W) writer structure"] -impl crate::Writable for MTIMECMP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`mtimecmp::R`](R) reader structure"] +impl crate::Readable for MtimecmpSpec {} +#[doc = "`write(|w| ..)` method takes [`mtimecmp::W`](W) writer structure"] +impl crate::Writable for MtimecmpSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets mtimecmp to value 0"] -impl crate::Resettable for MTIMECMP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for MtimecmpSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/clint/mtimecmph.rs b/src/clint/mtimecmph.rs index 7c07503..d70cff4 100644 --- a/src/clint/mtimecmph.rs +++ b/src/clint/mtimecmph.rs @@ -1,64 +1,27 @@ #[doc = "Register `mtimecmph` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `mtimecmph` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Hart 0 time comparator register\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 [mtimecmph](index.html) module"] -pub struct MTIMECMPH_SPEC; -impl crate::RegisterSpec for MTIMECMPH_SPEC { +impl W {} +#[doc = "Hart 0 time comparator register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimecmph::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimecmph::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct MtimecmphSpec; +impl crate::RegisterSpec for MtimecmphSpec { type Ux = u32; } -#[doc = "`read()` method returns [mtimecmph::R](R) reader structure"] -impl crate::Readable for MTIMECMPH_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mtimecmph::W](W) writer structure"] -impl crate::Writable for MTIMECMPH_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`mtimecmph::R`](R) reader structure"] +impl crate::Readable for MtimecmphSpec {} +#[doc = "`write(|w| ..)` method takes [`mtimecmph::W`](W) writer structure"] +impl crate::Writable for MtimecmphSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets mtimecmph to value 0"] -impl crate::Resettable for MTIMECMPH_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for MtimecmphSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/clint/mtimeh.rs b/src/clint/mtimeh.rs index a0b16d4..4de4968 100644 --- a/src/clint/mtimeh.rs +++ b/src/clint/mtimeh.rs @@ -1,64 +1,27 @@ #[doc = "Register `mtimeh` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `mtimeh` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Timer register\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 [mtimeh](index.html) module"] -pub struct MTIMEH_SPEC; -impl crate::RegisterSpec for MTIMEH_SPEC { +impl W {} +#[doc = "Timer register\n\nYou can [`read`](crate::Reg::read) this register and get [`mtimeh::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mtimeh::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct MtimehSpec; +impl crate::RegisterSpec for MtimehSpec { type Ux = u32; } -#[doc = "`read()` method returns [mtimeh::R](R) reader structure"] -impl crate::Readable for MTIMEH_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mtimeh::W](W) writer structure"] -impl crate::Writable for MTIMEH_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`mtimeh::R`](R) reader structure"] +impl crate::Readable for MtimehSpec {} +#[doc = "`write(|w| ..)` method takes [`mtimeh::W`](W) writer structure"] +impl crate::Writable for MtimehSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets mtimeh to value 0"] -impl crate::Resettable for MTIMEH_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for MtimehSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/generic.rs b/src/generic.rs index 56bd2a2..5c6d2a6 100644 --- a/src/generic.rs +++ b/src/generic.rs @@ -1,27 +1,83 @@ use core::marker; +/// Raw register type (`u8`, `u16`, `u32`, ...) +pub trait RawReg: + Copy + + Default + + From + + core::ops::BitOr + + core::ops::BitAnd + + core::ops::BitOrAssign + + core::ops::BitAndAssign + + core::ops::Not + + core::ops::Shl +{ + /// Mask for bits of width `WI` + fn mask() -> Self; + /// Mask for bits of width 1 + fn one() -> Self; +} + +macro_rules! raw_reg { + ($U:ty, $size:literal, $mask:ident) => { + impl RawReg for $U { + #[inline(always)] + fn mask() -> Self { + $mask::() + } + #[inline(always)] + fn one() -> Self { + 1 + } + } + const fn $mask() -> $U { + <$U>::MAX >> ($size - WI) + } + impl FieldSpec for $U { + type Ux = $U; + } + }; +} + +raw_reg!(u8, 8, mask_u8); +raw_reg!(u16, 16, mask_u16); +raw_reg!(u32, 32, mask_u32); +raw_reg!(u64, 64, mask_u64); + /// Raw register type pub trait RegisterSpec { /// Raw register type (`u8`, `u16`, `u32`, ...). - type Ux: Copy; + type Ux: RawReg; +} + +/// Raw field type +pub trait FieldSpec: Sized { + /// Raw field type (`u8`, `u16`, `u32`, ...). + type Ux: Copy + core::fmt::Debug + PartialEq + From; } +/// Marker for fields with fixed values +pub trait IsEnum: FieldSpec {} + /// Trait implemented by readable registers to enable the `read` method. /// -/// Registers marked with `Writable` can be also `modify`'ed. -pub trait Readable: RegisterSpec { - /// Result from a call to `read` and argument to `modify`. - type Reader: From> + core::ops::Deref>; -} +/// Registers marked with `Writable` can be also be `modify`'ed. +pub trait Readable: RegisterSpec {} /// Trait implemented by writeable registers. /// /// This enables the `write`, `write_with_zero` and `reset` methods. /// -/// Registers marked with `Readable` can be also `modify`'ed. +/// Registers marked with `Readable` can be also be `modify`'ed. pub trait Writable: RegisterSpec { - /// Writer type argument to `write`, et al. - type Writer: From> + core::ops::DerefMut>; + /// Is it safe to write any bits to register + type Safety; + + /// Specifies the register bits that are not changed if you pass `1` and are changed if you pass `0` + const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux; + + /// Specifies the register bits that are not changed if you pass `0` and are changed if you pass `1` + const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux; } /// Reset value of the register. @@ -30,170 +86,119 @@ pub trait Writable: RegisterSpec { /// register by using the `reset` method. pub trait Resettable: RegisterSpec { /// Reset value of the register. - fn reset_value() -> Self::Ux; -} + const RESET_VALUE: Self::Ux; -/// This structure provides volatile access to registers. -#[repr(transparent)] -pub struct Reg { - register: vcell::VolatileCell, - _marker: marker::PhantomData, -} - -unsafe impl Send for Reg where REG::Ux: Send {} - -impl Reg { - /// Returns the underlying memory address of register. - /// - /// ```ignore - /// let reg_ptr = periph.reg.as_ptr(); - /// ``` + /// Reset value of the register. #[inline(always)] - pub fn as_ptr(&self) -> *mut REG::Ux { - self.register.as_ptr() + fn reset_value() -> Self::Ux { + Self::RESET_VALUE } } -impl Reg { - /// Reads the contents of a `Readable` register. - /// - /// You can read the raw contents of a register by using `bits`: - /// ```ignore - /// let bits = periph.reg.read().bits(); - /// ``` - /// or get the content of a particular field of a register: - /// ```ignore - /// let reader = periph.reg.read(); - /// let bits = reader.field1().bits(); - /// let flag = reader.field2().bit_is_set(); - /// ``` - #[inline(always)] - pub fn read(&self) -> REG::Reader { - REG::Reader::from(R { - bits: self.register.get(), - _reg: marker::PhantomData, - }) +#[doc(hidden)] +pub mod raw { + use super::{marker, BitM, FieldSpec, RegisterSpec, Unsafe, Writable}; + + pub struct R { + pub(crate) bits: REG::Ux, + pub(super) _reg: marker::PhantomData, } -} -impl Reg { - /// Writes the reset value to `Writable` register. - /// - /// Resets the register to its initial state. - #[inline(always)] - pub fn reset(&self) { - self.register.set(REG::reset_value()) + pub struct W { + ///Writable bits + pub(crate) bits: REG::Ux, + pub(super) _reg: marker::PhantomData, } - /// Writes bits to a `Writable` register. - /// - /// You can write raw bits into a register: - /// ```ignore - /// periph.reg.write(|w| unsafe { w.bits(rawbits) }); - /// ``` - /// or write only the fields you need: - /// ```ignore - /// periph.reg.write(|w| w - /// .field1().bits(newfield1bits) - /// .field2().set_bit() - /// .field3().variant(VARIANT) - /// ); - /// ``` - /// or an alternative way of saying the same: - /// ```ignore - /// periph.reg.write(|w| { - /// w.field1().bits(newfield1bits); - /// w.field2().set_bit(); - /// w.field3().variant(VARIANT) - /// }); - /// ``` - /// In the latter case, other fields will be set to their reset value. - #[inline(always)] - pub fn write(&self, f: F) + pub struct FieldReader where - F: FnOnce(&mut REG::Writer) -> &mut W, + FI: FieldSpec, { - self.register.set( - f(&mut REG::Writer::from(W { - bits: REG::reset_value(), + pub(crate) bits: FI::Ux, + _reg: marker::PhantomData, + } + + impl FieldReader { + /// Creates a new instance of the reader. + #[allow(unused)] + #[inline(always)] + pub(crate) const fn new(bits: FI::Ux) -> Self { + Self { + bits, _reg: marker::PhantomData, - })) - .bits, - ); + } + } } -} -impl Reg -where - REG::Ux: Default, -{ - /// Writes 0 to a `Writable` register. - /// - /// Similar to `write`, but unused bits will contain 0. - /// - /// # Safety - /// - /// Unsafe to use with registers which don't allow to write 0. - #[inline(always)] - pub unsafe fn write_with_zero(&self, f: F) + pub struct BitReader { + pub(crate) bits: bool, + _reg: marker::PhantomData, + } + + impl BitReader { + /// Creates a new instance of the reader. + #[allow(unused)] + #[inline(always)] + pub(crate) const fn new(bits: bool) -> Self { + Self { + bits, + _reg: marker::PhantomData, + } + } + } + + pub struct FieldWriter<'a, REG, const WI: u8, FI = u8, Safety = Unsafe> where - F: FnOnce(&mut REG::Writer) -> &mut W, + REG: Writable + RegisterSpec, + FI: FieldSpec, { - self.register.set( - (*f(&mut REG::Writer::from(W { - bits: REG::Ux::default(), - _reg: marker::PhantomData, - }))) - .bits, - ); + pub(crate) w: &'a mut W, + pub(crate) o: u8, + _field: marker::PhantomData<(FI, Safety)>, } -} -impl Reg { - /// Modifies the contents of the register by reading and then writing it. - /// - /// E.g. to do a read-modify-write sequence to change parts of a register: - /// ```ignore - /// periph.reg.modify(|r, w| unsafe { w.bits( - /// r.bits() | 3 - /// ) }); - /// ``` - /// or - /// ```ignore - /// periph.reg.modify(|_, w| w - /// .field1().bits(newfield1bits) - /// .field2().set_bit() - /// .field3().variant(VARIANT) - /// ); - /// ``` - /// or an alternative way of saying the same: - /// ```ignore - /// periph.reg.modify(|_, w| { - /// w.field1().bits(newfield1bits); - /// w.field2().set_bit(); - /// w.field3().variant(VARIANT) - /// }); - /// ``` - /// Other fields will have the value they had before the call to `modify`. - #[inline(always)] - pub fn modify(&self, f: F) + impl<'a, REG, const WI: u8, FI, Safety> FieldWriter<'a, REG, WI, FI, Safety> where - for<'w> F: FnOnce(®::Reader, &'w mut REG::Writer) -> &'w mut W, + REG: Writable + RegisterSpec, + FI: FieldSpec, { - let bits = self.register.get(); - self.register.set( - f( - ®::Reader::from(R { - bits, - _reg: marker::PhantomData, - }), - &mut REG::Writer::from(W { - bits, - _reg: marker::PhantomData, - }), - ) - .bits, - ); + /// Creates a new instance of the writer + #[allow(unused)] + #[inline(always)] + pub(crate) fn new(w: &'a mut W, o: u8) -> Self { + Self { + w, + o, + _field: marker::PhantomData, + } + } + } + + pub struct BitWriter<'a, REG, FI = bool, M = BitM> + where + REG: Writable + RegisterSpec, + bool: From, + { + pub(crate) w: &'a mut W, + pub(crate) o: u8, + _field: marker::PhantomData<(FI, M)>, + } + + impl<'a, REG, FI, M> BitWriter<'a, REG, FI, M> + where + REG: Writable + RegisterSpec, + bool: From, + { + /// Creates a new instance of the writer + #[allow(unused)] + #[inline(always)] + pub(crate) fn new(w: &'a mut W, o: u8) -> Self { + Self { + w, + o, + _field: marker::PhantomData, + } + } } } @@ -201,15 +206,12 @@ impl Reg { /// /// Result of the `read` methods of registers. Also used as a closure argument in the `modify` /// method. -pub struct R { - pub(crate) bits: REG::Ux, - _reg: marker::PhantomData, -} +pub type R = raw::R; impl R { /// Reads raw bits from register. #[inline(always)] - pub fn bits(&self) -> REG::Ux { + pub const fn bits(&self) -> REG::Ux { self.bits } } @@ -217,218 +219,245 @@ impl R { impl PartialEq for R where REG::Ux: PartialEq, - FI: Copy + Into, + FI: Copy, + REG::Ux: From, { #[inline(always)] fn eq(&self, other: &FI) -> bool { - self.bits.eq(&(*other).into()) + self.bits.eq(®::Ux::from(*other)) } } /// Register writer. /// /// Used as an argument to the closures in the `write` and `modify` methods of the register. -pub struct W { - ///Writable bits - pub(crate) bits: REG::Ux, - _reg: marker::PhantomData, -} +pub type W = raw::W; -impl W { +impl W { /// Writes raw bits to the register. /// /// # Safety /// - /// Read datasheet or reference manual to find what values are allowed to pass. + /// Passing incorrect value can cause undefined behaviour. See reference manual #[inline(always)] pub unsafe fn bits(&mut self, bits: REG::Ux) -> &mut Self { self.bits = bits; self } } - -#[doc(hidden)] -pub struct FieldReaderRaw { - pub(crate) bits: U, - _reg: marker::PhantomData, -} - -impl FieldReaderRaw +impl W where - U: Copy, + REG: Writable, { - /// Creates a new instance of the reader. - #[allow(unused)] - #[inline(always)] - pub(crate) fn new(bits: U) -> Self { - Self { - bits, - _reg: marker::PhantomData, - } - } -} - -#[doc(hidden)] -pub struct BitReaderRaw { - pub(crate) bits: bool, - _reg: marker::PhantomData, -} - -impl BitReaderRaw { - /// Creates a new instance of the reader. - #[allow(unused)] + /// Writes raw bits to the register. #[inline(always)] - pub(crate) fn new(bits: bool) -> Self { - Self { - bits, - _reg: marker::PhantomData, - } + pub fn set(&mut self, bits: REG::Ux) -> &mut Self { + self.bits = bits; + self } } /// Field reader. /// /// Result of the `read` methods of fields. -pub type FieldReader = FieldReaderRaw; +pub type FieldReader = raw::FieldReader; /// Bit-wise field reader -pub type BitReader = BitReaderRaw; +pub type BitReader = raw::BitReader; -impl FieldReader -where - U: Copy, -{ +impl FieldReader { /// Reads raw bits from field. #[inline(always)] - pub fn bits(&self) -> U { + pub const fn bits(&self) -> FI::Ux { self.bits } } -impl PartialEq for FieldReader +impl core::fmt::Debug for FieldReader { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + core::fmt::Debug::fmt(&self.bits, f) + } +} + +impl PartialEq for FieldReader where - U: PartialEq, - FI: Copy + Into, + FI: FieldSpec + Copy, { #[inline(always)] fn eq(&self, other: &FI) -> bool { - self.bits.eq(&(*other).into()) + self.bits.eq(&FI::Ux::from(*other)) } } impl PartialEq for BitReader where - FI: Copy + Into, + FI: Copy, + bool: From, { #[inline(always)] fn eq(&self, other: &FI) -> bool { - self.bits.eq(&(*other).into()) + self.bits.eq(&bool::from(*other)) } } impl BitReader { /// Value of the field as raw bits. #[inline(always)] - pub fn bit(&self) -> bool { + pub const fn bit(&self) -> bool { self.bits } /// Returns `true` if the bit is clear (0). #[inline(always)] - pub fn bit_is_clear(&self) -> bool { + pub const fn bit_is_clear(&self) -> bool { !self.bit() } /// Returns `true` if the bit is set (1). #[inline(always)] - pub fn bit_is_set(&self) -> bool { + pub const fn bit_is_set(&self) -> bool { self.bit() } } -#[doc(hidden)] +impl core::fmt::Debug for BitReader { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + core::fmt::Debug::fmt(&self.bits, f) + } +} + +/// Marker for register/field writers which can take any value of specified width pub struct Safe; -#[doc(hidden)] +/// You should check that value is allowed to pass to register/field writer marked with this pub struct Unsafe; - -#[doc(hidden)] -pub struct FieldWriterRaw<'a, U, REG, N, FI, Safety, const WI: u8, const O: u8> +/// Marker for field writers are safe to write in specified inclusive range +pub struct Range; +/// Marker for field writers are safe to write in specified inclusive range +pub struct RangeFrom; +/// Marker for field writers are safe to write in specified inclusive range +pub struct RangeTo; + +/// Write field Proxy +pub type FieldWriter<'a, REG, const WI: u8, FI = u8, Safety = Unsafe> = + raw::FieldWriter<'a, REG, WI, FI, Safety>; + +impl<'a, REG, const WI: u8, FI, Safety> FieldWriter<'a, REG, WI, FI, Safety> where - REG: Writable + RegisterSpec, - FI: Into, + REG: Writable + RegisterSpec, + FI: FieldSpec, { - pub(crate) w: &'a mut REG::Writer, - _field: marker::PhantomData<(N, FI, Safety)>, + /// Field width + pub const WIDTH: u8 = WI; + + /// Field width + #[inline(always)] + pub const fn width(&self) -> u8 { + WI + } + + /// Field offset + #[inline(always)] + pub const fn offset(&self) -> u8 { + self.o + } } -impl<'a, U, REG, N, FI, Safety, const WI: u8, const O: u8> - FieldWriterRaw<'a, U, REG, N, FI, Safety, WI, O> +impl<'a, REG, const WI: u8, FI, Safety> FieldWriter<'a, REG, WI, FI, Safety> where - REG: Writable + RegisterSpec, - FI: Into, + REG: Writable + RegisterSpec, + FI: FieldSpec, + REG::Ux: From, { - /// Creates a new instance of the writer - #[allow(unused)] + /// Writes raw bits to the field + /// + /// # Safety + /// + /// Passing incorrect value can cause undefined behaviour. See reference manual #[inline(always)] - pub(crate) fn new(w: &'a mut REG::Writer) -> Self { - Self { - w, - _field: marker::PhantomData, - } + pub unsafe fn bits(self, value: FI::Ux) -> &'a mut W { + self.w.bits &= !(REG::Ux::mask::() << self.o); + self.w.bits |= (REG::Ux::from(value) & REG::Ux::mask::()) << self.o; + self.w } } -#[doc(hidden)] -pub struct BitWriterRaw<'a, U, REG, FI, M, const O: u8> +impl<'a, REG, const WI: u8, FI> FieldWriter<'a, REG, WI, FI, Safe> where - REG: Writable + RegisterSpec, - FI: Into, + REG: Writable + RegisterSpec, + FI: FieldSpec, + REG::Ux: From, { - pub(crate) w: &'a mut REG::Writer, - _field: marker::PhantomData<(FI, M)>, + /// Writes raw bits to the field + #[inline(always)] + pub fn set(self, value: FI::Ux) -> &'a mut W { + unsafe { self.bits(value) } + } } -impl<'a, U, REG, FI, M, const O: u8> BitWriterRaw<'a, U, REG, FI, M, O> +impl<'a, REG, const WI: u8, FI, const MIN: u64, const MAX: u64> + FieldWriter<'a, REG, WI, FI, Range> where - REG: Writable + RegisterSpec, - FI: Into, + REG: Writable + RegisterSpec, + FI: FieldSpec, + REG::Ux: From, + u64: From, { - /// Creates a new instance of the writer - #[allow(unused)] + /// Writes raw bits to the field #[inline(always)] - pub(crate) fn new(w: &'a mut REG::Writer) -> Self { - Self { - w, - _field: marker::PhantomData, + pub fn set(self, value: FI::Ux) -> &'a mut W { + { + let value = u64::from(value); + assert!(value >= MIN && value <= MAX); } + unsafe { self.bits(value) } } } -/// Write field Proxy with unsafe `bits` -pub type FieldWriter<'a, U, REG, N, FI, const WI: u8, const O: u8> = - FieldWriterRaw<'a, U, REG, N, FI, Unsafe, WI, O>; -/// Write field Proxy with safe `bits` -pub type FieldWriterSafe<'a, U, REG, N, FI, const WI: u8, const O: u8> = - FieldWriterRaw<'a, U, REG, N, FI, Safe, WI, O>; +impl<'a, REG, const WI: u8, FI, const MIN: u64> FieldWriter<'a, REG, WI, FI, RangeFrom> +where + REG: Writable + RegisterSpec, + FI: FieldSpec, + REG::Ux: From, + u64: From, +{ + /// Writes raw bits to the field + #[inline(always)] + pub fn set(self, value: FI::Ux) -> &'a mut W { + { + let value = u64::from(value); + assert!(value >= MIN); + } + unsafe { self.bits(value) } + } +} -impl<'a, U, REG, N, FI, const WI: u8, const OF: u8> FieldWriter<'a, U, REG, N, FI, WI, OF> +impl<'a, REG, const WI: u8, FI, const MAX: u64> FieldWriter<'a, REG, WI, FI, RangeTo> where - REG: Writable + RegisterSpec, - FI: Into, + REG: Writable + RegisterSpec, + FI: FieldSpec, + REG::Ux: From, + u64: From, { - /// Field width - pub const WIDTH: u8 = WI; - /// Field offset - pub const OFFSET: u8 = OF; + /// Writes raw bits to the field + #[inline(always)] + pub fn set(self, value: FI::Ux) -> &'a mut W { + { + let value = u64::from(value); + assert!(value <= MAX); + } + unsafe { self.bits(value) } + } } -impl<'a, U, REG, N, FI, const WI: u8, const OF: u8> FieldWriterSafe<'a, U, REG, N, FI, WI, OF> +impl<'a, REG, const WI: u8, FI, Safety> FieldWriter<'a, REG, WI, FI, Safety> where - REG: Writable + RegisterSpec, - FI: Into, + REG: Writable + RegisterSpec, + FI: IsEnum, + REG::Ux: From, { - /// Field width - pub const WIDTH: u8 = WI; - /// Field offset - pub const OFFSET: u8 = OF; + /// Writes `variant` to the field + #[inline(always)] + pub fn variant(self, variant: FI) -> &'a mut W { + unsafe { self.bits(FI::Ux::from(variant)) } + } } macro_rules! bit_proxy { @@ -437,38 +466,39 @@ macro_rules! bit_proxy { pub struct $mwv; /// Bit-wise write field proxy - pub type $writer<'a, U, REG, FI, const O: u8> = BitWriterRaw<'a, U, REG, FI, $mwv, O>; + pub type $writer<'a, REG, FI = bool> = raw::BitWriter<'a, REG, FI, $mwv>; - impl<'a, U, REG, FI, const OF: u8> $writer<'a, U, REG, FI, OF> + impl<'a, REG, FI> $writer<'a, REG, FI> where - REG: Writable + RegisterSpec, - FI: Into, + REG: Writable + RegisterSpec, + bool: From, { /// Field width pub const WIDTH: u8 = 1; + + /// Field width + #[inline(always)] + pub const fn width(&self) -> u8 { + Self::WIDTH + } + /// Field offset - pub const OFFSET: u8 = OF; - } - }; -} + #[inline(always)] + pub const fn offset(&self) -> u8 { + self.o + } -macro_rules! impl_bit_proxy { - ($writer:ident, $U:ty) => { - impl<'a, REG, FI, const OF: u8> $writer<'a, $U, REG, FI, OF> - where - REG: Writable + RegisterSpec, - FI: Into, - { /// Writes bit to the field #[inline(always)] - pub fn bit(self, value: bool) -> &'a mut REG::Writer { - self.w.bits = (self.w.bits & !(1 << { OF })) | ((<$U>::from(value) & 1) << { OF }); + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits &= !(REG::Ux::one() << self.o); + self.w.bits |= (REG::Ux::from(value) & REG::Ux::one()) << self.o; self.w } /// Writes `variant` to the field #[inline(always)] - pub fn variant(self, variant: FI) -> &'a mut REG::Writer { - self.bit(variant.into()) + pub fn variant(self, variant: FI) -> &'a mut W { + self.bit(bool::from(variant)) } } }; @@ -482,142 +512,271 @@ bit_proxy!(BitWriter0S, Bit0S); bit_proxy!(BitWriter1T, Bit1T); bit_proxy!(BitWriter0T, Bit0T); -macro_rules! impl_proxy { - ($U:ty) => { - impl<'a, REG, N, FI, const WI: u8, const OF: u8> FieldWriter<'a, $U, REG, N, FI, WI, OF> - where - REG: Writable + RegisterSpec, - N: Into<$U>, - FI: Into, - { - const MASK: $U = <$U>::MAX >> (<$U>::MAX.leading_ones() as u8 - { WI }); - /// Writes raw bits to the field - /// - /// # Safety - /// - /// Passing incorrect value can cause undefined behaviour. See reference manual - #[inline(always)] - pub unsafe fn bits(self, value: N) -> &'a mut REG::Writer { - self.w.bits = (self.w.bits & !(Self::MASK << { OF })) - | ((value.into() & Self::MASK) << { OF }); - self.w - } - /// Writes `variant` to the field - #[inline(always)] - pub fn variant(self, variant: FI) -> &'a mut REG::Writer { - unsafe { self.bits(variant.into()) } - } - } - impl<'a, REG, N, FI, const WI: u8, const OF: u8> FieldWriterSafe<'a, $U, REG, N, FI, WI, OF> - where - REG: Writable + RegisterSpec, - N: Into<$U>, - FI: Into, - { - const MASK: $U = <$U>::MAX >> (<$U>::MAX.leading_ones() as u8 - { WI }); - /// Writes raw bits to the field - #[inline(always)] - pub fn bits(self, value: N) -> &'a mut REG::Writer { - self.w.bits = (self.w.bits & !(Self::MASK << { OF })) - | ((value.into() & Self::MASK) << { OF }); - self.w - } - /// Writes `variant` to the field - #[inline(always)] - pub fn variant(self, variant: FI) -> &'a mut REG::Writer { - self.bits(variant.into()) - } - } - impl_bit_proxy!(BitWriter, $U); - impl_bit_proxy!(BitWriter1S, $U); - impl_bit_proxy!(BitWriter0C, $U); - impl_bit_proxy!(BitWriter1C, $U); - impl_bit_proxy!(BitWriter0S, $U); - impl_bit_proxy!(BitWriter1T, $U); - impl_bit_proxy!(BitWriter0T, $U); - impl<'a, REG, FI, const OF: u8> BitWriter<'a, $U, REG, FI, OF> - where - REG: Writable + RegisterSpec, - FI: Into, - { - /// Sets the field bit - #[inline(always)] - pub fn set_bit(self) -> &'a mut REG::Writer { - self.bit(true) - } - /// Clears the field bit - #[inline(always)] - pub fn clear_bit(self) -> &'a mut REG::Writer { - self.bit(false) - } - } - impl<'a, REG, FI, const OF: u8> BitWriter1S<'a, $U, REG, FI, OF> - where - REG: Writable + RegisterSpec, - FI: Into, - { - /// Sets the field bit - #[inline(always)] - pub fn set_bit(self) -> &'a mut REG::Writer { - self.bit(true) - } - } - impl<'a, REG, FI, const OF: u8> BitWriter0C<'a, $U, REG, FI, OF> - where - REG: Writable + RegisterSpec, - FI: Into, - { - /// Clears the field bit - #[inline(always)] - pub fn clear_bit(self) -> &'a mut REG::Writer { - self.bit(false) - } - } - impl<'a, REG, FI, const OF: u8> BitWriter1C<'a, $U, REG, FI, OF> - where - REG: Writable + RegisterSpec, - FI: Into, - { - ///Clears the field bit by passing one - #[inline(always)] - pub fn clear_bit_by_one(self) -> &'a mut REG::Writer { - self.bit(true) - } - } - impl<'a, REG, FI, const OF: u8> BitWriter0S<'a, $U, REG, FI, OF> - where - REG: Writable + RegisterSpec, - FI: Into, - { - ///Sets the field bit by passing zero - #[inline(always)] - pub fn set_bit_by_zero(self) -> &'a mut REG::Writer { - self.bit(false) - } - } - impl<'a, REG, FI, const OF: u8> BitWriter1T<'a, $U, REG, FI, OF> - where - REG: Writable + RegisterSpec, - FI: Into, - { - ///Toggle the field bit by passing one - #[inline(always)] - pub fn toggle_bit(self) -> &'a mut REG::Writer { - self.bit(true) - } - } - impl<'a, REG, FI, const OF: u8> BitWriter0T<'a, $U, REG, FI, OF> - where - REG: Writable + RegisterSpec, - FI: Into, - { - ///Toggle the field bit by passing zero - #[inline(always)] - pub fn toggle_bit(self) -> &'a mut REG::Writer { - self.bit(false) - } +impl<'a, REG, FI> BitWriter<'a, REG, FI> +where + REG: Writable + RegisterSpec, + bool: From, +{ + /// Sets the field bit + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.w.bits |= REG::Ux::one() << self.o; + self.w + } + /// Clears the field bit + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.w.bits &= !(REG::Ux::one() << self.o); + self.w + } +} + +impl<'a, REG, FI> BitWriter1S<'a, REG, FI> +where + REG: Writable + RegisterSpec, + bool: From, +{ + /// Sets the field bit + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.w.bits |= REG::Ux::one() << self.o; + self.w + } +} + +impl<'a, REG, FI> BitWriter0C<'a, REG, FI> +where + REG: Writable + RegisterSpec, + bool: From, +{ + /// Clears the field bit + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.w.bits &= !(REG::Ux::one() << self.o); + self.w + } +} + +impl<'a, REG, FI> BitWriter1C<'a, REG, FI> +where + REG: Writable + RegisterSpec, + bool: From, +{ + ///Clears the field bit by passing one + #[inline(always)] + pub fn clear_bit_by_one(self) -> &'a mut W { + self.w.bits |= REG::Ux::one() << self.o; + self.w + } +} + +impl<'a, REG, FI> BitWriter0S<'a, REG, FI> +where + REG: Writable + RegisterSpec, + bool: From, +{ + ///Sets the field bit by passing zero + #[inline(always)] + pub fn set_bit_by_zero(self) -> &'a mut W { + self.w.bits &= !(REG::Ux::one() << self.o); + self.w + } +} + +impl<'a, REG, FI> BitWriter1T<'a, REG, FI> +where + REG: Writable + RegisterSpec, + bool: From, +{ + ///Toggle the field bit by passing one + #[inline(always)] + pub fn toggle_bit(self) -> &'a mut W { + self.w.bits |= REG::Ux::one() << self.o; + self.w + } +} + +impl<'a, REG, FI> BitWriter0T<'a, REG, FI> +where + REG: Writable + RegisterSpec, + bool: From, +{ + ///Toggle the field bit by passing zero + #[inline(always)] + pub fn toggle_bit(self) -> &'a mut W { + self.w.bits &= !(REG::Ux::one() << self.o); + self.w + } +} + +/// This structure provides volatile access to registers. +#[repr(transparent)] +pub struct Reg { + register: vcell::VolatileCell, + _marker: marker::PhantomData, +} + +unsafe impl Send for Reg where REG::Ux: Send {} + +impl Reg { + /// Returns the underlying memory address of register. + /// + /// ```ignore + /// let reg_ptr = periph.reg.as_ptr(); + /// ``` + #[inline(always)] + pub fn as_ptr(&self) -> *mut REG::Ux { + self.register.as_ptr() + } +} + +impl Reg { + /// Reads the contents of a `Readable` register. + /// + /// You can read the raw contents of a register by using `bits`: + /// ```ignore + /// let bits = periph.reg.read().bits(); + /// ``` + /// or get the content of a particular field of a register: + /// ```ignore + /// let reader = periph.reg.read(); + /// let bits = reader.field1().bits(); + /// let flag = reader.field2().bit_is_set(); + /// ``` + #[inline(always)] + pub fn read(&self) -> R { + R { + bits: self.register.get(), + _reg: marker::PhantomData, } - }; + } +} + +impl Reg { + /// Writes the reset value to `Writable` register. + /// + /// Resets the register to its initial state. + #[inline(always)] + pub fn reset(&self) { + self.register.set(REG::RESET_VALUE) + } + + /// Writes bits to a `Writable` register. + /// + /// You can write raw bits into a register: + /// ```ignore + /// periph.reg.write(|w| unsafe { w.bits(rawbits) }); + /// ``` + /// or write only the fields you need: + /// ```ignore + /// periph.reg.write(|w| w + /// .field1().bits(newfield1bits) + /// .field2().set_bit() + /// .field3().variant(VARIANT) + /// ); + /// ``` + /// or an alternative way of saying the same: + /// ```ignore + /// periph.reg.write(|w| { + /// w.field1().bits(newfield1bits); + /// w.field2().set_bit(); + /// w.field3().variant(VARIANT) + /// }); + /// ``` + /// In the latter case, other fields will be set to their reset value. + #[inline(always)] + pub fn write(&self, f: F) + where + F: FnOnce(&mut W) -> &mut W, + { + self.register.set( + f(&mut W { + bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP + | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }) + .bits, + ); + } +} + +impl Reg { + /// Writes 0 to a `Writable` register. + /// + /// Similar to `write`, but unused bits will contain 0. + /// + /// # Safety + /// + /// Unsafe to use with registers which don't allow to write 0. + #[inline(always)] + pub unsafe fn write_with_zero(&self, f: F) + where + F: FnOnce(&mut W) -> &mut W, + { + self.register.set( + f(&mut W { + bits: REG::Ux::default(), + _reg: marker::PhantomData, + }) + .bits, + ); + } +} + +impl Reg { + /// Modifies the contents of the register by reading and then writing it. + /// + /// E.g. to do a read-modify-write sequence to change parts of a register: + /// ```ignore + /// periph.reg.modify(|r, w| unsafe { w.bits( + /// r.bits() | 3 + /// ) }); + /// ``` + /// or + /// ```ignore + /// periph.reg.modify(|_, w| w + /// .field1().bits(newfield1bits) + /// .field2().set_bit() + /// .field3().variant(VARIANT) + /// ); + /// ``` + /// or an alternative way of saying the same: + /// ```ignore + /// periph.reg.modify(|_, w| { + /// w.field1().bits(newfield1bits); + /// w.field2().set_bit(); + /// w.field3().variant(VARIANT) + /// }); + /// ``` + /// Other fields will have the value they had before the call to `modify`. + #[inline(always)] + pub fn modify(&self, f: F) + where + for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, + { + let bits = self.register.get(); + self.register.set( + f( + &R { + bits, + _reg: marker::PhantomData, + }, + &mut W { + bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP + | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, + _reg: marker::PhantomData, + }, + ) + .bits, + ); + } } -impl_proxy!(u32); +impl core::fmt::Debug for crate::generic::Reg +where + R: core::fmt::Debug, +{ + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + core::fmt::Debug::fmt(&self.read(), f) + } +} diff --git a/src/gpio0.rs b/src/gpio0.rs index c607d29..ac14852 100644 --- a/src/gpio0.rs +++ b/src/gpio0.rs @@ -1,106 +1,210 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { + input_val: InputVal, + input_en: InputEn, + output_en: OutputEn, + output_val: OutputVal, + pullup: Pullup, + drive: Drive, + rise_ie: RiseIe, + rise_ip: RiseIp, + fall_ie: FallIe, + fall_ip: FallIp, + high_ie: HighIe, + high_ip: HighIp, + low_ie: LowIe, + low_ip: LowIp, + iof_en: IofEn, + iof_sel: IofSel, + out_xor: OutXor, +} +impl RegisterBlock { #[doc = "0x00 - Pin value."] - pub input_val: INPUT_VAL, + #[inline(always)] + pub const fn input_val(&self) -> &InputVal { + &self.input_val + } #[doc = "0x04 - Pin Input Enable Register"] - pub input_en: INPUT_EN, + #[inline(always)] + pub const fn input_en(&self) -> &InputEn { + &self.input_en + } #[doc = "0x08 - Pin Output Enable Register"] - pub output_en: OUTPUT_EN, + #[inline(always)] + pub const fn output_en(&self) -> &OutputEn { + &self.output_en + } #[doc = "0x0c - Output Port Value Register"] - pub output_val: OUTPUT_VAL, + #[inline(always)] + pub const fn output_val(&self) -> &OutputVal { + &self.output_val + } #[doc = "0x10 - Internal Pull-Up Enable Register"] - pub pullup: PULLUP, + #[inline(always)] + pub const fn pullup(&self) -> &Pullup { + &self.pullup + } #[doc = "0x14 - Drive Strength Register"] - pub drive: DRIVE, + #[inline(always)] + pub const fn drive(&self) -> &Drive { + &self.drive + } #[doc = "0x18 - Rise Interrupt Enable Register"] - pub rise_ie: RISE_IE, + #[inline(always)] + pub const fn rise_ie(&self) -> &RiseIe { + &self.rise_ie + } #[doc = "0x1c - Rise Interrupt Pending Register"] - pub rise_ip: RISE_IP, + #[inline(always)] + pub const fn rise_ip(&self) -> &RiseIp { + &self.rise_ip + } #[doc = "0x20 - Fall Interrupt Enable Register"] - pub fall_ie: FALL_IE, + #[inline(always)] + pub const fn fall_ie(&self) -> &FallIe { + &self.fall_ie + } #[doc = "0x24 - Fall Interrupt Pending Register"] - pub fall_ip: FALL_IP, + #[inline(always)] + pub const fn fall_ip(&self) -> &FallIp { + &self.fall_ip + } #[doc = "0x28 - High Interrupt Enable Register"] - pub high_ie: HIGH_IE, + #[inline(always)] + pub const fn high_ie(&self) -> &HighIe { + &self.high_ie + } #[doc = "0x2c - High Interrupt Pending Register"] - pub high_ip: HIGH_IP, + #[inline(always)] + pub const fn high_ip(&self) -> &HighIp { + &self.high_ip + } #[doc = "0x30 - Low Interrupt Enable Register"] - pub low_ie: LOW_IE, + #[inline(always)] + pub const fn low_ie(&self) -> &LowIe { + &self.low_ie + } #[doc = "0x34 - Low Interrupt Pending Register"] - pub low_ip: LOW_IP, + #[inline(always)] + pub const fn low_ip(&self) -> &LowIp { + &self.low_ip + } #[doc = "0x38 - HW I/O Function Enable Register"] - pub iof_en: IOF_EN, + #[inline(always)] + pub const fn iof_en(&self) -> &IofEn { + &self.iof_en + } #[doc = "0x3c - HW I/O Function Select Register"] - pub iof_sel: IOF_SEL, + #[inline(always)] + pub const fn iof_sel(&self) -> &IofSel { + &self.iof_sel + } #[doc = "0x40 - Output XOR (invert) Register"] - pub out_xor: OUT_XOR, + #[inline(always)] + pub const fn out_xor(&self) -> &OutXor { + &self.out_xor + } } -#[doc = "input_val (rw) register accessor: an alias for `Reg`"] -pub type INPUT_VAL = crate::Reg; +#[doc = "input_val (rw) register accessor: Pin value.\n\nYou can [`read`](crate::Reg::read) this register and get [`input_val::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`input_val::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@input_val`] +module"] +#[doc(alias = "input_val")] +pub type InputVal = crate::Reg; #[doc = "Pin value."] pub mod input_val; -#[doc = "input_en (rw) register accessor: an alias for `Reg`"] -pub type INPUT_EN = crate::Reg; +#[doc = "input_en (rw) register accessor: Pin Input Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`input_en::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`input_en::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@input_en`] +module"] +#[doc(alias = "input_en")] +pub type InputEn = crate::Reg; #[doc = "Pin Input Enable Register"] pub mod input_en; -#[doc = "output_en (rw) register accessor: an alias for `Reg`"] -pub type OUTPUT_EN = crate::Reg; +#[doc = "output_en (rw) register accessor: Pin Output Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`output_en::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`output_en::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@output_en`] +module"] +#[doc(alias = "output_en")] +pub type OutputEn = crate::Reg; #[doc = "Pin Output Enable Register"] pub mod output_en; -#[doc = "output_val (rw) register accessor: an alias for `Reg`"] -pub type OUTPUT_VAL = crate::Reg; +#[doc = "output_val (rw) register accessor: Output Port Value Register\n\nYou can [`read`](crate::Reg::read) this register and get [`output_val::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`output_val::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@output_val`] +module"] +#[doc(alias = "output_val")] +pub type OutputVal = crate::Reg; #[doc = "Output Port Value Register"] pub mod output_val; -#[doc = "pullup (rw) register accessor: an alias for `Reg`"] -pub type PULLUP = crate::Reg; +#[doc = "pullup (rw) register accessor: Internal Pull-Up Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pullup::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pullup::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pullup`] +module"] +#[doc(alias = "pullup")] +pub type Pullup = crate::Reg; #[doc = "Internal Pull-Up Enable Register"] pub mod pullup; -#[doc = "drive (rw) register accessor: an alias for `Reg`"] -pub type DRIVE = crate::Reg; +#[doc = "drive (rw) register accessor: Drive Strength Register\n\nYou can [`read`](crate::Reg::read) this register and get [`drive::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`drive::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@drive`] +module"] +#[doc(alias = "drive")] +pub type Drive = crate::Reg; #[doc = "Drive Strength Register"] pub mod drive; -#[doc = "rise_ie (rw) register accessor: an alias for `Reg`"] -pub type RISE_IE = crate::Reg; +#[doc = "rise_ie (rw) register accessor: Rise Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rise_ie::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rise_ie::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rise_ie`] +module"] +#[doc(alias = "rise_ie")] +pub type RiseIe = crate::Reg; #[doc = "Rise Interrupt Enable Register"] pub mod rise_ie; -#[doc = "rise_ip (rw) register accessor: an alias for `Reg`"] -pub type RISE_IP = crate::Reg; +#[doc = "rise_ip (rw) register accessor: Rise Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rise_ip::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rise_ip::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rise_ip`] +module"] +#[doc(alias = "rise_ip")] +pub type RiseIp = crate::Reg; #[doc = "Rise Interrupt Pending Register"] pub mod rise_ip; -#[doc = "fall_ie (rw) register accessor: an alias for `Reg`"] -pub type FALL_IE = crate::Reg; +#[doc = "fall_ie (rw) register accessor: Fall Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fall_ie::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fall_ie::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fall_ie`] +module"] +#[doc(alias = "fall_ie")] +pub type FallIe = crate::Reg; #[doc = "Fall Interrupt Enable Register"] pub mod fall_ie; -#[doc = "fall_ip (rw) register accessor: an alias for `Reg`"] -pub type FALL_IP = crate::Reg; +#[doc = "fall_ip (rw) register accessor: Fall Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fall_ip::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fall_ip::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fall_ip`] +module"] +#[doc(alias = "fall_ip")] +pub type FallIp = crate::Reg; #[doc = "Fall Interrupt Pending Register"] pub mod fall_ip; -#[doc = "high_ie (rw) register accessor: an alias for `Reg`"] -pub type HIGH_IE = crate::Reg; +#[doc = "high_ie (rw) register accessor: High Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`high_ie::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`high_ie::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@high_ie`] +module"] +#[doc(alias = "high_ie")] +pub type HighIe = crate::Reg; #[doc = "High Interrupt Enable Register"] pub mod high_ie; -#[doc = "high_ip (rw) register accessor: an alias for `Reg`"] -pub type HIGH_IP = crate::Reg; +#[doc = "high_ip (rw) register accessor: High Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`high_ip::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`high_ip::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@high_ip`] +module"] +#[doc(alias = "high_ip")] +pub type HighIp = crate::Reg; #[doc = "High Interrupt Pending Register"] pub mod high_ip; -#[doc = "low_ie (rw) register accessor: an alias for `Reg`"] -pub type LOW_IE = crate::Reg; +#[doc = "low_ie (rw) register accessor: Low Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`low_ie::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`low_ie::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@low_ie`] +module"] +#[doc(alias = "low_ie")] +pub type LowIe = crate::Reg; #[doc = "Low Interrupt Enable Register"] pub mod low_ie; -#[doc = "low_ip (rw) register accessor: an alias for `Reg`"] -pub type LOW_IP = crate::Reg; +#[doc = "low_ip (rw) register accessor: Low Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`low_ip::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`low_ip::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@low_ip`] +module"] +#[doc(alias = "low_ip")] +pub type LowIp = crate::Reg; #[doc = "Low Interrupt Pending Register"] pub mod low_ip; -#[doc = "iof_en (rw) register accessor: an alias for `Reg`"] -pub type IOF_EN = crate::Reg; +#[doc = "iof_en (rw) register accessor: HW I/O Function Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`iof_en::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`iof_en::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iof_en`] +module"] +#[doc(alias = "iof_en")] +pub type IofEn = crate::Reg; #[doc = "HW I/O Function Enable Register"] pub mod iof_en; -#[doc = "iof_sel (rw) register accessor: an alias for `Reg`"] -pub type IOF_SEL = crate::Reg; +#[doc = "iof_sel (rw) register accessor: HW I/O Function Select Register\n\nYou can [`read`](crate::Reg::read) this register and get [`iof_sel::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`iof_sel::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iof_sel`] +module"] +#[doc(alias = "iof_sel")] +pub type IofSel = crate::Reg; #[doc = "HW I/O Function Select Register"] pub mod iof_sel; -#[doc = "out_xor (rw) register accessor: an alias for `Reg`"] -pub type OUT_XOR = crate::Reg; +#[doc = "out_xor (rw) register accessor: Output XOR (invert) Register\n\nYou can [`read`](crate::Reg::read) this register and get [`out_xor::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`out_xor::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@out_xor`] +module"] +#[doc(alias = "out_xor")] +pub type OutXor = crate::Reg; #[doc = "Output XOR (invert) Register"] pub mod out_xor; diff --git a/src/gpio0/drive.rs b/src/gpio0/drive.rs index 432d4f8..dd5cd3c 100644 --- a/src/gpio0/drive.rs +++ b/src/gpio0/drive.rs @@ -1,514 +1,505 @@ #[doc = "Register `drive` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `drive` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, DRIVE_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Drive Strength Register\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 [drive](index.html) module"] -pub struct DRIVE_SPEC; -impl crate::RegisterSpec for DRIVE_SPEC { +#[doc = "Drive Strength Register\n\nYou can [`read`](crate::Reg::read) this register and get [`drive::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`drive::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct DriveSpec; +impl crate::RegisterSpec for DriveSpec { type Ux = u32; } -#[doc = "`read()` method returns [drive::R](R) reader structure"] -impl crate::Readable for DRIVE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [drive::W](W) writer structure"] -impl crate::Writable for DRIVE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`drive::R`](R) reader structure"] +impl crate::Readable for DriveSpec {} +#[doc = "`write(|w| ..)` method takes [`drive::W`](W) writer structure"] +impl crate::Writable for DriveSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets drive to value 0"] -impl crate::Resettable for DRIVE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for DriveSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/fall_ie.rs b/src/gpio0/fall_ie.rs index 635da3f..80e5d99 100644 --- a/src/gpio0/fall_ie.rs +++ b/src/gpio0/fall_ie.rs @@ -1,514 +1,505 @@ #[doc = "Register `fall_ie` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `fall_ie` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IE_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Fall Interrupt Enable Register\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 [fall_ie](index.html) module"] -pub struct FALL_IE_SPEC; -impl crate::RegisterSpec for FALL_IE_SPEC { +#[doc = "Fall Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fall_ie::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fall_ie::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct FallIeSpec; +impl crate::RegisterSpec for FallIeSpec { type Ux = u32; } -#[doc = "`read()` method returns [fall_ie::R](R) reader structure"] -impl crate::Readable for FALL_IE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [fall_ie::W](W) writer structure"] -impl crate::Writable for FALL_IE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`fall_ie::R`](R) reader structure"] +impl crate::Readable for FallIeSpec {} +#[doc = "`write(|w| ..)` method takes [`fall_ie::W`](W) writer structure"] +impl crate::Writable for FallIeSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets fall_ie to value 0"] -impl crate::Resettable for FALL_IE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for FallIeSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/fall_ip.rs b/src/gpio0/fall_ip.rs index c177714..36df848 100644 --- a/src/gpio0/fall_ip.rs +++ b/src/gpio0/fall_ip.rs @@ -1,514 +1,505 @@ #[doc = "Register `fall_ip` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `fall_ip` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, FALL_IP_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Fall Interrupt Pending Register\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 [fall_ip](index.html) module"] -pub struct FALL_IP_SPEC; -impl crate::RegisterSpec for FALL_IP_SPEC { +#[doc = "Fall Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fall_ip::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fall_ip::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct FallIpSpec; +impl crate::RegisterSpec for FallIpSpec { type Ux = u32; } -#[doc = "`read()` method returns [fall_ip::R](R) reader structure"] -impl crate::Readable for FALL_IP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [fall_ip::W](W) writer structure"] -impl crate::Writable for FALL_IP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`fall_ip::R`](R) reader structure"] +impl crate::Readable for FallIpSpec {} +#[doc = "`write(|w| ..)` method takes [`fall_ip::W`](W) writer structure"] +impl crate::Writable for FallIpSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets fall_ip to value 0"] -impl crate::Resettable for FALL_IP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for FallIpSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/high_ie.rs b/src/gpio0/high_ie.rs index 7331dd5..627853b 100644 --- a/src/gpio0/high_ie.rs +++ b/src/gpio0/high_ie.rs @@ -1,514 +1,505 @@ #[doc = "Register `high_ie` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `high_ie` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IE_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "High Interrupt Enable Register\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 [high_ie](index.html) module"] -pub struct HIGH_IE_SPEC; -impl crate::RegisterSpec for HIGH_IE_SPEC { +#[doc = "High Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`high_ie::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`high_ie::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct HighIeSpec; +impl crate::RegisterSpec for HighIeSpec { type Ux = u32; } -#[doc = "`read()` method returns [high_ie::R](R) reader structure"] -impl crate::Readable for HIGH_IE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [high_ie::W](W) writer structure"] -impl crate::Writable for HIGH_IE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`high_ie::R`](R) reader structure"] +impl crate::Readable for HighIeSpec {} +#[doc = "`write(|w| ..)` method takes [`high_ie::W`](W) writer structure"] +impl crate::Writable for HighIeSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets high_ie to value 0"] -impl crate::Resettable for HIGH_IE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for HighIeSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/high_ip.rs b/src/gpio0/high_ip.rs index 37f9eee..eb02239 100644 --- a/src/gpio0/high_ip.rs +++ b/src/gpio0/high_ip.rs @@ -1,514 +1,505 @@ #[doc = "Register `high_ip` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `high_ip` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, HIGH_IP_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "High Interrupt Pending Register\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 [high_ip](index.html) module"] -pub struct HIGH_IP_SPEC; -impl crate::RegisterSpec for HIGH_IP_SPEC { +#[doc = "High Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`high_ip::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`high_ip::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct HighIpSpec; +impl crate::RegisterSpec for HighIpSpec { type Ux = u32; } -#[doc = "`read()` method returns [high_ip::R](R) reader structure"] -impl crate::Readable for HIGH_IP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [high_ip::W](W) writer structure"] -impl crate::Writable for HIGH_IP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`high_ip::R`](R) reader structure"] +impl crate::Readable for HighIpSpec {} +#[doc = "`write(|w| ..)` method takes [`high_ip::W`](W) writer structure"] +impl crate::Writable for HighIpSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets high_ip to value 0"] -impl crate::Resettable for HIGH_IP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for HighIpSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/input_en.rs b/src/gpio0/input_en.rs index 6a581fa..5348ebe 100644 --- a/src/gpio0/input_en.rs +++ b/src/gpio0/input_en.rs @@ -1,514 +1,505 @@ #[doc = "Register `input_en` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `input_en` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_EN_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Pin Input Enable Register\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 [input_en](index.html) module"] -pub struct INPUT_EN_SPEC; -impl crate::RegisterSpec for INPUT_EN_SPEC { +#[doc = "Pin Input Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`input_en::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`input_en::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct InputEnSpec; +impl crate::RegisterSpec for InputEnSpec { type Ux = u32; } -#[doc = "`read()` method returns [input_en::R](R) reader structure"] -impl crate::Readable for INPUT_EN_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [input_en::W](W) writer structure"] -impl crate::Writable for INPUT_EN_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`input_en::R`](R) reader structure"] +impl crate::Readable for InputEnSpec {} +#[doc = "`write(|w| ..)` method takes [`input_en::W`](W) writer structure"] +impl crate::Writable for InputEnSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets input_en to value 0"] -impl crate::Resettable for INPUT_EN_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for InputEnSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/input_val.rs b/src/gpio0/input_val.rs index ca4f3f8..710e706 100644 --- a/src/gpio0/input_val.rs +++ b/src/gpio0/input_val.rs @@ -1,514 +1,505 @@ #[doc = "Register `input_val` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `input_val` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, INPUT_VAL_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Pin value.\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 [input_val](index.html) module"] -pub struct INPUT_VAL_SPEC; -impl crate::RegisterSpec for INPUT_VAL_SPEC { +#[doc = "Pin value.\n\nYou can [`read`](crate::Reg::read) this register and get [`input_val::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`input_val::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct InputValSpec; +impl crate::RegisterSpec for InputValSpec { type Ux = u32; } -#[doc = "`read()` method returns [input_val::R](R) reader structure"] -impl crate::Readable for INPUT_VAL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [input_val::W](W) writer structure"] -impl crate::Writable for INPUT_VAL_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`input_val::R`](R) reader structure"] +impl crate::Readable for InputValSpec {} +#[doc = "`write(|w| ..)` method takes [`input_val::W`](W) writer structure"] +impl crate::Writable for InputValSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets input_val to value 0"] -impl crate::Resettable for INPUT_VAL_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for InputValSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/iof_en.rs b/src/gpio0/iof_en.rs index 8b3762d..cd9590a 100644 --- a/src/gpio0/iof_en.rs +++ b/src/gpio0/iof_en.rs @@ -1,514 +1,505 @@ #[doc = "Register `iof_en` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `iof_en` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_EN_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "HW I/O Function Enable Register\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 [iof_en](index.html) module"] -pub struct IOF_EN_SPEC; -impl crate::RegisterSpec for IOF_EN_SPEC { +#[doc = "HW I/O Function Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`iof_en::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`iof_en::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct IofEnSpec; +impl crate::RegisterSpec for IofEnSpec { type Ux = u32; } -#[doc = "`read()` method returns [iof_en::R](R) reader structure"] -impl crate::Readable for IOF_EN_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [iof_en::W](W) writer structure"] -impl crate::Writable for IOF_EN_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`iof_en::R`](R) reader structure"] +impl crate::Readable for IofEnSpec {} +#[doc = "`write(|w| ..)` method takes [`iof_en::W`](W) writer structure"] +impl crate::Writable for IofEnSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets iof_en to value 0"] -impl crate::Resettable for IOF_EN_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for IofEnSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/iof_sel.rs b/src/gpio0/iof_sel.rs index 2d9d967..b0cb56c 100644 --- a/src/gpio0/iof_sel.rs +++ b/src/gpio0/iof_sel.rs @@ -1,1986 +1,2073 @@ #[doc = "Register `iof_sel` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `iof_sel` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -#[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type W = crate::W; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN0_A { +pub enum Pin0 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - PWM0_0 = 1, + Pwm0_0 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN0_A) -> Self { + fn from(variant: Pin0) -> Self { variant as u8 != 0 } } -impl PIN0_R { +#[doc = "Field `pin0` reader - "] +pub type Pin0R = crate::BitReader; +impl Pin0R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN0_A { + pub const fn variant(&self) -> Pin0 { match self.bits { - false => PIN0_A::IOF0, - true => PIN0_A::PWM0_0, + false => Pin0::Iof0, + true => Pin0::Pwm0_0, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN0_A::IOF0 + *self == Pin0::Iof0 } - #[doc = "Checks if the value of the field is `PWM0_0`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm0_0(&self) -> bool { - *self == PIN0_A::PWM0_0 + *self == Pin0::Pwm0_0 } } #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN0_A, O>; -impl<'a, const O: u8> PIN0_W<'a, O> { +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG, Pin0>; +impl<'a, REG> Pin0W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN0_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin0::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn pwm0_0(self) -> &'a mut W { - self.variant(PIN0_A::PWM0_0) + pub fn pwm0_0(self) -> &'a mut crate::W { + self.variant(Pin0::Pwm0_0) } } -#[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN1_A { +pub enum Pin1 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - PWM0_1 = 1, + Pwm0_1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN1_A) -> Self { + fn from(variant: Pin1) -> Self { variant as u8 != 0 } } -impl PIN1_R { +#[doc = "Field `pin1` reader - "] +pub type Pin1R = crate::BitReader; +impl Pin1R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN1_A { + pub const fn variant(&self) -> Pin1 { match self.bits { - false => PIN1_A::IOF0, - true => PIN1_A::PWM0_1, + false => Pin1::Iof0, + true => Pin1::Pwm0_1, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN1_A::IOF0 + *self == Pin1::Iof0 } - #[doc = "Checks if the value of the field is `PWM0_1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm0_1(&self) -> bool { - *self == PIN1_A::PWM0_1 + *self == Pin1::Pwm0_1 } } #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN1_A, O>; -impl<'a, const O: u8> PIN1_W<'a, O> { +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG, Pin1>; +impl<'a, REG> Pin1W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN1_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin1::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn pwm0_1(self) -> &'a mut W { - self.variant(PIN1_A::PWM0_1) + pub fn pwm0_1(self) -> &'a mut crate::W { + self.variant(Pin1::Pwm0_1) } } -#[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN2_A { +pub enum Pin2 { #[doc = "0: `0`"] - QSPI1_SS0 = 0, + Qspi1Ss0 = 0, #[doc = "1: `1`"] - PWM0_2 = 1, + Pwm0_2 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN2_A) -> Self { + fn from(variant: Pin2) -> Self { variant as u8 != 0 } } -impl PIN2_R { +#[doc = "Field `pin2` reader - "] +pub type Pin2R = crate::BitReader; +impl Pin2R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN2_A { + pub const fn variant(&self) -> Pin2 { match self.bits { - false => PIN2_A::QSPI1_SS0, - true => PIN2_A::PWM0_2, + false => Pin2::Qspi1Ss0, + true => Pin2::Pwm0_2, } } - #[doc = "Checks if the value of the field is `QSPI1_SS0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi1_ss0(&self) -> bool { - *self == PIN2_A::QSPI1_SS0 + *self == Pin2::Qspi1Ss0 } - #[doc = "Checks if the value of the field is `PWM0_2`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm0_2(&self) -> bool { - *self == PIN2_A::PWM0_2 + *self == Pin2::Pwm0_2 } } #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN2_A, O>; -impl<'a, const O: u8> PIN2_W<'a, O> { +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG, Pin2>; +impl<'a, REG> Pin2W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi1_ss0(self) -> &'a mut W { - self.variant(PIN2_A::QSPI1_SS0) + pub fn qspi1_ss0(self) -> &'a mut crate::W { + self.variant(Pin2::Qspi1Ss0) } #[doc = "`1`"] #[inline(always)] - pub fn pwm0_2(self) -> &'a mut W { - self.variant(PIN2_A::PWM0_2) + pub fn pwm0_2(self) -> &'a mut crate::W { + self.variant(Pin2::Pwm0_2) } } -#[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN3_A { +pub enum Pin3 { #[doc = "0: `0`"] - QSPI1_SD0 = 0, + Qspi1Sd0 = 0, #[doc = "1: `1`"] - PWM0_3 = 1, + Pwm0_3 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN3_A) -> Self { + fn from(variant: Pin3) -> Self { variant as u8 != 0 } } -impl PIN3_R { +#[doc = "Field `pin3` reader - "] +pub type Pin3R = crate::BitReader; +impl Pin3R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN3_A { + pub const fn variant(&self) -> Pin3 { match self.bits { - false => PIN3_A::QSPI1_SD0, - true => PIN3_A::PWM0_3, + false => Pin3::Qspi1Sd0, + true => Pin3::Pwm0_3, } } - #[doc = "Checks if the value of the field is `QSPI1_SD0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi1_sd0(&self) -> bool { - *self == PIN3_A::QSPI1_SD0 + *self == Pin3::Qspi1Sd0 } - #[doc = "Checks if the value of the field is `PWM0_3`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm0_3(&self) -> bool { - *self == PIN3_A::PWM0_3 + *self == Pin3::Pwm0_3 } } #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN3_A, O>; -impl<'a, const O: u8> PIN3_W<'a, O> { +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG, Pin3>; +impl<'a, REG> Pin3W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi1_sd0(self) -> &'a mut W { - self.variant(PIN3_A::QSPI1_SD0) + pub fn qspi1_sd0(self) -> &'a mut crate::W { + self.variant(Pin3::Qspi1Sd0) } #[doc = "`1`"] #[inline(always)] - pub fn pwm0_3(self) -> &'a mut W { - self.variant(PIN3_A::PWM0_3) + pub fn pwm0_3(self) -> &'a mut crate::W { + self.variant(Pin3::Pwm0_3) } } -#[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN4_A { +pub enum Pin4 { #[doc = "0: `0`"] - QSPI1_SD1 = 0, + Qspi1Sd1 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN4_A) -> Self { + fn from(variant: Pin4) -> Self { variant as u8 != 0 } } -impl PIN4_R { +#[doc = "Field `pin4` reader - "] +pub type Pin4R = crate::BitReader; +impl Pin4R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN4_A { + pub const fn variant(&self) -> Pin4 { match self.bits { - false => PIN4_A::QSPI1_SD1, - true => PIN4_A::IOF1, + false => Pin4::Qspi1Sd1, + true => Pin4::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI1_SD1`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi1_sd1(&self) -> bool { - *self == PIN4_A::QSPI1_SD1 + *self == Pin4::Qspi1Sd1 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN4_A::IOF1 + *self == Pin4::Iof1 } } #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN4_A, O>; -impl<'a, const O: u8> PIN4_W<'a, O> { +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG, Pin4>; +impl<'a, REG> Pin4W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi1_sd1(self) -> &'a mut W { - self.variant(PIN4_A::QSPI1_SD1) + pub fn qspi1_sd1(self) -> &'a mut crate::W { + self.variant(Pin4::Qspi1Sd1) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN4_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin4::Iof1) } } -#[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN5_A { +pub enum Pin5 { #[doc = "0: `0`"] - QSPI1_SCK = 0, + Qspi1Sck = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN5_A) -> Self { + fn from(variant: Pin5) -> Self { variant as u8 != 0 } } -impl PIN5_R { +#[doc = "Field `pin5` reader - "] +pub type Pin5R = crate::BitReader; +impl Pin5R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN5_A { + pub const fn variant(&self) -> Pin5 { match self.bits { - false => PIN5_A::QSPI1_SCK, - true => PIN5_A::IOF1, + false => Pin5::Qspi1Sck, + true => Pin5::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI1_SCK`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi1_sck(&self) -> bool { - *self == PIN5_A::QSPI1_SCK + *self == Pin5::Qspi1Sck } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN5_A::IOF1 + *self == Pin5::Iof1 } } #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN5_A, O>; -impl<'a, const O: u8> PIN5_W<'a, O> { +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG, Pin5>; +impl<'a, REG> Pin5W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi1_sck(self) -> &'a mut W { - self.variant(PIN5_A::QSPI1_SCK) + pub fn qspi1_sck(self) -> &'a mut crate::W { + self.variant(Pin5::Qspi1Sck) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN5_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin5::Iof1) } } -#[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN6_A { +pub enum Pin6 { #[doc = "0: `0`"] - QSPI1_SD2 = 0, + Qspi1Sd2 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN6_A) -> Self { + fn from(variant: Pin6) -> Self { variant as u8 != 0 } } -impl PIN6_R { +#[doc = "Field `pin6` reader - "] +pub type Pin6R = crate::BitReader; +impl Pin6R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN6_A { + pub const fn variant(&self) -> Pin6 { match self.bits { - false => PIN6_A::QSPI1_SD2, - true => PIN6_A::IOF1, + false => Pin6::Qspi1Sd2, + true => Pin6::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI1_SD2`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi1_sd2(&self) -> bool { - *self == PIN6_A::QSPI1_SD2 + *self == Pin6::Qspi1Sd2 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN6_A::IOF1 + *self == Pin6::Iof1 } } #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN6_A, O>; -impl<'a, const O: u8> PIN6_W<'a, O> { +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG, Pin6>; +impl<'a, REG> Pin6W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi1_sd2(self) -> &'a mut W { - self.variant(PIN6_A::QSPI1_SD2) + pub fn qspi1_sd2(self) -> &'a mut crate::W { + self.variant(Pin6::Qspi1Sd2) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN6_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin6::Iof1) } } -#[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN7_A { +pub enum Pin7 { #[doc = "0: `0`"] - QSPI1_SD3 = 0, + Qspi1Sd3 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN7_A) -> Self { + fn from(variant: Pin7) -> Self { variant as u8 != 0 } } -impl PIN7_R { +#[doc = "Field `pin7` reader - "] +pub type Pin7R = crate::BitReader; +impl Pin7R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN7_A { + pub const fn variant(&self) -> Pin7 { match self.bits { - false => PIN7_A::QSPI1_SD3, - true => PIN7_A::IOF1, + false => Pin7::Qspi1Sd3, + true => Pin7::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI1_SD3`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi1_sd3(&self) -> bool { - *self == PIN7_A::QSPI1_SD3 + *self == Pin7::Qspi1Sd3 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN7_A::IOF1 + *self == Pin7::Iof1 } } #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN7_A, O>; -impl<'a, const O: u8> PIN7_W<'a, O> { +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG, Pin7>; +impl<'a, REG> Pin7W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi1_sd3(self) -> &'a mut W { - self.variant(PIN7_A::QSPI1_SD3) + pub fn qspi1_sd3(self) -> &'a mut crate::W { + self.variant(Pin7::Qspi1Sd3) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN7_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin7::Iof1) } } -#[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN8_A { +pub enum Pin8 { #[doc = "0: `0`"] - QSPI1_SS1 = 0, + Qspi1Ss1 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN8_A) -> Self { + fn from(variant: Pin8) -> Self { variant as u8 != 0 } } -impl PIN8_R { +#[doc = "Field `pin8` reader - "] +pub type Pin8R = crate::BitReader; +impl Pin8R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN8_A { + pub const fn variant(&self) -> Pin8 { match self.bits { - false => PIN8_A::QSPI1_SS1, - true => PIN8_A::IOF1, + false => Pin8::Qspi1Ss1, + true => Pin8::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI1_SS1`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi1_ss1(&self) -> bool { - *self == PIN8_A::QSPI1_SS1 + *self == Pin8::Qspi1Ss1 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN8_A::IOF1 + *self == Pin8::Iof1 } } #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN8_A, O>; -impl<'a, const O: u8> PIN8_W<'a, O> { +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG, Pin8>; +impl<'a, REG> Pin8W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi1_ss1(self) -> &'a mut W { - self.variant(PIN8_A::QSPI1_SS1) + pub fn qspi1_ss1(self) -> &'a mut crate::W { + self.variant(Pin8::Qspi1Ss1) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN8_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin8::Iof1) } } -#[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN9_A { +pub enum Pin9 { #[doc = "0: `0`"] - QSPI1_SS2 = 0, + Qspi1Ss2 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN9_A) -> Self { + fn from(variant: Pin9) -> Self { variant as u8 != 0 } } -impl PIN9_R { +#[doc = "Field `pin9` reader - "] +pub type Pin9R = crate::BitReader; +impl Pin9R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN9_A { + pub const fn variant(&self) -> Pin9 { match self.bits { - false => PIN9_A::QSPI1_SS2, - true => PIN9_A::IOF1, + false => Pin9::Qspi1Ss2, + true => Pin9::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI1_SS2`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi1_ss2(&self) -> bool { - *self == PIN9_A::QSPI1_SS2 + *self == Pin9::Qspi1Ss2 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN9_A::IOF1 + *self == Pin9::Iof1 } } #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN9_A, O>; -impl<'a, const O: u8> PIN9_W<'a, O> { +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG, Pin9>; +impl<'a, REG> Pin9W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi1_ss2(self) -> &'a mut W { - self.variant(PIN9_A::QSPI1_SS2) + pub fn qspi1_ss2(self) -> &'a mut crate::W { + self.variant(Pin9::Qspi1Ss2) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN9_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin9::Iof1) } } -#[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN10_A { +pub enum Pin10 { #[doc = "0: `0`"] - QSPI1_SS3 = 0, + Qspi1Ss3 = 0, #[doc = "1: `1`"] - PWM2_0 = 1, + Pwm2_0 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN10_A) -> Self { + fn from(variant: Pin10) -> Self { variant as u8 != 0 } } -impl PIN10_R { +#[doc = "Field `pin10` reader - "] +pub type Pin10R = crate::BitReader; +impl Pin10R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN10_A { + pub const fn variant(&self) -> Pin10 { match self.bits { - false => PIN10_A::QSPI1_SS3, - true => PIN10_A::PWM2_0, + false => Pin10::Qspi1Ss3, + true => Pin10::Pwm2_0, } } - #[doc = "Checks if the value of the field is `QSPI1_SS3`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi1_ss3(&self) -> bool { - *self == PIN10_A::QSPI1_SS3 + *self == Pin10::Qspi1Ss3 } - #[doc = "Checks if the value of the field is `PWM2_0`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm2_0(&self) -> bool { - *self == PIN10_A::PWM2_0 + *self == Pin10::Pwm2_0 } } #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN10_A, O>; -impl<'a, const O: u8> PIN10_W<'a, O> { +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG, Pin10>; +impl<'a, REG> Pin10W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi1_ss3(self) -> &'a mut W { - self.variant(PIN10_A::QSPI1_SS3) + pub fn qspi1_ss3(self) -> &'a mut crate::W { + self.variant(Pin10::Qspi1Ss3) } #[doc = "`1`"] #[inline(always)] - pub fn pwm2_0(self) -> &'a mut W { - self.variant(PIN10_A::PWM2_0) + pub fn pwm2_0(self) -> &'a mut crate::W { + self.variant(Pin10::Pwm2_0) } } -#[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN11_A { +pub enum Pin11 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - PWM2_1 = 1, + Pwm2_1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN11_A) -> Self { + fn from(variant: Pin11) -> Self { variant as u8 != 0 } } -impl PIN11_R { +#[doc = "Field `pin11` reader - "] +pub type Pin11R = crate::BitReader; +impl Pin11R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN11_A { + pub const fn variant(&self) -> Pin11 { match self.bits { - false => PIN11_A::IOF0, - true => PIN11_A::PWM2_1, + false => Pin11::Iof0, + true => Pin11::Pwm2_1, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN11_A::IOF0 + *self == Pin11::Iof0 } - #[doc = "Checks if the value of the field is `PWM2_1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm2_1(&self) -> bool { - *self == PIN11_A::PWM2_1 + *self == Pin11::Pwm2_1 } } #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN11_A, O>; -impl<'a, const O: u8> PIN11_W<'a, O> { +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG, Pin11>; +impl<'a, REG> Pin11W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN11_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin11::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn pwm2_1(self) -> &'a mut W { - self.variant(PIN11_A::PWM2_1) + pub fn pwm2_1(self) -> &'a mut crate::W { + self.variant(Pin11::Pwm2_1) } } -#[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN12_A { +pub enum Pin12 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - PWM2_2 = 1, + Pwm2_2 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN12_A) -> Self { + fn from(variant: Pin12) -> Self { variant as u8 != 0 } } -impl PIN12_R { +#[doc = "Field `pin12` reader - "] +pub type Pin12R = crate::BitReader; +impl Pin12R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN12_A { + pub const fn variant(&self) -> Pin12 { match self.bits { - false => PIN12_A::IOF0, - true => PIN12_A::PWM2_2, + false => Pin12::Iof0, + true => Pin12::Pwm2_2, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN12_A::IOF0 + *self == Pin12::Iof0 } - #[doc = "Checks if the value of the field is `PWM2_2`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm2_2(&self) -> bool { - *self == PIN12_A::PWM2_2 + *self == Pin12::Pwm2_2 } } #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN12_A, O>; -impl<'a, const O: u8> PIN12_W<'a, O> { +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG, Pin12>; +impl<'a, REG> Pin12W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN12_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin12::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn pwm2_2(self) -> &'a mut W { - self.variant(PIN12_A::PWM2_2) + pub fn pwm2_2(self) -> &'a mut crate::W { + self.variant(Pin12::Pwm2_2) } } -#[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN13_A { +pub enum Pin13 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - PWM2_3 = 1, + Pwm2_3 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN13_A) -> Self { + fn from(variant: Pin13) -> Self { variant as u8 != 0 } } -impl PIN13_R { +#[doc = "Field `pin13` reader - "] +pub type Pin13R = crate::BitReader; +impl Pin13R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN13_A { + pub const fn variant(&self) -> Pin13 { match self.bits { - false => PIN13_A::IOF0, - true => PIN13_A::PWM2_3, + false => Pin13::Iof0, + true => Pin13::Pwm2_3, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN13_A::IOF0 + *self == Pin13::Iof0 } - #[doc = "Checks if the value of the field is `PWM2_3`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm2_3(&self) -> bool { - *self == PIN13_A::PWM2_3 + *self == Pin13::Pwm2_3 } } #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN13_A, O>; -impl<'a, const O: u8> PIN13_W<'a, O> { +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG, Pin13>; +impl<'a, REG> Pin13W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN13_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin13::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn pwm2_3(self) -> &'a mut W { - self.variant(PIN13_A::PWM2_3) + pub fn pwm2_3(self) -> &'a mut crate::W { + self.variant(Pin13::Pwm2_3) } } -#[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN14_A { +pub enum Pin14 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN14_A) -> Self { + fn from(variant: Pin14) -> Self { variant as u8 != 0 } } -impl PIN14_R { +#[doc = "Field `pin14` reader - "] +pub type Pin14R = crate::BitReader; +impl Pin14R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN14_A { + pub const fn variant(&self) -> Pin14 { match self.bits { - false => PIN14_A::IOF0, - true => PIN14_A::IOF1, + false => Pin14::Iof0, + true => Pin14::Iof1, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN14_A::IOF0 + *self == Pin14::Iof0 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN14_A::IOF1 + *self == Pin14::Iof1 } } #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN14_A, O>; -impl<'a, const O: u8> PIN14_W<'a, O> { +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG, Pin14>; +impl<'a, REG> Pin14W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN14_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin14::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN14_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin14::Iof1) } } -#[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN15_A { +pub enum Pin15 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN15_A) -> Self { + fn from(variant: Pin15) -> Self { variant as u8 != 0 } } -impl PIN15_R { +#[doc = "Field `pin15` reader - "] +pub type Pin15R = crate::BitReader; +impl Pin15R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN15_A { + pub const fn variant(&self) -> Pin15 { match self.bits { - false => PIN15_A::IOF0, - true => PIN15_A::IOF1, + false => Pin15::Iof0, + true => Pin15::Iof1, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN15_A::IOF0 + *self == Pin15::Iof0 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN15_A::IOF1 + *self == Pin15::Iof1 } } #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN15_A, O>; -impl<'a, const O: u8> PIN15_W<'a, O> { +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG, Pin15>; +impl<'a, REG> Pin15W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN15_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin15::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN15_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin15::Iof1) } } -#[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN16_A { +pub enum Pin16 { #[doc = "0: `0`"] - UART0_RX = 0, + Uart0Rx = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN16_A) -> Self { + fn from(variant: Pin16) -> Self { variant as u8 != 0 } } -impl PIN16_R { +#[doc = "Field `pin16` reader - "] +pub type Pin16R = crate::BitReader; +impl Pin16R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN16_A { + pub const fn variant(&self) -> Pin16 { match self.bits { - false => PIN16_A::UART0_RX, - true => PIN16_A::IOF1, + false => Pin16::Uart0Rx, + true => Pin16::Iof1, } } - #[doc = "Checks if the value of the field is `UART0_RX`"] + #[doc = "`0`"] #[inline(always)] pub fn is_uart0_rx(&self) -> bool { - *self == PIN16_A::UART0_RX + *self == Pin16::Uart0Rx } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN16_A::IOF1 + *self == Pin16::Iof1 } } #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN16_A, O>; -impl<'a, const O: u8> PIN16_W<'a, O> { +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG, Pin16>; +impl<'a, REG> Pin16W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn uart0_rx(self) -> &'a mut W { - self.variant(PIN16_A::UART0_RX) + pub fn uart0_rx(self) -> &'a mut crate::W { + self.variant(Pin16::Uart0Rx) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN16_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin16::Iof1) } } -#[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN17_A { +pub enum Pin17 { #[doc = "0: `0`"] - UART0_TX = 0, + Uart0Tx = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN17_A) -> Self { + fn from(variant: Pin17) -> Self { variant as u8 != 0 } } -impl PIN17_R { +#[doc = "Field `pin17` reader - "] +pub type Pin17R = crate::BitReader; +impl Pin17R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN17_A { + pub const fn variant(&self) -> Pin17 { match self.bits { - false => PIN17_A::UART0_TX, - true => PIN17_A::IOF1, + false => Pin17::Uart0Tx, + true => Pin17::Iof1, } } - #[doc = "Checks if the value of the field is `UART0_TX`"] + #[doc = "`0`"] #[inline(always)] pub fn is_uart0_tx(&self) -> bool { - *self == PIN17_A::UART0_TX + *self == Pin17::Uart0Tx } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN17_A::IOF1 + *self == Pin17::Iof1 } } #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN17_A, O>; -impl<'a, const O: u8> PIN17_W<'a, O> { +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG, Pin17>; +impl<'a, REG> Pin17W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn uart0_tx(self) -> &'a mut W { - self.variant(PIN17_A::UART0_TX) + pub fn uart0_tx(self) -> &'a mut crate::W { + self.variant(Pin17::Uart0Tx) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN17_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin17::Iof1) } } -#[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN18_A { +pub enum Pin18 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN18_A) -> Self { + fn from(variant: Pin18) -> Self { variant as u8 != 0 } } -impl PIN18_R { +#[doc = "Field `pin18` reader - "] +pub type Pin18R = crate::BitReader; +impl Pin18R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN18_A { + pub const fn variant(&self) -> Pin18 { match self.bits { - false => PIN18_A::IOF0, - true => PIN18_A::IOF1, + false => Pin18::Iof0, + true => Pin18::Iof1, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN18_A::IOF0 + *self == Pin18::Iof0 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN18_A::IOF1 + *self == Pin18::Iof1 } } #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN18_A, O>; -impl<'a, const O: u8> PIN18_W<'a, O> { +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG, Pin18>; +impl<'a, REG> Pin18W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN18_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin18::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN18_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin18::Iof1) } } -#[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN19_A { +pub enum Pin19 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - PWM1_1 = 1, + Pwm1_1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN19_A) -> Self { + fn from(variant: Pin19) -> Self { variant as u8 != 0 } } -impl PIN19_R { +#[doc = "Field `pin19` reader - "] +pub type Pin19R = crate::BitReader; +impl Pin19R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN19_A { + pub const fn variant(&self) -> Pin19 { match self.bits { - false => PIN19_A::IOF0, - true => PIN19_A::PWM1_1, + false => Pin19::Iof0, + true => Pin19::Pwm1_1, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN19_A::IOF0 + *self == Pin19::Iof0 } - #[doc = "Checks if the value of the field is `PWM1_1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm1_1(&self) -> bool { - *self == PIN19_A::PWM1_1 + *self == Pin19::Pwm1_1 } } #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN19_A, O>; -impl<'a, const O: u8> PIN19_W<'a, O> { +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG, Pin19>; +impl<'a, REG> Pin19W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN19_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin19::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn pwm1_1(self) -> &'a mut W { - self.variant(PIN19_A::PWM1_1) + pub fn pwm1_1(self) -> &'a mut crate::W { + self.variant(Pin19::Pwm1_1) } } -#[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN20_A { +pub enum Pin20 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - PWM1_0 = 1, + Pwm1_0 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN20_A) -> Self { + fn from(variant: Pin20) -> Self { variant as u8 != 0 } } -impl PIN20_R { +#[doc = "Field `pin20` reader - "] +pub type Pin20R = crate::BitReader; +impl Pin20R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN20_A { + pub const fn variant(&self) -> Pin20 { match self.bits { - false => PIN20_A::IOF0, - true => PIN20_A::PWM1_0, + false => Pin20::Iof0, + true => Pin20::Pwm1_0, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN20_A::IOF0 + *self == Pin20::Iof0 } - #[doc = "Checks if the value of the field is `PWM1_0`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm1_0(&self) -> bool { - *self == PIN20_A::PWM1_0 + *self == Pin20::Pwm1_0 } } #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN20_A, O>; -impl<'a, const O: u8> PIN20_W<'a, O> { +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG, Pin20>; +impl<'a, REG> Pin20W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN20_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin20::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn pwm1_0(self) -> &'a mut W { - self.variant(PIN20_A::PWM1_0) + pub fn pwm1_0(self) -> &'a mut crate::W { + self.variant(Pin20::Pwm1_0) } } -#[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN21_A { +pub enum Pin21 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - PWM1_2 = 1, + Pwm1_2 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN21_A) -> Self { + fn from(variant: Pin21) -> Self { variant as u8 != 0 } } -impl PIN21_R { +#[doc = "Field `pin21` reader - "] +pub type Pin21R = crate::BitReader; +impl Pin21R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN21_A { + pub const fn variant(&self) -> Pin21 { match self.bits { - false => PIN21_A::IOF0, - true => PIN21_A::PWM1_2, + false => Pin21::Iof0, + true => Pin21::Pwm1_2, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN21_A::IOF0 + *self == Pin21::Iof0 } - #[doc = "Checks if the value of the field is `PWM1_2`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm1_2(&self) -> bool { - *self == PIN21_A::PWM1_2 + *self == Pin21::Pwm1_2 } } #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN21_A, O>; -impl<'a, const O: u8> PIN21_W<'a, O> { +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG, Pin21>; +impl<'a, REG> Pin21W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN21_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin21::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn pwm1_2(self) -> &'a mut W { - self.variant(PIN21_A::PWM1_2) + pub fn pwm1_2(self) -> &'a mut crate::W { + self.variant(Pin21::Pwm1_2) } } -#[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN22_A { +pub enum Pin22 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - PWM1_3 = 1, + Pwm1_3 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN22_A) -> Self { + fn from(variant: Pin22) -> Self { variant as u8 != 0 } } -impl PIN22_R { +#[doc = "Field `pin22` reader - "] +pub type Pin22R = crate::BitReader; +impl Pin22R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN22_A { + pub const fn variant(&self) -> Pin22 { match self.bits { - false => PIN22_A::IOF0, - true => PIN22_A::PWM1_3, + false => Pin22::Iof0, + true => Pin22::Pwm1_3, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN22_A::IOF0 + *self == Pin22::Iof0 } - #[doc = "Checks if the value of the field is `PWM1_3`"] + #[doc = "`1`"] #[inline(always)] pub fn is_pwm1_3(&self) -> bool { - *self == PIN22_A::PWM1_3 + *self == Pin22::Pwm1_3 } } #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN22_A, O>; -impl<'a, const O: u8> PIN22_W<'a, O> { +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG, Pin22>; +impl<'a, REG> Pin22W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN22_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin22::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn pwm1_3(self) -> &'a mut W { - self.variant(PIN22_A::PWM1_3) + pub fn pwm1_3(self) -> &'a mut crate::W { + self.variant(Pin22::Pwm1_3) } } -#[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN23_A { +pub enum Pin23 { #[doc = "0: `0`"] - IOF0 = 0, + Iof0 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN23_A) -> Self { + fn from(variant: Pin23) -> Self { variant as u8 != 0 } } -impl PIN23_R { +#[doc = "Field `pin23` reader - "] +pub type Pin23R = crate::BitReader; +impl Pin23R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN23_A { + pub const fn variant(&self) -> Pin23 { match self.bits { - false => PIN23_A::IOF0, - true => PIN23_A::IOF1, + false => Pin23::Iof0, + true => Pin23::Iof1, } } - #[doc = "Checks if the value of the field is `IOF0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_iof0(&self) -> bool { - *self == PIN23_A::IOF0 + *self == Pin23::Iof0 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN23_A::IOF1 + *self == Pin23::Iof1 } } #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN23_A, O>; -impl<'a, const O: u8> PIN23_W<'a, O> { +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG, Pin23>; +impl<'a, REG> Pin23W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn iof0(self) -> &'a mut W { - self.variant(PIN23_A::IOF0) + pub fn iof0(self) -> &'a mut crate::W { + self.variant(Pin23::Iof0) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN23_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin23::Iof1) } } -#[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN24_A { +pub enum Pin24 { #[doc = "0: `0`"] - UART1_RX = 0, + Uart1Rx = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN24_A) -> Self { + fn from(variant: Pin24) -> Self { variant as u8 != 0 } } -impl PIN24_R { +#[doc = "Field `pin24` reader - "] +pub type Pin24R = crate::BitReader; +impl Pin24R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN24_A { + pub const fn variant(&self) -> Pin24 { match self.bits { - false => PIN24_A::UART1_RX, - true => PIN24_A::IOF1, + false => Pin24::Uart1Rx, + true => Pin24::Iof1, } } - #[doc = "Checks if the value of the field is `UART1_RX`"] + #[doc = "`0`"] #[inline(always)] pub fn is_uart1_rx(&self) -> bool { - *self == PIN24_A::UART1_RX + *self == Pin24::Uart1Rx } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN24_A::IOF1 + *self == Pin24::Iof1 } } #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN24_A, O>; -impl<'a, const O: u8> PIN24_W<'a, O> { +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG, Pin24>; +impl<'a, REG> Pin24W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn uart1_rx(self) -> &'a mut W { - self.variant(PIN24_A::UART1_RX) + pub fn uart1_rx(self) -> &'a mut crate::W { + self.variant(Pin24::Uart1Rx) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN24_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin24::Iof1) } } -#[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN25_A { +pub enum Pin25 { #[doc = "0: `0`"] - UART1_TX = 0, + Uart1Tx = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN25_A) -> Self { + fn from(variant: Pin25) -> Self { variant as u8 != 0 } } -impl PIN25_R { +#[doc = "Field `pin25` reader - "] +pub type Pin25R = crate::BitReader; +impl Pin25R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN25_A { + pub const fn variant(&self) -> Pin25 { match self.bits { - false => PIN25_A::UART1_TX, - true => PIN25_A::IOF1, + false => Pin25::Uart1Tx, + true => Pin25::Iof1, } } - #[doc = "Checks if the value of the field is `UART1_TX`"] + #[doc = "`0`"] #[inline(always)] pub fn is_uart1_tx(&self) -> bool { - *self == PIN25_A::UART1_TX + *self == Pin25::Uart1Tx } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN25_A::IOF1 + *self == Pin25::Iof1 } } #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN25_A, O>; -impl<'a, const O: u8> PIN25_W<'a, O> { +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG, Pin25>; +impl<'a, REG> Pin25W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn uart1_tx(self) -> &'a mut W { - self.variant(PIN25_A::UART1_TX) + pub fn uart1_tx(self) -> &'a mut crate::W { + self.variant(Pin25::Uart1Tx) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN25_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin25::Iof1) } } -#[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN26_A { +pub enum Pin26 { #[doc = "0: `0`"] - QSPI2_SS = 0, + Qspi2Ss = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN26_A) -> Self { + fn from(variant: Pin26) -> Self { variant as u8 != 0 } } -impl PIN26_R { +#[doc = "Field `pin26` reader - "] +pub type Pin26R = crate::BitReader; +impl Pin26R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN26_A { + pub const fn variant(&self) -> Pin26 { match self.bits { - false => PIN26_A::QSPI2_SS, - true => PIN26_A::IOF1, + false => Pin26::Qspi2Ss, + true => Pin26::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI2_SS`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi2_ss(&self) -> bool { - *self == PIN26_A::QSPI2_SS + *self == Pin26::Qspi2Ss } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN26_A::IOF1 + *self == Pin26::Iof1 } } #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN26_A, O>; -impl<'a, const O: u8> PIN26_W<'a, O> { +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG, Pin26>; +impl<'a, REG> Pin26W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi2_ss(self) -> &'a mut W { - self.variant(PIN26_A::QSPI2_SS) + pub fn qspi2_ss(self) -> &'a mut crate::W { + self.variant(Pin26::Qspi2Ss) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN26_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin26::Iof1) } } -#[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN27_A { +pub enum Pin27 { #[doc = "0: `0`"] - QSPI2_SD0 = 0, + Qspi2Sd0 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN27_A) -> Self { + fn from(variant: Pin27) -> Self { variant as u8 != 0 } } -impl PIN27_R { +#[doc = "Field `pin27` reader - "] +pub type Pin27R = crate::BitReader; +impl Pin27R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN27_A { + pub const fn variant(&self) -> Pin27 { match self.bits { - false => PIN27_A::QSPI2_SD0, - true => PIN27_A::IOF1, + false => Pin27::Qspi2Sd0, + true => Pin27::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI2_SD0`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi2_sd0(&self) -> bool { - *self == PIN27_A::QSPI2_SD0 + *self == Pin27::Qspi2Sd0 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN27_A::IOF1 + *self == Pin27::Iof1 } } #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN27_A, O>; -impl<'a, const O: u8> PIN27_W<'a, O> { +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG, Pin27>; +impl<'a, REG> Pin27W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi2_sd0(self) -> &'a mut W { - self.variant(PIN27_A::QSPI2_SD0) + pub fn qspi2_sd0(self) -> &'a mut crate::W { + self.variant(Pin27::Qspi2Sd0) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN27_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin27::Iof1) } } -#[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN28_A { +pub enum Pin28 { #[doc = "0: `0`"] - QSPI2_SD1 = 0, + Qspi2Sd1 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN28_A) -> Self { + fn from(variant: Pin28) -> Self { variant as u8 != 0 } } -impl PIN28_R { +#[doc = "Field `pin28` reader - "] +pub type Pin28R = crate::BitReader; +impl Pin28R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN28_A { + pub const fn variant(&self) -> Pin28 { match self.bits { - false => PIN28_A::QSPI2_SD1, - true => PIN28_A::IOF1, + false => Pin28::Qspi2Sd1, + true => Pin28::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI2_SD1`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi2_sd1(&self) -> bool { - *self == PIN28_A::QSPI2_SD1 + *self == Pin28::Qspi2Sd1 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN28_A::IOF1 + *self == Pin28::Iof1 } } #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN28_A, O>; -impl<'a, const O: u8> PIN28_W<'a, O> { +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG, Pin28>; +impl<'a, REG> Pin28W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi2_sd1(self) -> &'a mut W { - self.variant(PIN28_A::QSPI2_SD1) + pub fn qspi2_sd1(self) -> &'a mut crate::W { + self.variant(Pin28::Qspi2Sd1) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN28_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin28::Iof1) } } -#[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN29_A { +pub enum Pin29 { #[doc = "0: `0`"] - QSPI2_SCK = 0, + Qspi2Sck = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN29_A) -> Self { + fn from(variant: Pin29) -> Self { variant as u8 != 0 } } -impl PIN29_R { +#[doc = "Field `pin29` reader - "] +pub type Pin29R = crate::BitReader; +impl Pin29R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN29_A { + pub const fn variant(&self) -> Pin29 { match self.bits { - false => PIN29_A::QSPI2_SCK, - true => PIN29_A::IOF1, + false => Pin29::Qspi2Sck, + true => Pin29::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI2_SCK`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi2_sck(&self) -> bool { - *self == PIN29_A::QSPI2_SCK + *self == Pin29::Qspi2Sck } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN29_A::IOF1 + *self == Pin29::Iof1 } } #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN29_A, O>; -impl<'a, const O: u8> PIN29_W<'a, O> { +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG, Pin29>; +impl<'a, REG> Pin29W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi2_sck(self) -> &'a mut W { - self.variant(PIN29_A::QSPI2_SCK) + pub fn qspi2_sck(self) -> &'a mut crate::W { + self.variant(Pin29::Qspi2Sck) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN29_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin29::Iof1) } } -#[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN30_A { +pub enum Pin30 { #[doc = "0: `0`"] - QSPI2_SD2 = 0, + Qspi2Sd2 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN30_A) -> Self { + fn from(variant: Pin30) -> Self { variant as u8 != 0 } } -impl PIN30_R { +#[doc = "Field `pin30` reader - "] +pub type Pin30R = crate::BitReader; +impl Pin30R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN30_A { + pub const fn variant(&self) -> Pin30 { match self.bits { - false => PIN30_A::QSPI2_SD2, - true => PIN30_A::IOF1, + false => Pin30::Qspi2Sd2, + true => Pin30::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI2_SD2`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi2_sd2(&self) -> bool { - *self == PIN30_A::QSPI2_SD2 + *self == Pin30::Qspi2Sd2 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN30_A::IOF1 + *self == Pin30::Iof1 } } #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN30_A, O>; -impl<'a, const O: u8> PIN30_W<'a, O> { +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG, Pin30>; +impl<'a, REG> Pin30W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi2_sd2(self) -> &'a mut W { - self.variant(PIN30_A::QSPI2_SD2) + pub fn qspi2_sd2(self) -> &'a mut crate::W { + self.variant(Pin30::Qspi2Sd2) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN30_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin30::Iof1) } } -#[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum PIN31_A { +pub enum Pin31 { #[doc = "0: `0`"] - QSPI2_SD3 = 0, + Qspi2Sd3 = 0, #[doc = "1: `1`"] - IOF1 = 1, + Iof1 = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: PIN31_A) -> Self { + fn from(variant: Pin31) -> Self { variant as u8 != 0 } } -impl PIN31_R { +#[doc = "Field `pin31` reader - "] +pub type Pin31R = crate::BitReader; +impl Pin31R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PIN31_A { + pub const fn variant(&self) -> Pin31 { match self.bits { - false => PIN31_A::QSPI2_SD3, - true => PIN31_A::IOF1, + false => Pin31::Qspi2Sd3, + true => Pin31::Iof1, } } - #[doc = "Checks if the value of the field is `QSPI2_SD3`"] + #[doc = "`0`"] #[inline(always)] pub fn is_qspi2_sd3(&self) -> bool { - *self == PIN31_A::QSPI2_SD3 + *self == Pin31::Qspi2Sd3 } - #[doc = "Checks if the value of the field is `IOF1`"] + #[doc = "`1`"] #[inline(always)] pub fn is_iof1(&self) -> bool { - *self == PIN31_A::IOF1 + *self == Pin31::Iof1 } } #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, IOF_SEL_SPEC, PIN31_A, O>; -impl<'a, const O: u8> PIN31_W<'a, O> { +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG, Pin31>; +impl<'a, REG> Pin31W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn qspi2_sd3(self) -> &'a mut W { - self.variant(PIN31_A::QSPI2_SD3) + pub fn qspi2_sd3(self) -> &'a mut crate::W { + self.variant(Pin31::Qspi2Sd3) } #[doc = "`1`"] #[inline(always)] - pub fn iof1(self) -> &'a mut W { - self.variant(PIN31_A::IOF1) + pub fn iof1(self) -> &'a mut crate::W { + self.variant(Pin31::Iof1) } } impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "HW I/O Function Select Register\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 [iof_sel](index.html) module"] -pub struct IOF_SEL_SPEC; -impl crate::RegisterSpec for IOF_SEL_SPEC { +#[doc = "HW I/O Function Select Register\n\nYou can [`read`](crate::Reg::read) this register and get [`iof_sel::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`iof_sel::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct IofSelSpec; +impl crate::RegisterSpec for IofSelSpec { type Ux = u32; } -#[doc = "`read()` method returns [iof_sel::R](R) reader structure"] -impl crate::Readable for IOF_SEL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [iof_sel::W](W) writer structure"] -impl crate::Writable for IOF_SEL_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`iof_sel::R`](R) reader structure"] +impl crate::Readable for IofSelSpec {} +#[doc = "`write(|w| ..)` method takes [`iof_sel::W`](W) writer structure"] +impl crate::Writable for IofSelSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets iof_sel to value 0"] -impl crate::Resettable for IOF_SEL_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for IofSelSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/low_ie.rs b/src/gpio0/low_ie.rs index 7bda513..b696aea 100644 --- a/src/gpio0/low_ie.rs +++ b/src/gpio0/low_ie.rs @@ -1,514 +1,505 @@ #[doc = "Register `low_ie` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `low_ie` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IE_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Low Interrupt Enable Register\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 [low_ie](index.html) module"] -pub struct LOW_IE_SPEC; -impl crate::RegisterSpec for LOW_IE_SPEC { +#[doc = "Low Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`low_ie::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`low_ie::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct LowIeSpec; +impl crate::RegisterSpec for LowIeSpec { type Ux = u32; } -#[doc = "`read()` method returns [low_ie::R](R) reader structure"] -impl crate::Readable for LOW_IE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [low_ie::W](W) writer structure"] -impl crate::Writable for LOW_IE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`low_ie::R`](R) reader structure"] +impl crate::Readable for LowIeSpec {} +#[doc = "`write(|w| ..)` method takes [`low_ie::W`](W) writer structure"] +impl crate::Writable for LowIeSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets low_ie to value 0"] -impl crate::Resettable for LOW_IE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for LowIeSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/low_ip.rs b/src/gpio0/low_ip.rs index 9e5e2ce..f9660d4 100644 --- a/src/gpio0/low_ip.rs +++ b/src/gpio0/low_ip.rs @@ -1,514 +1,505 @@ #[doc = "Register `low_ip` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `low_ip` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, LOW_IP_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Low Interrupt Pending Register\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 [low_ip](index.html) module"] -pub struct LOW_IP_SPEC; -impl crate::RegisterSpec for LOW_IP_SPEC { +#[doc = "Low Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`low_ip::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`low_ip::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct LowIpSpec; +impl crate::RegisterSpec for LowIpSpec { type Ux = u32; } -#[doc = "`read()` method returns [low_ip::R](R) reader structure"] -impl crate::Readable for LOW_IP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [low_ip::W](W) writer structure"] -impl crate::Writable for LOW_IP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`low_ip::R`](R) reader structure"] +impl crate::Readable for LowIpSpec {} +#[doc = "`write(|w| ..)` method takes [`low_ip::W`](W) writer structure"] +impl crate::Writable for LowIpSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets low_ip to value 0"] -impl crate::Resettable for LOW_IP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for LowIpSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/out_xor.rs b/src/gpio0/out_xor.rs index daf7a68..dde20db 100644 --- a/src/gpio0/out_xor.rs +++ b/src/gpio0/out_xor.rs @@ -1,514 +1,505 @@ #[doc = "Register `out_xor` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `out_xor` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_XOR_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Output XOR (invert) Register\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 [out_xor](index.html) module"] -pub struct OUT_XOR_SPEC; -impl crate::RegisterSpec for OUT_XOR_SPEC { +#[doc = "Output XOR (invert) Register\n\nYou can [`read`](crate::Reg::read) this register and get [`out_xor::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`out_xor::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct OutXorSpec; +impl crate::RegisterSpec for OutXorSpec { type Ux = u32; } -#[doc = "`read()` method returns [out_xor::R](R) reader structure"] -impl crate::Readable for OUT_XOR_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [out_xor::W](W) writer structure"] -impl crate::Writable for OUT_XOR_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`out_xor::R`](R) reader structure"] +impl crate::Readable for OutXorSpec {} +#[doc = "`write(|w| ..)` method takes [`out_xor::W`](W) writer structure"] +impl crate::Writable for OutXorSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets out_xor to value 0"] -impl crate::Resettable for OUT_XOR_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for OutXorSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/output_en.rs b/src/gpio0/output_en.rs index 4bbe546..3e56491 100644 --- a/src/gpio0/output_en.rs +++ b/src/gpio0/output_en.rs @@ -1,514 +1,505 @@ #[doc = "Register `output_en` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `output_en` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_EN_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Pin Output Enable Register\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 [output_en](index.html) module"] -pub struct OUTPUT_EN_SPEC; -impl crate::RegisterSpec for OUTPUT_EN_SPEC { +#[doc = "Pin Output Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`output_en::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`output_en::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct OutputEnSpec; +impl crate::RegisterSpec for OutputEnSpec { type Ux = u32; } -#[doc = "`read()` method returns [output_en::R](R) reader structure"] -impl crate::Readable for OUTPUT_EN_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [output_en::W](W) writer structure"] -impl crate::Writable for OUTPUT_EN_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`output_en::R`](R) reader structure"] +impl crate::Readable for OutputEnSpec {} +#[doc = "`write(|w| ..)` method takes [`output_en::W`](W) writer structure"] +impl crate::Writable for OutputEnSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets output_en to value 0"] -impl crate::Resettable for OUTPUT_EN_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for OutputEnSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/output_val.rs b/src/gpio0/output_val.rs index 65ea85b..876de01 100644 --- a/src/gpio0/output_val.rs +++ b/src/gpio0/output_val.rs @@ -1,514 +1,505 @@ #[doc = "Register `output_val` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `output_val` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUTPUT_VAL_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Output Port Value Register\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 [output_val](index.html) module"] -pub struct OUTPUT_VAL_SPEC; -impl crate::RegisterSpec for OUTPUT_VAL_SPEC { +#[doc = "Output Port Value Register\n\nYou can [`read`](crate::Reg::read) this register and get [`output_val::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`output_val::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct OutputValSpec; +impl crate::RegisterSpec for OutputValSpec { type Ux = u32; } -#[doc = "`read()` method returns [output_val::R](R) reader structure"] -impl crate::Readable for OUTPUT_VAL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [output_val::W](W) writer structure"] -impl crate::Writable for OUTPUT_VAL_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`output_val::R`](R) reader structure"] +impl crate::Readable for OutputValSpec {} +#[doc = "`write(|w| ..)` method takes [`output_val::W`](W) writer structure"] +impl crate::Writable for OutputValSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets output_val to value 0"] -impl crate::Resettable for OUTPUT_VAL_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for OutputValSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/pullup.rs b/src/gpio0/pullup.rs index a4ac1bd..c3ef136 100644 --- a/src/gpio0/pullup.rs +++ b/src/gpio0/pullup.rs @@ -1,514 +1,505 @@ #[doc = "Register `pullup` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `pullup` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, PULLUP_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Internal Pull-Up Enable Register\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 [pullup](index.html) module"] -pub struct PULLUP_SPEC; -impl crate::RegisterSpec for PULLUP_SPEC { +#[doc = "Internal Pull-Up Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pullup::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pullup::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PullupSpec; +impl crate::RegisterSpec for PullupSpec { type Ux = u32; } -#[doc = "`read()` method returns [pullup::R](R) reader structure"] -impl crate::Readable for PULLUP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [pullup::W](W) writer structure"] -impl crate::Writable for PULLUP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`pullup::R`](R) reader structure"] +impl crate::Readable for PullupSpec {} +#[doc = "`write(|w| ..)` method takes [`pullup::W`](W) writer structure"] +impl crate::Writable for PullupSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets pullup to value 0"] -impl crate::Resettable for PULLUP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PullupSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/rise_ie.rs b/src/gpio0/rise_ie.rs index ca25f11..c3d628b 100644 --- a/src/gpio0/rise_ie.rs +++ b/src/gpio0/rise_ie.rs @@ -1,514 +1,505 @@ #[doc = "Register `rise_ie` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rise_ie` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IE_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Rise Interrupt Enable Register\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 [rise_ie](index.html) module"] -pub struct RISE_IE_SPEC; -impl crate::RegisterSpec for RISE_IE_SPEC { +#[doc = "Rise Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rise_ie::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rise_ie::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RiseIeSpec; +impl crate::RegisterSpec for RiseIeSpec { type Ux = u32; } -#[doc = "`read()` method returns [rise_ie::R](R) reader structure"] -impl crate::Readable for RISE_IE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rise_ie::W](W) writer structure"] -impl crate::Writable for RISE_IE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rise_ie::R`](R) reader structure"] +impl crate::Readable for RiseIeSpec {} +#[doc = "`write(|w| ..)` method takes [`rise_ie::W`](W) writer structure"] +impl crate::Writable for RiseIeSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rise_ie to value 0"] -impl crate::Resettable for RISE_IE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RiseIeSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/gpio0/rise_ip.rs b/src/gpio0/rise_ip.rs index b0fdabd..1d70a1f 100644 --- a/src/gpio0/rise_ip.rs +++ b/src/gpio0/rise_ip.rs @@ -1,514 +1,505 @@ #[doc = "Register `rise_ip` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rise_ip` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pin0` reader - "] -pub type PIN0_R = crate::BitReader; +pub type Pin0R = crate::BitReader; #[doc = "Field `pin0` writer - "] -pub type PIN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin0W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin1` reader - "] -pub type PIN1_R = crate::BitReader; +pub type Pin1R = crate::BitReader; #[doc = "Field `pin1` writer - "] -pub type PIN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin1W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin2` reader - "] -pub type PIN2_R = crate::BitReader; +pub type Pin2R = crate::BitReader; #[doc = "Field `pin2` writer - "] -pub type PIN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin2W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin3` reader - "] -pub type PIN3_R = crate::BitReader; +pub type Pin3R = crate::BitReader; #[doc = "Field `pin3` writer - "] -pub type PIN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin3W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin4` reader - "] -pub type PIN4_R = crate::BitReader; +pub type Pin4R = crate::BitReader; #[doc = "Field `pin4` writer - "] -pub type PIN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin4W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin5` reader - "] -pub type PIN5_R = crate::BitReader; +pub type Pin5R = crate::BitReader; #[doc = "Field `pin5` writer - "] -pub type PIN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin5W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin6` reader - "] -pub type PIN6_R = crate::BitReader; +pub type Pin6R = crate::BitReader; #[doc = "Field `pin6` writer - "] -pub type PIN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin6W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin7` reader - "] -pub type PIN7_R = crate::BitReader; +pub type Pin7R = crate::BitReader; #[doc = "Field `pin7` writer - "] -pub type PIN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin7W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin8` reader - "] -pub type PIN8_R = crate::BitReader; +pub type Pin8R = crate::BitReader; #[doc = "Field `pin8` writer - "] -pub type PIN8_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin8W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin9` reader - "] -pub type PIN9_R = crate::BitReader; +pub type Pin9R = crate::BitReader; #[doc = "Field `pin9` writer - "] -pub type PIN9_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin9W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin10` reader - "] -pub type PIN10_R = crate::BitReader; +pub type Pin10R = crate::BitReader; #[doc = "Field `pin10` writer - "] -pub type PIN10_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin10W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin11` reader - "] -pub type PIN11_R = crate::BitReader; +pub type Pin11R = crate::BitReader; #[doc = "Field `pin11` writer - "] -pub type PIN11_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin11W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin12` reader - "] -pub type PIN12_R = crate::BitReader; +pub type Pin12R = crate::BitReader; #[doc = "Field `pin12` writer - "] -pub type PIN12_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin12W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin13` reader - "] -pub type PIN13_R = crate::BitReader; +pub type Pin13R = crate::BitReader; #[doc = "Field `pin13` writer - "] -pub type PIN13_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin13W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin14` reader - "] -pub type PIN14_R = crate::BitReader; +pub type Pin14R = crate::BitReader; #[doc = "Field `pin14` writer - "] -pub type PIN14_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin14W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin15` reader - "] -pub type PIN15_R = crate::BitReader; +pub type Pin15R = crate::BitReader; #[doc = "Field `pin15` writer - "] -pub type PIN15_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin15W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin16` reader - "] -pub type PIN16_R = crate::BitReader; +pub type Pin16R = crate::BitReader; #[doc = "Field `pin16` writer - "] -pub type PIN16_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin16W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin17` reader - "] -pub type PIN17_R = crate::BitReader; +pub type Pin17R = crate::BitReader; #[doc = "Field `pin17` writer - "] -pub type PIN17_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin17W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin18` reader - "] -pub type PIN18_R = crate::BitReader; +pub type Pin18R = crate::BitReader; #[doc = "Field `pin18` writer - "] -pub type PIN18_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin18W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin19` reader - "] -pub type PIN19_R = crate::BitReader; +pub type Pin19R = crate::BitReader; #[doc = "Field `pin19` writer - "] -pub type PIN19_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin19W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin20` reader - "] -pub type PIN20_R = crate::BitReader; +pub type Pin20R = crate::BitReader; #[doc = "Field `pin20` writer - "] -pub type PIN20_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin20W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin21` reader - "] -pub type PIN21_R = crate::BitReader; +pub type Pin21R = crate::BitReader; #[doc = "Field `pin21` writer - "] -pub type PIN21_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin21W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin22` reader - "] -pub type PIN22_R = crate::BitReader; +pub type Pin22R = crate::BitReader; #[doc = "Field `pin22` writer - "] -pub type PIN22_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin22W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin23` reader - "] -pub type PIN23_R = crate::BitReader; +pub type Pin23R = crate::BitReader; #[doc = "Field `pin23` writer - "] -pub type PIN23_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin23W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin24` reader - "] -pub type PIN24_R = crate::BitReader; +pub type Pin24R = crate::BitReader; #[doc = "Field `pin24` writer - "] -pub type PIN24_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin24W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin25` reader - "] -pub type PIN25_R = crate::BitReader; +pub type Pin25R = crate::BitReader; #[doc = "Field `pin25` writer - "] -pub type PIN25_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin25W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin26` reader - "] -pub type PIN26_R = crate::BitReader; +pub type Pin26R = crate::BitReader; #[doc = "Field `pin26` writer - "] -pub type PIN26_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin26W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin27` reader - "] -pub type PIN27_R = crate::BitReader; +pub type Pin27R = crate::BitReader; #[doc = "Field `pin27` writer - "] -pub type PIN27_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin27W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin28` reader - "] -pub type PIN28_R = crate::BitReader; +pub type Pin28R = crate::BitReader; #[doc = "Field `pin28` writer - "] -pub type PIN28_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin28W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin29` reader - "] -pub type PIN29_R = crate::BitReader; +pub type Pin29R = crate::BitReader; #[doc = "Field `pin29` writer - "] -pub type PIN29_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin29W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin30` reader - "] -pub type PIN30_R = crate::BitReader; +pub type Pin30R = crate::BitReader; #[doc = "Field `pin30` writer - "] -pub type PIN30_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin30W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pin31` reader - "] -pub type PIN31_R = crate::BitReader; +pub type Pin31R = crate::BitReader; #[doc = "Field `pin31` writer - "] -pub type PIN31_W<'a, const O: u8> = crate::BitWriter<'a, u32, RISE_IP_SPEC, bool, O>; +pub type Pin31W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&self) -> PIN0_R { - PIN0_R::new((self.bits & 1) != 0) + pub fn pin0(&self) -> Pin0R { + Pin0R::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&self) -> PIN1_R { - PIN1_R::new(((self.bits >> 1) & 1) != 0) + pub fn pin1(&self) -> Pin1R { + Pin1R::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&self) -> PIN2_R { - PIN2_R::new(((self.bits >> 2) & 1) != 0) + pub fn pin2(&self) -> Pin2R { + Pin2R::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&self) -> PIN3_R { - PIN3_R::new(((self.bits >> 3) & 1) != 0) + pub fn pin3(&self) -> Pin3R { + Pin3R::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&self) -> PIN4_R { - PIN4_R::new(((self.bits >> 4) & 1) != 0) + pub fn pin4(&self) -> Pin4R { + Pin4R::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&self) -> PIN5_R { - PIN5_R::new(((self.bits >> 5) & 1) != 0) + pub fn pin5(&self) -> Pin5R { + Pin5R::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&self) -> PIN6_R { - PIN6_R::new(((self.bits >> 6) & 1) != 0) + pub fn pin6(&self) -> Pin6R { + Pin6R::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&self) -> PIN7_R { - PIN7_R::new(((self.bits >> 7) & 1) != 0) + pub fn pin7(&self) -> Pin7R { + Pin7R::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&self) -> PIN8_R { - PIN8_R::new(((self.bits >> 8) & 1) != 0) + pub fn pin8(&self) -> Pin8R { + Pin8R::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&self) -> PIN9_R { - PIN9_R::new(((self.bits >> 9) & 1) != 0) + pub fn pin9(&self) -> Pin9R { + Pin9R::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&self) -> PIN10_R { - PIN10_R::new(((self.bits >> 10) & 1) != 0) + pub fn pin10(&self) -> Pin10R { + Pin10R::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&self) -> PIN11_R { - PIN11_R::new(((self.bits >> 11) & 1) != 0) + pub fn pin11(&self) -> Pin11R { + Pin11R::new(((self.bits >> 11) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&self) -> PIN12_R { - PIN12_R::new(((self.bits >> 12) & 1) != 0) + pub fn pin12(&self) -> Pin12R { + Pin12R::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&self) -> PIN13_R { - PIN13_R::new(((self.bits >> 13) & 1) != 0) + pub fn pin13(&self) -> Pin13R { + Pin13R::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&self) -> PIN14_R { - PIN14_R::new(((self.bits >> 14) & 1) != 0) + pub fn pin14(&self) -> Pin14R { + Pin14R::new(((self.bits >> 14) & 1) != 0) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&self) -> PIN15_R { - PIN15_R::new(((self.bits >> 15) & 1) != 0) + pub fn pin15(&self) -> Pin15R { + Pin15R::new(((self.bits >> 15) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&self) -> PIN16_R { - PIN16_R::new(((self.bits >> 16) & 1) != 0) + pub fn pin16(&self) -> Pin16R { + Pin16R::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&self) -> PIN17_R { - PIN17_R::new(((self.bits >> 17) & 1) != 0) + pub fn pin17(&self) -> Pin17R { + Pin17R::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&self) -> PIN18_R { - PIN18_R::new(((self.bits >> 18) & 1) != 0) + pub fn pin18(&self) -> Pin18R { + Pin18R::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&self) -> PIN19_R { - PIN19_R::new(((self.bits >> 19) & 1) != 0) + pub fn pin19(&self) -> Pin19R { + Pin19R::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&self) -> PIN20_R { - PIN20_R::new(((self.bits >> 20) & 1) != 0) + pub fn pin20(&self) -> Pin20R { + Pin20R::new(((self.bits >> 20) & 1) != 0) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&self) -> PIN21_R { - PIN21_R::new(((self.bits >> 21) & 1) != 0) + pub fn pin21(&self) -> Pin21R { + Pin21R::new(((self.bits >> 21) & 1) != 0) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&self) -> PIN22_R { - PIN22_R::new(((self.bits >> 22) & 1) != 0) + pub fn pin22(&self) -> Pin22R { + Pin22R::new(((self.bits >> 22) & 1) != 0) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&self) -> PIN23_R { - PIN23_R::new(((self.bits >> 23) & 1) != 0) + pub fn pin23(&self) -> Pin23R { + Pin23R::new(((self.bits >> 23) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&self) -> PIN24_R { - PIN24_R::new(((self.bits >> 24) & 1) != 0) + pub fn pin24(&self) -> Pin24R { + Pin24R::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&self) -> PIN25_R { - PIN25_R::new(((self.bits >> 25) & 1) != 0) + pub fn pin25(&self) -> Pin25R { + Pin25R::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&self) -> PIN26_R { - PIN26_R::new(((self.bits >> 26) & 1) != 0) + pub fn pin26(&self) -> Pin26R { + Pin26R::new(((self.bits >> 26) & 1) != 0) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&self) -> PIN27_R { - PIN27_R::new(((self.bits >> 27) & 1) != 0) + pub fn pin27(&self) -> Pin27R { + Pin27R::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&self) -> PIN28_R { - PIN28_R::new(((self.bits >> 28) & 1) != 0) + pub fn pin28(&self) -> Pin28R { + Pin28R::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&self) -> PIN29_R { - PIN29_R::new(((self.bits >> 29) & 1) != 0) + pub fn pin29(&self) -> Pin29R { + Pin29R::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&self) -> PIN30_R { - PIN30_R::new(((self.bits >> 30) & 1) != 0) + pub fn pin30(&self) -> Pin30R { + Pin30R::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&self) -> PIN31_R { - PIN31_R::new(((self.bits >> 31) & 1) != 0) + pub fn pin31(&self) -> Pin31R { + Pin31R::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn pin0(&mut self) -> PIN0_W<0> { - PIN0_W::new(self) + #[must_use] + pub fn pin0(&mut self) -> Pin0W { + Pin0W::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn pin1(&mut self) -> PIN1_W<1> { - PIN1_W::new(self) + #[must_use] + pub fn pin1(&mut self) -> Pin1W { + Pin1W::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn pin2(&mut self) -> PIN2_W<2> { - PIN2_W::new(self) + #[must_use] + pub fn pin2(&mut self) -> Pin2W { + Pin2W::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn pin3(&mut self) -> PIN3_W<3> { - PIN3_W::new(self) + #[must_use] + pub fn pin3(&mut self) -> Pin3W { + Pin3W::new(self, 3) } #[doc = "Bit 4"] #[inline(always)] - pub fn pin4(&mut self) -> PIN4_W<4> { - PIN4_W::new(self) + #[must_use] + pub fn pin4(&mut self) -> Pin4W { + Pin4W::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pin5(&mut self) -> PIN5_W<5> { - PIN5_W::new(self) + #[must_use] + pub fn pin5(&mut self) -> Pin5W { + Pin5W::new(self, 5) } #[doc = "Bit 6"] #[inline(always)] - pub fn pin6(&mut self) -> PIN6_W<6> { - PIN6_W::new(self) + #[must_use] + pub fn pin6(&mut self) -> Pin6W { + Pin6W::new(self, 6) } #[doc = "Bit 7"] #[inline(always)] - pub fn pin7(&mut self) -> PIN7_W<7> { - PIN7_W::new(self) + #[must_use] + pub fn pin7(&mut self) -> Pin7W { + Pin7W::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn pin8(&mut self) -> PIN8_W<8> { - PIN8_W::new(self) + #[must_use] + pub fn pin8(&mut self) -> Pin8W { + Pin8W::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn pin9(&mut self) -> PIN9_W<9> { - PIN9_W::new(self) + #[must_use] + pub fn pin9(&mut self) -> Pin9W { + Pin9W::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn pin10(&mut self) -> PIN10_W<10> { - PIN10_W::new(self) + #[must_use] + pub fn pin10(&mut self) -> Pin10W { + Pin10W::new(self, 10) } #[doc = "Bit 11"] #[inline(always)] - pub fn pin11(&mut self) -> PIN11_W<11> { - PIN11_W::new(self) + #[must_use] + pub fn pin11(&mut self) -> Pin11W { + Pin11W::new(self, 11) } #[doc = "Bit 12"] #[inline(always)] - pub fn pin12(&mut self) -> PIN12_W<12> { - PIN12_W::new(self) + #[must_use] + pub fn pin12(&mut self) -> Pin12W { + Pin12W::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn pin13(&mut self) -> PIN13_W<13> { - PIN13_W::new(self) + #[must_use] + pub fn pin13(&mut self) -> Pin13W { + Pin13W::new(self, 13) } #[doc = "Bit 14"] #[inline(always)] - pub fn pin14(&mut self) -> PIN14_W<14> { - PIN14_W::new(self) + #[must_use] + pub fn pin14(&mut self) -> Pin14W { + Pin14W::new(self, 14) } #[doc = "Bit 15"] #[inline(always)] - pub fn pin15(&mut self) -> PIN15_W<15> { - PIN15_W::new(self) + #[must_use] + pub fn pin15(&mut self) -> Pin15W { + Pin15W::new(self, 15) } #[doc = "Bit 16"] #[inline(always)] - pub fn pin16(&mut self) -> PIN16_W<16> { - PIN16_W::new(self) + #[must_use] + pub fn pin16(&mut self) -> Pin16W { + Pin16W::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn pin17(&mut self) -> PIN17_W<17> { - PIN17_W::new(self) + #[must_use] + pub fn pin17(&mut self) -> Pin17W { + Pin17W::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn pin18(&mut self) -> PIN18_W<18> { - PIN18_W::new(self) + #[must_use] + pub fn pin18(&mut self) -> Pin18W { + Pin18W::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn pin19(&mut self) -> PIN19_W<19> { - PIN19_W::new(self) + #[must_use] + pub fn pin19(&mut self) -> Pin19W { + Pin19W::new(self, 19) } #[doc = "Bit 20"] #[inline(always)] - pub fn pin20(&mut self) -> PIN20_W<20> { - PIN20_W::new(self) + #[must_use] + pub fn pin20(&mut self) -> Pin20W { + Pin20W::new(self, 20) } #[doc = "Bit 21"] #[inline(always)] - pub fn pin21(&mut self) -> PIN21_W<21> { - PIN21_W::new(self) + #[must_use] + pub fn pin21(&mut self) -> Pin21W { + Pin21W::new(self, 21) } #[doc = "Bit 22"] #[inline(always)] - pub fn pin22(&mut self) -> PIN22_W<22> { - PIN22_W::new(self) + #[must_use] + pub fn pin22(&mut self) -> Pin22W { + Pin22W::new(self, 22) } #[doc = "Bit 23"] #[inline(always)] - pub fn pin23(&mut self) -> PIN23_W<23> { - PIN23_W::new(self) + #[must_use] + pub fn pin23(&mut self) -> Pin23W { + Pin23W::new(self, 23) } #[doc = "Bit 24"] #[inline(always)] - pub fn pin24(&mut self) -> PIN24_W<24> { - PIN24_W::new(self) + #[must_use] + pub fn pin24(&mut self) -> Pin24W { + Pin24W::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn pin25(&mut self) -> PIN25_W<25> { - PIN25_W::new(self) + #[must_use] + pub fn pin25(&mut self) -> Pin25W { + Pin25W::new(self, 25) } #[doc = "Bit 26"] #[inline(always)] - pub fn pin26(&mut self) -> PIN26_W<26> { - PIN26_W::new(self) + #[must_use] + pub fn pin26(&mut self) -> Pin26W { + Pin26W::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn pin27(&mut self) -> PIN27_W<27> { - PIN27_W::new(self) + #[must_use] + pub fn pin27(&mut self) -> Pin27W { + Pin27W::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn pin28(&mut self) -> PIN28_W<28> { - PIN28_W::new(self) + #[must_use] + pub fn pin28(&mut self) -> Pin28W { + Pin28W::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn pin29(&mut self) -> PIN29_W<29> { - PIN29_W::new(self) + #[must_use] + pub fn pin29(&mut self) -> Pin29W { + Pin29W::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn pin30(&mut self) -> PIN30_W<30> { - PIN30_W::new(self) + #[must_use] + pub fn pin30(&mut self) -> Pin30W { + Pin30W::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn pin31(&mut self) -> PIN31_W<31> { - PIN31_W::new(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 + #[must_use] + pub fn pin31(&mut self) -> Pin31W { + Pin31W::new(self, 31) } } -#[doc = "Rise Interrupt Pending Register\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 [rise_ip](index.html) module"] -pub struct RISE_IP_SPEC; -impl crate::RegisterSpec for RISE_IP_SPEC { +#[doc = "Rise Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rise_ip::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rise_ip::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RiseIpSpec; +impl crate::RegisterSpec for RiseIpSpec { type Ux = u32; } -#[doc = "`read()` method returns [rise_ip::R](R) reader structure"] -impl crate::Readable for RISE_IP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rise_ip::W](W) writer structure"] -impl crate::Writable for RISE_IP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rise_ip::R`](R) reader structure"] +impl crate::Readable for RiseIpSpec {} +#[doc = "`write(|w| ..)` method takes [`rise_ip::W`](W) writer structure"] +impl crate::Writable for RiseIpSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rise_ip to value 0"] -impl crate::Resettable for RISE_IP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RiseIpSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/i2c0.rs b/src/i2c0.rs index 60e0dc3..493193a 100644 --- a/src/i2c0.rs +++ b/src/i2c0.rs @@ -1,58 +1,88 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { + prer_lo: PrerLo, + prer_hi: PrerHi, + ctr: Ctr, + txr_rxr: TxrRxr, + _reserved_4_cr: [u8; 0x04], +} +impl RegisterBlock { #[doc = "0x00 - Clock Prescale register lo-byte"] - pub prer_lo: PRER_LO, + #[inline(always)] + pub const fn prer_lo(&self) -> &PrerLo { + &self.prer_lo + } #[doc = "0x04 - Clock Prescale register hi-byte"] - pub prer_hi: PRER_HI, + #[inline(always)] + pub const fn prer_hi(&self) -> &PrerHi { + &self.prer_hi + } #[doc = "0x08 - Control register"] - pub ctr: CTR, + #[inline(always)] + pub const fn ctr(&self) -> &Ctr { + &self.ctr + } #[doc = "0x0c - Transmit register / Receive register"] - pub txr_rxr: TXR_RXR, - _reserved_4_cr: [u8; 0x04], -} -impl RegisterBlock { + #[inline(always)] + pub const fn txr_rxr(&self) -> &TxrRxr { + &self.txr_rxr + } #[doc = "0x10 - Status register"] #[inline(always)] - pub fn sr(&self) -> &SR { - unsafe { &*(((self as *const Self) as *const u8).add(16usize) as *const SR) } + pub const fn sr(&self) -> &Sr { + unsafe { &*(self as *const Self).cast::().add(16).cast() } } #[doc = "0x10 - Command register"] #[inline(always)] - pub fn cr(&self) -> &CR { - unsafe { &*(((self as *const Self) as *const u8).add(16usize) as *const CR) } + pub const fn cr(&self) -> &Cr { + unsafe { &*(self as *const Self).cast::().add(16).cast() } } #[doc = "0x10 - Command register / Status register"] #[inline(always)] - pub fn cr_sr(&self) -> &CR_SR { - unsafe { &*(((self as *const Self) as *const u8).add(16usize) as *const CR_SR) } + pub const fn cr_sr(&self) -> &CrSr { + unsafe { &*(self as *const Self).cast::().add(16).cast() } } } -#[doc = "prer_lo (rw) register accessor: an alias for `Reg`"] -pub type PRER_LO = crate::Reg; +#[doc = "prer_lo (rw) register accessor: Clock Prescale register lo-byte\n\nYou can [`read`](crate::Reg::read) this register and get [`prer_lo::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`prer_lo::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prer_lo`] +module"] +#[doc(alias = "prer_lo")] +pub type PrerLo = crate::Reg; #[doc = "Clock Prescale register lo-byte"] pub mod prer_lo; -#[doc = "prer_hi (rw) register accessor: an alias for `Reg`"] -pub type PRER_HI = crate::Reg; +#[doc = "prer_hi (rw) register accessor: Clock Prescale register hi-byte\n\nYou can [`read`](crate::Reg::read) this register and get [`prer_hi::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`prer_hi::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prer_hi`] +module"] +#[doc(alias = "prer_hi")] +pub type PrerHi = crate::Reg; #[doc = "Clock Prescale register hi-byte"] pub mod prer_hi; -#[doc = "ctr (rw) register accessor: an alias for `Reg`"] -pub type CTR = crate::Reg; +#[doc = "ctr (rw) register accessor: Control register\n\nYou can [`read`](crate::Reg::read) this register and get [`ctr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctr`] +module"] +#[doc(alias = "ctr")] +pub type Ctr = crate::Reg; #[doc = "Control register"] pub mod ctr; -#[doc = "txr_rxr (rw) register accessor: an alias for `Reg`"] -pub type TXR_RXR = crate::Reg; +#[doc = "txr_rxr (rw) register accessor: Transmit register / Receive register\n\nYou can [`read`](crate::Reg::read) this register and get [`txr_rxr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`txr_rxr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@txr_rxr`] +module"] +#[doc(alias = "txr_rxr")] +pub type TxrRxr = crate::Reg; #[doc = "Transmit register / Receive register"] pub mod txr_rxr; -#[doc = "cr_sr (rw) register accessor: an alias for `Reg`"] -pub type CR_SR = crate::Reg; +#[doc = "cr_sr (rw) register accessor: Command register / Status register\n\nYou can [`read`](crate::Reg::read) this register and get [`cr_sr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cr_sr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cr_sr`] +module"] +#[doc(alias = "cr_sr")] +pub type CrSr = crate::Reg; #[doc = "Command register / Status register"] pub mod cr_sr; -#[doc = "cr (w) register accessor: an alias for `Reg`"] -pub type CR = crate::Reg; +#[doc = "cr (w) register accessor: Command register\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cr`] +module"] +#[doc(alias = "cr")] +pub type Cr = crate::Reg; #[doc = "Command register"] pub mod cr; -#[doc = "sr (r) register accessor: an alias for `Reg`"] -pub type SR = crate::Reg; +#[doc = "sr (r) register accessor: Status register\n\nYou can [`read`](crate::Reg::read) this register and get [`sr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sr`] +module"] +#[doc(alias = "sr")] +pub type Sr = crate::Reg; #[doc = "Status register"] pub mod sr; diff --git a/src/i2c0/cr.rs b/src/i2c0/cr.rs index 714bad3..3f6fbb3 100644 --- a/src/i2c0/cr.rs +++ b/src/i2c0/cr.rs @@ -1,113 +1,96 @@ #[doc = "Register `cr` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `iack` writer - Interrupt acknowledge. When set, clears a pending interrupt"] -pub type IACK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>; +pub type IackW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "When a receiver, sent ACK (0) or NACK (1)\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum ACK_AW { +pub enum Ack { #[doc = "0: `0`"] - ACK = 0, + Ack = 0, #[doc = "1: `1`"] - NACK = 1, + Nack = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: ACK_AW) -> Self { + fn from(variant: Ack) -> Self { variant as u8 != 0 } } #[doc = "Field `ack` writer - When a receiver, sent ACK (0) or NACK (1)"] -pub type ACK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, ACK_AW, O>; -impl<'a, const O: u8> ACK_W<'a, O> { +pub type AckW<'a, REG> = crate::BitWriter<'a, REG, Ack>; +impl<'a, REG> AckW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "`0`"] #[inline(always)] - pub fn ack(self) -> &'a mut W { - self.variant(ACK_AW::ACK) + pub fn ack(self) -> &'a mut crate::W { + self.variant(Ack::Ack) } #[doc = "`1`"] #[inline(always)] - pub fn nack(self) -> &'a mut W { - self.variant(ACK_AW::NACK) + pub fn nack(self) -> &'a mut crate::W { + self.variant(Ack::Nack) } } #[doc = "Field `wr` writer - Write to slave"] -pub type WR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>; +pub type WrW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `rd` writer - Read from slave"] -pub type RD_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>; +pub type RdW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `sto` writer - Generate stop condition"] -pub type STO_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>; +pub type StoW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `sta` writer - Generate (repeated) start condition"] -pub type STA_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>; +pub type StaW<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Interrupt acknowledge. When set, clears a pending interrupt"] #[inline(always)] - pub fn iack(&mut self) -> IACK_W<0> { - IACK_W::new(self) + #[must_use] + pub fn iack(&mut self) -> IackW { + IackW::new(self, 0) } #[doc = "Bit 3 - When a receiver, sent ACK (0) or NACK (1)"] #[inline(always)] - pub fn ack(&mut self) -> ACK_W<3> { - ACK_W::new(self) + #[must_use] + pub fn ack(&mut self) -> AckW { + AckW::new(self, 3) } #[doc = "Bit 4 - Write to slave"] #[inline(always)] - pub fn wr(&mut self) -> WR_W<4> { - WR_W::new(self) + #[must_use] + pub fn wr(&mut self) -> WrW { + WrW::new(self, 4) } #[doc = "Bit 5 - Read from slave"] #[inline(always)] - pub fn rd(&mut self) -> RD_W<5> { - RD_W::new(self) + #[must_use] + pub fn rd(&mut self) -> RdW { + RdW::new(self, 5) } #[doc = "Bit 6 - Generate stop condition"] #[inline(always)] - pub fn sto(&mut self) -> STO_W<6> { - STO_W::new(self) + #[must_use] + pub fn sto(&mut self) -> StoW { + StoW::new(self, 6) } #[doc = "Bit 7 - Generate (repeated) start condition"] #[inline(always)] - pub fn sta(&mut self) -> STA_W<7> { - STA_W::new(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 + #[must_use] + pub fn sta(&mut self) -> StaW { + StaW::new(self, 7) } } -#[doc = "Command register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr](index.html) module"] -pub struct CR_SPEC; -impl crate::RegisterSpec for CR_SPEC { +#[doc = "Command register\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct CrSpec; +impl crate::RegisterSpec for CrSpec { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [cr::W](W) writer structure"] -impl crate::Writable for CR_SPEC { - type Writer = W; +#[doc = "`write(|w| ..)` method takes [`cr::W`](W) writer structure"] +impl crate::Writable for CrSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets cr to value 0"] -impl crate::Resettable for CR_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for CrSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/i2c0/cr_sr.rs b/src/i2c0/cr_sr.rs index 8ead11c..40fea3a 100644 --- a/src/i2c0/cr_sr.rs +++ b/src/i2c0/cr_sr.rs @@ -1,64 +1,27 @@ #[doc = "Register `cr_sr` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `cr_sr` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Command register / Status register\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 [cr_sr](index.html) module"] -pub struct CR_SR_SPEC; -impl crate::RegisterSpec for CR_SR_SPEC { +impl W {} +#[doc = "Command register / Status register\n\nYou can [`read`](crate::Reg::read) this register and get [`cr_sr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cr_sr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct CrSrSpec; +impl crate::RegisterSpec for CrSrSpec { type Ux = u32; } -#[doc = "`read()` method returns [cr_sr::R](R) reader structure"] -impl crate::Readable for CR_SR_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [cr_sr::W](W) writer structure"] -impl crate::Writable for CR_SR_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`cr_sr::R`](R) reader structure"] +impl crate::Readable for CrSrSpec {} +#[doc = "`write(|w| ..)` method takes [`cr_sr::W`](W) writer structure"] +impl crate::Writable for CrSrSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets cr_sr to value 0"] -impl crate::Resettable for CR_SR_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for CrSrSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/i2c0/ctr.rs b/src/i2c0/ctr.rs index 8b4bcea..474cca8 100644 --- a/src/i2c0/ctr.rs +++ b/src/i2c0/ctr.rs @@ -1,94 +1,55 @@ #[doc = "Register `ctr` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `ctr` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ien` reader - I2C core interrupt enable bit"] -pub type IEN_R = crate::BitReader; +pub type IenR = crate::BitReader; #[doc = "Field `ien` writer - I2C core interrupt enable bit"] -pub type IEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type IenW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `en` reader - I2C core enable bit"] -pub type EN_R = crate::BitReader; +pub type EnR = crate::BitReader; #[doc = "Field `en` writer - I2C core enable bit"] -pub type EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type EnW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 6 - I2C core interrupt enable bit"] #[inline(always)] - pub fn ien(&self) -> IEN_R { - IEN_R::new(((self.bits >> 6) & 1) != 0) + pub fn ien(&self) -> IenR { + IenR::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7 - I2C core enable bit"] #[inline(always)] - pub fn en(&self) -> EN_R { - EN_R::new(((self.bits >> 7) & 1) != 0) + pub fn en(&self) -> EnR { + EnR::new(((self.bits >> 7) & 1) != 0) } } impl W { #[doc = "Bit 6 - I2C core interrupt enable bit"] #[inline(always)] - pub fn ien(&mut self) -> IEN_W<6> { - IEN_W::new(self) + #[must_use] + pub fn ien(&mut self) -> IenW { + IenW::new(self, 6) } #[doc = "Bit 7 - I2C core enable bit"] #[inline(always)] - pub fn en(&mut self) -> EN_W<7> { - EN_W::new(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 + #[must_use] + pub fn en(&mut self) -> EnW { + EnW::new(self, 7) } } -#[doc = "Control register\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 [ctr](index.html) module"] -pub struct CTR_SPEC; -impl crate::RegisterSpec for CTR_SPEC { +#[doc = "Control register\n\nYou can [`read`](crate::Reg::read) this register and get [`ctr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct CtrSpec; +impl crate::RegisterSpec for CtrSpec { type Ux = u32; } -#[doc = "`read()` method returns [ctr::R](R) reader structure"] -impl crate::Readable for CTR_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [ctr::W](W) writer structure"] -impl crate::Writable for CTR_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`ctr::R`](R) reader structure"] +impl crate::Readable for CtrSpec {} +#[doc = "`write(|w| ..)` method takes [`ctr::W`](W) writer structure"] +impl crate::Writable for CtrSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets ctr to value 0"] -impl crate::Resettable for CTR_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for CtrSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/i2c0/prer_hi.rs b/src/i2c0/prer_hi.rs index 54a9939..1b9029a 100644 --- a/src/i2c0/prer_hi.rs +++ b/src/i2c0/prer_hi.rs @@ -1,80 +1,40 @@ #[doc = "Register `prer_hi` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `prer_hi` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `value` reader - "] -pub type VALUE_R = crate::FieldReader; +pub type ValueR = crate::FieldReader; #[doc = "Field `value` writer - "] -pub type VALUE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRER_HI_SPEC, u8, u8, 8, O>; +pub type ValueW<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7"] #[inline(always)] - pub fn value(&self) -> VALUE_R { - VALUE_R::new((self.bits & 0xff) as u8) + pub fn value(&self) -> ValueR { + ValueR::new((self.bits & 0xff) as u8) } } impl W { #[doc = "Bits 0:7"] #[inline(always)] - pub fn value(&mut self) -> VALUE_W<0> { - VALUE_W::new(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 + #[must_use] + pub fn value(&mut self) -> ValueW { + ValueW::new(self, 0) } } -#[doc = "Clock Prescale register hi-byte\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 [prer_hi](index.html) module"] -pub struct PRER_HI_SPEC; -impl crate::RegisterSpec for PRER_HI_SPEC { +#[doc = "Clock Prescale register hi-byte\n\nYou can [`read`](crate::Reg::read) this register and get [`prer_hi::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`prer_hi::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PrerHiSpec; +impl crate::RegisterSpec for PrerHiSpec { type Ux = u32; } -#[doc = "`read()` method returns [prer_hi::R](R) reader structure"] -impl crate::Readable for PRER_HI_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [prer_hi::W](W) writer structure"] -impl crate::Writable for PRER_HI_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`prer_hi::R`](R) reader structure"] +impl crate::Readable for PrerHiSpec {} +#[doc = "`write(|w| ..)` method takes [`prer_hi::W`](W) writer structure"] +impl crate::Writable for PrerHiSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets prer_hi to value 0"] -impl crate::Resettable for PRER_HI_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PrerHiSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/i2c0/prer_lo.rs b/src/i2c0/prer_lo.rs index bf01945..b00c9d6 100644 --- a/src/i2c0/prer_lo.rs +++ b/src/i2c0/prer_lo.rs @@ -1,80 +1,40 @@ #[doc = "Register `prer_lo` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `prer_lo` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `value` reader - "] -pub type VALUE_R = crate::FieldReader; +pub type ValueR = crate::FieldReader; #[doc = "Field `value` writer - "] -pub type VALUE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRER_LO_SPEC, u8, u8, 8, O>; +pub type ValueW<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7"] #[inline(always)] - pub fn value(&self) -> VALUE_R { - VALUE_R::new((self.bits & 0xff) as u8) + pub fn value(&self) -> ValueR { + ValueR::new((self.bits & 0xff) as u8) } } impl W { #[doc = "Bits 0:7"] #[inline(always)] - pub fn value(&mut self) -> VALUE_W<0> { - VALUE_W::new(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 + #[must_use] + pub fn value(&mut self) -> ValueW { + ValueW::new(self, 0) } } -#[doc = "Clock Prescale register lo-byte\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 [prer_lo](index.html) module"] -pub struct PRER_LO_SPEC; -impl crate::RegisterSpec for PRER_LO_SPEC { +#[doc = "Clock Prescale register lo-byte\n\nYou can [`read`](crate::Reg::read) this register and get [`prer_lo::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`prer_lo::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PrerLoSpec; +impl crate::RegisterSpec for PrerLoSpec { type Ux = u32; } -#[doc = "`read()` method returns [prer_lo::R](R) reader structure"] -impl crate::Readable for PRER_LO_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [prer_lo::W](W) writer structure"] -impl crate::Writable for PRER_LO_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`prer_lo::R`](R) reader structure"] +impl crate::Readable for PrerLoSpec {} +#[doc = "`write(|w| ..)` method takes [`prer_lo::W`](W) writer structure"] +impl crate::Writable for PrerLoSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets prer_lo to value 0"] -impl crate::Resettable for PRER_LO_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PrerLoSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/i2c0/sr.rs b/src/i2c0/sr.rs index 6271030..4c9cc38 100644 --- a/src/i2c0/sr.rs +++ b/src/i2c0/sr.rs @@ -1,68 +1,50 @@ #[doc = "Register `sr` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `if` reader - Interrupt Flag. This bit is set when an interrupt is pending, which will cause a processor interrupt request if the IEN bit is set."] -pub type IF_R = crate::BitReader; +pub type IfR = crate::BitReader; #[doc = "Field `tip` reader - Transfer in progress"] -pub type TIP_R = crate::BitReader; +pub type TipR = crate::BitReader; #[doc = "Field `al` reader - Arbitration lost"] -pub type AL_R = crate::BitReader; +pub type AlR = crate::BitReader; #[doc = "Field `busy` reader - I2C bus busy"] -pub type BUSY_R = crate::BitReader; +pub type BusyR = crate::BitReader; #[doc = "Field `rx_ack` reader - Received acknowledge from slave. This flag represents acknowledge from the addressed slave. '1' = No acknowledge received '0' = Acknowledge received"] -pub type RX_ACK_R = crate::BitReader; +pub type RxAckR = crate::BitReader; impl R { #[doc = "Bit 0 - Interrupt Flag. This bit is set when an interrupt is pending, which will cause a processor interrupt request if the IEN bit is set."] #[inline(always)] - pub fn if_(&self) -> IF_R { - IF_R::new((self.bits & 1) != 0) + pub fn if_(&self) -> IfR { + IfR::new((self.bits & 1) != 0) } #[doc = "Bit 1 - Transfer in progress"] #[inline(always)] - pub fn tip(&self) -> TIP_R { - TIP_R::new(((self.bits >> 1) & 1) != 0) + pub fn tip(&self) -> TipR { + TipR::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 5 - Arbitration lost"] #[inline(always)] - pub fn al(&self) -> AL_R { - AL_R::new(((self.bits >> 5) & 1) != 0) + pub fn al(&self) -> AlR { + AlR::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 6 - I2C bus busy"] #[inline(always)] - pub fn busy(&self) -> BUSY_R { - BUSY_R::new(((self.bits >> 6) & 1) != 0) + pub fn busy(&self) -> BusyR { + BusyR::new(((self.bits >> 6) & 1) != 0) } #[doc = "Bit 7 - Received acknowledge from slave. This flag represents acknowledge from the addressed slave. '1' = No acknowledge received '0' = Acknowledge received"] #[inline(always)] - pub fn rx_ack(&self) -> RX_ACK_R { - RX_ACK_R::new(((self.bits >> 7) & 1) != 0) + pub fn rx_ack(&self) -> RxAckR { + RxAckR::new(((self.bits >> 7) & 1) != 0) } } -#[doc = "Status register\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 [sr](index.html) module"] -pub struct SR_SPEC; -impl crate::RegisterSpec for SR_SPEC { +#[doc = "Status register\n\nYou can [`read`](crate::Reg::read) this register and get [`sr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct SrSpec; +impl crate::RegisterSpec for SrSpec { type Ux = u32; } -#[doc = "`read()` method returns [sr::R](R) reader structure"] -impl crate::Readable for SR_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`sr::R`](R) reader structure"] +impl crate::Readable for SrSpec {} #[doc = "`reset()` method sets sr to value 0"] -impl crate::Resettable for SR_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for SrSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/i2c0/txr_rxr.rs b/src/i2c0/txr_rxr.rs index 562a10b..9684ac7 100644 --- a/src/i2c0/txr_rxr.rs +++ b/src/i2c0/txr_rxr.rs @@ -1,80 +1,40 @@ #[doc = "Register `txr_rxr` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `txr_rxr` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `data` reader - "] -pub type DATA_R = crate::FieldReader; +pub type DataR = crate::FieldReader; #[doc = "Field `data` writer - "] -pub type DATA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TXR_RXR_SPEC, u8, u8, 8, O>; +pub type DataW<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7"] #[inline(always)] - pub fn data(&self) -> DATA_R { - DATA_R::new((self.bits & 0xff) as u8) + pub fn data(&self) -> DataR { + DataR::new((self.bits & 0xff) as u8) } } impl W { #[doc = "Bits 0:7"] #[inline(always)] - pub fn data(&mut self) -> DATA_W<0> { - DATA_W::new(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 + #[must_use] + pub fn data(&mut self) -> DataW { + DataW::new(self, 0) } } -#[doc = "Transmit register / Receive register\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 [txr_rxr](index.html) module"] -pub struct TXR_RXR_SPEC; -impl crate::RegisterSpec for TXR_RXR_SPEC { +#[doc = "Transmit register / Receive register\n\nYou can [`read`](crate::Reg::read) this register and get [`txr_rxr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`txr_rxr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct TxrRxrSpec; +impl crate::RegisterSpec for TxrRxrSpec { type Ux = u32; } -#[doc = "`read()` method returns [txr_rxr::R](R) reader structure"] -impl crate::Readable for TXR_RXR_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [txr_rxr::W](W) writer structure"] -impl crate::Writable for TXR_RXR_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`txr_rxr::R`](R) reader structure"] +impl crate::Readable for TxrRxrSpec {} +#[doc = "`write(|w| ..)` method takes [`txr_rxr::W`](W) writer structure"] +impl crate::Writable for TxrRxrSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets txr_rxr to value 0"] -impl crate::Resettable for TXR_RXR_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for TxrRxrSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/lib.rs b/src/lib.rs index dd14ddd..f617f42 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,19 +1,5 @@ -#![doc = "Peripheral access API for FE310 microcontrollers (generated using svd2rust v0.26.0 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next] -svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.26.0/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"] -#![deny(dead_code)] -#![deny(improper_ctypes)] -#![deny(missing_docs)] -#![deny(no_mangle_generic_items)] -#![deny(non_shorthand_field_patterns)] -#![deny(overflowing_literals)] -#![deny(path_statements)] -#![deny(patterns_in_fns_without_body)] -#![deny(private_in_public)] -#![deny(unconditional_recursion)] -#![deny(unused_allocation)] -#![deny(unused_comparisons)] -#![deny(unused_parens)] -#![deny(while_true)] +#![doc = "Peripheral access API for FE310 microcontrollers (generated using svd2rust v0.33.4 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next] +svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.33.4/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![no_std] @@ -79,6 +65,7 @@ extern "C" { fn I2C0(); } #[doc(hidden)] +#[repr(C)] pub union Vector { pub _handler: unsafe extern "C" fn(), pub _reserved: usize, @@ -145,11 +132,11 @@ pub static __EXTERNAL_INTERRUPTS: [Vector; 53] = [ pub mod interrupt; pub use self::interrupt::Interrupt; #[doc = "Coreplex Local Interrupts"] -pub struct CLINT { +pub struct Clint { _marker: PhantomData<*const ()>, } -unsafe impl Send for CLINT {} -impl CLINT { +unsafe impl Send for Clint {} +impl Clint { #[doc = r"Pointer to the register block"] pub const PTR: *const clint::RegisterBlock = 0x0200_0000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -157,27 +144,45 @@ impl CLINT { pub const fn ptr() -> *const clint::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for CLINT { +impl Deref for Clint { type Target = clint::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for CLINT { +impl core::fmt::Debug for Clint { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("CLINT").finish() + f.debug_struct("Clint").finish() } } #[doc = "Coreplex Local Interrupts"] pub mod clint; #[doc = "Platform Level Interrupt Control"] -pub struct PLIC { +pub struct Plic { _marker: PhantomData<*const ()>, } -unsafe impl Send for PLIC {} -impl PLIC { +unsafe impl Send for Plic {} +impl Plic { #[doc = r"Pointer to the register block"] pub const PTR: *const plic::RegisterBlock = 0x0c00_0000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -185,27 +190,45 @@ impl PLIC { pub const fn ptr() -> *const plic::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for PLIC { +impl Deref for Plic { type Target = plic::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for PLIC { +impl core::fmt::Debug for Plic { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("PLIC").finish() + f.debug_struct("Plic").finish() } } #[doc = "Platform Level Interrupt Control"] pub mod plic; #[doc = "Watchdog"] -pub struct WDOG { +pub struct Wdog { _marker: PhantomData<*const ()>, } -unsafe impl Send for WDOG {} -impl WDOG { +unsafe impl Send for Wdog {} +impl Wdog { #[doc = r"Pointer to the register block"] pub const PTR: *const wdog::RegisterBlock = 0x1000_0000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -213,27 +236,45 @@ impl WDOG { pub const fn ptr() -> *const wdog::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for WDOG { +impl Deref for Wdog { type Target = wdog::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for WDOG { +impl core::fmt::Debug for Wdog { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("WDOG").finish() + f.debug_struct("Wdog").finish() } } #[doc = "Watchdog"] pub mod wdog; #[doc = "Watchdog"] -pub struct RTC { +pub struct Rtc { _marker: PhantomData<*const ()>, } -unsafe impl Send for RTC {} -impl RTC { +unsafe impl Send for Rtc {} +impl Rtc { #[doc = r"Pointer to the register block"] pub const PTR: *const rtc::RegisterBlock = 0x1000_0000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -241,27 +282,45 @@ impl RTC { pub const fn ptr() -> *const rtc::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for RTC { +impl Deref for Rtc { type Target = rtc::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for RTC { +impl core::fmt::Debug for Rtc { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("RTC").finish() + f.debug_struct("Rtc").finish() } } #[doc = "Watchdog"] pub mod rtc; #[doc = "Always-On Clock Configuration"] -pub struct AONCLK { +pub struct Aonclk { _marker: PhantomData<*const ()>, } -unsafe impl Send for AONCLK {} -impl AONCLK { +unsafe impl Send for Aonclk {} +impl Aonclk { #[doc = r"Pointer to the register block"] pub const PTR: *const aonclk::RegisterBlock = 0x1000_0000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -269,27 +328,45 @@ impl AONCLK { pub const fn ptr() -> *const aonclk::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for AONCLK { +impl Deref for Aonclk { type Target = aonclk::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for AONCLK { +impl core::fmt::Debug for Aonclk { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("AONCLK").finish() + f.debug_struct("Aonclk").finish() } } #[doc = "Always-On Clock Configuration"] pub mod aonclk; #[doc = "Backup Registers"] -pub struct BACKUP { +pub struct Backup { _marker: PhantomData<*const ()>, } -unsafe impl Send for BACKUP {} -impl BACKUP { +unsafe impl Send for Backup {} +impl Backup { #[doc = r"Pointer to the register block"] pub const PTR: *const backup::RegisterBlock = 0x1000_0000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -297,27 +374,45 @@ impl BACKUP { pub const fn ptr() -> *const backup::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for BACKUP { +impl Deref for Backup { type Target = backup::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for BACKUP { +impl core::fmt::Debug for Backup { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("BACKUP").finish() + f.debug_struct("Backup").finish() } } #[doc = "Backup Registers"] pub mod backup; #[doc = "PMU"] -pub struct PMU { +pub struct Pmu { _marker: PhantomData<*const ()>, } -unsafe impl Send for PMU {} -impl PMU { +unsafe impl Send for Pmu {} +impl Pmu { #[doc = r"Pointer to the register block"] pub const PTR: *const pmu::RegisterBlock = 0x1000_0000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -325,27 +420,45 @@ impl PMU { pub const fn ptr() -> *const pmu::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for PMU { +impl Deref for Pmu { type Target = pmu::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for PMU { +impl core::fmt::Debug for Pmu { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("PMU").finish() + f.debug_struct("Pmu").finish() } } #[doc = "PMU"] pub mod pmu; #[doc = "Power Reset Clock Interrupts"] -pub struct PRCI { +pub struct Prci { _marker: PhantomData<*const ()>, } -unsafe impl Send for PRCI {} -impl PRCI { +unsafe impl Send for Prci {} +impl Prci { #[doc = r"Pointer to the register block"] pub const PTR: *const prci::RegisterBlock = 0x1000_8000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -353,27 +466,45 @@ impl PRCI { pub const fn ptr() -> *const prci::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for PRCI { +impl Deref for Prci { type Target = prci::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for PRCI { +impl core::fmt::Debug for Prci { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("PRCI").finish() + f.debug_struct("Prci").finish() } } #[doc = "Power Reset Clock Interrupts"] pub mod prci; #[doc = "One Time Programmable Memory"] -pub struct OTP { +pub struct Otp { _marker: PhantomData<*const ()>, } -unsafe impl Send for OTP {} -impl OTP { +unsafe impl Send for Otp {} +impl Otp { #[doc = r"Pointer to the register block"] pub const PTR: *const otp::RegisterBlock = 0x1001_0000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -381,27 +512,45 @@ impl OTP { pub const fn ptr() -> *const otp::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for OTP { +impl Deref for Otp { type Target = otp::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for OTP { +impl core::fmt::Debug for Otp { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("OTP").finish() + f.debug_struct("Otp").finish() } } #[doc = "One Time Programmable Memory"] pub mod otp; #[doc = "General Purpose Input Output"] -pub struct GPIO0 { +pub struct Gpio0 { _marker: PhantomData<*const ()>, } -unsafe impl Send for GPIO0 {} -impl GPIO0 { +unsafe impl Send for Gpio0 {} +impl Gpio0 { #[doc = r"Pointer to the register block"] pub const PTR: *const gpio0::RegisterBlock = 0x1001_2000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -409,27 +558,45 @@ impl GPIO0 { pub const fn ptr() -> *const gpio0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for GPIO0 { +impl Deref for Gpio0 { type Target = gpio0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for GPIO0 { +impl core::fmt::Debug for Gpio0 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("GPIO0").finish() + f.debug_struct("Gpio0").finish() } } #[doc = "General Purpose Input Output"] pub mod gpio0; #[doc = "Universal Asynchronous Receiver Transmitter"] -pub struct UART0 { +pub struct Uart0 { _marker: PhantomData<*const ()>, } -unsafe impl Send for UART0 {} -impl UART0 { +unsafe impl Send for Uart0 {} +impl Uart0 { #[doc = r"Pointer to the register block"] pub const PTR: *const uart0::RegisterBlock = 0x1001_3000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -437,27 +604,45 @@ impl UART0 { pub const fn ptr() -> *const uart0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for UART0 { +impl Deref for Uart0 { type Target = uart0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for UART0 { +impl core::fmt::Debug for Uart0 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("UART0").finish() + f.debug_struct("Uart0").finish() } } #[doc = "Universal Asynchronous Receiver Transmitter"] pub mod uart0; #[doc = "Quad Serial Peripheral Interface"] -pub struct QSPI0 { +pub struct Qspi0 { _marker: PhantomData<*const ()>, } -unsafe impl Send for QSPI0 {} -impl QSPI0 { +unsafe impl Send for Qspi0 {} +impl Qspi0 { #[doc = r"Pointer to the register block"] pub const PTR: *const qspi0::RegisterBlock = 0x1001_4000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -465,27 +650,45 @@ impl QSPI0 { pub const fn ptr() -> *const qspi0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for QSPI0 { +impl Deref for Qspi0 { type Target = qspi0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for QSPI0 { +impl core::fmt::Debug for Qspi0 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("QSPI0").finish() + f.debug_struct("Qspi0").finish() } } #[doc = "Quad Serial Peripheral Interface"] pub mod qspi0; #[doc = "8-bit timer with 4 cmp"] -pub struct PWM0 { +pub struct Pwm0 { _marker: PhantomData<*const ()>, } -unsafe impl Send for PWM0 {} -impl PWM0 { +unsafe impl Send for Pwm0 {} +impl Pwm0 { #[doc = r"Pointer to the register block"] pub const PTR: *const pwm0::RegisterBlock = 0x1001_5000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -493,27 +696,45 @@ impl PWM0 { pub const fn ptr() -> *const pwm0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for PWM0 { +impl Deref for Pwm0 { type Target = pwm0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for PWM0 { +impl core::fmt::Debug for Pwm0 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("PWM0").finish() + f.debug_struct("Pwm0").finish() } } #[doc = "8-bit timer with 4 cmp"] pub mod pwm0; #[doc = "Inter-Integrated Circuit Master Interface (FE310-G002 only)"] -pub struct I2C0 { +pub struct I2c0 { _marker: PhantomData<*const ()>, } -unsafe impl Send for I2C0 {} -impl I2C0 { +unsafe impl Send for I2c0 {} +impl I2c0 { #[doc = r"Pointer to the register block"] pub const PTR: *const i2c0::RegisterBlock = 0x1001_6000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -521,27 +742,45 @@ impl I2C0 { pub const fn ptr() -> *const i2c0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for I2C0 { +impl Deref for I2c0 { type Target = i2c0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for I2C0 { +impl core::fmt::Debug for I2c0 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("I2C0").finish() + f.debug_struct("I2c0").finish() } } #[doc = "Inter-Integrated Circuit Master Interface (FE310-G002 only)"] pub mod i2c0; #[doc = "Universal Asynchronous Receiver Transmitter"] -pub struct UART1 { +pub struct Uart1 { _marker: PhantomData<*const ()>, } -unsafe impl Send for UART1 {} -impl UART1 { +unsafe impl Send for Uart1 {} +impl Uart1 { #[doc = r"Pointer to the register block"] pub const PTR: *const uart0::RegisterBlock = 0x1002_3000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -549,27 +788,45 @@ impl UART1 { pub const fn ptr() -> *const uart0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for UART1 { +impl Deref for Uart1 { type Target = uart0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for UART1 { +impl core::fmt::Debug for Uart1 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("UART1").finish() + f.debug_struct("Uart1").finish() } } #[doc = "Universal Asynchronous Receiver Transmitter"] pub use self::uart0 as uart1; #[doc = "Quad Serial Peripheral Interface"] -pub struct QSPI1 { +pub struct Qspi1 { _marker: PhantomData<*const ()>, } -unsafe impl Send for QSPI1 {} -impl QSPI1 { +unsafe impl Send for Qspi1 {} +impl Qspi1 { #[doc = r"Pointer to the register block"] pub const PTR: *const qspi0::RegisterBlock = 0x1002_4000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -577,27 +834,45 @@ impl QSPI1 { pub const fn ptr() -> *const qspi0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for QSPI1 { +impl Deref for Qspi1 { type Target = qspi0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for QSPI1 { +impl core::fmt::Debug for Qspi1 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("QSPI1").finish() + f.debug_struct("Qspi1").finish() } } #[doc = "Quad Serial Peripheral Interface"] pub use self::qspi0 as qspi1; #[doc = "8-bit timer with 4 cmp"] -pub struct PWM1 { +pub struct Pwm1 { _marker: PhantomData<*const ()>, } -unsafe impl Send for PWM1 {} -impl PWM1 { +unsafe impl Send for Pwm1 {} +impl Pwm1 { #[doc = r"Pointer to the register block"] pub const PTR: *const pwm0::RegisterBlock = 0x1002_5000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -605,27 +880,45 @@ impl PWM1 { pub const fn ptr() -> *const pwm0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for PWM1 { +impl Deref for Pwm1 { type Target = pwm0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for PWM1 { +impl core::fmt::Debug for Pwm1 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("PWM1").finish() + f.debug_struct("Pwm1").finish() } } #[doc = "8-bit timer with 4 cmp"] pub use self::pwm0 as pwm1; #[doc = "Quad Serial Peripheral Interface"] -pub struct QSPI2 { +pub struct Qspi2 { _marker: PhantomData<*const ()>, } -unsafe impl Send for QSPI2 {} -impl QSPI2 { +unsafe impl Send for Qspi2 {} +impl Qspi2 { #[doc = r"Pointer to the register block"] pub const PTR: *const qspi0::RegisterBlock = 0x1003_4000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -633,27 +926,45 @@ impl QSPI2 { pub const fn ptr() -> *const qspi0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for QSPI2 { +impl Deref for Qspi2 { type Target = qspi0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for QSPI2 { +impl core::fmt::Debug for Qspi2 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("QSPI2").finish() + f.debug_struct("Qspi2").finish() } } #[doc = "Quad Serial Peripheral Interface"] pub use self::qspi0 as qspi2; #[doc = "8-bit timer with 4 cmp"] -pub struct PWM2 { +pub struct Pwm2 { _marker: PhantomData<*const ()>, } -unsafe impl Send for PWM2 {} -impl PWM2 { +unsafe impl Send for Pwm2 {} +impl Pwm2 { #[doc = r"Pointer to the register block"] pub const PTR: *const pwm0::RegisterBlock = 0x1003_5000 as *const _; #[doc = r"Return the pointer to the register block"] @@ -661,17 +972,35 @@ impl PWM2 { pub const fn ptr() -> *const pwm0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } } -impl Deref for PWM2 { +impl Deref for Pwm2 { type Target = pwm0::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe { &*Self::PTR } } } -impl core::fmt::Debug for PWM2 { +impl core::fmt::Debug for Pwm2 { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_struct("PWM2").finish() + f.debug_struct("Pwm2").finish() } } #[doc = "8-bit timer with 4 cmp"] @@ -682,43 +1011,43 @@ static mut DEVICE_PERIPHERALS: bool = false; #[allow(non_snake_case)] pub struct Peripherals { #[doc = "CLINT"] - pub CLINT: CLINT, + pub clint: Clint, #[doc = "PLIC"] - pub PLIC: PLIC, + pub plic: Plic, #[doc = "WDOG"] - pub WDOG: WDOG, + pub wdog: Wdog, #[doc = "RTC"] - pub RTC: RTC, + pub rtc: Rtc, #[doc = "AONCLK"] - pub AONCLK: AONCLK, + pub aonclk: Aonclk, #[doc = "BACKUP"] - pub BACKUP: BACKUP, + pub backup: Backup, #[doc = "PMU"] - pub PMU: PMU, + pub pmu: Pmu, #[doc = "PRCI"] - pub PRCI: PRCI, + pub prci: Prci, #[doc = "OTP"] - pub OTP: OTP, + pub otp: Otp, #[doc = "GPIO0"] - pub GPIO0: GPIO0, + pub gpio0: Gpio0, #[doc = "UART0"] - pub UART0: UART0, + pub uart0: Uart0, #[doc = "QSPI0"] - pub QSPI0: QSPI0, + pub qspi0: Qspi0, #[doc = "PWM0"] - pub PWM0: PWM0, + pub pwm0: Pwm0, #[doc = "I2C0"] - pub I2C0: I2C0, + pub i2c0: I2c0, #[doc = "UART1"] - pub UART1: UART1, + pub uart1: Uart1, #[doc = "QSPI1"] - pub QSPI1: QSPI1, + pub qspi1: Qspi1, #[doc = "PWM1"] - pub PWM1: PWM1, + pub pwm1: Pwm1, #[doc = "QSPI2"] - pub QSPI2: QSPI2, + pub qspi2: Qspi2, #[doc = "PWM2"] - pub PWM2: PWM2, + pub pwm2: Pwm2, } impl Peripherals { #[doc = r" Returns all the peripherals *once*."] @@ -741,63 +1070,25 @@ impl Peripherals { pub unsafe fn steal() -> Self { DEVICE_PERIPHERALS = true; Peripherals { - CLINT: CLINT { - _marker: PhantomData, - }, - PLIC: PLIC { - _marker: PhantomData, - }, - WDOG: WDOG { - _marker: PhantomData, - }, - RTC: RTC { - _marker: PhantomData, - }, - AONCLK: AONCLK { - _marker: PhantomData, - }, - BACKUP: BACKUP { - _marker: PhantomData, - }, - PMU: PMU { - _marker: PhantomData, - }, - PRCI: PRCI { - _marker: PhantomData, - }, - OTP: OTP { - _marker: PhantomData, - }, - GPIO0: GPIO0 { - _marker: PhantomData, - }, - UART0: UART0 { - _marker: PhantomData, - }, - QSPI0: QSPI0 { - _marker: PhantomData, - }, - PWM0: PWM0 { - _marker: PhantomData, - }, - I2C0: I2C0 { - _marker: PhantomData, - }, - UART1: UART1 { - _marker: PhantomData, - }, - QSPI1: QSPI1 { - _marker: PhantomData, - }, - PWM1: PWM1 { - _marker: PhantomData, - }, - QSPI2: QSPI2 { - _marker: PhantomData, - }, - PWM2: PWM2 { - _marker: PhantomData, - }, + clint: Clint::steal(), + plic: Plic::steal(), + wdog: Wdog::steal(), + rtc: Rtc::steal(), + aonclk: Aonclk::steal(), + backup: Backup::steal(), + pmu: Pmu::steal(), + prci: Prci::steal(), + otp: Otp::steal(), + gpio0: Gpio0::steal(), + uart0: Uart0::steal(), + qspi0: Qspi0::steal(), + pwm0: Pwm0::steal(), + i2c0: I2c0::steal(), + uart1: Uart1::steal(), + qspi1: Qspi1::steal(), + pwm1: Pwm1::steal(), + qspi2: Qspi2::steal(), + pwm2: Pwm2::steal(), } } } diff --git a/src/otp.rs b/src/otp.rs index 4b2ae26..d4ea297 100644 --- a/src/otp.rs +++ b/src/otp.rs @@ -1,88 +1,174 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { + lock: Lock, + clock: Clock, + output_en: OutputEn, + select: Select, + write_en: WriteEn, + mode: Mode, + mrr: Mrr, + mpp: Mpp, + vrren: Vrren, + vppen: Vppen, + addr: Addr, + data_in: DataIn, + data_out: DataOut, + rsctrl: Rsctrl, +} +impl RegisterBlock { #[doc = "0x00 - Programmed-I/O lock register"] - pub lock: LOCK, + #[inline(always)] + pub const fn lock(&self) -> &Lock { + &self.lock + } #[doc = "0x04 - OTP device clock signal"] - pub clock: CLOCK, + #[inline(always)] + pub const fn clock(&self) -> &Clock { + &self.clock + } #[doc = "0x08 - OTP device output-enable signal"] - pub output_en: OUTPUT_EN, + #[inline(always)] + pub const fn output_en(&self) -> &OutputEn { + &self.output_en + } #[doc = "0x0c - OTP device chip-select signal"] - pub select: SELECT, + #[inline(always)] + pub const fn select(&self) -> &Select { + &self.select + } #[doc = "0x10 - OTP device write-enable signal"] - pub write_en: WRITE_EN, + #[inline(always)] + pub const fn write_en(&self) -> &WriteEn { + &self.write_en + } #[doc = "0x14 - OTP device mode register"] - pub mode: MODE, + #[inline(always)] + pub const fn mode(&self) -> &Mode { + &self.mode + } #[doc = "0x18 - OTP read-voltage regulator control"] - pub mrr: MRR, + #[inline(always)] + pub const fn mrr(&self) -> &Mrr { + &self.mrr + } #[doc = "0x1c - OTP write-voltage charge pump control"] - pub mpp: MPP, + #[inline(always)] + pub const fn mpp(&self) -> &Mpp { + &self.mpp + } #[doc = "0x20 - OTP read-voltage enable"] - pub vrren: VRREN, + #[inline(always)] + pub const fn vrren(&self) -> &Vrren { + &self.vrren + } #[doc = "0x24 - OTP write-voltage enable"] - pub vppen: VPPEN, + #[inline(always)] + pub const fn vppen(&self) -> &Vppen { + &self.vppen + } #[doc = "0x28 - OTP device address"] - pub addr: ADDR, + #[inline(always)] + pub const fn addr(&self) -> &Addr { + &self.addr + } #[doc = "0x2c - OTP device data input"] - pub data_in: DATA_IN, + #[inline(always)] + pub const fn data_in(&self) -> &DataIn { + &self.data_in + } #[doc = "0x30 - OTP device data output"] - pub data_out: DATA_OUT, + #[inline(always)] + pub const fn data_out(&self) -> &DataOut { + &self.data_out + } #[doc = "0x34 - OTP read sequencer control"] - pub rsctrl: RSCTRL, + #[inline(always)] + pub const fn rsctrl(&self) -> &Rsctrl { + &self.rsctrl + } } -#[doc = "lock (rw) register accessor: an alias for `Reg`"] -pub type LOCK = crate::Reg; +#[doc = "lock (rw) register accessor: Programmed-I/O lock register\n\nYou can [`read`](crate::Reg::read) this register and get [`lock::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`lock::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@lock`] +module"] +#[doc(alias = "lock")] +pub type Lock = crate::Reg; #[doc = "Programmed-I/O lock register"] pub mod lock; -#[doc = "clock (rw) register accessor: an alias for `Reg`"] -pub type CLOCK = crate::Reg; +#[doc = "clock (rw) register accessor: OTP device clock signal\n\nYou can [`read`](crate::Reg::read) this register and get [`clock::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`clock::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clock`] +module"] +#[doc(alias = "clock")] +pub type Clock = crate::Reg; #[doc = "OTP device clock signal"] pub mod clock; -#[doc = "output_en (rw) register accessor: an alias for `Reg`"] -pub type OUTPUT_EN = crate::Reg; +#[doc = "output_en (rw) register accessor: OTP device output-enable signal\n\nYou can [`read`](crate::Reg::read) this register and get [`output_en::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`output_en::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@output_en`] +module"] +#[doc(alias = "output_en")] +pub type OutputEn = crate::Reg; #[doc = "OTP device output-enable signal"] pub mod output_en; -#[doc = "select (rw) register accessor: an alias for `Reg`"] -pub type SELECT = crate::Reg; +#[doc = "select (rw) register accessor: OTP device chip-select signal\n\nYou can [`read`](crate::Reg::read) this register and get [`select::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`select::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@select`] +module"] +#[doc(alias = "select")] +pub type Select = crate::Reg; #[doc = "OTP device chip-select signal"] pub mod select; -#[doc = "write_en (rw) register accessor: an alias for `Reg`"] -pub type WRITE_EN = crate::Reg; +#[doc = "write_en (rw) register accessor: OTP device write-enable signal\n\nYou can [`read`](crate::Reg::read) this register and get [`write_en::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`write_en::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@write_en`] +module"] +#[doc(alias = "write_en")] +pub type WriteEn = crate::Reg; #[doc = "OTP device write-enable signal"] pub mod write_en; -#[doc = "mode (rw) register accessor: an alias for `Reg`"] -pub type MODE = crate::Reg; +#[doc = "mode (rw) register accessor: OTP device mode register\n\nYou can [`read`](crate::Reg::read) this register and get [`mode::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mode::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mode`] +module"] +#[doc(alias = "mode")] +pub type Mode = crate::Reg; #[doc = "OTP device mode register"] pub mod mode; -#[doc = "mrr (rw) register accessor: an alias for `Reg`"] -pub type MRR = crate::Reg; +#[doc = "mrr (rw) register accessor: OTP read-voltage regulator control\n\nYou can [`read`](crate::Reg::read) this register and get [`mrr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mrr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mrr`] +module"] +#[doc(alias = "mrr")] +pub type Mrr = crate::Reg; #[doc = "OTP read-voltage regulator control"] pub mod mrr; -#[doc = "mpp (rw) register accessor: an alias for `Reg`"] -pub type MPP = crate::Reg; +#[doc = "mpp (rw) register accessor: OTP write-voltage charge pump control\n\nYou can [`read`](crate::Reg::read) this register and get [`mpp::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mpp::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpp`] +module"] +#[doc(alias = "mpp")] +pub type Mpp = crate::Reg; #[doc = "OTP write-voltage charge pump control"] pub mod mpp; -#[doc = "vrren (rw) register accessor: an alias for `Reg`"] -pub type VRREN = crate::Reg; +#[doc = "vrren (rw) register accessor: OTP read-voltage enable\n\nYou can [`read`](crate::Reg::read) this register and get [`vrren::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`vrren::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@vrren`] +module"] +#[doc(alias = "vrren")] +pub type Vrren = crate::Reg; #[doc = "OTP read-voltage enable"] pub mod vrren; -#[doc = "vppen (rw) register accessor: an alias for `Reg`"] -pub type VPPEN = crate::Reg; +#[doc = "vppen (rw) register accessor: OTP write-voltage enable\n\nYou can [`read`](crate::Reg::read) this register and get [`vppen::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`vppen::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@vppen`] +module"] +#[doc(alias = "vppen")] +pub type Vppen = crate::Reg; #[doc = "OTP write-voltage enable"] pub mod vppen; -#[doc = "addr (rw) register accessor: an alias for `Reg`"] -pub type ADDR = crate::Reg; +#[doc = "addr (rw) register accessor: OTP device address\n\nYou can [`read`](crate::Reg::read) this register and get [`addr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`addr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@addr`] +module"] +#[doc(alias = "addr")] +pub type Addr = crate::Reg; #[doc = "OTP device address"] pub mod addr; -#[doc = "data_in (rw) register accessor: an alias for `Reg`"] -pub type DATA_IN = crate::Reg; +#[doc = "data_in (rw) register accessor: OTP device data input\n\nYou can [`read`](crate::Reg::read) this register and get [`data_in::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`data_in::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@data_in`] +module"] +#[doc(alias = "data_in")] +pub type DataIn = crate::Reg; #[doc = "OTP device data input"] pub mod data_in; -#[doc = "data_out (rw) register accessor: an alias for `Reg`"] -pub type DATA_OUT = crate::Reg; +#[doc = "data_out (rw) register accessor: OTP device data output\n\nYou can [`read`](crate::Reg::read) this register and get [`data_out::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`data_out::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@data_out`] +module"] +#[doc(alias = "data_out")] +pub type DataOut = crate::Reg; #[doc = "OTP device data output"] pub mod data_out; -#[doc = "rsctrl (rw) register accessor: an alias for `Reg`"] -pub type RSCTRL = crate::Reg; +#[doc = "rsctrl (rw) register accessor: OTP read sequencer control\n\nYou can [`read`](crate::Reg::read) this register and get [`rsctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rsctrl::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rsctrl`] +module"] +#[doc(alias = "rsctrl")] +pub type Rsctrl = crate::Reg; #[doc = "OTP read sequencer control"] pub mod rsctrl; diff --git a/src/otp/addr.rs b/src/otp/addr.rs index f9abf39..5aea566 100644 --- a/src/otp/addr.rs +++ b/src/otp/addr.rs @@ -1,64 +1,27 @@ #[doc = "Register `addr` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `addr` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP device 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 { +impl W {} +#[doc = "OTP device address\n\nYou can [`read`](crate::Reg::read) this register and get [`addr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`addr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct AddrSpec; +impl crate::RegisterSpec for AddrSpec { 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 = "`read()` method returns [`addr::R`](R) reader structure"] +impl crate::Readable for AddrSpec {} +#[doc = "`write(|w| ..)` method takes [`addr::W`](W) writer structure"] +impl crate::Writable for AddrSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets addr to value 0"] -impl crate::Resettable for ADDR_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for AddrSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/clock.rs b/src/otp/clock.rs index d7d6d0d..6929538 100644 --- a/src/otp/clock.rs +++ b/src/otp/clock.rs @@ -1,64 +1,27 @@ #[doc = "Register `clock` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `clock` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP device clock signal\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 [clock](index.html) module"] -pub struct CLOCK_SPEC; -impl crate::RegisterSpec for CLOCK_SPEC { +impl W {} +#[doc = "OTP device clock signal\n\nYou can [`read`](crate::Reg::read) this register and get [`clock::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`clock::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct ClockSpec; +impl crate::RegisterSpec for ClockSpec { type Ux = u32; } -#[doc = "`read()` method returns [clock::R](R) reader structure"] -impl crate::Readable for CLOCK_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [clock::W](W) writer structure"] -impl crate::Writable for CLOCK_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`clock::R`](R) reader structure"] +impl crate::Readable for ClockSpec {} +#[doc = "`write(|w| ..)` method takes [`clock::W`](W) writer structure"] +impl crate::Writable for ClockSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets clock to value 0"] -impl crate::Resettable for CLOCK_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for ClockSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/data_in.rs b/src/otp/data_in.rs index c55ec38..e804aab 100644 --- a/src/otp/data_in.rs +++ b/src/otp/data_in.rs @@ -1,64 +1,27 @@ #[doc = "Register `data_in` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `data_in` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP device data 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 [data_in](index.html) module"] -pub struct DATA_IN_SPEC; -impl crate::RegisterSpec for DATA_IN_SPEC { +impl W {} +#[doc = "OTP device data input\n\nYou can [`read`](crate::Reg::read) this register and get [`data_in::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`data_in::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct DataInSpec; +impl crate::RegisterSpec for DataInSpec { type Ux = u32; } -#[doc = "`read()` method returns [data_in::R](R) reader structure"] -impl crate::Readable for DATA_IN_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [data_in::W](W) writer structure"] -impl crate::Writable for DATA_IN_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`data_in::R`](R) reader structure"] +impl crate::Readable for DataInSpec {} +#[doc = "`write(|w| ..)` method takes [`data_in::W`](W) writer structure"] +impl crate::Writable for DataInSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets data_in to value 0"] -impl crate::Resettable for DATA_IN_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for DataInSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/data_out.rs b/src/otp/data_out.rs index 34d2033..c2523c8 100644 --- a/src/otp/data_out.rs +++ b/src/otp/data_out.rs @@ -1,64 +1,27 @@ #[doc = "Register `data_out` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `data_out` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP device data output\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 [data_out](index.html) module"] -pub struct DATA_OUT_SPEC; -impl crate::RegisterSpec for DATA_OUT_SPEC { +impl W {} +#[doc = "OTP device data output\n\nYou can [`read`](crate::Reg::read) this register and get [`data_out::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`data_out::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct DataOutSpec; +impl crate::RegisterSpec for DataOutSpec { type Ux = u32; } -#[doc = "`read()` method returns [data_out::R](R) reader structure"] -impl crate::Readable for DATA_OUT_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [data_out::W](W) writer structure"] -impl crate::Writable for DATA_OUT_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`data_out::R`](R) reader structure"] +impl crate::Readable for DataOutSpec {} +#[doc = "`write(|w| ..)` method takes [`data_out::W`](W) writer structure"] +impl crate::Writable for DataOutSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets data_out to value 0"] -impl crate::Resettable for DATA_OUT_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for DataOutSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/lock.rs b/src/otp/lock.rs index 0f1b8f6..97234e7 100644 --- a/src/otp/lock.rs +++ b/src/otp/lock.rs @@ -1,64 +1,27 @@ #[doc = "Register `lock` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `lock` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Programmed-I/O lock register\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 { +impl W {} +#[doc = "Programmed-I/O lock register\n\nYou can [`read`](crate::Reg::read) this register and get [`lock::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`lock::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct LockSpec; +impl crate::RegisterSpec for LockSpec { type Ux = u32; } -#[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 = "`read()` method returns [`lock::R`](R) reader structure"] +impl crate::Readable for LockSpec {} +#[doc = "`write(|w| ..)` method takes [`lock::W`](W) writer structure"] +impl crate::Writable for LockSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets lock to value 0"] -impl crate::Resettable for LOCK_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for LockSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/mode.rs b/src/otp/mode.rs index 6bbabd3..be2cfad 100644 --- a/src/otp/mode.rs +++ b/src/otp/mode.rs @@ -1,64 +1,27 @@ #[doc = "Register `mode` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `mode` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP device mode register\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 [mode](index.html) module"] -pub struct MODE_SPEC; -impl crate::RegisterSpec for MODE_SPEC { +impl W {} +#[doc = "OTP device mode register\n\nYou can [`read`](crate::Reg::read) this register and get [`mode::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mode::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct ModeSpec; +impl crate::RegisterSpec for ModeSpec { type Ux = u32; } -#[doc = "`read()` method returns [mode::R](R) reader structure"] -impl crate::Readable for MODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mode::W](W) writer structure"] -impl crate::Writable for MODE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`mode::R`](R) reader structure"] +impl crate::Readable for ModeSpec {} +#[doc = "`write(|w| ..)` method takes [`mode::W`](W) writer structure"] +impl crate::Writable for ModeSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets mode to value 0"] -impl crate::Resettable for MODE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for ModeSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/mpp.rs b/src/otp/mpp.rs index 4ec4d71..db4576e 100644 --- a/src/otp/mpp.rs +++ b/src/otp/mpp.rs @@ -1,64 +1,27 @@ #[doc = "Register `mpp` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `mpp` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP write-voltage charge pump 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 [mpp](index.html) module"] -pub struct MPP_SPEC; -impl crate::RegisterSpec for MPP_SPEC { +impl W {} +#[doc = "OTP write-voltage charge pump control\n\nYou can [`read`](crate::Reg::read) this register and get [`mpp::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mpp::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct MppSpec; +impl crate::RegisterSpec for MppSpec { type Ux = u32; } -#[doc = "`read()` method returns [mpp::R](R) reader structure"] -impl crate::Readable for MPP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mpp::W](W) writer structure"] -impl crate::Writable for MPP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`mpp::R`](R) reader structure"] +impl crate::Readable for MppSpec {} +#[doc = "`write(|w| ..)` method takes [`mpp::W`](W) writer structure"] +impl crate::Writable for MppSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets mpp to value 0"] -impl crate::Resettable for MPP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for MppSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/mrr.rs b/src/otp/mrr.rs index eadb3c3..e19a648 100644 --- a/src/otp/mrr.rs +++ b/src/otp/mrr.rs @@ -1,64 +1,27 @@ #[doc = "Register `mrr` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `mrr` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP read-voltage regulator 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 [mrr](index.html) module"] -pub struct MRR_SPEC; -impl crate::RegisterSpec for MRR_SPEC { +impl W {} +#[doc = "OTP read-voltage regulator control\n\nYou can [`read`](crate::Reg::read) this register and get [`mrr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mrr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct MrrSpec; +impl crate::RegisterSpec for MrrSpec { type Ux = u32; } -#[doc = "`read()` method returns [mrr::R](R) reader structure"] -impl crate::Readable for MRR_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mrr::W](W) writer structure"] -impl crate::Writable for MRR_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`mrr::R`](R) reader structure"] +impl crate::Readable for MrrSpec {} +#[doc = "`write(|w| ..)` method takes [`mrr::W`](W) writer structure"] +impl crate::Writable for MrrSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets mrr to value 0"] -impl crate::Resettable for MRR_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for MrrSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/output_en.rs b/src/otp/output_en.rs index 2eea6a5..09f9eb8 100644 --- a/src/otp/output_en.rs +++ b/src/otp/output_en.rs @@ -1,64 +1,27 @@ #[doc = "Register `output_en` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `output_en` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP device output-enable signal\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 [output_en](index.html) module"] -pub struct OUTPUT_EN_SPEC; -impl crate::RegisterSpec for OUTPUT_EN_SPEC { +impl W {} +#[doc = "OTP device output-enable signal\n\nYou can [`read`](crate::Reg::read) this register and get [`output_en::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`output_en::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct OutputEnSpec; +impl crate::RegisterSpec for OutputEnSpec { type Ux = u32; } -#[doc = "`read()` method returns [output_en::R](R) reader structure"] -impl crate::Readable for OUTPUT_EN_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [output_en::W](W) writer structure"] -impl crate::Writable for OUTPUT_EN_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`output_en::R`](R) reader structure"] +impl crate::Readable for OutputEnSpec {} +#[doc = "`write(|w| ..)` method takes [`output_en::W`](W) writer structure"] +impl crate::Writable for OutputEnSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets output_en to value 0"] -impl crate::Resettable for OUTPUT_EN_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for OutputEnSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/rsctrl.rs b/src/otp/rsctrl.rs index 7789510..0473d25 100644 --- a/src/otp/rsctrl.rs +++ b/src/otp/rsctrl.rs @@ -1,64 +1,27 @@ #[doc = "Register `rsctrl` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rsctrl` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP read sequencer 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 [rsctrl](index.html) module"] -pub struct RSCTRL_SPEC; -impl crate::RegisterSpec for RSCTRL_SPEC { +impl W {} +#[doc = "OTP read sequencer control\n\nYou can [`read`](crate::Reg::read) this register and get [`rsctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rsctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RsctrlSpec; +impl crate::RegisterSpec for RsctrlSpec { type Ux = u32; } -#[doc = "`read()` method returns [rsctrl::R](R) reader structure"] -impl crate::Readable for RSCTRL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rsctrl::W](W) writer structure"] -impl crate::Writable for RSCTRL_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rsctrl::R`](R) reader structure"] +impl crate::Readable for RsctrlSpec {} +#[doc = "`write(|w| ..)` method takes [`rsctrl::W`](W) writer structure"] +impl crate::Writable for RsctrlSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rsctrl to value 0"] -impl crate::Resettable for RSCTRL_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RsctrlSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/select.rs b/src/otp/select.rs index 8795549..bad465d 100644 --- a/src/otp/select.rs +++ b/src/otp/select.rs @@ -1,64 +1,27 @@ #[doc = "Register `select` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `select` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP device chip-select signal\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 [select](index.html) module"] -pub struct SELECT_SPEC; -impl crate::RegisterSpec for SELECT_SPEC { +impl W {} +#[doc = "OTP device chip-select signal\n\nYou can [`read`](crate::Reg::read) this register and get [`select::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`select::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct SelectSpec; +impl crate::RegisterSpec for SelectSpec { type Ux = u32; } -#[doc = "`read()` method returns [select::R](R) reader structure"] -impl crate::Readable for SELECT_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [select::W](W) writer structure"] -impl crate::Writable for SELECT_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`select::R`](R) reader structure"] +impl crate::Readable for SelectSpec {} +#[doc = "`write(|w| ..)` method takes [`select::W`](W) writer structure"] +impl crate::Writable for SelectSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets select to value 0"] -impl crate::Resettable for SELECT_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for SelectSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/vppen.rs b/src/otp/vppen.rs index 46322c0..8f19566 100644 --- a/src/otp/vppen.rs +++ b/src/otp/vppen.rs @@ -1,64 +1,27 @@ #[doc = "Register `vppen` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `vppen` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP write-voltage enable\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 [vppen](index.html) module"] -pub struct VPPEN_SPEC; -impl crate::RegisterSpec for VPPEN_SPEC { +impl W {} +#[doc = "OTP write-voltage enable\n\nYou can [`read`](crate::Reg::read) this register and get [`vppen::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`vppen::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct VppenSpec; +impl crate::RegisterSpec for VppenSpec { type Ux = u32; } -#[doc = "`read()` method returns [vppen::R](R) reader structure"] -impl crate::Readable for VPPEN_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [vppen::W](W) writer structure"] -impl crate::Writable for VPPEN_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`vppen::R`](R) reader structure"] +impl crate::Readable for VppenSpec {} +#[doc = "`write(|w| ..)` method takes [`vppen::W`](W) writer structure"] +impl crate::Writable for VppenSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets vppen to value 0"] -impl crate::Resettable for VPPEN_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for VppenSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/vrren.rs b/src/otp/vrren.rs index ab7739d..d16a127 100644 --- a/src/otp/vrren.rs +++ b/src/otp/vrren.rs @@ -1,64 +1,27 @@ #[doc = "Register `vrren` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `vrren` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP read-voltage enable\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 [vrren](index.html) module"] -pub struct VRREN_SPEC; -impl crate::RegisterSpec for VRREN_SPEC { +impl W {} +#[doc = "OTP read-voltage enable\n\nYou can [`read`](crate::Reg::read) this register and get [`vrren::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`vrren::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct VrrenSpec; +impl crate::RegisterSpec for VrrenSpec { type Ux = u32; } -#[doc = "`read()` method returns [vrren::R](R) reader structure"] -impl crate::Readable for VRREN_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [vrren::W](W) writer structure"] -impl crate::Writable for VRREN_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`vrren::R`](R) reader structure"] +impl crate::Readable for VrrenSpec {} +#[doc = "`write(|w| ..)` method takes [`vrren::W`](W) writer structure"] +impl crate::Writable for VrrenSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets vrren to value 0"] -impl crate::Resettable for VRREN_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for VrrenSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/otp/write_en.rs b/src/otp/write_en.rs index 3730778..38ed46b 100644 --- a/src/otp/write_en.rs +++ b/src/otp/write_en.rs @@ -1,64 +1,27 @@ #[doc = "Register `write_en` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `write_en` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "OTP device write-enable signal\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 [write_en](index.html) module"] -pub struct WRITE_EN_SPEC; -impl crate::RegisterSpec for WRITE_EN_SPEC { +impl W {} +#[doc = "OTP device write-enable signal\n\nYou can [`read`](crate::Reg::read) this register and get [`write_en::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`write_en::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct WriteEnSpec; +impl crate::RegisterSpec for WriteEnSpec { type Ux = u32; } -#[doc = "`read()` method returns [write_en::R](R) reader structure"] -impl crate::Readable for WRITE_EN_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [write_en::W](W) writer structure"] -impl crate::Writable for WRITE_EN_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`write_en::R`](R) reader structure"] +impl crate::Readable for WriteEnSpec {} +#[doc = "`write(|w| ..)` method takes [`write_en::W`](W) writer structure"] +impl crate::Writable for WriteEnSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets write_en to value 0"] -impl crate::Resettable for WRITE_EN_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for WriteEnSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/plic.rs b/src/plic.rs index 896b26c..0fcb34a 100644 --- a/src/plic.rs +++ b/src/plic.rs @@ -1,37 +1,87 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { - #[doc = "0x00..0xd4 - Interrupt Priority Register"] - pub priority: [PRIORITY; 53], + priority: [Priority; 53], _reserved1: [u8; 0x0f2c], - #[doc = "0x1000..0x1008 - Interrupt Pending Register"] - pub pending: [PENDING; 2], + pending: [Pending; 2], _reserved2: [u8; 0x0ff8], - #[doc = "0x2000..0x2008 - Interrupt Enable Register"] - pub enable: [ENABLE; 2], + enable: [Enable; 2], _reserved3: [u8; 0x001f_dff8], + threshold: Threshold, + claim: Claim, +} +impl RegisterBlock { + #[doc = "0x00..0xd4 - Interrupt Priority Register"] + #[inline(always)] + pub const fn priority(&self, n: usize) -> &Priority { + &self.priority[n] + } + #[doc = "Iterator for array of:"] + #[doc = "0x00..0xd4 - Interrupt Priority Register"] + #[inline(always)] + pub fn priority_iter(&self) -> impl Iterator { + self.priority.iter() + } + #[doc = "0x1000..0x1008 - Interrupt Pending Register"] + #[inline(always)] + pub const fn pending(&self, n: usize) -> &Pending { + &self.pending[n] + } + #[doc = "Iterator for array of:"] + #[doc = "0x1000..0x1008 - Interrupt Pending Register"] + #[inline(always)] + pub fn pending_iter(&self) -> impl Iterator { + self.pending.iter() + } + #[doc = "0x2000..0x2008 - Interrupt Enable Register"] + #[inline(always)] + pub const fn enable(&self, n: usize) -> &Enable { + &self.enable[n] + } + #[doc = "Iterator for array of:"] + #[doc = "0x2000..0x2008 - Interrupt Enable Register"] + #[inline(always)] + pub fn enable_iter(&self) -> impl Iterator { + self.enable.iter() + } #[doc = "0x200000 - Priority Threshold Register"] - pub threshold: THRESHOLD, + #[inline(always)] + pub const fn threshold(&self) -> &Threshold { + &self.threshold + } #[doc = "0x200004 - Claim/Complete Register"] - pub claim: CLAIM, + #[inline(always)] + pub const fn claim(&self) -> &Claim { + &self.claim + } } -#[doc = "priority (rw) register accessor: an alias for `Reg`"] -pub type PRIORITY = crate::Reg; +#[doc = "priority (rw) register accessor: Interrupt Priority Register\n\nYou can [`read`](crate::Reg::read) this register and get [`priority::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`priority::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@priority`] +module"] +#[doc(alias = "priority")] +pub type Priority = crate::Reg; #[doc = "Interrupt Priority Register"] pub mod priority; -#[doc = "pending (rw) register accessor: an alias for `Reg`"] -pub type PENDING = crate::Reg; +#[doc = "pending (rw) register accessor: Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pending::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pending::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pending`] +module"] +#[doc(alias = "pending")] +pub type Pending = crate::Reg; #[doc = "Interrupt Pending Register"] pub mod pending; -#[doc = "enable (rw) register accessor: an alias for `Reg`"] -pub type ENABLE = crate::Reg; +#[doc = "enable (rw) register accessor: Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`enable::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`enable::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@enable`] +module"] +#[doc(alias = "enable")] +pub type Enable = crate::Reg; #[doc = "Interrupt Enable Register"] pub mod enable; -#[doc = "threshold (rw) register accessor: an alias for `Reg`"] -pub type THRESHOLD = crate::Reg; +#[doc = "threshold (rw) register accessor: Priority Threshold Register\n\nYou can [`read`](crate::Reg::read) this register and get [`threshold::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`threshold::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@threshold`] +module"] +#[doc(alias = "threshold")] +pub type Threshold = crate::Reg; #[doc = "Priority Threshold Register"] pub mod threshold; -#[doc = "claim (rw) register accessor: an alias for `Reg`"] -pub type CLAIM = crate::Reg; +#[doc = "claim (rw) register accessor: Claim/Complete Register\n\nYou can [`read`](crate::Reg::read) this register and get [`claim::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`claim::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@claim`] +module"] +#[doc(alias = "claim")] +pub type Claim = crate::Reg; #[doc = "Claim/Complete Register"] pub mod claim; diff --git a/src/plic/claim.rs b/src/plic/claim.rs index 9a84589..94bbdef 100644 --- a/src/plic/claim.rs +++ b/src/plic/claim.rs @@ -1,64 +1,27 @@ #[doc = "Register `claim` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `claim` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Claim/Complete Register\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 [claim](index.html) module"] -pub struct CLAIM_SPEC; -impl crate::RegisterSpec for CLAIM_SPEC { +impl W {} +#[doc = "Claim/Complete Register\n\nYou can [`read`](crate::Reg::read) this register and get [`claim::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`claim::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct ClaimSpec; +impl crate::RegisterSpec for ClaimSpec { type Ux = u32; } -#[doc = "`read()` method returns [claim::R](R) reader structure"] -impl crate::Readable for CLAIM_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [claim::W](W) writer structure"] -impl crate::Writable for CLAIM_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`claim::R`](R) reader structure"] +impl crate::Readable for ClaimSpec {} +#[doc = "`write(|w| ..)` method takes [`claim::W`](W) writer structure"] +impl crate::Writable for ClaimSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets claim to value 0"] -impl crate::Resettable for CLAIM_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for ClaimSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/plic/enable.rs b/src/plic/enable.rs index b1062f6..49582b8 100644 --- a/src/plic/enable.rs +++ b/src/plic/enable.rs @@ -1,65 +1,28 @@ #[doc = "Register `enable[%s]` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `enable[%s]` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Interrupt Enable Register\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 [enable](index.html) module"] -pub struct ENABLE_SPEC; -impl crate::RegisterSpec for ENABLE_SPEC { +impl W {} +#[doc = "Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`enable::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`enable::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct EnableSpec; +impl crate::RegisterSpec for EnableSpec { type Ux = u32; } -#[doc = "`read()` method returns [enable::R](R) reader structure"] -impl crate::Readable for ENABLE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] -impl crate::Writable for ENABLE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`enable::R`](R) reader structure"] +impl crate::Readable for EnableSpec {} +#[doc = "`write(|w| ..)` method takes [`enable::W`](W) writer structure"] +impl crate::Writable for EnableSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets enable[%s] to value 0"] -impl crate::Resettable for ENABLE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for EnableSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/plic/pending.rs b/src/plic/pending.rs index 4f4ee5f..7edf1ec 100644 --- a/src/plic/pending.rs +++ b/src/plic/pending.rs @@ -1,65 +1,28 @@ #[doc = "Register `pending[%s]` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `pending[%s]` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Interrupt Pending Register\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 [pending](index.html) module"] -pub struct PENDING_SPEC; -impl crate::RegisterSpec for PENDING_SPEC { +impl W {} +#[doc = "Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pending::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pending::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PendingSpec; +impl crate::RegisterSpec for PendingSpec { type Ux = u32; } -#[doc = "`read()` method returns [pending::R](R) reader structure"] -impl crate::Readable for PENDING_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [pending::W](W) writer structure"] -impl crate::Writable for PENDING_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`pending::R`](R) reader structure"] +impl crate::Readable for PendingSpec {} +#[doc = "`write(|w| ..)` method takes [`pending::W`](W) writer structure"] +impl crate::Writable for PendingSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets pending[%s] to value 0"] -impl crate::Resettable for PENDING_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PendingSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/plic/priority.rs b/src/plic/priority.rs index fd62cf5..b63d655 100644 --- a/src/plic/priority.rs +++ b/src/plic/priority.rs @@ -1,45 +1,11 @@ #[doc = "Register `priority[%s]` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `priority[%s]` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -#[doc = "Field `priority` reader - "] -pub type PRIORITY_R = crate::FieldReader; +pub type W = crate::W; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] -pub enum PRIORITY_A { +pub enum Priority { #[doc = "0: Priority 0 (never interrupt)"] P0 = 0, #[doc = "1: Priority 1"] @@ -57,152 +23,153 @@ pub enum PRIORITY_A { #[doc = "7: Priority 7"] P7 = 7, } -impl From for u8 { +impl From for u8 { #[inline(always)] - fn from(variant: PRIORITY_A) -> Self { + fn from(variant: Priority) -> Self { variant as _ } } -impl PRIORITY_R { +impl crate::FieldSpec for Priority { + type Ux = u8; +} +impl crate::IsEnum for Priority {} +#[doc = "Field `priority` reader - "] +pub type PriorityR = crate::FieldReader; +impl PriorityR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRIORITY_A { + pub const fn variant(&self) -> Priority { match self.bits { - 0 => PRIORITY_A::P0, - 1 => PRIORITY_A::P1, - 2 => PRIORITY_A::P2, - 3 => PRIORITY_A::P3, - 4 => PRIORITY_A::P4, - 5 => PRIORITY_A::P5, - 6 => PRIORITY_A::P6, - 7 => PRIORITY_A::P7, + 0 => Priority::P0, + 1 => Priority::P1, + 2 => Priority::P2, + 3 => Priority::P3, + 4 => Priority::P4, + 5 => Priority::P5, + 6 => Priority::P6, + 7 => Priority::P7, _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `P0`"] + #[doc = "Priority 0 (never interrupt)"] #[inline(always)] pub fn is_p0(&self) -> bool { - *self == PRIORITY_A::P0 + *self == Priority::P0 } - #[doc = "Checks if the value of the field is `P1`"] + #[doc = "Priority 1"] #[inline(always)] pub fn is_p1(&self) -> bool { - *self == PRIORITY_A::P1 + *self == Priority::P1 } - #[doc = "Checks if the value of the field is `P2`"] + #[doc = "Priority 2"] #[inline(always)] pub fn is_p2(&self) -> bool { - *self == PRIORITY_A::P2 + *self == Priority::P2 } - #[doc = "Checks if the value of the field is `P3`"] + #[doc = "Priority 3"] #[inline(always)] pub fn is_p3(&self) -> bool { - *self == PRIORITY_A::P3 + *self == Priority::P3 } - #[doc = "Checks if the value of the field is `P4`"] + #[doc = "Priority 4"] #[inline(always)] pub fn is_p4(&self) -> bool { - *self == PRIORITY_A::P4 + *self == Priority::P4 } - #[doc = "Checks if the value of the field is `P5`"] + #[doc = "Priority 5"] #[inline(always)] pub fn is_p5(&self) -> bool { - *self == PRIORITY_A::P5 + *self == Priority::P5 } - #[doc = "Checks if the value of the field is `P6`"] + #[doc = "Priority 6"] #[inline(always)] pub fn is_p6(&self) -> bool { - *self == PRIORITY_A::P6 + *self == Priority::P6 } - #[doc = "Checks if the value of the field is `P7`"] + #[doc = "Priority 7"] #[inline(always)] pub fn is_p7(&self) -> bool { - *self == PRIORITY_A::P7 + *self == Priority::P7 } } #[doc = "Field `priority` writer - "] -pub type PRIORITY_W<'a, const O: u8> = - crate::FieldWriterSafe<'a, u32, PRIORITY_SPEC, u8, PRIORITY_A, 3, O>; -impl<'a, const O: u8> PRIORITY_W<'a, O> { +pub type PriorityW<'a, REG> = crate::FieldWriter<'a, REG, 3, Priority, crate::Safe>; +impl<'a, REG> PriorityW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Priority 0 (never interrupt)"] #[inline(always)] - pub fn p0(self) -> &'a mut W { - self.variant(PRIORITY_A::P0) + pub fn p0(self) -> &'a mut crate::W { + self.variant(Priority::P0) } #[doc = "Priority 1"] #[inline(always)] - pub fn p1(self) -> &'a mut W { - self.variant(PRIORITY_A::P1) + pub fn p1(self) -> &'a mut crate::W { + self.variant(Priority::P1) } #[doc = "Priority 2"] #[inline(always)] - pub fn p2(self) -> &'a mut W { - self.variant(PRIORITY_A::P2) + pub fn p2(self) -> &'a mut crate::W { + self.variant(Priority::P2) } #[doc = "Priority 3"] #[inline(always)] - pub fn p3(self) -> &'a mut W { - self.variant(PRIORITY_A::P3) + pub fn p3(self) -> &'a mut crate::W { + self.variant(Priority::P3) } #[doc = "Priority 4"] #[inline(always)] - pub fn p4(self) -> &'a mut W { - self.variant(PRIORITY_A::P4) + pub fn p4(self) -> &'a mut crate::W { + self.variant(Priority::P4) } #[doc = "Priority 5"] #[inline(always)] - pub fn p5(self) -> &'a mut W { - self.variant(PRIORITY_A::P5) + pub fn p5(self) -> &'a mut crate::W { + self.variant(Priority::P5) } #[doc = "Priority 6"] #[inline(always)] - pub fn p6(self) -> &'a mut W { - self.variant(PRIORITY_A::P6) + pub fn p6(self) -> &'a mut crate::W { + self.variant(Priority::P6) } #[doc = "Priority 7"] #[inline(always)] - pub fn p7(self) -> &'a mut W { - self.variant(PRIORITY_A::P7) + pub fn p7(self) -> &'a mut crate::W { + self.variant(Priority::P7) } } impl R { #[doc = "Bits 0:2"] #[inline(always)] - pub fn priority(&self) -> PRIORITY_R { - PRIORITY_R::new((self.bits & 7) as u8) + pub fn priority(&self) -> PriorityR { + PriorityR::new((self.bits & 7) as u8) } } impl W { #[doc = "Bits 0:2"] #[inline(always)] - pub fn priority(&mut self) -> PRIORITY_W<0> { - PRIORITY_W::new(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 + #[must_use] + pub fn priority(&mut self) -> PriorityW { + PriorityW::new(self, 0) } } -#[doc = "Interrupt Priority Register\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 [priority](index.html) module"] -pub struct PRIORITY_SPEC; -impl crate::RegisterSpec for PRIORITY_SPEC { +#[doc = "Interrupt Priority Register\n\nYou can [`read`](crate::Reg::read) this register and get [`priority::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`priority::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PrioritySpec; +impl crate::RegisterSpec for PrioritySpec { type Ux = u32; } -#[doc = "`read()` method returns [priority::R](R) reader structure"] -impl crate::Readable for PRIORITY_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [priority::W](W) writer structure"] -impl crate::Writable for PRIORITY_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`priority::R`](R) reader structure"] +impl crate::Readable for PrioritySpec {} +#[doc = "`write(|w| ..)` method takes [`priority::W`](W) writer structure"] +impl crate::Writable for PrioritySpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets priority[%s] to value 0"] -impl crate::Resettable for PRIORITY_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PrioritySpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/plic/threshold.rs b/src/plic/threshold.rs index 76eede4..69a870d 100644 --- a/src/plic/threshold.rs +++ b/src/plic/threshold.rs @@ -1,45 +1,11 @@ #[doc = "Register `threshold` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `threshold` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -#[doc = "Field `priority` reader - "] -pub type PRIORITY_R = crate::FieldReader; +pub type W = crate::W; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] -pub enum PRIORITY_A { +pub enum Priority { #[doc = "0: Allow interrupts with priority > 0"] P0 = 0, #[doc = "1: Allow interrupts with priority > 1"] @@ -57,151 +23,152 @@ pub enum PRIORITY_A { #[doc = "7: Mask all interrupts"] P7 = 7, } -impl From for u8 { +impl From for u8 { #[inline(always)] - fn from(variant: PRIORITY_A) -> Self { + fn from(variant: Priority) -> Self { variant as _ } } -impl PRIORITY_R { +impl crate::FieldSpec for Priority { + type Ux = u8; +} +impl crate::IsEnum for Priority {} +#[doc = "Field `priority` reader - "] +pub type PriorityR = crate::FieldReader; +impl PriorityR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRIORITY_A { + pub const fn variant(&self) -> Priority { match self.bits { - 0 => PRIORITY_A::P0, - 1 => PRIORITY_A::P1, - 2 => PRIORITY_A::P2, - 3 => PRIORITY_A::P3, - 4 => PRIORITY_A::P4, - 5 => PRIORITY_A::P5, - 6 => PRIORITY_A::P6, - 7 => PRIORITY_A::P7, + 0 => Priority::P0, + 1 => Priority::P1, + 2 => Priority::P2, + 3 => Priority::P3, + 4 => Priority::P4, + 5 => Priority::P5, + 6 => Priority::P6, + 7 => Priority::P7, _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `P0`"] + #[doc = "Allow interrupts with priority > 0"] #[inline(always)] pub fn is_p0(&self) -> bool { - *self == PRIORITY_A::P0 + *self == Priority::P0 } - #[doc = "Checks if the value of the field is `P1`"] + #[doc = "Allow interrupts with priority > 1"] #[inline(always)] pub fn is_p1(&self) -> bool { - *self == PRIORITY_A::P1 + *self == Priority::P1 } - #[doc = "Checks if the value of the field is `P2`"] + #[doc = "Allow interrupts with priority > 2"] #[inline(always)] pub fn is_p2(&self) -> bool { - *self == PRIORITY_A::P2 + *self == Priority::P2 } - #[doc = "Checks if the value of the field is `P3`"] + #[doc = "Allow interrupts with priority > 3"] #[inline(always)] pub fn is_p3(&self) -> bool { - *self == PRIORITY_A::P3 + *self == Priority::P3 } - #[doc = "Checks if the value of the field is `P4`"] + #[doc = "Allow interrupts with priority > 4"] #[inline(always)] pub fn is_p4(&self) -> bool { - *self == PRIORITY_A::P4 + *self == Priority::P4 } - #[doc = "Checks if the value of the field is `P5`"] + #[doc = "Allow interrupts with priority > 5"] #[inline(always)] pub fn is_p5(&self) -> bool { - *self == PRIORITY_A::P5 + *self == Priority::P5 } - #[doc = "Checks if the value of the field is `P6`"] + #[doc = "Allow interrupts with priority > 6"] #[inline(always)] pub fn is_p6(&self) -> bool { - *self == PRIORITY_A::P6 + *self == Priority::P6 } - #[doc = "Checks if the value of the field is `P7`"] + #[doc = "Mask all interrupts"] #[inline(always)] pub fn is_p7(&self) -> bool { - *self == PRIORITY_A::P7 + *self == Priority::P7 } } #[doc = "Field `priority` writer - "] -pub type PRIORITY_W<'a, const O: u8> = - crate::FieldWriterSafe<'a, u32, THRESHOLD_SPEC, u8, PRIORITY_A, 3, O>; -impl<'a, const O: u8> PRIORITY_W<'a, O> { +pub type PriorityW<'a, REG> = crate::FieldWriter<'a, REG, 3, Priority, crate::Safe>; +impl<'a, REG> PriorityW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Allow interrupts with priority > 0"] #[inline(always)] - pub fn p0(self) -> &'a mut W { - self.variant(PRIORITY_A::P0) + pub fn p0(self) -> &'a mut crate::W { + self.variant(Priority::P0) } #[doc = "Allow interrupts with priority > 1"] #[inline(always)] - pub fn p1(self) -> &'a mut W { - self.variant(PRIORITY_A::P1) + pub fn p1(self) -> &'a mut crate::W { + self.variant(Priority::P1) } #[doc = "Allow interrupts with priority > 2"] #[inline(always)] - pub fn p2(self) -> &'a mut W { - self.variant(PRIORITY_A::P2) + pub fn p2(self) -> &'a mut crate::W { + self.variant(Priority::P2) } #[doc = "Allow interrupts with priority > 3"] #[inline(always)] - pub fn p3(self) -> &'a mut W { - self.variant(PRIORITY_A::P3) + pub fn p3(self) -> &'a mut crate::W { + self.variant(Priority::P3) } #[doc = "Allow interrupts with priority > 4"] #[inline(always)] - pub fn p4(self) -> &'a mut W { - self.variant(PRIORITY_A::P4) + pub fn p4(self) -> &'a mut crate::W { + self.variant(Priority::P4) } #[doc = "Allow interrupts with priority > 5"] #[inline(always)] - pub fn p5(self) -> &'a mut W { - self.variant(PRIORITY_A::P5) + pub fn p5(self) -> &'a mut crate::W { + self.variant(Priority::P5) } #[doc = "Allow interrupts with priority > 6"] #[inline(always)] - pub fn p6(self) -> &'a mut W { - self.variant(PRIORITY_A::P6) + pub fn p6(self) -> &'a mut crate::W { + self.variant(Priority::P6) } #[doc = "Mask all interrupts"] #[inline(always)] - pub fn p7(self) -> &'a mut W { - self.variant(PRIORITY_A::P7) + pub fn p7(self) -> &'a mut crate::W { + self.variant(Priority::P7) } } impl R { #[doc = "Bits 0:2"] #[inline(always)] - pub fn priority(&self) -> PRIORITY_R { - PRIORITY_R::new((self.bits & 7) as u8) + pub fn priority(&self) -> PriorityR { + PriorityR::new((self.bits & 7) as u8) } } impl W { #[doc = "Bits 0:2"] #[inline(always)] - pub fn priority(&mut self) -> PRIORITY_W<0> { - PRIORITY_W::new(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 + #[must_use] + pub fn priority(&mut self) -> PriorityW { + PriorityW::new(self, 0) } } -#[doc = "Priority Threshold Register\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 [threshold](index.html) module"] -pub struct THRESHOLD_SPEC; -impl crate::RegisterSpec for THRESHOLD_SPEC { +#[doc = "Priority Threshold Register\n\nYou can [`read`](crate::Reg::read) this register and get [`threshold::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`threshold::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct ThresholdSpec; +impl crate::RegisterSpec for ThresholdSpec { type Ux = u32; } -#[doc = "`read()` method returns [threshold::R](R) reader structure"] -impl crate::Readable for THRESHOLD_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [threshold::W](W) writer structure"] -impl crate::Writable for THRESHOLD_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`threshold::R`](R) reader structure"] +impl crate::Readable for ThresholdSpec {} +#[doc = "`write(|w| ..)` method takes [`threshold::W`](W) writer structure"] +impl crate::Writable for ThresholdSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets threshold to value 0"] -impl crate::Resettable for THRESHOLD_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for ThresholdSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pmu.rs b/src/pmu.rs index 4e2307e..507f326 100644 --- a/src/pmu.rs +++ b/src/pmu.rs @@ -1,41 +1,91 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { _reserved0: [u8; 0x0100], + pmuwakepm: [Pmuwakepm; 8], + pmusleeppm: [Pmusleeppm; 8], + pmuie: Pmuie, + pmucause: Pmucause, + pmusleep: Pmusleep, + pmukey: Pmukey, +} +impl RegisterBlock { + #[doc = "0x100..0x120 - PMU Wake Program Memory"] + #[inline(always)] + pub const fn pmuwakepm(&self, n: usize) -> &Pmuwakepm { + &self.pmuwakepm[n] + } + #[doc = "Iterator for array of:"] #[doc = "0x100..0x120 - PMU Wake Program Memory"] - pub pmuwakepm: [PMUWAKEPM; 8], + #[inline(always)] + pub fn pmuwakepm_iter(&self) -> impl Iterator { + self.pmuwakepm.iter() + } + #[doc = "0x120..0x140 - PMU Sleep Program Memory"] + #[inline(always)] + pub const fn pmusleeppm(&self, n: usize) -> &Pmusleeppm { + &self.pmusleeppm[n] + } + #[doc = "Iterator for array of:"] #[doc = "0x120..0x140 - PMU Sleep Program Memory"] - pub pmusleeppm: [PMUSLEEPPM; 8], + #[inline(always)] + pub fn pmusleeppm_iter(&self) -> impl Iterator { + self.pmusleeppm.iter() + } #[doc = "0x140 - PMU Interrupt Enable Register"] - pub pmuie: PMUIE, + #[inline(always)] + pub const fn pmuie(&self) -> &Pmuie { + &self.pmuie + } #[doc = "0x144 - PMU Cause Register"] - pub pmucause: PMUCAUSE, + #[inline(always)] + pub const fn pmucause(&self) -> &Pmucause { + &self.pmucause + } #[doc = "0x148 - PMU Sleep Register"] - pub pmusleep: PMUSLEEP, + #[inline(always)] + pub const fn pmusleep(&self) -> &Pmusleep { + &self.pmusleep + } #[doc = "0x14c - PMU Key Register"] - pub pmukey: PMUKEY, + #[inline(always)] + pub const fn pmukey(&self) -> &Pmukey { + &self.pmukey + } } -#[doc = "pmuwakepm (rw) register accessor: an alias for `Reg`"] -pub type PMUWAKEPM = crate::Reg; +#[doc = "pmuwakepm (rw) register accessor: PMU Wake Program Memory\n\nYou can [`read`](crate::Reg::read) this register and get [`pmuwakepm::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmuwakepm::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pmuwakepm`] +module"] +#[doc(alias = "pmuwakepm")] +pub type Pmuwakepm = crate::Reg; #[doc = "PMU Wake Program Memory"] pub mod pmuwakepm; -#[doc = "pmusleeppm (rw) register accessor: an alias for `Reg`"] -pub type PMUSLEEPPM = crate::Reg; +#[doc = "pmusleeppm (rw) register accessor: PMU Sleep Program Memory\n\nYou can [`read`](crate::Reg::read) this register and get [`pmusleeppm::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmusleeppm::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pmusleeppm`] +module"] +#[doc(alias = "pmusleeppm")] +pub type Pmusleeppm = crate::Reg; #[doc = "PMU Sleep Program Memory"] pub mod pmusleeppm; -#[doc = "pmuie (rw) register accessor: an alias for `Reg`"] -pub type PMUIE = crate::Reg; +#[doc = "pmuie (rw) register accessor: PMU Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pmuie::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmuie::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pmuie`] +module"] +#[doc(alias = "pmuie")] +pub type Pmuie = crate::Reg; #[doc = "PMU Interrupt Enable Register"] pub mod pmuie; -#[doc = "pmucause (rw) register accessor: an alias for `Reg`"] -pub type PMUCAUSE = crate::Reg; +#[doc = "pmucause (rw) register accessor: PMU Cause Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pmucause::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmucause::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pmucause`] +module"] +#[doc(alias = "pmucause")] +pub type Pmucause = crate::Reg; #[doc = "PMU Cause Register"] pub mod pmucause; -#[doc = "pmusleep (w) register accessor: an alias for `Reg`"] -pub type PMUSLEEP = crate::Reg; +#[doc = "pmusleep (w) register accessor: PMU Sleep Register\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmusleep::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pmusleep`] +module"] +#[doc(alias = "pmusleep")] +pub type Pmusleep = crate::Reg; #[doc = "PMU Sleep Register"] pub mod pmusleep; -#[doc = "pmukey (rw) register accessor: an alias for `Reg`"] -pub type PMUKEY = crate::Reg; +#[doc = "pmukey (rw) register accessor: PMU Key Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pmukey::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmukey::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pmukey`] +module"] +#[doc(alias = "pmukey")] +pub type Pmukey = crate::Reg; #[doc = "PMU Key Register"] pub mod pmukey; diff --git a/src/pmu/pmucause.rs b/src/pmu/pmucause.rs index 513b65b..f716e32 100644 --- a/src/pmu/pmucause.rs +++ b/src/pmu/pmucause.rs @@ -1,218 +1,193 @@ #[doc = "Register `pmucause` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `pmucause` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -#[doc = "Field `wakeupcause` reader - "] -pub type WAKEUPCAUSE_R = crate::FieldReader; +pub type W = crate::W; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] -pub enum WAKEUPCAUSE_A { +pub enum Wakeupcause { #[doc = "0: Reset wakeup"] - RESET = 0, + Reset = 0, #[doc = "1: RTC wakeup"] - RTC = 1, + Rtc = 1, #[doc = "2: Digital input wakeup"] - DIGITAL = 2, + Digital = 2, } -impl From for u8 { +impl From for u8 { #[inline(always)] - fn from(variant: WAKEUPCAUSE_A) -> Self { + fn from(variant: Wakeupcause) -> Self { variant as _ } } -impl WAKEUPCAUSE_R { +impl crate::FieldSpec for Wakeupcause { + type Ux = u8; +} +impl crate::IsEnum for Wakeupcause {} +#[doc = "Field `wakeupcause` reader - "] +pub type WakeupcauseR = crate::FieldReader; +impl WakeupcauseR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(WAKEUPCAUSE_A::RESET), - 1 => Some(WAKEUPCAUSE_A::RTC), - 2 => Some(WAKEUPCAUSE_A::DIGITAL), + 0 => Some(Wakeupcause::Reset), + 1 => Some(Wakeupcause::Rtc), + 2 => Some(Wakeupcause::Digital), _ => None, } } - #[doc = "Checks if the value of the field is `RESET`"] + #[doc = "Reset wakeup"] #[inline(always)] pub fn is_reset(&self) -> bool { - *self == WAKEUPCAUSE_A::RESET + *self == Wakeupcause::Reset } - #[doc = "Checks if the value of the field is `RTC`"] + #[doc = "RTC wakeup"] #[inline(always)] pub fn is_rtc(&self) -> bool { - *self == WAKEUPCAUSE_A::RTC + *self == Wakeupcause::Rtc } - #[doc = "Checks if the value of the field is `DIGITAL`"] + #[doc = "Digital input wakeup"] #[inline(always)] pub fn is_digital(&self) -> bool { - *self == WAKEUPCAUSE_A::DIGITAL + *self == Wakeupcause::Digital } } #[doc = "Field `wakeupcause` writer - "] -pub type WAKEUPCAUSE_W<'a, const O: u8> = - crate::FieldWriter<'a, u32, PMUCAUSE_SPEC, u8, WAKEUPCAUSE_A, 2, O>; -impl<'a, const O: u8> WAKEUPCAUSE_W<'a, O> { +pub type WakeupcauseW<'a, REG> = crate::FieldWriter<'a, REG, 2, Wakeupcause>; +impl<'a, REG> WakeupcauseW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Reset wakeup"] #[inline(always)] - pub fn reset(self) -> &'a mut W { - self.variant(WAKEUPCAUSE_A::RESET) + pub fn reset(self) -> &'a mut crate::W { + self.variant(Wakeupcause::Reset) } #[doc = "RTC wakeup"] #[inline(always)] - pub fn rtc(self) -> &'a mut W { - self.variant(WAKEUPCAUSE_A::RTC) + pub fn rtc(self) -> &'a mut crate::W { + self.variant(Wakeupcause::Rtc) } #[doc = "Digital input wakeup"] #[inline(always)] - pub fn digital(self) -> &'a mut W { - self.variant(WAKEUPCAUSE_A::DIGITAL) + pub fn digital(self) -> &'a mut crate::W { + self.variant(Wakeupcause::Digital) } } -#[doc = "Field `resetcause` reader - "] -pub type RESETCAUSE_R = crate::FieldReader; #[doc = "\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] -pub enum RESETCAUSE_A { +pub enum Resetcause { #[doc = "0: Power-on reset"] - POWER_ON = 0, + PowerOn = 0, #[doc = "1: External reset"] - EXTERNAL = 1, + External = 1, #[doc = "2: Watchdog reset"] - WATCHDOG = 2, + Watchdog = 2, } -impl From for u8 { +impl From for u8 { #[inline(always)] - fn from(variant: RESETCAUSE_A) -> Self { + fn from(variant: Resetcause) -> Self { variant as _ } } -impl RESETCAUSE_R { +impl crate::FieldSpec for Resetcause { + type Ux = u8; +} +impl crate::IsEnum for Resetcause {} +#[doc = "Field `resetcause` reader - "] +pub type ResetcauseR = crate::FieldReader; +impl ResetcauseR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(RESETCAUSE_A::POWER_ON), - 1 => Some(RESETCAUSE_A::EXTERNAL), - 2 => Some(RESETCAUSE_A::WATCHDOG), + 0 => Some(Resetcause::PowerOn), + 1 => Some(Resetcause::External), + 2 => Some(Resetcause::Watchdog), _ => None, } } - #[doc = "Checks if the value of the field is `POWER_ON`"] + #[doc = "Power-on reset"] #[inline(always)] pub fn is_power_on(&self) -> bool { - *self == RESETCAUSE_A::POWER_ON + *self == Resetcause::PowerOn } - #[doc = "Checks if the value of the field is `EXTERNAL`"] + #[doc = "External reset"] #[inline(always)] pub fn is_external(&self) -> bool { - *self == RESETCAUSE_A::EXTERNAL + *self == Resetcause::External } - #[doc = "Checks if the value of the field is `WATCHDOG`"] + #[doc = "Watchdog reset"] #[inline(always)] pub fn is_watchdog(&self) -> bool { - *self == RESETCAUSE_A::WATCHDOG + *self == Resetcause::Watchdog } } #[doc = "Field `resetcause` writer - "] -pub type RESETCAUSE_W<'a, const O: u8> = - crate::FieldWriter<'a, u32, PMUCAUSE_SPEC, u8, RESETCAUSE_A, 2, O>; -impl<'a, const O: u8> RESETCAUSE_W<'a, O> { +pub type ResetcauseW<'a, REG> = crate::FieldWriter<'a, REG, 2, Resetcause>; +impl<'a, REG> ResetcauseW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Power-on reset"] #[inline(always)] - pub fn power_on(self) -> &'a mut W { - self.variant(RESETCAUSE_A::POWER_ON) + pub fn power_on(self) -> &'a mut crate::W { + self.variant(Resetcause::PowerOn) } #[doc = "External reset"] #[inline(always)] - pub fn external(self) -> &'a mut W { - self.variant(RESETCAUSE_A::EXTERNAL) + pub fn external(self) -> &'a mut crate::W { + self.variant(Resetcause::External) } #[doc = "Watchdog reset"] #[inline(always)] - pub fn watchdog(self) -> &'a mut W { - self.variant(RESETCAUSE_A::WATCHDOG) + pub fn watchdog(self) -> &'a mut crate::W { + self.variant(Resetcause::Watchdog) } } impl R { #[doc = "Bits 0:1"] #[inline(always)] - pub fn wakeupcause(&self) -> WAKEUPCAUSE_R { - WAKEUPCAUSE_R::new((self.bits & 3) as u8) + pub fn wakeupcause(&self) -> WakeupcauseR { + WakeupcauseR::new((self.bits & 3) as u8) } #[doc = "Bits 8:9"] #[inline(always)] - pub fn resetcause(&self) -> RESETCAUSE_R { - RESETCAUSE_R::new(((self.bits >> 8) & 3) as u8) + pub fn resetcause(&self) -> ResetcauseR { + ResetcauseR::new(((self.bits >> 8) & 3) as u8) } } impl W { #[doc = "Bits 0:1"] #[inline(always)] - pub fn wakeupcause(&mut self) -> WAKEUPCAUSE_W<0> { - WAKEUPCAUSE_W::new(self) + #[must_use] + pub fn wakeupcause(&mut self) -> WakeupcauseW { + WakeupcauseW::new(self, 0) } #[doc = "Bits 8:9"] #[inline(always)] - pub fn resetcause(&mut self) -> RESETCAUSE_W<8> { - RESETCAUSE_W::new(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 + #[must_use] + pub fn resetcause(&mut self) -> ResetcauseW { + ResetcauseW::new(self, 8) } } -#[doc = "PMU Cause Register\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 [pmucause](index.html) module"] -pub struct PMUCAUSE_SPEC; -impl crate::RegisterSpec for PMUCAUSE_SPEC { +#[doc = "PMU Cause Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pmucause::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmucause::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PmucauseSpec; +impl crate::RegisterSpec for PmucauseSpec { type Ux = u32; } -#[doc = "`read()` method returns [pmucause::R](R) reader structure"] -impl crate::Readable for PMUCAUSE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [pmucause::W](W) writer structure"] -impl crate::Writable for PMUCAUSE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`pmucause::R`](R) reader structure"] +impl crate::Readable for PmucauseSpec {} +#[doc = "`write(|w| ..)` method takes [`pmucause::W`](W) writer structure"] +impl crate::Writable for PmucauseSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets pmucause to value 0"] -impl crate::Resettable for PMUCAUSE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PmucauseSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pmu/pmuie.rs b/src/pmu/pmuie.rs index fc9e446..023c965 100644 --- a/src/pmu/pmuie.rs +++ b/src/pmu/pmuie.rs @@ -1,108 +1,70 @@ #[doc = "Register `pmuie` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `pmuie` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `rtc` reader - "] -pub type RTC_R = crate::BitReader; +pub type RtcR = crate::BitReader; #[doc = "Field `rtc` writer - "] -pub type RTC_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUIE_SPEC, bool, O>; +pub type RtcW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `dwakeup` reader - "] -pub type DWAKEUP_R = crate::BitReader; +pub type DwakeupR = crate::BitReader; #[doc = "Field `dwakeup` writer - "] -pub type DWAKEUP_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUIE_SPEC, bool, O>; +pub type DwakeupW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `awakeup` reader - "] -pub type AWAKEUP_R = crate::BitReader; +pub type AwakeupR = crate::BitReader; #[doc = "Field `awakeup` writer - "] -pub type AWAKEUP_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUIE_SPEC, bool, O>; +pub type AwakeupW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 1"] #[inline(always)] - pub fn rtc(&self) -> RTC_R { - RTC_R::new(((self.bits >> 1) & 1) != 0) + pub fn rtc(&self) -> RtcR { + RtcR::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bit 2"] #[inline(always)] - pub fn dwakeup(&self) -> DWAKEUP_R { - DWAKEUP_R::new(((self.bits >> 2) & 1) != 0) + pub fn dwakeup(&self) -> DwakeupR { + DwakeupR::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3"] #[inline(always)] - pub fn awakeup(&self) -> AWAKEUP_R { - AWAKEUP_R::new(((self.bits >> 3) & 1) != 0) + pub fn awakeup(&self) -> AwakeupR { + AwakeupR::new(((self.bits >> 3) & 1) != 0) } } impl W { #[doc = "Bit 1"] #[inline(always)] - pub fn rtc(&mut self) -> RTC_W<1> { - RTC_W::new(self) + #[must_use] + pub fn rtc(&mut self) -> RtcW { + RtcW::new(self, 1) } #[doc = "Bit 2"] #[inline(always)] - pub fn dwakeup(&mut self) -> DWAKEUP_W<2> { - DWAKEUP_W::new(self) + #[must_use] + pub fn dwakeup(&mut self) -> DwakeupW { + DwakeupW::new(self, 2) } #[doc = "Bit 3"] #[inline(always)] - pub fn awakeup(&mut self) -> AWAKEUP_W<3> { - AWAKEUP_W::new(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 + #[must_use] + pub fn awakeup(&mut self) -> AwakeupW { + AwakeupW::new(self, 3) } } -#[doc = "PMU Interrupt Enable Register\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 [pmuie](index.html) module"] -pub struct PMUIE_SPEC; -impl crate::RegisterSpec for PMUIE_SPEC { +#[doc = "PMU Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pmuie::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmuie::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PmuieSpec; +impl crate::RegisterSpec for PmuieSpec { type Ux = u32; } -#[doc = "`read()` method returns [pmuie::R](R) reader structure"] -impl crate::Readable for PMUIE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [pmuie::W](W) writer structure"] -impl crate::Writable for PMUIE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`pmuie::R`](R) reader structure"] +impl crate::Readable for PmuieSpec {} +#[doc = "`write(|w| ..)` method takes [`pmuie::W`](W) writer structure"] +impl crate::Writable for PmuieSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets pmuie to value 0"] -impl crate::Resettable for PMUIE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PmuieSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pmu/pmukey.rs b/src/pmu/pmukey.rs index 1b3d7fc..5519261 100644 --- a/src/pmu/pmukey.rs +++ b/src/pmu/pmukey.rs @@ -1,64 +1,27 @@ #[doc = "Register `pmukey` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `pmukey` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "PMU Key Register\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 [pmukey](index.html) module"] -pub struct PMUKEY_SPEC; -impl crate::RegisterSpec for PMUKEY_SPEC { +impl W {} +#[doc = "PMU Key Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pmukey::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmukey::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PmukeySpec; +impl crate::RegisterSpec for PmukeySpec { type Ux = u32; } -#[doc = "`read()` method returns [pmukey::R](R) reader structure"] -impl crate::Readable for PMUKEY_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [pmukey::W](W) writer structure"] -impl crate::Writable for PMUKEY_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`pmukey::R`](R) reader structure"] +impl crate::Readable for PmukeySpec {} +#[doc = "`write(|w| ..)` method takes [`pmukey::W`](W) writer structure"] +impl crate::Writable for PmukeySpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets pmukey to value 0"] -impl crate::Resettable for PMUKEY_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PmukeySpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pmu/pmusleep.rs b/src/pmu/pmusleep.rs index 348d470..7cdc56d 100644 --- a/src/pmu/pmusleep.rs +++ b/src/pmu/pmusleep.rs @@ -1,52 +1,27 @@ #[doc = "Register `pmusleep` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `sleep` writer - "] -pub type SLEEP_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUSLEEP_SPEC, bool, O>; +pub type SleepW<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn sleep(&mut self) -> SLEEP_W<0> { - SLEEP_W::new(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 + #[must_use] + pub fn sleep(&mut self) -> SleepW { + SleepW::new(self, 0) } } -#[doc = "PMU Sleep Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pmusleep](index.html) module"] -pub struct PMUSLEEP_SPEC; -impl crate::RegisterSpec for PMUSLEEP_SPEC { +#[doc = "PMU Sleep Register\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmusleep::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PmusleepSpec; +impl crate::RegisterSpec for PmusleepSpec { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [pmusleep::W](W) writer structure"] -impl crate::Writable for PMUSLEEP_SPEC { - type Writer = W; +#[doc = "`write(|w| ..)` method takes [`pmusleep::W`](W) writer structure"] +impl crate::Writable for PmusleepSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets pmusleep to value 0"] -impl crate::Resettable for PMUSLEEP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PmusleepSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pmu/pmusleeppm.rs b/src/pmu/pmusleeppm.rs index 04a7009..cf59af6 100644 --- a/src/pmu/pmusleeppm.rs +++ b/src/pmu/pmusleeppm.rs @@ -1,151 +1,116 @@ #[doc = "Register `pmusleeppm[%s]` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `pmusleeppm[%s]` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `delay` reader - "] -pub type DELAY_R = crate::FieldReader; +pub type DelayR = crate::FieldReader; #[doc = "Field `delay` writer - "] -pub type DELAY_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PMUSLEEPPM_SPEC, u8, u8, 4, O>; +pub type DelayW<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `pmu_out_0_en` reader - "] -pub type PMU_OUT_0_EN_R = crate::BitReader; +pub type PmuOut0EnR = crate::BitReader; #[doc = "Field `pmu_out_0_en` writer - "] -pub type PMU_OUT_0_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUSLEEPPM_SPEC, bool, O>; +pub type PmuOut0EnW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pmu_out_1_en` reader - "] -pub type PMU_OUT_1_EN_R = crate::BitReader; +pub type PmuOut1EnR = crate::BitReader; #[doc = "Field `pmu_out_1_en` writer - "] -pub type PMU_OUT_1_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUSLEEPPM_SPEC, bool, O>; +pub type PmuOut1EnW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `corerst` reader - "] -pub type CORERST_R = crate::BitReader; +pub type CorerstR = crate::BitReader; #[doc = "Field `corerst` writer - "] -pub type CORERST_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUSLEEPPM_SPEC, bool, O>; +pub type CorerstW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `hfclkrst` reader - "] -pub type HFCLKRST_R = crate::BitReader; +pub type HfclkrstR = crate::BitReader; #[doc = "Field `hfclkrst` writer - "] -pub type HFCLKRST_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUSLEEPPM_SPEC, bool, O>; +pub type HfclkrstW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `isolate` reader - "] -pub type ISOLATE_R = crate::BitReader; +pub type IsolateR = crate::BitReader; #[doc = "Field `isolate` writer - "] -pub type ISOLATE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUSLEEPPM_SPEC, bool, O>; +pub type IsolateW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:3"] #[inline(always)] - pub fn delay(&self) -> DELAY_R { - DELAY_R::new((self.bits & 0x0f) as u8) + pub fn delay(&self) -> DelayR { + DelayR::new((self.bits & 0x0f) as u8) } #[doc = "Bit 4"] #[inline(always)] - pub fn pmu_out_0_en(&self) -> PMU_OUT_0_EN_R { - PMU_OUT_0_EN_R::new(((self.bits >> 4) & 1) != 0) + pub fn pmu_out_0_en(&self) -> PmuOut0EnR { + PmuOut0EnR::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pmu_out_1_en(&self) -> PMU_OUT_1_EN_R { - PMU_OUT_1_EN_R::new(((self.bits >> 5) & 1) != 0) + pub fn pmu_out_1_en(&self) -> PmuOut1EnR { + PmuOut1EnR::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn corerst(&self) -> CORERST_R { - CORERST_R::new(((self.bits >> 7) & 1) != 0) + pub fn corerst(&self) -> CorerstR { + CorerstR::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn hfclkrst(&self) -> HFCLKRST_R { - HFCLKRST_R::new(((self.bits >> 8) & 1) != 0) + pub fn hfclkrst(&self) -> HfclkrstR { + HfclkrstR::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn isolate(&self) -> ISOLATE_R { - ISOLATE_R::new(((self.bits >> 9) & 1) != 0) + pub fn isolate(&self) -> IsolateR { + IsolateR::new(((self.bits >> 9) & 1) != 0) } } impl W { #[doc = "Bits 0:3"] #[inline(always)] - pub fn delay(&mut self) -> DELAY_W<0> { - DELAY_W::new(self) + #[must_use] + pub fn delay(&mut self) -> DelayW { + DelayW::new(self, 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pmu_out_0_en(&mut self) -> PMU_OUT_0_EN_W<4> { - PMU_OUT_0_EN_W::new(self) + #[must_use] + pub fn pmu_out_0_en(&mut self) -> PmuOut0EnW { + PmuOut0EnW::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pmu_out_1_en(&mut self) -> PMU_OUT_1_EN_W<5> { - PMU_OUT_1_EN_W::new(self) + #[must_use] + pub fn pmu_out_1_en(&mut self) -> PmuOut1EnW { + PmuOut1EnW::new(self, 5) } #[doc = "Bit 7"] #[inline(always)] - pub fn corerst(&mut self) -> CORERST_W<7> { - CORERST_W::new(self) + #[must_use] + pub fn corerst(&mut self) -> CorerstW { + CorerstW::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn hfclkrst(&mut self) -> HFCLKRST_W<8> { - HFCLKRST_W::new(self) + #[must_use] + pub fn hfclkrst(&mut self) -> HfclkrstW { + HfclkrstW::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn isolate(&mut self) -> ISOLATE_W<9> { - ISOLATE_W::new(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 + #[must_use] + pub fn isolate(&mut self) -> IsolateW { + IsolateW::new(self, 9) } } -#[doc = "PMU Sleep Program Memory\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 [pmusleeppm](index.html) module"] -pub struct PMUSLEEPPM_SPEC; -impl crate::RegisterSpec for PMUSLEEPPM_SPEC { +#[doc = "PMU Sleep Program Memory\n\nYou can [`read`](crate::Reg::read) this register and get [`pmusleeppm::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmusleeppm::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PmusleeppmSpec; +impl crate::RegisterSpec for PmusleeppmSpec { type Ux = u32; } -#[doc = "`read()` method returns [pmusleeppm::R](R) reader structure"] -impl crate::Readable for PMUSLEEPPM_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [pmusleeppm::W](W) writer structure"] -impl crate::Writable for PMUSLEEPPM_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`pmusleeppm::R`](R) reader structure"] +impl crate::Readable for PmusleeppmSpec {} +#[doc = "`write(|w| ..)` method takes [`pmusleeppm::W`](W) writer structure"] +impl crate::Writable for PmusleeppmSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets pmusleeppm[%s] to value 0"] -impl crate::Resettable for PMUSLEEPPM_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PmusleeppmSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pmu/pmuwakepm.rs b/src/pmu/pmuwakepm.rs index 3e2f2e9..030488e 100644 --- a/src/pmu/pmuwakepm.rs +++ b/src/pmu/pmuwakepm.rs @@ -1,151 +1,116 @@ #[doc = "Register `pmuwakepm[%s]` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `pmuwakepm[%s]` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `delay` reader - "] -pub type DELAY_R = crate::FieldReader; +pub type DelayR = crate::FieldReader; #[doc = "Field `delay` writer - "] -pub type DELAY_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PMUWAKEPM_SPEC, u8, u8, 4, O>; +pub type DelayW<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `pmu_out_0_en` reader - "] -pub type PMU_OUT_0_EN_R = crate::BitReader; +pub type PmuOut0EnR = crate::BitReader; #[doc = "Field `pmu_out_0_en` writer - "] -pub type PMU_OUT_0_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUWAKEPM_SPEC, bool, O>; +pub type PmuOut0EnW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pmu_out_1_en` reader - "] -pub type PMU_OUT_1_EN_R = crate::BitReader; +pub type PmuOut1EnR = crate::BitReader; #[doc = "Field `pmu_out_1_en` writer - "] -pub type PMU_OUT_1_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUWAKEPM_SPEC, bool, O>; +pub type PmuOut1EnW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `corerst` reader - "] -pub type CORERST_R = crate::BitReader; +pub type CorerstR = crate::BitReader; #[doc = "Field `corerst` writer - "] -pub type CORERST_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUWAKEPM_SPEC, bool, O>; +pub type CorerstW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `hfclkrst` reader - "] -pub type HFCLKRST_R = crate::BitReader; +pub type HfclkrstR = crate::BitReader; #[doc = "Field `hfclkrst` writer - "] -pub type HFCLKRST_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUWAKEPM_SPEC, bool, O>; +pub type HfclkrstW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `isolate` reader - "] -pub type ISOLATE_R = crate::BitReader; +pub type IsolateR = crate::BitReader; #[doc = "Field `isolate` writer - "] -pub type ISOLATE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMUWAKEPM_SPEC, bool, O>; +pub type IsolateW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:3"] #[inline(always)] - pub fn delay(&self) -> DELAY_R { - DELAY_R::new((self.bits & 0x0f) as u8) + pub fn delay(&self) -> DelayR { + DelayR::new((self.bits & 0x0f) as u8) } #[doc = "Bit 4"] #[inline(always)] - pub fn pmu_out_0_en(&self) -> PMU_OUT_0_EN_R { - PMU_OUT_0_EN_R::new(((self.bits >> 4) & 1) != 0) + pub fn pmu_out_0_en(&self) -> PmuOut0EnR { + PmuOut0EnR::new(((self.bits >> 4) & 1) != 0) } #[doc = "Bit 5"] #[inline(always)] - pub fn pmu_out_1_en(&self) -> PMU_OUT_1_EN_R { - PMU_OUT_1_EN_R::new(((self.bits >> 5) & 1) != 0) + pub fn pmu_out_1_en(&self) -> PmuOut1EnR { + PmuOut1EnR::new(((self.bits >> 5) & 1) != 0) } #[doc = "Bit 7"] #[inline(always)] - pub fn corerst(&self) -> CORERST_R { - CORERST_R::new(((self.bits >> 7) & 1) != 0) + pub fn corerst(&self) -> CorerstR { + CorerstR::new(((self.bits >> 7) & 1) != 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn hfclkrst(&self) -> HFCLKRST_R { - HFCLKRST_R::new(((self.bits >> 8) & 1) != 0) + pub fn hfclkrst(&self) -> HfclkrstR { + HfclkrstR::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn isolate(&self) -> ISOLATE_R { - ISOLATE_R::new(((self.bits >> 9) & 1) != 0) + pub fn isolate(&self) -> IsolateR { + IsolateR::new(((self.bits >> 9) & 1) != 0) } } impl W { #[doc = "Bits 0:3"] #[inline(always)] - pub fn delay(&mut self) -> DELAY_W<0> { - DELAY_W::new(self) + #[must_use] + pub fn delay(&mut self) -> DelayW { + DelayW::new(self, 0) } #[doc = "Bit 4"] #[inline(always)] - pub fn pmu_out_0_en(&mut self) -> PMU_OUT_0_EN_W<4> { - PMU_OUT_0_EN_W::new(self) + #[must_use] + pub fn pmu_out_0_en(&mut self) -> PmuOut0EnW { + PmuOut0EnW::new(self, 4) } #[doc = "Bit 5"] #[inline(always)] - pub fn pmu_out_1_en(&mut self) -> PMU_OUT_1_EN_W<5> { - PMU_OUT_1_EN_W::new(self) + #[must_use] + pub fn pmu_out_1_en(&mut self) -> PmuOut1EnW { + PmuOut1EnW::new(self, 5) } #[doc = "Bit 7"] #[inline(always)] - pub fn corerst(&mut self) -> CORERST_W<7> { - CORERST_W::new(self) + #[must_use] + pub fn corerst(&mut self) -> CorerstW { + CorerstW::new(self, 7) } #[doc = "Bit 8"] #[inline(always)] - pub fn hfclkrst(&mut self) -> HFCLKRST_W<8> { - HFCLKRST_W::new(self) + #[must_use] + pub fn hfclkrst(&mut self) -> HfclkrstW { + HfclkrstW::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn isolate(&mut self) -> ISOLATE_W<9> { - ISOLATE_W::new(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 + #[must_use] + pub fn isolate(&mut self) -> IsolateW { + IsolateW::new(self, 9) } } -#[doc = "PMU Wake Program Memory\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 [pmuwakepm](index.html) module"] -pub struct PMUWAKEPM_SPEC; -impl crate::RegisterSpec for PMUWAKEPM_SPEC { +#[doc = "PMU Wake Program Memory\n\nYou can [`read`](crate::Reg::read) this register and get [`pmuwakepm::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pmuwakepm::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PmuwakepmSpec; +impl crate::RegisterSpec for PmuwakepmSpec { type Ux = u32; } -#[doc = "`read()` method returns [pmuwakepm::R](R) reader structure"] -impl crate::Readable for PMUWAKEPM_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [pmuwakepm::W](W) writer structure"] -impl crate::Writable for PMUWAKEPM_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`pmuwakepm::R`](R) reader structure"] +impl crate::Readable for PmuwakepmSpec {} +#[doc = "`write(|w| ..)` method takes [`pmuwakepm::W`](W) writer structure"] +impl crate::Writable for PmuwakepmSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets pmuwakepm[%s] to value 0"] -impl crate::Resettable for PMUWAKEPM_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PmuwakepmSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/prci.rs b/src/prci.rs index 5750ddf..02d87f7 100644 --- a/src/prci.rs +++ b/src/prci.rs @@ -1,34 +1,66 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { + hfrosccfg: Hfrosccfg, + hfxosccfg: Hfxosccfg, + pllcfg: Pllcfg, + plloutdiv: Plloutdiv, + coreclkcfg: Coreclkcfg, +} +impl RegisterBlock { #[doc = "0x00 - Clock Configuration Register"] - pub hfrosccfg: HFROSCCFG, + #[inline(always)] + pub const fn hfrosccfg(&self) -> &Hfrosccfg { + &self.hfrosccfg + } #[doc = "0x04 - Clock Configuration Register"] - pub hfxosccfg: HFXOSCCFG, + #[inline(always)] + pub const fn hfxosccfg(&self) -> &Hfxosccfg { + &self.hfxosccfg + } #[doc = "0x08 - PLL Configuration Register"] - pub pllcfg: PLLCFG, + #[inline(always)] + pub const fn pllcfg(&self) -> &Pllcfg { + &self.pllcfg + } #[doc = "0x0c - PLL Divider Register"] - pub plloutdiv: PLLOUTDIV, + #[inline(always)] + pub const fn plloutdiv(&self) -> &Plloutdiv { + &self.plloutdiv + } #[doc = "0x10 - Clock Configuration Register"] - pub coreclkcfg: CORECLKCFG, + #[inline(always)] + pub const fn coreclkcfg(&self) -> &Coreclkcfg { + &self.coreclkcfg + } } -#[doc = "hfrosccfg (rw) register accessor: an alias for `Reg`"] -pub type HFROSCCFG = crate::Reg; +#[doc = "hfrosccfg (rw) register accessor: Clock Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`hfrosccfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`hfrosccfg::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hfrosccfg`] +module"] +#[doc(alias = "hfrosccfg")] +pub type Hfrosccfg = crate::Reg; #[doc = "Clock Configuration Register"] pub mod hfrosccfg; -#[doc = "hfxosccfg (rw) register accessor: an alias for `Reg`"] -pub type HFXOSCCFG = crate::Reg; +#[doc = "hfxosccfg (rw) register accessor: Clock Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`hfxosccfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`hfxosccfg::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hfxosccfg`] +module"] +#[doc(alias = "hfxosccfg")] +pub type Hfxosccfg = crate::Reg; #[doc = "Clock Configuration Register"] pub mod hfxosccfg; -#[doc = "pllcfg (rw) register accessor: an alias for `Reg`"] -pub type PLLCFG = crate::Reg; +#[doc = "pllcfg (rw) register accessor: PLL Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pllcfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pllcfg::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pllcfg`] +module"] +#[doc(alias = "pllcfg")] +pub type Pllcfg = crate::Reg; #[doc = "PLL Configuration Register"] pub mod pllcfg; -#[doc = "plloutdiv (rw) register accessor: an alias for `Reg`"] -pub type PLLOUTDIV = crate::Reg; +#[doc = "plloutdiv (rw) register accessor: PLL Divider Register\n\nYou can [`read`](crate::Reg::read) this register and get [`plloutdiv::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`plloutdiv::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@plloutdiv`] +module"] +#[doc(alias = "plloutdiv")] +pub type Plloutdiv = crate::Reg; #[doc = "PLL Divider Register"] pub mod plloutdiv; -#[doc = "coreclkcfg (rw) register accessor: an alias for `Reg`"] -pub type CORECLKCFG = crate::Reg; +#[doc = "coreclkcfg (rw) register accessor: Clock Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`coreclkcfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`coreclkcfg::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@coreclkcfg`] +module"] +#[doc(alias = "coreclkcfg")] +pub type Coreclkcfg = crate::Reg; #[doc = "Clock Configuration Register"] pub mod coreclkcfg; diff --git a/src/prci/coreclkcfg.rs b/src/prci/coreclkcfg.rs index 519fa7b..3ec149f 100644 --- a/src/prci/coreclkcfg.rs +++ b/src/prci/coreclkcfg.rs @@ -1,64 +1,27 @@ #[doc = "Register `coreclkcfg` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `coreclkcfg` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Clock Configuration Register\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 [coreclkcfg](index.html) module"] -pub struct CORECLKCFG_SPEC; -impl crate::RegisterSpec for CORECLKCFG_SPEC { +impl W {} +#[doc = "Clock Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`coreclkcfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`coreclkcfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct CoreclkcfgSpec; +impl crate::RegisterSpec for CoreclkcfgSpec { type Ux = u32; } -#[doc = "`read()` method returns [coreclkcfg::R](R) reader structure"] -impl crate::Readable for CORECLKCFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [coreclkcfg::W](W) writer structure"] -impl crate::Writable for CORECLKCFG_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`coreclkcfg::R`](R) reader structure"] +impl crate::Readable for CoreclkcfgSpec {} +#[doc = "`write(|w| ..)` method takes [`coreclkcfg::W`](W) writer structure"] +impl crate::Writable for CoreclkcfgSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets coreclkcfg to value 0"] -impl crate::Resettable for CORECLKCFG_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for CoreclkcfgSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/prci/hfrosccfg.rs b/src/prci/hfrosccfg.rs index 3a82a53..a9d2491 100644 --- a/src/prci/hfrosccfg.rs +++ b/src/prci/hfrosccfg.rs @@ -1,122 +1,85 @@ #[doc = "Register `hfrosccfg` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `hfrosccfg` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `div` reader - "] -pub type DIV_R = crate::FieldReader; +pub type DivR = crate::FieldReader; #[doc = "Field `div` writer - "] -pub type DIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HFROSCCFG_SPEC, u8, u8, 6, O>; +pub type DivW<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `trim` reader - "] -pub type TRIM_R = crate::FieldReader; +pub type TrimR = crate::FieldReader; #[doc = "Field `trim` writer - "] -pub type TRIM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HFROSCCFG_SPEC, u8, u8, 5, O>; +pub type TrimW<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `enable` reader - "] -pub type ENABLE_R = crate::BitReader; +pub type EnableR = crate::BitReader; #[doc = "Field `enable` writer - "] -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, HFROSCCFG_SPEC, bool, O>; +pub type EnableW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ready` reader - "] -pub type READY_R = crate::BitReader; +pub type ReadyR = crate::BitReader; #[doc = "Field `ready` writer - "] -pub type READY_W<'a, const O: u8> = crate::BitWriter<'a, u32, HFROSCCFG_SPEC, bool, O>; +pub type ReadyW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:5"] #[inline(always)] - pub fn div(&self) -> DIV_R { - DIV_R::new((self.bits & 0x3f) as u8) + pub fn div(&self) -> DivR { + DivR::new((self.bits & 0x3f) as u8) } #[doc = "Bits 16:20"] #[inline(always)] - pub fn trim(&self) -> TRIM_R { - TRIM_R::new(((self.bits >> 16) & 0x1f) as u8) + pub fn trim(&self) -> TrimR { + TrimR::new(((self.bits >> 16) & 0x1f) as u8) } #[doc = "Bit 30"] #[inline(always)] - pub fn enable(&self) -> ENABLE_R { - ENABLE_R::new(((self.bits >> 30) & 1) != 0) + pub fn enable(&self) -> EnableR { + EnableR::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn ready(&self) -> READY_R { - READY_R::new(((self.bits >> 31) & 1) != 0) + pub fn ready(&self) -> ReadyR { + ReadyR::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bits 0:5"] #[inline(always)] - pub fn div(&mut self) -> DIV_W<0> { - DIV_W::new(self) + #[must_use] + pub fn div(&mut self) -> DivW { + DivW::new(self, 0) } #[doc = "Bits 16:20"] #[inline(always)] - pub fn trim(&mut self) -> TRIM_W<16> { - TRIM_W::new(self) + #[must_use] + pub fn trim(&mut self) -> TrimW { + TrimW::new(self, 16) } #[doc = "Bit 30"] #[inline(always)] - pub fn enable(&mut self) -> ENABLE_W<30> { - ENABLE_W::new(self) + #[must_use] + pub fn enable(&mut self) -> EnableW { + EnableW::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn ready(&mut self) -> READY_W<31> { - READY_W::new(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 + #[must_use] + pub fn ready(&mut self) -> ReadyW { + ReadyW::new(self, 31) } } -#[doc = "Clock Configuration Register\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 [hfrosccfg](index.html) module"] -pub struct HFROSCCFG_SPEC; -impl crate::RegisterSpec for HFROSCCFG_SPEC { +#[doc = "Clock Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`hfrosccfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`hfrosccfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct HfrosccfgSpec; +impl crate::RegisterSpec for HfrosccfgSpec { type Ux = u32; } -#[doc = "`read()` method returns [hfrosccfg::R](R) reader structure"] -impl crate::Readable for HFROSCCFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hfrosccfg::W](W) writer structure"] -impl crate::Writable for HFROSCCFG_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`hfrosccfg::R`](R) reader structure"] +impl crate::Readable for HfrosccfgSpec {} +#[doc = "`write(|w| ..)` method takes [`hfrosccfg::W`](W) writer structure"] +impl crate::Writable for HfrosccfgSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets hfrosccfg to value 0"] -impl crate::Resettable for HFROSCCFG_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for HfrosccfgSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/prci/hfxosccfg.rs b/src/prci/hfxosccfg.rs index 448564f..ad2cdc9 100644 --- a/src/prci/hfxosccfg.rs +++ b/src/prci/hfxosccfg.rs @@ -1,94 +1,55 @@ #[doc = "Register `hfxosccfg` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `hfxosccfg` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `enable` reader - "] -pub type ENABLE_R = crate::BitReader; +pub type EnableR = crate::BitReader; #[doc = "Field `enable` writer - "] -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, HFXOSCCFG_SPEC, bool, O>; +pub type EnableW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ready` reader - "] -pub type READY_R = crate::BitReader; +pub type ReadyR = crate::BitReader; #[doc = "Field `ready` writer - "] -pub type READY_W<'a, const O: u8> = crate::BitWriter<'a, u32, HFXOSCCFG_SPEC, bool, O>; +pub type ReadyW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 30"] #[inline(always)] - pub fn enable(&self) -> ENABLE_R { - ENABLE_R::new(((self.bits >> 30) & 1) != 0) + pub fn enable(&self) -> EnableR { + EnableR::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn ready(&self) -> READY_R { - READY_R::new(((self.bits >> 31) & 1) != 0) + pub fn ready(&self) -> ReadyR { + ReadyR::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bit 30"] #[inline(always)] - pub fn enable(&mut self) -> ENABLE_W<30> { - ENABLE_W::new(self) + #[must_use] + pub fn enable(&mut self) -> EnableW { + EnableW::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn ready(&mut self) -> READY_W<31> { - READY_W::new(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 + #[must_use] + pub fn ready(&mut self) -> ReadyW { + ReadyW::new(self, 31) } } -#[doc = "Clock Configuration Register\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 [hfxosccfg](index.html) module"] -pub struct HFXOSCCFG_SPEC; -impl crate::RegisterSpec for HFXOSCCFG_SPEC { +#[doc = "Clock Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`hfxosccfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`hfxosccfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct HfxosccfgSpec; +impl crate::RegisterSpec for HfxosccfgSpec { type Ux = u32; } -#[doc = "`read()` method returns [hfxosccfg::R](R) reader structure"] -impl crate::Readable for HFXOSCCFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hfxosccfg::W](W) writer structure"] -impl crate::Writable for HFXOSCCFG_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`hfxosccfg::R`](R) reader structure"] +impl crate::Readable for HfxosccfgSpec {} +#[doc = "`write(|w| ..)` method takes [`hfxosccfg::W`](W) writer structure"] +impl crate::Writable for HfxosccfgSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets hfxosccfg to value 0"] -impl crate::Resettable for HFXOSCCFG_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for HfxosccfgSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/prci/pllcfg.rs b/src/prci/pllcfg.rs index 57b4bf7..cd00cd4 100644 --- a/src/prci/pllcfg.rs +++ b/src/prci/pllcfg.rs @@ -1,45 +1,11 @@ #[doc = "Register `pllcfg` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `pllcfg` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -#[doc = "Field `pllr` reader - "] -pub type PLLR_R = crate::FieldReader; +pub type W = crate::W; #[doc = "\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] -pub enum PLLR_A { +pub enum Pllr { #[doc = "0: `0`"] R1 = 0, #[doc = "1: `1`"] @@ -49,79 +15,87 @@ pub enum PLLR_A { #[doc = "3: `11`"] R4 = 3, } -impl From for u8 { +impl From for u8 { #[inline(always)] - fn from(variant: PLLR_A) -> Self { + fn from(variant: Pllr) -> Self { variant as _ } } -impl PLLR_R { +impl crate::FieldSpec for Pllr { + type Ux = u8; +} +impl crate::IsEnum for Pllr {} +#[doc = "Field `pllr` reader - "] +pub type PllrR = crate::FieldReader; +impl PllrR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(PLLR_A::R1), - 1 => Some(PLLR_A::R2), - 2 => Some(PLLR_A::R3), - 3 => Some(PLLR_A::R4), + 0 => Some(Pllr::R1), + 1 => Some(Pllr::R2), + 2 => Some(Pllr::R3), + 3 => Some(Pllr::R4), _ => None, } } - #[doc = "Checks if the value of the field is `R1`"] + #[doc = "`0`"] #[inline(always)] pub fn is_r1(&self) -> bool { - *self == PLLR_A::R1 + *self == Pllr::R1 } - #[doc = "Checks if the value of the field is `R2`"] + #[doc = "`1`"] #[inline(always)] pub fn is_r2(&self) -> bool { - *self == PLLR_A::R2 + *self == Pllr::R2 } - #[doc = "Checks if the value of the field is `R3`"] + #[doc = "`10`"] #[inline(always)] pub fn is_r3(&self) -> bool { - *self == PLLR_A::R3 + *self == Pllr::R3 } - #[doc = "Checks if the value of the field is `R4`"] + #[doc = "`11`"] #[inline(always)] pub fn is_r4(&self) -> bool { - *self == PLLR_A::R4 + *self == Pllr::R4 } } #[doc = "Field `pllr` writer - "] -pub type PLLR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PLLCFG_SPEC, u8, PLLR_A, 3, O>; -impl<'a, const O: u8> PLLR_W<'a, O> { +pub type PllrW<'a, REG> = crate::FieldWriter<'a, REG, 3, Pllr>; +impl<'a, REG> PllrW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "`0`"] #[inline(always)] - pub fn r1(self) -> &'a mut W { - self.variant(PLLR_A::R1) + pub fn r1(self) -> &'a mut crate::W { + self.variant(Pllr::R1) } #[doc = "`1`"] #[inline(always)] - pub fn r2(self) -> &'a mut W { - self.variant(PLLR_A::R2) + pub fn r2(self) -> &'a mut crate::W { + self.variant(Pllr::R2) } #[doc = "`10`"] #[inline(always)] - pub fn r3(self) -> &'a mut W { - self.variant(PLLR_A::R3) + pub fn r3(self) -> &'a mut crate::W { + self.variant(Pllr::R3) } #[doc = "`11`"] #[inline(always)] - pub fn r4(self) -> &'a mut W { - self.variant(PLLR_A::R4) + pub fn r4(self) -> &'a mut crate::W { + self.variant(Pllr::R4) } } #[doc = "Field `pllf` reader - "] -pub type PLLF_R = crate::FieldReader; +pub type PllfR = crate::FieldReader; #[doc = "Field `pllf` writer - "] -pub type PLLF_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PLLCFG_SPEC, u8, u8, 6, O>; -#[doc = "Field `pllq` reader - "] -pub type PLLQ_R = crate::FieldReader; +pub type PllfW<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] -pub enum PLLQ_A { +pub enum Pllq { #[doc = "1: `1`"] Q2 = 1, #[doc = "2: `10`"] @@ -129,171 +103,179 @@ pub enum PLLQ_A { #[doc = "3: `11`"] Q8 = 3, } -impl From for u8 { +impl From for u8 { #[inline(always)] - fn from(variant: PLLQ_A) -> Self { + fn from(variant: Pllq) -> Self { variant as _ } } -impl PLLQ_R { +impl crate::FieldSpec for Pllq { + type Ux = u8; +} +impl crate::IsEnum for Pllq {} +#[doc = "Field `pllq` reader - "] +pub type PllqR = crate::FieldReader; +impl PllqR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { - 1 => Some(PLLQ_A::Q2), - 2 => Some(PLLQ_A::Q4), - 3 => Some(PLLQ_A::Q8), + 1 => Some(Pllq::Q2), + 2 => Some(Pllq::Q4), + 3 => Some(Pllq::Q8), _ => None, } } - #[doc = "Checks if the value of the field is `Q2`"] + #[doc = "`1`"] #[inline(always)] pub fn is_q2(&self) -> bool { - *self == PLLQ_A::Q2 + *self == Pllq::Q2 } - #[doc = "Checks if the value of the field is `Q4`"] + #[doc = "`10`"] #[inline(always)] pub fn is_q4(&self) -> bool { - *self == PLLQ_A::Q4 + *self == Pllq::Q4 } - #[doc = "Checks if the value of the field is `Q8`"] + #[doc = "`11`"] #[inline(always)] pub fn is_q8(&self) -> bool { - *self == PLLQ_A::Q8 + *self == Pllq::Q8 } } #[doc = "Field `pllq` writer - "] -pub type PLLQ_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PLLCFG_SPEC, u8, PLLQ_A, 2, O>; -impl<'a, const O: u8> PLLQ_W<'a, O> { +pub type PllqW<'a, REG> = crate::FieldWriter<'a, REG, 2, Pllq>; +impl<'a, REG> PllqW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "`1`"] #[inline(always)] - pub fn q2(self) -> &'a mut W { - self.variant(PLLQ_A::Q2) + pub fn q2(self) -> &'a mut crate::W { + self.variant(Pllq::Q2) } #[doc = "`10`"] #[inline(always)] - pub fn q4(self) -> &'a mut W { - self.variant(PLLQ_A::Q4) + pub fn q4(self) -> &'a mut crate::W { + self.variant(Pllq::Q4) } #[doc = "`11`"] #[inline(always)] - pub fn q8(self) -> &'a mut W { - self.variant(PLLQ_A::Q8) + pub fn q8(self) -> &'a mut crate::W { + self.variant(Pllq::Q8) } } #[doc = "Field `sel` reader - "] -pub type SEL_R = crate::BitReader; +pub type SelR = crate::BitReader; #[doc = "Field `sel` writer - "] -pub type SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCFG_SPEC, bool, O>; +pub type SelW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `refsel` reader - "] -pub type REFSEL_R = crate::BitReader; +pub type RefselR = crate::BitReader; #[doc = "Field `refsel` writer - "] -pub type REFSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCFG_SPEC, bool, O>; +pub type RefselW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `bypass` reader - "] -pub type BYPASS_R = crate::BitReader; +pub type BypassR = crate::BitReader; #[doc = "Field `bypass` writer - "] -pub type BYPASS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCFG_SPEC, bool, O>; +pub type BypassW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `lock` reader - "] -pub type LOCK_R = crate::BitReader; +pub type LockR = crate::BitReader; #[doc = "Field `lock` writer - "] -pub type LOCK_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCFG_SPEC, bool, O>; +pub type LockW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:2"] #[inline(always)] - pub fn pllr(&self) -> PLLR_R { - PLLR_R::new((self.bits & 7) as u8) + pub fn pllr(&self) -> PllrR { + PllrR::new((self.bits & 7) as u8) } #[doc = "Bits 4:9"] #[inline(always)] - pub fn pllf(&self) -> PLLF_R { - PLLF_R::new(((self.bits >> 4) & 0x3f) as u8) + pub fn pllf(&self) -> PllfR { + PllfR::new(((self.bits >> 4) & 0x3f) as u8) } #[doc = "Bits 10:11"] #[inline(always)] - pub fn pllq(&self) -> PLLQ_R { - PLLQ_R::new(((self.bits >> 10) & 3) as u8) + pub fn pllq(&self) -> PllqR { + PllqR::new(((self.bits >> 10) & 3) as u8) } #[doc = "Bit 16"] #[inline(always)] - pub fn sel(&self) -> SEL_R { - SEL_R::new(((self.bits >> 16) & 1) != 0) + pub fn sel(&self) -> SelR { + SelR::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn refsel(&self) -> REFSEL_R { - REFSEL_R::new(((self.bits >> 17) & 1) != 0) + pub fn refsel(&self) -> RefselR { + RefselR::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn bypass(&self) -> BYPASS_R { - BYPASS_R::new(((self.bits >> 18) & 1) != 0) + pub fn bypass(&self) -> BypassR { + BypassR::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn lock(&self) -> LOCK_R { - LOCK_R::new(((self.bits >> 31) & 1) != 0) + pub fn lock(&self) -> LockR { + LockR::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bits 0:2"] #[inline(always)] - pub fn pllr(&mut self) -> PLLR_W<0> { - PLLR_W::new(self) + #[must_use] + pub fn pllr(&mut self) -> PllrW { + PllrW::new(self, 0) } #[doc = "Bits 4:9"] #[inline(always)] - pub fn pllf(&mut self) -> PLLF_W<4> { - PLLF_W::new(self) + #[must_use] + pub fn pllf(&mut self) -> PllfW { + PllfW::new(self, 4) } #[doc = "Bits 10:11"] #[inline(always)] - pub fn pllq(&mut self) -> PLLQ_W<10> { - PLLQ_W::new(self) + #[must_use] + pub fn pllq(&mut self) -> PllqW { + PllqW::new(self, 10) } #[doc = "Bit 16"] #[inline(always)] - pub fn sel(&mut self) -> SEL_W<16> { - SEL_W::new(self) + #[must_use] + pub fn sel(&mut self) -> SelW { + SelW::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn refsel(&mut self) -> REFSEL_W<17> { - REFSEL_W::new(self) + #[must_use] + pub fn refsel(&mut self) -> RefselW { + RefselW::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn bypass(&mut self) -> BYPASS_W<18> { - BYPASS_W::new(self) + #[must_use] + pub fn bypass(&mut self) -> BypassW { + BypassW::new(self, 18) } #[doc = "Bit 31"] #[inline(always)] - pub fn lock(&mut self) -> LOCK_W<31> { - LOCK_W::new(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 + #[must_use] + pub fn lock(&mut self) -> LockW { + LockW::new(self, 31) } } -#[doc = "PLL Configuration Register\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 [pllcfg](index.html) module"] -pub struct PLLCFG_SPEC; -impl crate::RegisterSpec for PLLCFG_SPEC { +#[doc = "PLL Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pllcfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pllcfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PllcfgSpec; +impl crate::RegisterSpec for PllcfgSpec { type Ux = u32; } -#[doc = "`read()` method returns [pllcfg::R](R) reader structure"] -impl crate::Readable for PLLCFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [pllcfg::W](W) writer structure"] -impl crate::Writable for PLLCFG_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`pllcfg::R`](R) reader structure"] +impl crate::Readable for PllcfgSpec {} +#[doc = "`write(|w| ..)` method takes [`pllcfg::W`](W) writer structure"] +impl crate::Writable for PllcfgSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets pllcfg to value 0x0003_06f9"] -impl crate::Resettable for PLLCFG_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0x0003_06f9 - } +impl crate::Resettable for PllcfgSpec { + const RESET_VALUE: u32 = 0x0003_06f9; } diff --git a/src/prci/plloutdiv.rs b/src/prci/plloutdiv.rs index fb3498b..44b4b49 100644 --- a/src/prci/plloutdiv.rs +++ b/src/prci/plloutdiv.rs @@ -1,94 +1,55 @@ #[doc = "Register `plloutdiv` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `plloutdiv` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `div` reader - "] -pub type DIV_R = crate::FieldReader; +pub type DivR = crate::FieldReader; #[doc = "Field `div` writer - "] -pub type DIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PLLOUTDIV_SPEC, u8, u8, 6, O>; +pub type DivW<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `divby1` reader - "] -pub type DIVBY1_R = crate::BitReader; +pub type Divby1R = crate::BitReader; #[doc = "Field `divby1` writer - "] -pub type DIVBY1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLOUTDIV_SPEC, bool, O>; +pub type Divby1W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:5"] #[inline(always)] - pub fn div(&self) -> DIV_R { - DIV_R::new((self.bits & 0x3f) as u8) + pub fn div(&self) -> DivR { + DivR::new((self.bits & 0x3f) as u8) } #[doc = "Bit 8"] #[inline(always)] - pub fn divby1(&self) -> DIVBY1_R { - DIVBY1_R::new(((self.bits >> 8) & 1) != 0) + pub fn divby1(&self) -> Divby1R { + Divby1R::new(((self.bits >> 8) & 1) != 0) } } impl W { #[doc = "Bits 0:5"] #[inline(always)] - pub fn div(&mut self) -> DIV_W<0> { - DIV_W::new(self) + #[must_use] + pub fn div(&mut self) -> DivW { + DivW::new(self, 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn divby1(&mut self) -> DIVBY1_W<8> { - DIVBY1_W::new(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 + #[must_use] + pub fn divby1(&mut self) -> Divby1W { + Divby1W::new(self, 8) } } -#[doc = "PLL Divider Register\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 [plloutdiv](index.html) module"] -pub struct PLLOUTDIV_SPEC; -impl crate::RegisterSpec for PLLOUTDIV_SPEC { +#[doc = "PLL Divider Register\n\nYou can [`read`](crate::Reg::read) this register and get [`plloutdiv::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`plloutdiv::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PlloutdivSpec; +impl crate::RegisterSpec for PlloutdivSpec { type Ux = u32; } -#[doc = "`read()` method returns [plloutdiv::R](R) reader structure"] -impl crate::Readable for PLLOUTDIV_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [plloutdiv::W](W) writer structure"] -impl crate::Writable for PLLOUTDIV_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`plloutdiv::R`](R) reader structure"] +impl crate::Readable for PlloutdivSpec {} +#[doc = "`write(|w| ..)` method takes [`plloutdiv::W`](W) writer structure"] +impl crate::Writable for PlloutdivSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets plloutdiv to value 0x0100"] -impl crate::Resettable for PLLOUTDIV_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0x0100 - } +impl crate::Resettable for PlloutdivSpec { + const RESET_VALUE: u32 = 0x0100; } diff --git a/src/pwm0.rs b/src/pwm0.rs index 8f43b3f..ed7c0af 100644 --- a/src/pwm0.rs +++ b/src/pwm0.rs @@ -1,49 +1,93 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { - #[doc = "0x00 - PWM Configuration Register"] - pub cfg: CFG, + cfg: Cfg, _reserved1: [u8; 0x04], - #[doc = "0x08 - Counter Register"] - pub count: COUNT, + count: Count, _reserved2: [u8; 0x04], - #[doc = "0x10 - Scaled Halfword Counter Register"] - pub pwms: PWMS, + pwms: Pwms, _reserved3: [u8; 0x0c], + cmp0: Cmp0, + cmp1: Cmp1, + cmp2: Cmp2, + cmp3: Cmp3, +} +impl RegisterBlock { + #[doc = "0x00 - PWM Configuration Register"] + #[inline(always)] + pub const fn cfg(&self) -> &Cfg { + &self.cfg + } + #[doc = "0x08 - Counter Register"] + #[inline(always)] + pub const fn count(&self) -> &Count { + &self.count + } + #[doc = "0x10 - Scaled Halfword Counter Register"] + #[inline(always)] + pub const fn pwms(&self) -> &Pwms { + &self.pwms + } #[doc = "0x20 - Compare Register"] - pub cmp0: CMP0, + #[inline(always)] + pub const fn cmp0(&self) -> &Cmp0 { + &self.cmp0 + } #[doc = "0x24 - Compare Register"] - pub cmp1: CMP1, + #[inline(always)] + pub const fn cmp1(&self) -> &Cmp1 { + &self.cmp1 + } #[doc = "0x28 - Compare Register"] - pub cmp2: CMP2, + #[inline(always)] + pub const fn cmp2(&self) -> &Cmp2 { + &self.cmp2 + } #[doc = "0x2c - Compare Register"] - pub cmp3: CMP3, + #[inline(always)] + pub const fn cmp3(&self) -> &Cmp3 { + &self.cmp3 + } } -#[doc = "cfg (rw) register accessor: an alias for `Reg`"] -pub type CFG = crate::Reg; +#[doc = "cfg (rw) register accessor: PWM Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cfg::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cfg`] +module"] +#[doc(alias = "cfg")] +pub type Cfg = crate::Reg; #[doc = "PWM Configuration Register"] pub mod cfg; -#[doc = "count (rw) register accessor: an alias for `Reg`"] -pub type COUNT = crate::Reg; +#[doc = "count (rw) register accessor: Counter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`count::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`count::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@count`] +module"] +#[doc(alias = "count")] +pub type Count = crate::Reg; #[doc = "Counter Register"] pub mod count; -#[doc = "pwms (rw) register accessor: an alias for `Reg`"] -pub type PWMS = crate::Reg; +#[doc = "pwms (rw) register accessor: Scaled Halfword Counter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pwms::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pwms::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pwms`] +module"] +#[doc(alias = "pwms")] +pub type Pwms = crate::Reg; #[doc = "Scaled Halfword Counter Register"] pub mod pwms; -#[doc = "cmp0 (rw) register accessor: an alias for `Reg`"] -pub type CMP0 = crate::Reg; +#[doc = "cmp0 (rw) register accessor: Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cmp0::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmp0::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cmp0`] +module"] +#[doc(alias = "cmp0")] +pub type Cmp0 = crate::Reg; #[doc = "Compare Register"] pub mod cmp0; -#[doc = "cmp1 (rw) register accessor: an alias for `Reg`"] -pub type CMP1 = crate::Reg; +#[doc = "cmp1 (rw) register accessor: Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cmp1::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmp1::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cmp1`] +module"] +#[doc(alias = "cmp1")] +pub type Cmp1 = crate::Reg; #[doc = "Compare Register"] pub mod cmp1; -#[doc = "cmp2 (rw) register accessor: an alias for `Reg`"] -pub type CMP2 = crate::Reg; +#[doc = "cmp2 (rw) register accessor: Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cmp2::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmp2::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cmp2`] +module"] +#[doc(alias = "cmp2")] +pub type Cmp2 = crate::Reg; #[doc = "Compare Register"] pub mod cmp2; -#[doc = "cmp3 (rw) register accessor: an alias for `Reg`"] -pub type CMP3 = crate::Reg; +#[doc = "cmp3 (rw) register accessor: Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cmp3::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmp3::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cmp3`] +module"] +#[doc(alias = "cmp3")] +pub type Cmp3 = crate::Reg; #[doc = "Compare Register"] pub mod cmp3; diff --git a/src/pwm0/cfg.rs b/src/pwm0/cfg.rs index 02f3729..29adbd8 100644 --- a/src/pwm0/cfg.rs +++ b/src/pwm0/cfg.rs @@ -1,318 +1,295 @@ #[doc = "Register `cfg` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `cfg` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `scale` reader - "] -pub type SCALE_R = crate::FieldReader; +pub type ScaleR = crate::FieldReader; #[doc = "Field `scale` writer - "] -pub type SCALE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFG_SPEC, u8, u8, 4, O>; +pub type ScaleW<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `sticky` reader - "] -pub type STICKY_R = crate::BitReader; +pub type StickyR = crate::BitReader; #[doc = "Field `sticky` writer - "] -pub type STICKY_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type StickyW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `zerocmp` reader - "] -pub type ZEROCMP_R = crate::BitReader; +pub type ZerocmpR = crate::BitReader; #[doc = "Field `zerocmp` writer - "] -pub type ZEROCMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type ZerocmpW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `deglitch` reader - "] -pub type DEGLITCH_R = crate::BitReader; +pub type DeglitchR = crate::BitReader; #[doc = "Field `deglitch` writer - "] -pub type DEGLITCH_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type DeglitchW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `enalways` reader - "] -pub type ENALWAYS_R = crate::BitReader; +pub type EnalwaysR = crate::BitReader; #[doc = "Field `enalways` writer - "] -pub type ENALWAYS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type EnalwaysW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `enoneshot` reader - "] -pub type ENONESHOT_R = crate::BitReader; +pub type EnoneshotR = crate::BitReader; #[doc = "Field `enoneshot` writer - "] -pub type ENONESHOT_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type EnoneshotW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmp0center` reader - "] -pub type CMP0CENTER_R = crate::BitReader; +pub type Cmp0centerR = crate::BitReader; #[doc = "Field `cmp0center` writer - "] -pub type CMP0CENTER_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type Cmp0centerW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmp1center` reader - "] -pub type CMP1CENTER_R = crate::BitReader; +pub type Cmp1centerR = crate::BitReader; #[doc = "Field `cmp1center` writer - "] -pub type CMP1CENTER_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type Cmp1centerW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmp2center` reader - "] -pub type CMP2CENTER_R = crate::BitReader; +pub type Cmp2centerR = crate::BitReader; #[doc = "Field `cmp2center` writer - "] -pub type CMP2CENTER_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type Cmp2centerW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmp3center` reader - "] -pub type CMP3CENTER_R = crate::BitReader; +pub type Cmp3centerR = crate::BitReader; #[doc = "Field `cmp3center` writer - "] -pub type CMP3CENTER_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type Cmp3centerW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmp0gang` reader - "] -pub type CMP0GANG_R = crate::BitReader; +pub type Cmp0gangR = crate::BitReader; #[doc = "Field `cmp0gang` writer - "] -pub type CMP0GANG_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type Cmp0gangW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmp1gang` reader - "] -pub type CMP1GANG_R = crate::BitReader; +pub type Cmp1gangR = crate::BitReader; #[doc = "Field `cmp1gang` writer - "] -pub type CMP1GANG_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type Cmp1gangW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmp2gang` reader - "] -pub type CMP2GANG_R = crate::FieldReader; +pub type Cmp2gangR = crate::FieldReader; #[doc = "Field `cmp2gang` writer - "] -pub type CMP2GANG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFG_SPEC, u16, u16, 11, O>; +pub type Cmp2gangW<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>; #[doc = "Field `cmp3gang` reader - "] -pub type CMP3GANG_R = crate::BitReader; +pub type Cmp3gangR = crate::BitReader; #[doc = "Field `cmp3gang` writer - "] -pub type CMP3GANG_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type Cmp3gangW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmp0ip` reader - "] -pub type CMP0IP_R = crate::BitReader; +pub type Cmp0ipR = crate::BitReader; #[doc = "Field `cmp0ip` writer - "] -pub type CMP0IP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type Cmp0ipW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmp1ip` reader - "] -pub type CMP1IP_R = crate::BitReader; +pub type Cmp1ipR = crate::BitReader; #[doc = "Field `cmp1ip` writer - "] -pub type CMP1IP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type Cmp1ipW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmp2ip` reader - "] -pub type CMP2IP_R = crate::BitReader; +pub type Cmp2ipR = crate::BitReader; #[doc = "Field `cmp2ip` writer - "] -pub type CMP2IP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type Cmp2ipW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmp3ip` reader - "] -pub type CMP3IP_R = crate::BitReader; +pub type Cmp3ipR = crate::BitReader; #[doc = "Field `cmp3ip` writer - "] -pub type CMP3IP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>; +pub type Cmp3ipW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:3"] #[inline(always)] - pub fn scale(&self) -> SCALE_R { - SCALE_R::new((self.bits & 0x0f) as u8) + pub fn scale(&self) -> ScaleR { + ScaleR::new((self.bits & 0x0f) as u8) } #[doc = "Bit 8"] #[inline(always)] - pub fn sticky(&self) -> STICKY_R { - STICKY_R::new(((self.bits >> 8) & 1) != 0) + pub fn sticky(&self) -> StickyR { + StickyR::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn zerocmp(&self) -> ZEROCMP_R { - ZEROCMP_R::new(((self.bits >> 9) & 1) != 0) + pub fn zerocmp(&self) -> ZerocmpR { + ZerocmpR::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 10"] #[inline(always)] - pub fn deglitch(&self) -> DEGLITCH_R { - DEGLITCH_R::new(((self.bits >> 10) & 1) != 0) + pub fn deglitch(&self) -> DeglitchR { + DeglitchR::new(((self.bits >> 10) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn enalways(&self) -> ENALWAYS_R { - ENALWAYS_R::new(((self.bits >> 12) & 1) != 0) + pub fn enalways(&self) -> EnalwaysR { + EnalwaysR::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn enoneshot(&self) -> ENONESHOT_R { - ENONESHOT_R::new(((self.bits >> 13) & 1) != 0) + pub fn enoneshot(&self) -> EnoneshotR { + EnoneshotR::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 16"] #[inline(always)] - pub fn cmp0center(&self) -> CMP0CENTER_R { - CMP0CENTER_R::new(((self.bits >> 16) & 1) != 0) + pub fn cmp0center(&self) -> Cmp0centerR { + Cmp0centerR::new(((self.bits >> 16) & 1) != 0) } #[doc = "Bit 17"] #[inline(always)] - pub fn cmp1center(&self) -> CMP1CENTER_R { - CMP1CENTER_R::new(((self.bits >> 17) & 1) != 0) + pub fn cmp1center(&self) -> Cmp1centerR { + Cmp1centerR::new(((self.bits >> 17) & 1) != 0) } #[doc = "Bit 18"] #[inline(always)] - pub fn cmp2center(&self) -> CMP2CENTER_R { - CMP2CENTER_R::new(((self.bits >> 18) & 1) != 0) + pub fn cmp2center(&self) -> Cmp2centerR { + Cmp2centerR::new(((self.bits >> 18) & 1) != 0) } #[doc = "Bit 19"] #[inline(always)] - pub fn cmp3center(&self) -> CMP3CENTER_R { - CMP3CENTER_R::new(((self.bits >> 19) & 1) != 0) + pub fn cmp3center(&self) -> Cmp3centerR { + Cmp3centerR::new(((self.bits >> 19) & 1) != 0) } #[doc = "Bit 24"] #[inline(always)] - pub fn cmp0gang(&self) -> CMP0GANG_R { - CMP0GANG_R::new(((self.bits >> 24) & 1) != 0) + pub fn cmp0gang(&self) -> Cmp0gangR { + Cmp0gangR::new(((self.bits >> 24) & 1) != 0) } #[doc = "Bit 25"] #[inline(always)] - pub fn cmp1gang(&self) -> CMP1GANG_R { - CMP1GANG_R::new(((self.bits >> 25) & 1) != 0) + pub fn cmp1gang(&self) -> Cmp1gangR { + Cmp1gangR::new(((self.bits >> 25) & 1) != 0) } #[doc = "Bits 26:36"] #[inline(always)] - pub fn cmp2gang(&self) -> CMP2GANG_R { - CMP2GANG_R::new(((self.bits >> 26) & 0x07ff) as u16) + pub fn cmp2gang(&self) -> Cmp2gangR { + Cmp2gangR::new(((self.bits >> 26) & 0x07ff) as u16) } #[doc = "Bit 27"] #[inline(always)] - pub fn cmp3gang(&self) -> CMP3GANG_R { - CMP3GANG_R::new(((self.bits >> 27) & 1) != 0) + pub fn cmp3gang(&self) -> Cmp3gangR { + Cmp3gangR::new(((self.bits >> 27) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn cmp0ip(&self) -> CMP0IP_R { - CMP0IP_R::new(((self.bits >> 28) & 1) != 0) + pub fn cmp0ip(&self) -> Cmp0ipR { + Cmp0ipR::new(((self.bits >> 28) & 1) != 0) } #[doc = "Bit 29"] #[inline(always)] - pub fn cmp1ip(&self) -> CMP1IP_R { - CMP1IP_R::new(((self.bits >> 29) & 1) != 0) + pub fn cmp1ip(&self) -> Cmp1ipR { + Cmp1ipR::new(((self.bits >> 29) & 1) != 0) } #[doc = "Bit 30"] #[inline(always)] - pub fn cmp2ip(&self) -> CMP2IP_R { - CMP2IP_R::new(((self.bits >> 30) & 1) != 0) + pub fn cmp2ip(&self) -> Cmp2ipR { + Cmp2ipR::new(((self.bits >> 30) & 1) != 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn cmp3ip(&self) -> CMP3IP_R { - CMP3IP_R::new(((self.bits >> 31) & 1) != 0) + pub fn cmp3ip(&self) -> Cmp3ipR { + Cmp3ipR::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bits 0:3"] #[inline(always)] - pub fn scale(&mut self) -> SCALE_W<0> { - SCALE_W::new(self) + #[must_use] + pub fn scale(&mut self) -> ScaleW { + ScaleW::new(self, 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn sticky(&mut self) -> STICKY_W<8> { - STICKY_W::new(self) + #[must_use] + pub fn sticky(&mut self) -> StickyW { + StickyW::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn zerocmp(&mut self) -> ZEROCMP_W<9> { - ZEROCMP_W::new(self) + #[must_use] + pub fn zerocmp(&mut self) -> ZerocmpW { + ZerocmpW::new(self, 9) } #[doc = "Bit 10"] #[inline(always)] - pub fn deglitch(&mut self) -> DEGLITCH_W<10> { - DEGLITCH_W::new(self) + #[must_use] + pub fn deglitch(&mut self) -> DeglitchW { + DeglitchW::new(self, 10) } #[doc = "Bit 12"] #[inline(always)] - pub fn enalways(&mut self) -> ENALWAYS_W<12> { - ENALWAYS_W::new(self) + #[must_use] + pub fn enalways(&mut self) -> EnalwaysW { + EnalwaysW::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn enoneshot(&mut self) -> ENONESHOT_W<13> { - ENONESHOT_W::new(self) + #[must_use] + pub fn enoneshot(&mut self) -> EnoneshotW { + EnoneshotW::new(self, 13) } #[doc = "Bit 16"] #[inline(always)] - pub fn cmp0center(&mut self) -> CMP0CENTER_W<16> { - CMP0CENTER_W::new(self) + #[must_use] + pub fn cmp0center(&mut self) -> Cmp0centerW { + Cmp0centerW::new(self, 16) } #[doc = "Bit 17"] #[inline(always)] - pub fn cmp1center(&mut self) -> CMP1CENTER_W<17> { - CMP1CENTER_W::new(self) + #[must_use] + pub fn cmp1center(&mut self) -> Cmp1centerW { + Cmp1centerW::new(self, 17) } #[doc = "Bit 18"] #[inline(always)] - pub fn cmp2center(&mut self) -> CMP2CENTER_W<18> { - CMP2CENTER_W::new(self) + #[must_use] + pub fn cmp2center(&mut self) -> Cmp2centerW { + Cmp2centerW::new(self, 18) } #[doc = "Bit 19"] #[inline(always)] - pub fn cmp3center(&mut self) -> CMP3CENTER_W<19> { - CMP3CENTER_W::new(self) + #[must_use] + pub fn cmp3center(&mut self) -> Cmp3centerW { + Cmp3centerW::new(self, 19) } #[doc = "Bit 24"] #[inline(always)] - pub fn cmp0gang(&mut self) -> CMP0GANG_W<24> { - CMP0GANG_W::new(self) + #[must_use] + pub fn cmp0gang(&mut self) -> Cmp0gangW { + Cmp0gangW::new(self, 24) } #[doc = "Bit 25"] #[inline(always)] - pub fn cmp1gang(&mut self) -> CMP1GANG_W<25> { - CMP1GANG_W::new(self) + #[must_use] + pub fn cmp1gang(&mut self) -> Cmp1gangW { + Cmp1gangW::new(self, 25) } #[doc = "Bits 26:36"] #[inline(always)] - pub fn cmp2gang(&mut self) -> CMP2GANG_W<26> { - CMP2GANG_W::new(self) + #[must_use] + pub fn cmp2gang(&mut self) -> Cmp2gangW { + Cmp2gangW::new(self, 26) } #[doc = "Bit 27"] #[inline(always)] - pub fn cmp3gang(&mut self) -> CMP3GANG_W<27> { - CMP3GANG_W::new(self) + #[must_use] + pub fn cmp3gang(&mut self) -> Cmp3gangW { + Cmp3gangW::new(self, 27) } #[doc = "Bit 28"] #[inline(always)] - pub fn cmp0ip(&mut self) -> CMP0IP_W<28> { - CMP0IP_W::new(self) + #[must_use] + pub fn cmp0ip(&mut self) -> Cmp0ipW { + Cmp0ipW::new(self, 28) } #[doc = "Bit 29"] #[inline(always)] - pub fn cmp1ip(&mut self) -> CMP1IP_W<29> { - CMP1IP_W::new(self) + #[must_use] + pub fn cmp1ip(&mut self) -> Cmp1ipW { + Cmp1ipW::new(self, 29) } #[doc = "Bit 30"] #[inline(always)] - pub fn cmp2ip(&mut self) -> CMP2IP_W<30> { - CMP2IP_W::new(self) + #[must_use] + pub fn cmp2ip(&mut self) -> Cmp2ipW { + Cmp2ipW::new(self, 30) } #[doc = "Bit 31"] #[inline(always)] - pub fn cmp3ip(&mut self) -> CMP3IP_W<31> { - CMP3IP_W::new(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 + #[must_use] + pub fn cmp3ip(&mut self) -> Cmp3ipW { + Cmp3ipW::new(self, 31) } } -#[doc = "PWM Configuration Register\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)."] -pub struct CFG_SPEC; -impl crate::RegisterSpec for CFG_SPEC { +#[doc = "PWM Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct CfgSpec; +impl crate::RegisterSpec for CfgSpec { type Ux = u32; } -#[doc = "`read()` method returns [cfg::R](R) reader structure"] -impl crate::Readable for CFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [cfg::W](W) writer structure"] -impl crate::Writable for CFG_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`cfg::R`](R) reader structure"] +impl crate::Readable for CfgSpec {} +#[doc = "`write(|w| ..)` method takes [`cfg::W`](W) writer structure"] +impl crate::Writable for CfgSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets cfg to value 0"] -impl crate::Resettable for CFG_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for CfgSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pwm0/cmp0.rs b/src/pwm0/cmp0.rs index 294f761..ae5e513 100644 --- a/src/pwm0/cmp0.rs +++ b/src/pwm0/cmp0.rs @@ -1,80 +1,40 @@ #[doc = "Register `cmp0` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `cmp0` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `value` reader - "] -pub type VALUE_R = crate::FieldReader; +pub type ValueR = crate::FieldReader; #[doc = "Field `value` writer - "] -pub type VALUE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMP0_SPEC, u16, u16, 16, O>; +pub type ValueW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&self) -> VALUE_R { - VALUE_R::new((self.bits & 0xffff) as u16) + pub fn value(&self) -> ValueR { + ValueR::new((self.bits & 0xffff) as u16) } } impl W { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&mut self) -> VALUE_W<0> { - VALUE_W::new(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 + #[must_use] + pub fn value(&mut self) -> ValueW { + ValueW::new(self, 0) } } -#[doc = "Compare Register\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 [cmp0](index.html) module"] -pub struct CMP0_SPEC; -impl crate::RegisterSpec for CMP0_SPEC { +#[doc = "Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cmp0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmp0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct Cmp0Spec; +impl crate::RegisterSpec for Cmp0Spec { type Ux = u32; } -#[doc = "`read()` method returns [cmp0::R](R) reader structure"] -impl crate::Readable for CMP0_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [cmp0::W](W) writer structure"] -impl crate::Writable for CMP0_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`cmp0::R`](R) reader structure"] +impl crate::Readable for Cmp0Spec {} +#[doc = "`write(|w| ..)` method takes [`cmp0::W`](W) writer structure"] +impl crate::Writable for Cmp0Spec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets cmp0 to value 0"] -impl crate::Resettable for CMP0_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for Cmp0Spec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pwm0/cmp1.rs b/src/pwm0/cmp1.rs index 87b1de0..ab2467e 100644 --- a/src/pwm0/cmp1.rs +++ b/src/pwm0/cmp1.rs @@ -1,80 +1,40 @@ #[doc = "Register `cmp1` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `cmp1` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `value` reader - "] -pub type VALUE_R = crate::FieldReader; +pub type ValueR = crate::FieldReader; #[doc = "Field `value` writer - "] -pub type VALUE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMP1_SPEC, u16, u16, 16, O>; +pub type ValueW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&self) -> VALUE_R { - VALUE_R::new((self.bits & 0xffff) as u16) + pub fn value(&self) -> ValueR { + ValueR::new((self.bits & 0xffff) as u16) } } impl W { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&mut self) -> VALUE_W<0> { - VALUE_W::new(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 + #[must_use] + pub fn value(&mut self) -> ValueW { + ValueW::new(self, 0) } } -#[doc = "Compare Register\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 [cmp1](index.html) module"] -pub struct CMP1_SPEC; -impl crate::RegisterSpec for CMP1_SPEC { +#[doc = "Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cmp1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmp1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct Cmp1Spec; +impl crate::RegisterSpec for Cmp1Spec { type Ux = u32; } -#[doc = "`read()` method returns [cmp1::R](R) reader structure"] -impl crate::Readable for CMP1_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [cmp1::W](W) writer structure"] -impl crate::Writable for CMP1_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`cmp1::R`](R) reader structure"] +impl crate::Readable for Cmp1Spec {} +#[doc = "`write(|w| ..)` method takes [`cmp1::W`](W) writer structure"] +impl crate::Writable for Cmp1Spec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets cmp1 to value 0"] -impl crate::Resettable for CMP1_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for Cmp1Spec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pwm0/cmp2.rs b/src/pwm0/cmp2.rs index f0dae99..4b8e903 100644 --- a/src/pwm0/cmp2.rs +++ b/src/pwm0/cmp2.rs @@ -1,80 +1,40 @@ #[doc = "Register `cmp2` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `cmp2` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `value` reader - "] -pub type VALUE_R = crate::FieldReader; +pub type ValueR = crate::FieldReader; #[doc = "Field `value` writer - "] -pub type VALUE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMP2_SPEC, u16, u16, 16, O>; +pub type ValueW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&self) -> VALUE_R { - VALUE_R::new((self.bits & 0xffff) as u16) + pub fn value(&self) -> ValueR { + ValueR::new((self.bits & 0xffff) as u16) } } impl W { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&mut self) -> VALUE_W<0> { - VALUE_W::new(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 + #[must_use] + pub fn value(&mut self) -> ValueW { + ValueW::new(self, 0) } } -#[doc = "Compare Register\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 [cmp2](index.html) module"] -pub struct CMP2_SPEC; -impl crate::RegisterSpec for CMP2_SPEC { +#[doc = "Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cmp2::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmp2::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct Cmp2Spec; +impl crate::RegisterSpec for Cmp2Spec { type Ux = u32; } -#[doc = "`read()` method returns [cmp2::R](R) reader structure"] -impl crate::Readable for CMP2_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [cmp2::W](W) writer structure"] -impl crate::Writable for CMP2_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`cmp2::R`](R) reader structure"] +impl crate::Readable for Cmp2Spec {} +#[doc = "`write(|w| ..)` method takes [`cmp2::W`](W) writer structure"] +impl crate::Writable for Cmp2Spec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets cmp2 to value 0"] -impl crate::Resettable for CMP2_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for Cmp2Spec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pwm0/cmp3.rs b/src/pwm0/cmp3.rs index 7ab4131..c40bd1e 100644 --- a/src/pwm0/cmp3.rs +++ b/src/pwm0/cmp3.rs @@ -1,80 +1,40 @@ #[doc = "Register `cmp3` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `cmp3` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `value` reader - "] -pub type VALUE_R = crate::FieldReader; +pub type ValueR = crate::FieldReader; #[doc = "Field `value` writer - "] -pub type VALUE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMP3_SPEC, u16, u16, 16, O>; +pub type ValueW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&self) -> VALUE_R { - VALUE_R::new((self.bits & 0xffff) as u16) + pub fn value(&self) -> ValueR { + ValueR::new((self.bits & 0xffff) as u16) } } impl W { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&mut self) -> VALUE_W<0> { - VALUE_W::new(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 + #[must_use] + pub fn value(&mut self) -> ValueW { + ValueW::new(self, 0) } } -#[doc = "Compare Register\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 [cmp3](index.html) module"] -pub struct CMP3_SPEC; -impl crate::RegisterSpec for CMP3_SPEC { +#[doc = "Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cmp3::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmp3::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct Cmp3Spec; +impl crate::RegisterSpec for Cmp3Spec { type Ux = u32; } -#[doc = "`read()` method returns [cmp3::R](R) reader structure"] -impl crate::Readable for CMP3_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [cmp3::W](W) writer structure"] -impl crate::Writable for CMP3_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`cmp3::R`](R) reader structure"] +impl crate::Readable for Cmp3Spec {} +#[doc = "`write(|w| ..)` method takes [`cmp3::W`](W) writer structure"] +impl crate::Writable for Cmp3Spec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets cmp3 to value 0"] -impl crate::Resettable for CMP3_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for Cmp3Spec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pwm0/count.rs b/src/pwm0/count.rs index 2dda941..a5c49c6 100644 --- a/src/pwm0/count.rs +++ b/src/pwm0/count.rs @@ -1,64 +1,27 @@ #[doc = "Register `count` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `count` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Counter Register\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 [count](index.html) module"] -pub struct COUNT_SPEC; -impl crate::RegisterSpec for COUNT_SPEC { +impl W {} +#[doc = "Counter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`count::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`count::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct CountSpec; +impl crate::RegisterSpec for CountSpec { type Ux = u32; } -#[doc = "`read()` method returns [count::R](R) reader structure"] -impl crate::Readable for COUNT_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [count::W](W) writer structure"] -impl crate::Writable for COUNT_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`count::R`](R) reader structure"] +impl crate::Readable for CountSpec {} +#[doc = "`write(|w| ..)` method takes [`count::W`](W) writer structure"] +impl crate::Writable for CountSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets count to value 0"] -impl crate::Resettable for COUNT_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for CountSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/pwm0/pwms.rs b/src/pwm0/pwms.rs index 1909508..20434e1 100644 --- a/src/pwm0/pwms.rs +++ b/src/pwm0/pwms.rs @@ -1,64 +1,27 @@ #[doc = "Register `pwms` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `pwms` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Scaled Halfword Counter Register\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 [pwms](index.html) module"] -pub struct PWMS_SPEC; -impl crate::RegisterSpec for PWMS_SPEC { +impl W {} +#[doc = "Scaled Halfword Counter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pwms::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pwms::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct PwmsSpec; +impl crate::RegisterSpec for PwmsSpec { type Ux = u32; } -#[doc = "`read()` method returns [pwms::R](R) reader structure"] -impl crate::Readable for PWMS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [pwms::W](W) writer structure"] -impl crate::Writable for PWMS_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`pwms::R`](R) reader structure"] +impl crate::Readable for PwmsSpec {} +#[doc = "`write(|w| ..)` method takes [`pwms::W`](W) writer structure"] +impl crate::Writable for PwmsSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets pwms to value 0"] -impl crate::Resettable for PWMS_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for PwmsSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0.rs b/src/qspi0.rs index 97b148f..b424bea 100644 --- a/src/qspi0.rs +++ b/src/qspi0.rs @@ -1,106 +1,204 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { + sckdiv: Sckdiv, + sckmode: Sckmode, + _reserved2: [u8; 0x08], + csid: Csid, + csdef: Csdef, + csmode: Csmode, + _reserved5: [u8; 0x0c], + delay0: Delay0, + delay1: Delay1, + _reserved7: [u8; 0x10], + fmt: Fmt, + _reserved8: [u8; 0x04], + txdata: Txdata, + rxdata: Rxdata, + txmark: Txmark, + rxmark: Rxmark, + _reserved12: [u8; 0x08], + fctrl: Fctrl, + ffmt: Ffmt, + _reserved14: [u8; 0x08], + ie: Ie, + ip: Ip, +} +impl RegisterBlock { #[doc = "0x00 - Serial Clock Divisor Register"] - pub sckdiv: SCKDIV, + #[inline(always)] + pub const fn sckdiv(&self) -> &Sckdiv { + &self.sckdiv + } #[doc = "0x04 - Serial Clock Mode Register"] - pub sckmode: SCKMODE, - _reserved2: [u8; 0x08], + #[inline(always)] + pub const fn sckmode(&self) -> &Sckmode { + &self.sckmode + } #[doc = "0x10 - Chip Select ID Register"] - pub csid: CSID, + #[inline(always)] + pub const fn csid(&self) -> &Csid { + &self.csid + } #[doc = "0x14 - Chip Select Default Register"] - pub csdef: CSDEF, + #[inline(always)] + pub const fn csdef(&self) -> &Csdef { + &self.csdef + } #[doc = "0x18 - Chip Select Mode Register"] - pub csmode: CSMODE, - _reserved5: [u8; 0x0c], + #[inline(always)] + pub const fn csmode(&self) -> &Csmode { + &self.csmode + } #[doc = "0x28 - Delay Control 0 Register"] - pub delay0: DELAY0, + #[inline(always)] + pub const fn delay0(&self) -> &Delay0 { + &self.delay0 + } #[doc = "0x2c - Delay Control 1 Register"] - pub delay1: DELAY1, - _reserved7: [u8; 0x10], + #[inline(always)] + pub const fn delay1(&self) -> &Delay1 { + &self.delay1 + } #[doc = "0x40 - Frame Format Register"] - pub fmt: FMT, - _reserved8: [u8; 0x04], + #[inline(always)] + pub const fn fmt(&self) -> &Fmt { + &self.fmt + } #[doc = "0x48 - Transmit Data Register"] - pub txdata: TXDATA, + #[inline(always)] + pub const fn txdata(&self) -> &Txdata { + &self.txdata + } #[doc = "0x4c - Receive Data Register"] - pub rxdata: RXDATA, + #[inline(always)] + pub const fn rxdata(&self) -> &Rxdata { + &self.rxdata + } #[doc = "0x50 - Transmit Watermark Register"] - pub txmark: TXMARK, + #[inline(always)] + pub const fn txmark(&self) -> &Txmark { + &self.txmark + } #[doc = "0x54 - Receive Watermark Register"] - pub rxmark: RXMARK, - _reserved12: [u8; 0x08], + #[inline(always)] + pub const fn rxmark(&self) -> &Rxmark { + &self.rxmark + } #[doc = "0x60 - SPI Flash Interface Control Register"] - pub fctrl: FCTRL, + #[inline(always)] + pub const fn fctrl(&self) -> &Fctrl { + &self.fctrl + } #[doc = "0x64 - SPI Flash Instruction Format Register"] - pub ffmt: FFMT, - _reserved14: [u8; 0x08], + #[inline(always)] + pub const fn ffmt(&self) -> &Ffmt { + &self.ffmt + } #[doc = "0x70 - SPI Interrupt Enable Register"] - pub ie: IE, + #[inline(always)] + pub const fn ie(&self) -> &Ie { + &self.ie + } #[doc = "0x74 - SPI Interrupt Pending Register"] - pub ip: IP, + #[inline(always)] + pub const fn ip(&self) -> &Ip { + &self.ip + } } -#[doc = "sckdiv (rw) register accessor: an alias for `Reg`"] -pub type SCKDIV = crate::Reg; +#[doc = "sckdiv (rw) register accessor: Serial Clock Divisor Register\n\nYou can [`read`](crate::Reg::read) this register and get [`sckdiv::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sckdiv::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sckdiv`] +module"] +#[doc(alias = "sckdiv")] +pub type Sckdiv = crate::Reg; #[doc = "Serial Clock Divisor Register"] pub mod sckdiv; -#[doc = "sckmode (rw) register accessor: an alias for `Reg`"] -pub type SCKMODE = crate::Reg; +#[doc = "sckmode (rw) register accessor: Serial Clock Mode Register\n\nYou can [`read`](crate::Reg::read) this register and get [`sckmode::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sckmode::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sckmode`] +module"] +#[doc(alias = "sckmode")] +pub type Sckmode = crate::Reg; #[doc = "Serial Clock Mode Register"] pub mod sckmode; -#[doc = "csid (rw) register accessor: an alias for `Reg`"] -pub type CSID = crate::Reg; +#[doc = "csid (rw) register accessor: Chip Select ID Register\n\nYou can [`read`](crate::Reg::read) this register and get [`csid::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`csid::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csid`] +module"] +#[doc(alias = "csid")] +pub type Csid = crate::Reg; #[doc = "Chip Select ID Register"] pub mod csid; -#[doc = "csdef (rw) register accessor: an alias for `Reg`"] -pub type CSDEF = crate::Reg; +#[doc = "csdef (rw) register accessor: Chip Select Default Register\n\nYou can [`read`](crate::Reg::read) this register and get [`csdef::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`csdef::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csdef`] +module"] +#[doc(alias = "csdef")] +pub type Csdef = crate::Reg; #[doc = "Chip Select Default Register"] pub mod csdef; -#[doc = "csmode (rw) register accessor: an alias for `Reg`"] -pub type CSMODE = crate::Reg; +#[doc = "csmode (rw) register accessor: Chip Select Mode Register\n\nYou can [`read`](crate::Reg::read) this register and get [`csmode::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`csmode::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csmode`] +module"] +#[doc(alias = "csmode")] +pub type Csmode = crate::Reg; #[doc = "Chip Select Mode Register"] pub mod csmode; -#[doc = "delay0 (rw) register accessor: an alias for `Reg`"] -pub type DELAY0 = crate::Reg; +#[doc = "delay0 (rw) register accessor: Delay Control 0 Register\n\nYou can [`read`](crate::Reg::read) this register and get [`delay0::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`delay0::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@delay0`] +module"] +#[doc(alias = "delay0")] +pub type Delay0 = crate::Reg; #[doc = "Delay Control 0 Register"] pub mod delay0; -#[doc = "delay1 (rw) register accessor: an alias for `Reg`"] -pub type DELAY1 = crate::Reg; +#[doc = "delay1 (rw) register accessor: Delay Control 1 Register\n\nYou can [`read`](crate::Reg::read) this register and get [`delay1::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`delay1::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@delay1`] +module"] +#[doc(alias = "delay1")] +pub type Delay1 = crate::Reg; #[doc = "Delay Control 1 Register"] pub mod delay1; -#[doc = "fmt (rw) register accessor: an alias for `Reg`"] -pub type FMT = crate::Reg; +#[doc = "fmt (rw) register accessor: Frame Format Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fmt::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fmt::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fmt`] +module"] +#[doc(alias = "fmt")] +pub type Fmt = crate::Reg; #[doc = "Frame Format Register"] pub mod fmt; -#[doc = "txdata (rw) register accessor: an alias for `Reg`"] -pub type TXDATA = crate::Reg; +#[doc = "txdata (rw) register accessor: Transmit Data Register\n\nYou can [`read`](crate::Reg::read) this register and get [`txdata::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`txdata::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@txdata`] +module"] +#[doc(alias = "txdata")] +pub type Txdata = crate::Reg; #[doc = "Transmit Data Register"] pub mod txdata; -#[doc = "rxdata (rw) register accessor: an alias for `Reg`"] -pub type RXDATA = crate::Reg; +#[doc = "rxdata (rw) register accessor: Receive Data Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rxdata::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rxdata::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxdata`] +module"] +#[doc(alias = "rxdata")] +pub type Rxdata = crate::Reg; #[doc = "Receive Data Register"] pub mod rxdata; -#[doc = "txmark (rw) register accessor: an alias for `Reg`"] -pub type TXMARK = crate::Reg; +#[doc = "txmark (rw) register accessor: Transmit Watermark Register\n\nYou can [`read`](crate::Reg::read) this register and get [`txmark::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`txmark::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@txmark`] +module"] +#[doc(alias = "txmark")] +pub type Txmark = crate::Reg; #[doc = "Transmit Watermark Register"] pub mod txmark; -#[doc = "rxmark (rw) register accessor: an alias for `Reg`"] -pub type RXMARK = crate::Reg; +#[doc = "rxmark (rw) register accessor: Receive Watermark Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rxmark::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rxmark::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxmark`] +module"] +#[doc(alias = "rxmark")] +pub type Rxmark = crate::Reg; #[doc = "Receive Watermark Register"] pub mod rxmark; -#[doc = "fctrl (rw) register accessor: an alias for `Reg`"] -pub type FCTRL = crate::Reg; +#[doc = "fctrl (rw) register accessor: SPI Flash Interface Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fctrl::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fctrl`] +module"] +#[doc(alias = "fctrl")] +pub type Fctrl = crate::Reg; #[doc = "SPI Flash Interface Control Register"] pub mod fctrl; -#[doc = "ffmt (rw) register accessor: an alias for `Reg`"] -pub type FFMT = crate::Reg; +#[doc = "ffmt (rw) register accessor: SPI Flash Instruction Format Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ffmt::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ffmt::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ffmt`] +module"] +#[doc(alias = "ffmt")] +pub type Ffmt = crate::Reg; #[doc = "SPI Flash Instruction Format Register"] pub mod ffmt; -#[doc = "ie (rw) register accessor: an alias for `Reg`"] -pub type IE = crate::Reg; +#[doc = "ie (rw) register accessor: SPI Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ie::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ie::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ie`] +module"] +#[doc(alias = "ie")] +pub type Ie = crate::Reg; #[doc = "SPI Interrupt Enable Register"] pub mod ie; -#[doc = "ip (rw) register accessor: an alias for `Reg`"] -pub type IP = crate::Reg; +#[doc = "ip (rw) register accessor: SPI Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ip::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ip::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ip`] +module"] +#[doc(alias = "ip")] +pub type Ip = crate::Reg; #[doc = "SPI Interrupt Pending Register"] pub mod ip; diff --git a/src/qspi0/csdef.rs b/src/qspi0/csdef.rs index d2c3918..fdf22c9 100644 --- a/src/qspi0/csdef.rs +++ b/src/qspi0/csdef.rs @@ -1,64 +1,27 @@ #[doc = "Register `csdef` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `csdef` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Chip Select Default Register\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 [csdef](index.html) module"] -pub struct CSDEF_SPEC; -impl crate::RegisterSpec for CSDEF_SPEC { +impl W {} +#[doc = "Chip Select Default Register\n\nYou can [`read`](crate::Reg::read) this register and get [`csdef::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`csdef::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct CsdefSpec; +impl crate::RegisterSpec for CsdefSpec { type Ux = u32; } -#[doc = "`read()` method returns [csdef::R](R) reader structure"] -impl crate::Readable for CSDEF_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [csdef::W](W) writer structure"] -impl crate::Writable for CSDEF_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`csdef::R`](R) reader structure"] +impl crate::Readable for CsdefSpec {} +#[doc = "`write(|w| ..)` method takes [`csdef::W`](W) writer structure"] +impl crate::Writable for CsdefSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets csdef to value 0xffff"] -impl crate::Resettable for CSDEF_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0xffff - } +impl crate::Resettable for CsdefSpec { + const RESET_VALUE: u32 = 0xffff; } diff --git a/src/qspi0/csid.rs b/src/qspi0/csid.rs index c9ef11a..ba5b9b0 100644 --- a/src/qspi0/csid.rs +++ b/src/qspi0/csid.rs @@ -1,64 +1,27 @@ #[doc = "Register `csid` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `csid` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Chip Select ID Register\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 [csid](index.html) module"] -pub struct CSID_SPEC; -impl crate::RegisterSpec for CSID_SPEC { +impl W {} +#[doc = "Chip Select ID Register\n\nYou can [`read`](crate::Reg::read) this register and get [`csid::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`csid::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct CsidSpec; +impl crate::RegisterSpec for CsidSpec { type Ux = u32; } -#[doc = "`read()` method returns [csid::R](R) reader structure"] -impl crate::Readable for CSID_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [csid::W](W) writer structure"] -impl crate::Writable for CSID_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`csid::R`](R) reader structure"] +impl crate::Readable for CsidSpec {} +#[doc = "`write(|w| ..)` method takes [`csid::W`](W) writer structure"] +impl crate::Writable for CsidSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets csid to value 0"] -impl crate::Resettable for CSID_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for CsidSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/csmode.rs b/src/qspi0/csmode.rs index 6f3b6d2..acad207 100644 --- a/src/qspi0/csmode.rs +++ b/src/qspi0/csmode.rs @@ -1,141 +1,109 @@ #[doc = "Register `csmode` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `csmode` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -#[doc = "Field `mode` reader - Chip select mode"] -pub type MODE_R = crate::FieldReader; +pub type W = crate::W; #[doc = "Chip select mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] -pub enum MODE_A { +pub enum Mode { #[doc = "0: Assert/de-assert CS at the beginning/end of each frame."] - AUTO = 0, + Auto = 0, #[doc = "2: Keep CS continuously asserted after the initial frame."] - HOLD = 2, + Hold = 2, #[doc = "3: Disable hardware control of the CS pin."] - OFF = 3, + Off = 3, } -impl From for u8 { +impl From for u8 { #[inline(always)] - fn from(variant: MODE_A) -> Self { + fn from(variant: Mode) -> Self { variant as _ } } -impl MODE_R { +impl crate::FieldSpec for Mode { + type Ux = u8; +} +impl crate::IsEnum for Mode {} +#[doc = "Field `mode` reader - Chip select mode"] +pub type ModeR = crate::FieldReader; +impl ModeR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(MODE_A::AUTO), - 2 => Some(MODE_A::HOLD), - 3 => Some(MODE_A::OFF), + 0 => Some(Mode::Auto), + 2 => Some(Mode::Hold), + 3 => Some(Mode::Off), _ => None, } } - #[doc = "Checks if the value of the field is `AUTO`"] + #[doc = "Assert/de-assert CS at the beginning/end of each frame."] #[inline(always)] pub fn is_auto(&self) -> bool { - *self == MODE_A::AUTO + *self == Mode::Auto } - #[doc = "Checks if the value of the field is `HOLD`"] + #[doc = "Keep CS continuously asserted after the initial frame."] #[inline(always)] pub fn is_hold(&self) -> bool { - *self == MODE_A::HOLD + *self == Mode::Hold } - #[doc = "Checks if the value of the field is `OFF`"] + #[doc = "Disable hardware control of the CS pin."] #[inline(always)] pub fn is_off(&self) -> bool { - *self == MODE_A::OFF + *self == Mode::Off } } #[doc = "Field `mode` writer - Chip select mode"] -pub type MODE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CSMODE_SPEC, u8, MODE_A, 2, O>; -impl<'a, const O: u8> MODE_W<'a, O> { +pub type ModeW<'a, REG> = crate::FieldWriter<'a, REG, 2, Mode>; +impl<'a, REG> ModeW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Assert/de-assert CS at the beginning/end of each frame."] #[inline(always)] - pub fn auto(self) -> &'a mut W { - self.variant(MODE_A::AUTO) + pub fn auto(self) -> &'a mut crate::W { + self.variant(Mode::Auto) } #[doc = "Keep CS continuously asserted after the initial frame."] #[inline(always)] - pub fn hold(self) -> &'a mut W { - self.variant(MODE_A::HOLD) + pub fn hold(self) -> &'a mut crate::W { + self.variant(Mode::Hold) } #[doc = "Disable hardware control of the CS pin."] #[inline(always)] - pub fn off(self) -> &'a mut W { - self.variant(MODE_A::OFF) + pub fn off(self) -> &'a mut crate::W { + self.variant(Mode::Off) } } impl R { #[doc = "Bits 0:1 - Chip select mode"] #[inline(always)] - pub fn mode(&self) -> MODE_R { - MODE_R::new((self.bits & 3) as u8) + pub fn mode(&self) -> ModeR { + ModeR::new((self.bits & 3) as u8) } } impl W { #[doc = "Bits 0:1 - Chip select mode"] #[inline(always)] - pub fn mode(&mut self) -> MODE_W<0> { - MODE_W::new(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 + #[must_use] + pub fn mode(&mut self) -> ModeW { + ModeW::new(self, 0) } } -#[doc = "Chip Select Mode Register\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 [csmode](index.html) module"] -pub struct CSMODE_SPEC; -impl crate::RegisterSpec for CSMODE_SPEC { +#[doc = "Chip Select Mode Register\n\nYou can [`read`](crate::Reg::read) this register and get [`csmode::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`csmode::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct CsmodeSpec; +impl crate::RegisterSpec for CsmodeSpec { type Ux = u32; } -#[doc = "`read()` method returns [csmode::R](R) reader structure"] -impl crate::Readable for CSMODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [csmode::W](W) writer structure"] -impl crate::Writable for CSMODE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`csmode::R`](R) reader structure"] +impl crate::Readable for CsmodeSpec {} +#[doc = "`write(|w| ..)` method takes [`csmode::W`](W) writer structure"] +impl crate::Writable for CsmodeSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets csmode to value 0"] -impl crate::Resettable for CSMODE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for CsmodeSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/delay0.rs b/src/qspi0/delay0.rs index a78b32f..328caa7 100644 --- a/src/qspi0/delay0.rs +++ b/src/qspi0/delay0.rs @@ -1,94 +1,55 @@ #[doc = "Register `delay0` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `delay0` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `cssck` reader - CS to SCK Delay"] -pub type CSSCK_R = crate::FieldReader; +pub type CssckR = crate::FieldReader; #[doc = "Field `cssck` writer - CS to SCK Delay"] -pub type CSSCK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DELAY0_SPEC, u8, u8, 8, O>; +pub type CssckW<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `sckcs` reader - SCK to CS Delay"] -pub type SCKCS_R = crate::FieldReader; +pub type SckcsR = crate::FieldReader; #[doc = "Field `sckcs` writer - SCK to CS Delay"] -pub type SCKCS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DELAY0_SPEC, u8, u8, 8, O>; +pub type SckcsW<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - CS to SCK Delay"] #[inline(always)] - pub fn cssck(&self) -> CSSCK_R { - CSSCK_R::new((self.bits & 0xff) as u8) + pub fn cssck(&self) -> CssckR { + CssckR::new((self.bits & 0xff) as u8) } #[doc = "Bits 16:23 - SCK to CS Delay"] #[inline(always)] - pub fn sckcs(&self) -> SCKCS_R { - SCKCS_R::new(((self.bits >> 16) & 0xff) as u8) + pub fn sckcs(&self) -> SckcsR { + SckcsR::new(((self.bits >> 16) & 0xff) as u8) } } impl W { #[doc = "Bits 0:7 - CS to SCK Delay"] #[inline(always)] - pub fn cssck(&mut self) -> CSSCK_W<0> { - CSSCK_W::new(self) + #[must_use] + pub fn cssck(&mut self) -> CssckW { + CssckW::new(self, 0) } #[doc = "Bits 16:23 - SCK to CS Delay"] #[inline(always)] - pub fn sckcs(&mut self) -> SCKCS_W<16> { - SCKCS_W::new(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 + #[must_use] + pub fn sckcs(&mut self) -> SckcsW { + SckcsW::new(self, 16) } } -#[doc = "Delay Control 0 Register\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 [delay0](index.html) module"] -pub struct DELAY0_SPEC; -impl crate::RegisterSpec for DELAY0_SPEC { +#[doc = "Delay Control 0 Register\n\nYou can [`read`](crate::Reg::read) this register and get [`delay0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`delay0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct Delay0Spec; +impl crate::RegisterSpec for Delay0Spec { type Ux = u32; } -#[doc = "`read()` method returns [delay0::R](R) reader structure"] -impl crate::Readable for DELAY0_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [delay0::W](W) writer structure"] -impl crate::Writable for DELAY0_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`delay0::R`](R) reader structure"] +impl crate::Readable for Delay0Spec {} +#[doc = "`write(|w| ..)` method takes [`delay0::W`](W) writer structure"] +impl crate::Writable for Delay0Spec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets delay0 to value 0x0001_0001"] -impl crate::Resettable for DELAY0_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0x0001_0001 - } +impl crate::Resettable for Delay0Spec { + const RESET_VALUE: u32 = 0x0001_0001; } diff --git a/src/qspi0/delay1.rs b/src/qspi0/delay1.rs index b27860e..83f393d 100644 --- a/src/qspi0/delay1.rs +++ b/src/qspi0/delay1.rs @@ -1,94 +1,55 @@ #[doc = "Register `delay1` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `delay1` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `intercs` reader - Minimum CS inactive time"] -pub type INTERCS_R = crate::FieldReader; +pub type IntercsR = crate::FieldReader; #[doc = "Field `intercs` writer - Minimum CS inactive time"] -pub type INTERCS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DELAY1_SPEC, u8, u8, 8, O>; +pub type IntercsW<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `interxfr` reader - Maximum interframe delay"] -pub type INTERXFR_R = crate::FieldReader; +pub type InterxfrR = crate::FieldReader; #[doc = "Field `interxfr` writer - Maximum interframe delay"] -pub type INTERXFR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DELAY1_SPEC, u8, u8, 8, O>; +pub type InterxfrW<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Minimum CS inactive time"] #[inline(always)] - pub fn intercs(&self) -> INTERCS_R { - INTERCS_R::new((self.bits & 0xff) as u8) + pub fn intercs(&self) -> IntercsR { + IntercsR::new((self.bits & 0xff) as u8) } #[doc = "Bits 16:23 - Maximum interframe delay"] #[inline(always)] - pub fn interxfr(&self) -> INTERXFR_R { - INTERXFR_R::new(((self.bits >> 16) & 0xff) as u8) + pub fn interxfr(&self) -> InterxfrR { + InterxfrR::new(((self.bits >> 16) & 0xff) as u8) } } impl W { #[doc = "Bits 0:7 - Minimum CS inactive time"] #[inline(always)] - pub fn intercs(&mut self) -> INTERCS_W<0> { - INTERCS_W::new(self) + #[must_use] + pub fn intercs(&mut self) -> IntercsW { + IntercsW::new(self, 0) } #[doc = "Bits 16:23 - Maximum interframe delay"] #[inline(always)] - pub fn interxfr(&mut self) -> INTERXFR_W<16> { - INTERXFR_W::new(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 + #[must_use] + pub fn interxfr(&mut self) -> InterxfrW { + InterxfrW::new(self, 16) } } -#[doc = "Delay Control 1 Register\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 [delay1](index.html) module"] -pub struct DELAY1_SPEC; -impl crate::RegisterSpec for DELAY1_SPEC { +#[doc = "Delay Control 1 Register\n\nYou can [`read`](crate::Reg::read) this register and get [`delay1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`delay1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct Delay1Spec; +impl crate::RegisterSpec for Delay1Spec { type Ux = u32; } -#[doc = "`read()` method returns [delay1::R](R) reader structure"] -impl crate::Readable for DELAY1_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [delay1::W](W) writer structure"] -impl crate::Writable for DELAY1_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`delay1::R`](R) reader structure"] +impl crate::Readable for Delay1Spec {} +#[doc = "`write(|w| ..)` method takes [`delay1::W`](W) writer structure"] +impl crate::Writable for Delay1Spec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets delay1 to value 0x01"] -impl crate::Resettable for DELAY1_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0x01 - } +impl crate::Resettable for Delay1Spec { + const RESET_VALUE: u32 = 0x01; } diff --git a/src/qspi0/fctrl.rs b/src/qspi0/fctrl.rs index 94301e9..9336ba8 100644 --- a/src/qspi0/fctrl.rs +++ b/src/qspi0/fctrl.rs @@ -1,80 +1,40 @@ #[doc = "Register `fctrl` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `fctrl` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `en` reader - SPI Flash Mode Select"] -pub type EN_R = crate::BitReader; +pub type EnR = crate::BitReader; #[doc = "Field `en` writer - SPI Flash Mode Select"] -pub type EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCTRL_SPEC, bool, O>; +pub type EnW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - SPI Flash Mode Select"] #[inline(always)] - pub fn en(&self) -> EN_R { - EN_R::new((self.bits & 1) != 0) + pub fn en(&self) -> EnR { + EnR::new((self.bits & 1) != 0) } } impl W { #[doc = "Bit 0 - SPI Flash Mode Select"] #[inline(always)] - pub fn en(&mut self) -> EN_W<0> { - EN_W::new(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 + #[must_use] + pub fn en(&mut self) -> EnW { + EnW::new(self, 0) } } -#[doc = "SPI Flash Interface Control Register\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 [fctrl](index.html) module"] -pub struct FCTRL_SPEC; -impl crate::RegisterSpec for FCTRL_SPEC { +#[doc = "SPI Flash Interface Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct FctrlSpec; +impl crate::RegisterSpec for FctrlSpec { type Ux = u32; } -#[doc = "`read()` method returns [fctrl::R](R) reader structure"] -impl crate::Readable for FCTRL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [fctrl::W](W) writer structure"] -impl crate::Writable for FCTRL_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`fctrl::R`](R) reader structure"] +impl crate::Readable for FctrlSpec {} +#[doc = "`write(|w| ..)` method takes [`fctrl::W`](W) writer structure"] +impl crate::Writable for FctrlSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets fctrl to value 0"] -impl crate::Resettable for FCTRL_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for FctrlSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/ffmt.rs b/src/qspi0/ffmt.rs index 24d4751..e8493cf 100644 --- a/src/qspi0/ffmt.rs +++ b/src/qspi0/ffmt.rs @@ -1,364 +1,352 @@ #[doc = "Register `ffmt` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `ffmt` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `cmd_en` reader - Enable sending of command"] -pub type CMD_EN_R = crate::BitReader; +pub type CmdEnR = crate::BitReader; #[doc = "Field `cmd_en` writer - Enable sending of command"] -pub type CMD_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, FFMT_SPEC, bool, O>; +pub type CmdEnW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `addr_len` reader - Number of address bytes (0 to 4)"] -pub type ADDR_LEN_R = crate::FieldReader; +pub type AddrLenR = crate::FieldReader; #[doc = "Field `addr_len` writer - Number of address bytes (0 to 4)"] -pub type ADDR_LEN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FFMT_SPEC, u8, u8, 3, O>; +pub type AddrLenW<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `pad_cnt` reader - Number of dummy cycles"] -pub type PAD_CNT_R = crate::FieldReader; +pub type PadCntR = crate::FieldReader; #[doc = "Field `pad_cnt` writer - Number of dummy cycles"] -pub type PAD_CNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FFMT_SPEC, u8, u8, 4, O>; -#[doc = "Field `cmd_proto` reader - Protocol for transmitting command"] -pub type CMD_PROTO_R = crate::FieldReader; +pub type PadCntW<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Protocol for transmitting command\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] -pub enum CMD_PROTO_A { +pub enum CmdProto { #[doc = "0: DQ0 (MOSI), DQ1 (MISO)"] - SINGLE = 0, + Single = 0, #[doc = "1: DQ0, DQ1"] - DUAL = 1, + Dual = 1, #[doc = "2: DQ0, DQ1, DQ2, DQ3"] - QUAD = 2, + Quad = 2, } -impl From for u8 { +impl From for u8 { #[inline(always)] - fn from(variant: CMD_PROTO_A) -> Self { + fn from(variant: CmdProto) -> Self { variant as _ } } -impl CMD_PROTO_R { +impl crate::FieldSpec for CmdProto { + type Ux = u8; +} +impl crate::IsEnum for CmdProto {} +#[doc = "Field `cmd_proto` reader - Protocol for transmitting command"] +pub type CmdProtoR = crate::FieldReader; +impl CmdProtoR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(CMD_PROTO_A::SINGLE), - 1 => Some(CMD_PROTO_A::DUAL), - 2 => Some(CMD_PROTO_A::QUAD), + 0 => Some(CmdProto::Single), + 1 => Some(CmdProto::Dual), + 2 => Some(CmdProto::Quad), _ => None, } } - #[doc = "Checks if the value of the field is `SINGLE`"] + #[doc = "DQ0 (MOSI), DQ1 (MISO)"] #[inline(always)] pub fn is_single(&self) -> bool { - *self == CMD_PROTO_A::SINGLE + *self == CmdProto::Single } - #[doc = "Checks if the value of the field is `DUAL`"] + #[doc = "DQ0, DQ1"] #[inline(always)] pub fn is_dual(&self) -> bool { - *self == CMD_PROTO_A::DUAL + *self == CmdProto::Dual } - #[doc = "Checks if the value of the field is `QUAD`"] + #[doc = "DQ0, DQ1, DQ2, DQ3"] #[inline(always)] pub fn is_quad(&self) -> bool { - *self == CMD_PROTO_A::QUAD + *self == CmdProto::Quad } } #[doc = "Field `cmd_proto` writer - Protocol for transmitting command"] -pub type CMD_PROTO_W<'a, const O: u8> = - crate::FieldWriter<'a, u32, FFMT_SPEC, u8, CMD_PROTO_A, 2, O>; -impl<'a, const O: u8> CMD_PROTO_W<'a, O> { +pub type CmdProtoW<'a, REG> = crate::FieldWriter<'a, REG, 2, CmdProto>; +impl<'a, REG> CmdProtoW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "DQ0 (MOSI), DQ1 (MISO)"] #[inline(always)] - pub fn single(self) -> &'a mut W { - self.variant(CMD_PROTO_A::SINGLE) + pub fn single(self) -> &'a mut crate::W { + self.variant(CmdProto::Single) } #[doc = "DQ0, DQ1"] #[inline(always)] - pub fn dual(self) -> &'a mut W { - self.variant(CMD_PROTO_A::DUAL) + pub fn dual(self) -> &'a mut crate::W { + self.variant(CmdProto::Dual) } #[doc = "DQ0, DQ1, DQ2, DQ3"] #[inline(always)] - pub fn quad(self) -> &'a mut W { - self.variant(CMD_PROTO_A::QUAD) + pub fn quad(self) -> &'a mut crate::W { + self.variant(CmdProto::Quad) } } -#[doc = "Field `addr_proto` reader - Protocol for transmitting address and padding"] -pub type ADDR_PROTO_R = crate::FieldReader; #[doc = "Protocol for transmitting address and padding\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] -pub enum ADDR_PROTO_A { +pub enum AddrProto { #[doc = "0: DQ0 (MOSI), DQ1 (MISO)"] - SINGLE = 0, + Single = 0, #[doc = "1: DQ0, DQ1"] - DUAL = 1, + Dual = 1, #[doc = "2: DQ0, DQ1, DQ2, DQ3"] - QUAD = 2, + Quad = 2, } -impl From for u8 { +impl From for u8 { #[inline(always)] - fn from(variant: ADDR_PROTO_A) -> Self { + fn from(variant: AddrProto) -> Self { variant as _ } } -impl ADDR_PROTO_R { +impl crate::FieldSpec for AddrProto { + type Ux = u8; +} +impl crate::IsEnum for AddrProto {} +#[doc = "Field `addr_proto` reader - Protocol for transmitting address and padding"] +pub type AddrProtoR = crate::FieldReader; +impl AddrProtoR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(ADDR_PROTO_A::SINGLE), - 1 => Some(ADDR_PROTO_A::DUAL), - 2 => Some(ADDR_PROTO_A::QUAD), + 0 => Some(AddrProto::Single), + 1 => Some(AddrProto::Dual), + 2 => Some(AddrProto::Quad), _ => None, } } - #[doc = "Checks if the value of the field is `SINGLE`"] + #[doc = "DQ0 (MOSI), DQ1 (MISO)"] #[inline(always)] pub fn is_single(&self) -> bool { - *self == ADDR_PROTO_A::SINGLE + *self == AddrProto::Single } - #[doc = "Checks if the value of the field is `DUAL`"] + #[doc = "DQ0, DQ1"] #[inline(always)] pub fn is_dual(&self) -> bool { - *self == ADDR_PROTO_A::DUAL + *self == AddrProto::Dual } - #[doc = "Checks if the value of the field is `QUAD`"] + #[doc = "DQ0, DQ1, DQ2, DQ3"] #[inline(always)] pub fn is_quad(&self) -> bool { - *self == ADDR_PROTO_A::QUAD + *self == AddrProto::Quad } } #[doc = "Field `addr_proto` writer - Protocol for transmitting address and padding"] -pub type ADDR_PROTO_W<'a, const O: u8> = - crate::FieldWriter<'a, u32, FFMT_SPEC, u8, ADDR_PROTO_A, 2, O>; -impl<'a, const O: u8> ADDR_PROTO_W<'a, O> { +pub type AddrProtoW<'a, REG> = crate::FieldWriter<'a, REG, 2, AddrProto>; +impl<'a, REG> AddrProtoW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "DQ0 (MOSI), DQ1 (MISO)"] #[inline(always)] - pub fn single(self) -> &'a mut W { - self.variant(ADDR_PROTO_A::SINGLE) + pub fn single(self) -> &'a mut crate::W { + self.variant(AddrProto::Single) } #[doc = "DQ0, DQ1"] #[inline(always)] - pub fn dual(self) -> &'a mut W { - self.variant(ADDR_PROTO_A::DUAL) + pub fn dual(self) -> &'a mut crate::W { + self.variant(AddrProto::Dual) } #[doc = "DQ0, DQ1, DQ2, DQ3"] #[inline(always)] - pub fn quad(self) -> &'a mut W { - self.variant(ADDR_PROTO_A::QUAD) + pub fn quad(self) -> &'a mut crate::W { + self.variant(AddrProto::Quad) } } -#[doc = "Field `data_proto` reader - Protocol for receiving data bytes"] -pub type DATA_PROTO_R = crate::FieldReader; #[doc = "Protocol for receiving data bytes\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] -pub enum DATA_PROTO_A { +pub enum DataProto { #[doc = "0: DQ0 (MOSI), DQ1 (MISO)"] - SINGLE = 0, + Single = 0, #[doc = "1: DQ0, DQ1"] - DUAL = 1, + Dual = 1, #[doc = "2: DQ0, DQ1, DQ2, DQ3"] - QUAD = 2, + Quad = 2, } -impl From for u8 { +impl From for u8 { #[inline(always)] - fn from(variant: DATA_PROTO_A) -> Self { + fn from(variant: DataProto) -> Self { variant as _ } } -impl DATA_PROTO_R { +impl crate::FieldSpec for DataProto { + type Ux = u8; +} +impl crate::IsEnum for DataProto {} +#[doc = "Field `data_proto` reader - Protocol for receiving data bytes"] +pub type DataProtoR = crate::FieldReader; +impl DataProtoR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(DATA_PROTO_A::SINGLE), - 1 => Some(DATA_PROTO_A::DUAL), - 2 => Some(DATA_PROTO_A::QUAD), + 0 => Some(DataProto::Single), + 1 => Some(DataProto::Dual), + 2 => Some(DataProto::Quad), _ => None, } } - #[doc = "Checks if the value of the field is `SINGLE`"] + #[doc = "DQ0 (MOSI), DQ1 (MISO)"] #[inline(always)] pub fn is_single(&self) -> bool { - *self == DATA_PROTO_A::SINGLE + *self == DataProto::Single } - #[doc = "Checks if the value of the field is `DUAL`"] + #[doc = "DQ0, DQ1"] #[inline(always)] pub fn is_dual(&self) -> bool { - *self == DATA_PROTO_A::DUAL + *self == DataProto::Dual } - #[doc = "Checks if the value of the field is `QUAD`"] + #[doc = "DQ0, DQ1, DQ2, DQ3"] #[inline(always)] pub fn is_quad(&self) -> bool { - *self == DATA_PROTO_A::QUAD + *self == DataProto::Quad } } #[doc = "Field `data_proto` writer - Protocol for receiving data bytes"] -pub type DATA_PROTO_W<'a, const O: u8> = - crate::FieldWriter<'a, u32, FFMT_SPEC, u8, DATA_PROTO_A, 2, O>; -impl<'a, const O: u8> DATA_PROTO_W<'a, O> { +pub type DataProtoW<'a, REG> = crate::FieldWriter<'a, REG, 2, DataProto>; +impl<'a, REG> DataProtoW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "DQ0 (MOSI), DQ1 (MISO)"] #[inline(always)] - pub fn single(self) -> &'a mut W { - self.variant(DATA_PROTO_A::SINGLE) + pub fn single(self) -> &'a mut crate::W { + self.variant(DataProto::Single) } #[doc = "DQ0, DQ1"] #[inline(always)] - pub fn dual(self) -> &'a mut W { - self.variant(DATA_PROTO_A::DUAL) + pub fn dual(self) -> &'a mut crate::W { + self.variant(DataProto::Dual) } #[doc = "DQ0, DQ1, DQ2, DQ3"] #[inline(always)] - pub fn quad(self) -> &'a mut W { - self.variant(DATA_PROTO_A::QUAD) + pub fn quad(self) -> &'a mut crate::W { + self.variant(DataProto::Quad) } } #[doc = "Field `cmd_code` reader - Value of command byte"] -pub type CMD_CODE_R = crate::FieldReader; +pub type CmdCodeR = crate::FieldReader; #[doc = "Field `cmd_code` writer - Value of command byte"] -pub type CMD_CODE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FFMT_SPEC, u8, u8, 8, O>; +pub type CmdCodeW<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `pad_code` reader - First 8 bits to transmit during dummy cycles"] -pub type PAD_CODE_R = crate::FieldReader; +pub type PadCodeR = crate::FieldReader; #[doc = "Field `pad_code` writer - First 8 bits to transmit during dummy cycles"] -pub type PAD_CODE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FFMT_SPEC, u8, u8, 8, O>; +pub type PadCodeW<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bit 0 - Enable sending of command"] #[inline(always)] - pub fn cmd_en(&self) -> CMD_EN_R { - CMD_EN_R::new((self.bits & 1) != 0) + pub fn cmd_en(&self) -> CmdEnR { + CmdEnR::new((self.bits & 1) != 0) } #[doc = "Bits 1:3 - Number of address bytes (0 to 4)"] #[inline(always)] - pub fn addr_len(&self) -> ADDR_LEN_R { - ADDR_LEN_R::new(((self.bits >> 1) & 7) as u8) + pub fn addr_len(&self) -> AddrLenR { + AddrLenR::new(((self.bits >> 1) & 7) as u8) } #[doc = "Bits 4:7 - Number of dummy cycles"] #[inline(always)] - pub fn pad_cnt(&self) -> PAD_CNT_R { - PAD_CNT_R::new(((self.bits >> 4) & 0x0f) as u8) + pub fn pad_cnt(&self) -> PadCntR { + PadCntR::new(((self.bits >> 4) & 0x0f) as u8) } #[doc = "Bits 8:9 - Protocol for transmitting command"] #[inline(always)] - pub fn cmd_proto(&self) -> CMD_PROTO_R { - CMD_PROTO_R::new(((self.bits >> 8) & 3) as u8) + pub fn cmd_proto(&self) -> CmdProtoR { + CmdProtoR::new(((self.bits >> 8) & 3) as u8) } #[doc = "Bits 10:11 - Protocol for transmitting address and padding"] #[inline(always)] - pub fn addr_proto(&self) -> ADDR_PROTO_R { - ADDR_PROTO_R::new(((self.bits >> 10) & 3) as u8) + pub fn addr_proto(&self) -> AddrProtoR { + AddrProtoR::new(((self.bits >> 10) & 3) as u8) } #[doc = "Bits 12:13 - Protocol for receiving data bytes"] #[inline(always)] - pub fn data_proto(&self) -> DATA_PROTO_R { - DATA_PROTO_R::new(((self.bits >> 12) & 3) as u8) + pub fn data_proto(&self) -> DataProtoR { + DataProtoR::new(((self.bits >> 12) & 3) as u8) } #[doc = "Bits 16:23 - Value of command byte"] #[inline(always)] - pub fn cmd_code(&self) -> CMD_CODE_R { - CMD_CODE_R::new(((self.bits >> 16) & 0xff) as u8) + pub fn cmd_code(&self) -> CmdCodeR { + CmdCodeR::new(((self.bits >> 16) & 0xff) as u8) } #[doc = "Bits 24:31 - First 8 bits to transmit during dummy cycles"] #[inline(always)] - pub fn pad_code(&self) -> PAD_CODE_R { - PAD_CODE_R::new(((self.bits >> 24) & 0xff) as u8) + pub fn pad_code(&self) -> PadCodeR { + PadCodeR::new(((self.bits >> 24) & 0xff) as u8) } } impl W { #[doc = "Bit 0 - Enable sending of command"] #[inline(always)] - pub fn cmd_en(&mut self) -> CMD_EN_W<0> { - CMD_EN_W::new(self) + #[must_use] + pub fn cmd_en(&mut self) -> CmdEnW { + CmdEnW::new(self, 0) } #[doc = "Bits 1:3 - Number of address bytes (0 to 4)"] #[inline(always)] - pub fn addr_len(&mut self) -> ADDR_LEN_W<1> { - ADDR_LEN_W::new(self) + #[must_use] + pub fn addr_len(&mut self) -> AddrLenW { + AddrLenW::new(self, 1) } #[doc = "Bits 4:7 - Number of dummy cycles"] #[inline(always)] - pub fn pad_cnt(&mut self) -> PAD_CNT_W<4> { - PAD_CNT_W::new(self) + #[must_use] + pub fn pad_cnt(&mut self) -> PadCntW { + PadCntW::new(self, 4) } #[doc = "Bits 8:9 - Protocol for transmitting command"] #[inline(always)] - pub fn cmd_proto(&mut self) -> CMD_PROTO_W<8> { - CMD_PROTO_W::new(self) + #[must_use] + pub fn cmd_proto(&mut self) -> CmdProtoW { + CmdProtoW::new(self, 8) } #[doc = "Bits 10:11 - Protocol for transmitting address and padding"] #[inline(always)] - pub fn addr_proto(&mut self) -> ADDR_PROTO_W<10> { - ADDR_PROTO_W::new(self) + #[must_use] + pub fn addr_proto(&mut self) -> AddrProtoW { + AddrProtoW::new(self, 10) } #[doc = "Bits 12:13 - Protocol for receiving data bytes"] #[inline(always)] - pub fn data_proto(&mut self) -> DATA_PROTO_W<12> { - DATA_PROTO_W::new(self) + #[must_use] + pub fn data_proto(&mut self) -> DataProtoW { + DataProtoW::new(self, 12) } #[doc = "Bits 16:23 - Value of command byte"] #[inline(always)] - pub fn cmd_code(&mut self) -> CMD_CODE_W<16> { - CMD_CODE_W::new(self) + #[must_use] + pub fn cmd_code(&mut self) -> CmdCodeW { + CmdCodeW::new(self, 16) } #[doc = "Bits 24:31 - First 8 bits to transmit during dummy cycles"] #[inline(always)] - pub fn pad_code(&mut self) -> PAD_CODE_W<24> { - PAD_CODE_W::new(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 + #[must_use] + pub fn pad_code(&mut self) -> PadCodeW { + PadCodeW::new(self, 24) } } -#[doc = "SPI Flash Instruction Format Register\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 [ffmt](index.html) module"] -pub struct FFMT_SPEC; -impl crate::RegisterSpec for FFMT_SPEC { +#[doc = "SPI Flash Instruction Format Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ffmt::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ffmt::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct FfmtSpec; +impl crate::RegisterSpec for FfmtSpec { type Ux = u32; } -#[doc = "`read()` method returns [ffmt::R](R) reader structure"] -impl crate::Readable for FFMT_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [ffmt::W](W) writer structure"] -impl crate::Writable for FFMT_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`ffmt::R`](R) reader structure"] +impl crate::Readable for FfmtSpec {} +#[doc = "`write(|w| ..)` method takes [`ffmt::W`](W) writer structure"] +impl crate::Writable for FfmtSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets ffmt to value 0"] -impl crate::Resettable for FFMT_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for FfmtSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/fmt.rs b/src/qspi0/fmt.rs index 5e51f31..ae575bd 100644 --- a/src/qspi0/fmt.rs +++ b/src/qspi0/fmt.rs @@ -1,275 +1,252 @@ #[doc = "Register `fmt` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `fmt` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -#[doc = "Field `proto` reader - SPI protocol"] -pub type PROTO_R = crate::FieldReader; +pub type W = crate::W; #[doc = "SPI protocol\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] -pub enum PROTO_A { +pub enum Proto { #[doc = "0: DQ0 (MOSI), DQ1 (MISO)"] - SINGLE = 0, + Single = 0, #[doc = "1: DQ0, DQ1"] - DUAL = 1, + Dual = 1, #[doc = "2: DQ0, DQ1, DQ2, DQ3"] - QUAD = 2, + Quad = 2, } -impl From for u8 { +impl From for u8 { #[inline(always)] - fn from(variant: PROTO_A) -> Self { + fn from(variant: Proto) -> Self { variant as _ } } -impl PROTO_R { +impl crate::FieldSpec for Proto { + type Ux = u8; +} +impl crate::IsEnum for Proto {} +#[doc = "Field `proto` reader - SPI protocol"] +pub type ProtoR = crate::FieldReader; +impl ProtoR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { - 0 => Some(PROTO_A::SINGLE), - 1 => Some(PROTO_A::DUAL), - 2 => Some(PROTO_A::QUAD), + 0 => Some(Proto::Single), + 1 => Some(Proto::Dual), + 2 => Some(Proto::Quad), _ => None, } } - #[doc = "Checks if the value of the field is `SINGLE`"] + #[doc = "DQ0 (MOSI), DQ1 (MISO)"] #[inline(always)] pub fn is_single(&self) -> bool { - *self == PROTO_A::SINGLE + *self == Proto::Single } - #[doc = "Checks if the value of the field is `DUAL`"] + #[doc = "DQ0, DQ1"] #[inline(always)] pub fn is_dual(&self) -> bool { - *self == PROTO_A::DUAL + *self == Proto::Dual } - #[doc = "Checks if the value of the field is `QUAD`"] + #[doc = "DQ0, DQ1, DQ2, DQ3"] #[inline(always)] pub fn is_quad(&self) -> bool { - *self == PROTO_A::QUAD + *self == Proto::Quad } } #[doc = "Field `proto` writer - SPI protocol"] -pub type PROTO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FMT_SPEC, u8, PROTO_A, 2, O>; -impl<'a, const O: u8> PROTO_W<'a, O> { +pub type ProtoW<'a, REG> = crate::FieldWriter<'a, REG, 2, Proto>; +impl<'a, REG> ProtoW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "DQ0 (MOSI), DQ1 (MISO)"] #[inline(always)] - pub fn single(self) -> &'a mut W { - self.variant(PROTO_A::SINGLE) + pub fn single(self) -> &'a mut crate::W { + self.variant(Proto::Single) } #[doc = "DQ0, DQ1"] #[inline(always)] - pub fn dual(self) -> &'a mut W { - self.variant(PROTO_A::DUAL) + pub fn dual(self) -> &'a mut crate::W { + self.variant(Proto::Dual) } #[doc = "DQ0, DQ1, DQ2, DQ3"] #[inline(always)] - pub fn quad(self) -> &'a mut W { - self.variant(PROTO_A::QUAD) + pub fn quad(self) -> &'a mut crate::W { + self.variant(Proto::Quad) } } -#[doc = "Field `endian` reader - SPI endianness"] -pub type ENDIAN_R = crate::BitReader; #[doc = "SPI endianness\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum ENDIAN_A { +pub enum Endian { #[doc = "0: Transmit MSB first."] - BIG = 0, + Big = 0, #[doc = "1: Transmit LSB first."] - LITTLE = 1, + Little = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: ENDIAN_A) -> Self { + fn from(variant: Endian) -> Self { variant as u8 != 0 } } -impl ENDIAN_R { +#[doc = "Field `endian` reader - SPI endianness"] +pub type EndianR = crate::BitReader; +impl EndianR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENDIAN_A { + pub const fn variant(&self) -> Endian { match self.bits { - false => ENDIAN_A::BIG, - true => ENDIAN_A::LITTLE, + false => Endian::Big, + true => Endian::Little, } } - #[doc = "Checks if the value of the field is `BIG`"] + #[doc = "Transmit MSB first."] #[inline(always)] pub fn is_big(&self) -> bool { - *self == ENDIAN_A::BIG + *self == Endian::Big } - #[doc = "Checks if the value of the field is `LITTLE`"] + #[doc = "Transmit LSB first."] #[inline(always)] pub fn is_little(&self) -> bool { - *self == ENDIAN_A::LITTLE + *self == Endian::Little } } #[doc = "Field `endian` writer - SPI endianness"] -pub type ENDIAN_W<'a, const O: u8> = crate::BitWriter<'a, u32, FMT_SPEC, ENDIAN_A, O>; -impl<'a, const O: u8> ENDIAN_W<'a, O> { +pub type EndianW<'a, REG> = crate::BitWriter<'a, REG, Endian>; +impl<'a, REG> EndianW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Transmit MSB first."] #[inline(always)] - pub fn big(self) -> &'a mut W { - self.variant(ENDIAN_A::BIG) + pub fn big(self) -> &'a mut crate::W { + self.variant(Endian::Big) } #[doc = "Transmit LSB first."] #[inline(always)] - pub fn little(self) -> &'a mut W { - self.variant(ENDIAN_A::LITTLE) + pub fn little(self) -> &'a mut crate::W { + self.variant(Endian::Little) } } -#[doc = "Field `dir` reader - SPI I/O direction"] -pub type DIR_R = crate::BitReader; #[doc = "SPI I/O direction\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum DIR_A { +pub enum Dir { #[doc = "0: For dual and quad protocols, the DQ pins are tri-stated. For the single protocol, the DQ0 pin is driven with the transmit data as normal."] - RX = 0, + Rx = 0, #[doc = "1: The receive FIFO is not populated."] - TX = 1, + Tx = 1, } -impl From for bool { +impl From for bool { #[inline(always)] - fn from(variant: DIR_A) -> Self { + fn from(variant: Dir) -> Self { variant as u8 != 0 } } -impl DIR_R { +#[doc = "Field `dir` reader - SPI I/O direction"] +pub type DirR = crate::BitReader; +impl DirR { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DIR_A { + pub const fn variant(&self) -> Dir { match self.bits { - false => DIR_A::RX, - true => DIR_A::TX, + false => Dir::Rx, + true => Dir::Tx, } } - #[doc = "Checks if the value of the field is `RX`"] + #[doc = "For dual and quad protocols, the DQ pins are tri-stated. For the single protocol, the DQ0 pin is driven with the transmit data as normal."] #[inline(always)] pub fn is_rx(&self) -> bool { - *self == DIR_A::RX + *self == Dir::Rx } - #[doc = "Checks if the value of the field is `TX`"] + #[doc = "The receive FIFO is not populated."] #[inline(always)] pub fn is_tx(&self) -> bool { - *self == DIR_A::TX + *self == Dir::Tx } } #[doc = "Field `dir` writer - SPI I/O direction"] -pub type DIR_W<'a, const O: u8> = crate::BitWriter<'a, u32, FMT_SPEC, DIR_A, O>; -impl<'a, const O: u8> DIR_W<'a, O> { +pub type DirW<'a, REG> = crate::BitWriter<'a, REG, Dir>; +impl<'a, REG> DirW<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "For dual and quad protocols, the DQ pins are tri-stated. For the single protocol, the DQ0 pin is driven with the transmit data as normal."] #[inline(always)] - pub fn rx(self) -> &'a mut W { - self.variant(DIR_A::RX) + pub fn rx(self) -> &'a mut crate::W { + self.variant(Dir::Rx) } #[doc = "The receive FIFO is not populated."] #[inline(always)] - pub fn tx(self) -> &'a mut W { - self.variant(DIR_A::TX) + pub fn tx(self) -> &'a mut crate::W { + self.variant(Dir::Tx) } } #[doc = "Field `len` reader - Number of bits per frame"] -pub type LEN_R = crate::FieldReader; +pub type LenR = crate::FieldReader; #[doc = "Field `len` writer - Number of bits per frame"] -pub type LEN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FMT_SPEC, u8, u8, 4, O>; +pub type LenW<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:1 - SPI protocol"] #[inline(always)] - pub fn proto(&self) -> PROTO_R { - PROTO_R::new((self.bits & 3) as u8) + pub fn proto(&self) -> ProtoR { + ProtoR::new((self.bits & 3) as u8) } #[doc = "Bit 2 - SPI endianness"] #[inline(always)] - pub fn endian(&self) -> ENDIAN_R { - ENDIAN_R::new(((self.bits >> 2) & 1) != 0) + pub fn endian(&self) -> EndianR { + EndianR::new(((self.bits >> 2) & 1) != 0) } #[doc = "Bit 3 - SPI I/O direction"] #[inline(always)] - pub fn dir(&self) -> DIR_R { - DIR_R::new(((self.bits >> 3) & 1) != 0) + pub fn dir(&self) -> DirR { + DirR::new(((self.bits >> 3) & 1) != 0) } #[doc = "Bits 16:19 - Number of bits per frame"] #[inline(always)] - pub fn len(&self) -> LEN_R { - LEN_R::new(((self.bits >> 16) & 0x0f) as u8) + pub fn len(&self) -> LenR { + LenR::new(((self.bits >> 16) & 0x0f) as u8) } } impl W { #[doc = "Bits 0:1 - SPI protocol"] #[inline(always)] - pub fn proto(&mut self) -> PROTO_W<0> { - PROTO_W::new(self) + #[must_use] + pub fn proto(&mut self) -> ProtoW { + ProtoW::new(self, 0) } #[doc = "Bit 2 - SPI endianness"] #[inline(always)] - pub fn endian(&mut self) -> ENDIAN_W<2> { - ENDIAN_W::new(self) + #[must_use] + pub fn endian(&mut self) -> EndianW { + EndianW::new(self, 2) } #[doc = "Bit 3 - SPI I/O direction"] #[inline(always)] - pub fn dir(&mut self) -> DIR_W<3> { - DIR_W::new(self) + #[must_use] + pub fn dir(&mut self) -> DirW { + DirW::new(self, 3) } #[doc = "Bits 16:19 - Number of bits per frame"] #[inline(always)] - pub fn len(&mut self) -> LEN_W<16> { - LEN_W::new(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 + #[must_use] + pub fn len(&mut self) -> LenW { + LenW::new(self, 16) } } -#[doc = "Frame Format Register\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 [fmt](index.html) module"] -pub struct FMT_SPEC; -impl crate::RegisterSpec for FMT_SPEC { +#[doc = "Frame Format Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fmt::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fmt::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct FmtSpec; +impl crate::RegisterSpec for FmtSpec { type Ux = u32; } -#[doc = "`read()` method returns [fmt::R](R) reader structure"] -impl crate::Readable for FMT_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [fmt::W](W) writer structure"] -impl crate::Writable for FMT_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`fmt::R`](R) reader structure"] +impl crate::Readable for FmtSpec {} +#[doc = "`write(|w| ..)` method takes [`fmt::W`](W) writer structure"] +impl crate::Writable for FmtSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets fmt to value 0"] -impl crate::Resettable for FMT_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for FmtSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/ie.rs b/src/qspi0/ie.rs index 9401ff9..cd5ebab 100644 --- a/src/qspi0/ie.rs +++ b/src/qspi0/ie.rs @@ -1,94 +1,55 @@ #[doc = "Register `ie` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `ie` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `txwm` reader - Transmit watermark enable"] -pub type TXWM_R = crate::BitReader; +pub type TxwmR = crate::BitReader; #[doc = "Field `txwm` writer - Transmit watermark enable"] -pub type TXWM_W<'a, const O: u8> = crate::BitWriter<'a, u32, IE_SPEC, bool, O>; +pub type TxwmW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `rxwm` reader - Receive watermark enable"] -pub type RXWM_R = crate::BitReader; +pub type RxwmR = crate::BitReader; #[doc = "Field `rxwm` writer - Receive watermark enable"] -pub type RXWM_W<'a, const O: u8> = crate::BitWriter<'a, u32, IE_SPEC, bool, O>; +pub type RxwmW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Transmit watermark enable"] #[inline(always)] - pub fn txwm(&self) -> TXWM_R { - TXWM_R::new((self.bits & 1) != 0) + pub fn txwm(&self) -> TxwmR { + TxwmR::new((self.bits & 1) != 0) } #[doc = "Bit 1 - Receive watermark enable"] #[inline(always)] - pub fn rxwm(&self) -> RXWM_R { - RXWM_R::new(((self.bits >> 1) & 1) != 0) + pub fn rxwm(&self) -> RxwmR { + RxwmR::new(((self.bits >> 1) & 1) != 0) } } impl W { #[doc = "Bit 0 - Transmit watermark enable"] #[inline(always)] - pub fn txwm(&mut self) -> TXWM_W<0> { - TXWM_W::new(self) + #[must_use] + pub fn txwm(&mut self) -> TxwmW { + TxwmW::new(self, 0) } #[doc = "Bit 1 - Receive watermark enable"] #[inline(always)] - pub fn rxwm(&mut self) -> RXWM_W<1> { - RXWM_W::new(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 + #[must_use] + pub fn rxwm(&mut self) -> RxwmW { + RxwmW::new(self, 1) } } -#[doc = "SPI Interrupt Enable Register\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 [ie](index.html) module"] -pub struct IE_SPEC; -impl crate::RegisterSpec for IE_SPEC { +#[doc = "SPI Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ie::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ie::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct IeSpec; +impl crate::RegisterSpec for IeSpec { type Ux = u32; } -#[doc = "`read()` method returns [ie::R](R) reader structure"] -impl crate::Readable for IE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [ie::W](W) writer structure"] -impl crate::Writable for IE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`ie::R`](R) reader structure"] +impl crate::Readable for IeSpec {} +#[doc = "`write(|w| ..)` method takes [`ie::W`](W) writer structure"] +impl crate::Writable for IeSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets ie to value 0"] -impl crate::Resettable for IE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for IeSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/ip.rs b/src/qspi0/ip.rs index 18b9736..5fffd47 100644 --- a/src/qspi0/ip.rs +++ b/src/qspi0/ip.rs @@ -1,94 +1,55 @@ #[doc = "Register `ip` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `ip` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `txwm` reader - Transmit watermark enable"] -pub type TXWM_R = crate::BitReader; +pub type TxwmR = crate::BitReader; #[doc = "Field `txwm` writer - Transmit watermark enable"] -pub type TXWM_W<'a, const O: u8> = crate::BitWriter<'a, u32, IP_SPEC, bool, O>; +pub type TxwmW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `rxwm` reader - Receive watermark enable"] -pub type RXWM_R = crate::BitReader; +pub type RxwmR = crate::BitReader; #[doc = "Field `rxwm` writer - Receive watermark enable"] -pub type RXWM_W<'a, const O: u8> = crate::BitWriter<'a, u32, IP_SPEC, bool, O>; +pub type RxwmW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Transmit watermark enable"] #[inline(always)] - pub fn txwm(&self) -> TXWM_R { - TXWM_R::new((self.bits & 1) != 0) + pub fn txwm(&self) -> TxwmR { + TxwmR::new((self.bits & 1) != 0) } #[doc = "Bit 1 - Receive watermark enable"] #[inline(always)] - pub fn rxwm(&self) -> RXWM_R { - RXWM_R::new(((self.bits >> 1) & 1) != 0) + pub fn rxwm(&self) -> RxwmR { + RxwmR::new(((self.bits >> 1) & 1) != 0) } } impl W { #[doc = "Bit 0 - Transmit watermark enable"] #[inline(always)] - pub fn txwm(&mut self) -> TXWM_W<0> { - TXWM_W::new(self) + #[must_use] + pub fn txwm(&mut self) -> TxwmW { + TxwmW::new(self, 0) } #[doc = "Bit 1 - Receive watermark enable"] #[inline(always)] - pub fn rxwm(&mut self) -> RXWM_W<1> { - RXWM_W::new(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 + #[must_use] + pub fn rxwm(&mut self) -> RxwmW { + RxwmW::new(self, 1) } } -#[doc = "SPI Interrupt Pending Register\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 [ip](index.html) module"] -pub struct IP_SPEC; -impl crate::RegisterSpec for IP_SPEC { +#[doc = "SPI Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ip::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ip::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct IpSpec; +impl crate::RegisterSpec for IpSpec { type Ux = u32; } -#[doc = "`read()` method returns [ip::R](R) reader structure"] -impl crate::Readable for IP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [ip::W](W) writer structure"] -impl crate::Writable for IP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`ip::R`](R) reader structure"] +impl crate::Readable for IpSpec {} +#[doc = "`write(|w| ..)` method takes [`ip::W`](W) writer structure"] +impl crate::Writable for IpSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets ip to value 0"] -impl crate::Resettable for IP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for IpSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/rxdata.rs b/src/qspi0/rxdata.rs index 660312f..ae16b59 100644 --- a/src/qspi0/rxdata.rs +++ b/src/qspi0/rxdata.rs @@ -1,94 +1,55 @@ #[doc = "Register `rxdata` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rxdata` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `data` reader - Received data"] -pub type DATA_R = crate::FieldReader; +pub type DataR = crate::FieldReader; #[doc = "Field `data` writer - Received data"] -pub type DATA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RXDATA_SPEC, u8, u8, 8, O>; +pub type DataW<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `empty` reader - FIFO empty flag"] -pub type EMPTY_R = crate::BitReader; +pub type EmptyR = crate::BitReader; #[doc = "Field `empty` writer - FIFO empty flag"] -pub type EMPTY_W<'a, const O: u8> = crate::BitWriter<'a, u32, RXDATA_SPEC, bool, O>; +pub type EmptyW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:7 - Received data"] #[inline(always)] - pub fn data(&self) -> DATA_R { - DATA_R::new((self.bits & 0xff) as u8) + pub fn data(&self) -> DataR { + DataR::new((self.bits & 0xff) as u8) } #[doc = "Bit 31 - FIFO empty flag"] #[inline(always)] - pub fn empty(&self) -> EMPTY_R { - EMPTY_R::new(((self.bits >> 31) & 1) != 0) + pub fn empty(&self) -> EmptyR { + EmptyR::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bits 0:7 - Received data"] #[inline(always)] - pub fn data(&mut self) -> DATA_W<0> { - DATA_W::new(self) + #[must_use] + pub fn data(&mut self) -> DataW { + DataW::new(self, 0) } #[doc = "Bit 31 - FIFO empty flag"] #[inline(always)] - pub fn empty(&mut self) -> EMPTY_W<31> { - EMPTY_W::new(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 + #[must_use] + pub fn empty(&mut self) -> EmptyW { + EmptyW::new(self, 31) } } -#[doc = "Receive Data Register\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 [rxdata](index.html) module"] -pub struct RXDATA_SPEC; -impl crate::RegisterSpec for RXDATA_SPEC { +#[doc = "Receive Data Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rxdata::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rxdata::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RxdataSpec; +impl crate::RegisterSpec for RxdataSpec { type Ux = u32; } -#[doc = "`read()` method returns [rxdata::R](R) reader structure"] -impl crate::Readable for RXDATA_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rxdata::W](W) writer structure"] -impl crate::Writable for RXDATA_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rxdata::R`](R) reader structure"] +impl crate::Readable for RxdataSpec {} +#[doc = "`write(|w| ..)` method takes [`rxdata::W`](W) writer structure"] +impl crate::Writable for RxdataSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rxdata to value 0"] -impl crate::Resettable for RXDATA_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RxdataSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/rxmark.rs b/src/qspi0/rxmark.rs index 8bd9ba0..36dc6df 100644 --- a/src/qspi0/rxmark.rs +++ b/src/qspi0/rxmark.rs @@ -1,80 +1,40 @@ #[doc = "Register `rxmark` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rxmark` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `rxmark` reader - Receive watermark"] -pub type RXMARK_R = crate::FieldReader; +pub type RxmarkR = crate::FieldReader; #[doc = "Field `rxmark` writer - Receive watermark"] -pub type RXMARK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RXMARK_SPEC, u8, u8, 3, O>; +pub type RxmarkW<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Receive watermark"] #[inline(always)] - pub fn rxmark(&self) -> RXMARK_R { - RXMARK_R::new((self.bits & 7) as u8) + pub fn rxmark(&self) -> RxmarkR { + RxmarkR::new((self.bits & 7) as u8) } } impl W { #[doc = "Bits 0:2 - Receive watermark"] #[inline(always)] - pub fn rxmark(&mut self) -> RXMARK_W<0> { - RXMARK_W::new(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 + #[must_use] + pub fn rxmark(&mut self) -> RxmarkW { + RxmarkW::new(self, 0) } } -#[doc = "Receive Watermark Register\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 [rxmark](index.html) module"] -pub struct RXMARK_SPEC; -impl crate::RegisterSpec for RXMARK_SPEC { +#[doc = "Receive Watermark Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rxmark::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rxmark::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RxmarkSpec; +impl crate::RegisterSpec for RxmarkSpec { type Ux = u32; } -#[doc = "`read()` method returns [rxmark::R](R) reader structure"] -impl crate::Readable for RXMARK_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rxmark::W](W) writer structure"] -impl crate::Writable for RXMARK_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rxmark::R`](R) reader structure"] +impl crate::Readable for RxmarkSpec {} +#[doc = "`write(|w| ..)` method takes [`rxmark::W`](W) writer structure"] +impl crate::Writable for RxmarkSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rxmark to value 0"] -impl crate::Resettable for RXMARK_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RxmarkSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/sckdiv.rs b/src/qspi0/sckdiv.rs index a0ae08e..df80afe 100644 --- a/src/qspi0/sckdiv.rs +++ b/src/qspi0/sckdiv.rs @@ -1,80 +1,40 @@ #[doc = "Register `sckdiv` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `sckdiv` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `div` reader - Divisor for serial clock"] -pub type DIV_R = crate::FieldReader; +pub type DivR = crate::FieldReader; #[doc = "Field `div` writer - Divisor for serial clock"] -pub type DIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SCKDIV_SPEC, u16, u16, 12, O>; +pub type DivW<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; impl R { #[doc = "Bits 0:11 - Divisor for serial clock"] #[inline(always)] - pub fn div(&self) -> DIV_R { - DIV_R::new((self.bits & 0x0fff) as u16) + pub fn div(&self) -> DivR { + DivR::new((self.bits & 0x0fff) as u16) } } impl W { #[doc = "Bits 0:11 - Divisor for serial clock"] #[inline(always)] - pub fn div(&mut self) -> DIV_W<0> { - DIV_W::new(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 + #[must_use] + pub fn div(&mut self) -> DivW { + DivW::new(self, 0) } } -#[doc = "Serial Clock Divisor Register\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 [sckdiv](index.html) module"] -pub struct SCKDIV_SPEC; -impl crate::RegisterSpec for SCKDIV_SPEC { +#[doc = "Serial Clock Divisor Register\n\nYou can [`read`](crate::Reg::read) this register and get [`sckdiv::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sckdiv::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct SckdivSpec; +impl crate::RegisterSpec for SckdivSpec { type Ux = u32; } -#[doc = "`read()` method returns [sckdiv::R](R) reader structure"] -impl crate::Readable for SCKDIV_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [sckdiv::W](W) writer structure"] -impl crate::Writable for SCKDIV_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`sckdiv::R`](R) reader structure"] +impl crate::Readable for SckdivSpec {} +#[doc = "`write(|w| ..)` method takes [`sckdiv::W`](W) writer structure"] +impl crate::Writable for SckdivSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets sckdiv to value 0"] -impl crate::Resettable for SCKDIV_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for SckdivSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/sckmode.rs b/src/qspi0/sckmode.rs index 3a09a02..e4a274c 100644 --- a/src/qspi0/sckmode.rs +++ b/src/qspi0/sckmode.rs @@ -1,94 +1,55 @@ #[doc = "Register `sckmode` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `sckmode` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `pha` reader - Serial clock phase"] -pub type PHA_R = crate::BitReader; +pub type PhaR = crate::BitReader; #[doc = "Field `pha` writer - Serial clock phase"] -pub type PHA_W<'a, const O: u8> = crate::BitWriter<'a, u32, SCKMODE_SPEC, bool, O>; +pub type PhaW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `pol` reader - Serial clock polarity"] -pub type POL_R = crate::BitReader; +pub type PolR = crate::BitReader; #[doc = "Field `pol` writer - Serial clock polarity"] -pub type POL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SCKMODE_SPEC, bool, O>; +pub type PolW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Serial clock phase"] #[inline(always)] - pub fn pha(&self) -> PHA_R { - PHA_R::new((self.bits & 1) != 0) + pub fn pha(&self) -> PhaR { + PhaR::new((self.bits & 1) != 0) } #[doc = "Bit 1 - Serial clock polarity"] #[inline(always)] - pub fn pol(&self) -> POL_R { - POL_R::new(((self.bits >> 1) & 1) != 0) + pub fn pol(&self) -> PolR { + PolR::new(((self.bits >> 1) & 1) != 0) } } impl W { #[doc = "Bit 0 - Serial clock phase"] #[inline(always)] - pub fn pha(&mut self) -> PHA_W<0> { - PHA_W::new(self) + #[must_use] + pub fn pha(&mut self) -> PhaW { + PhaW::new(self, 0) } #[doc = "Bit 1 - Serial clock polarity"] #[inline(always)] - pub fn pol(&mut self) -> POL_W<1> { - POL_W::new(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 + #[must_use] + pub fn pol(&mut self) -> PolW { + PolW::new(self, 1) } } -#[doc = "Serial Clock Mode Register\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 [sckmode](index.html) module"] -pub struct SCKMODE_SPEC; -impl crate::RegisterSpec for SCKMODE_SPEC { +#[doc = "Serial Clock Mode Register\n\nYou can [`read`](crate::Reg::read) this register and get [`sckmode::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sckmode::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct SckmodeSpec; +impl crate::RegisterSpec for SckmodeSpec { type Ux = u32; } -#[doc = "`read()` method returns [sckmode::R](R) reader structure"] -impl crate::Readable for SCKMODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [sckmode::W](W) writer structure"] -impl crate::Writable for SCKMODE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`sckmode::R`](R) reader structure"] +impl crate::Readable for SckmodeSpec {} +#[doc = "`write(|w| ..)` method takes [`sckmode::W`](W) writer structure"] +impl crate::Writable for SckmodeSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets sckmode to value 0"] -impl crate::Resettable for SCKMODE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for SckmodeSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/txdata.rs b/src/qspi0/txdata.rs index 07c58be..6764a25 100644 --- a/src/qspi0/txdata.rs +++ b/src/qspi0/txdata.rs @@ -1,94 +1,55 @@ #[doc = "Register `txdata` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `txdata` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `data` reader - Transmit data"] -pub type DATA_R = crate::FieldReader; +pub type DataR = crate::FieldReader; #[doc = "Field `data` writer - Transmit data"] -pub type DATA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TXDATA_SPEC, u8, u8, 8, O>; +pub type DataW<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `full` reader - FIFO full flag"] -pub type FULL_R = crate::BitReader; +pub type FullR = crate::BitReader; #[doc = "Field `full` writer - FIFO full flag"] -pub type FULL_W<'a, const O: u8> = crate::BitWriter<'a, u32, TXDATA_SPEC, bool, O>; +pub type FullW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:7 - Transmit data"] #[inline(always)] - pub fn data(&self) -> DATA_R { - DATA_R::new((self.bits & 0xff) as u8) + pub fn data(&self) -> DataR { + DataR::new((self.bits & 0xff) as u8) } #[doc = "Bit 31 - FIFO full flag"] #[inline(always)] - pub fn full(&self) -> FULL_R { - FULL_R::new(((self.bits >> 31) & 1) != 0) + pub fn full(&self) -> FullR { + FullR::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bits 0:7 - Transmit data"] #[inline(always)] - pub fn data(&mut self) -> DATA_W<0> { - DATA_W::new(self) + #[must_use] + pub fn data(&mut self) -> DataW { + DataW::new(self, 0) } #[doc = "Bit 31 - FIFO full flag"] #[inline(always)] - pub fn full(&mut self) -> FULL_W<31> { - FULL_W::new(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 + #[must_use] + pub fn full(&mut self) -> FullW { + FullW::new(self, 31) } } -#[doc = "Transmit Data Register\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 [txdata](index.html) module"] -pub struct TXDATA_SPEC; -impl crate::RegisterSpec for TXDATA_SPEC { +#[doc = "Transmit Data Register\n\nYou can [`read`](crate::Reg::read) this register and get [`txdata::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`txdata::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct TxdataSpec; +impl crate::RegisterSpec for TxdataSpec { type Ux = u32; } -#[doc = "`read()` method returns [txdata::R](R) reader structure"] -impl crate::Readable for TXDATA_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [txdata::W](W) writer structure"] -impl crate::Writable for TXDATA_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`txdata::R`](R) reader structure"] +impl crate::Readable for TxdataSpec {} +#[doc = "`write(|w| ..)` method takes [`txdata::W`](W) writer structure"] +impl crate::Writable for TxdataSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets txdata to value 0"] -impl crate::Resettable for TXDATA_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for TxdataSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/qspi0/txmark.rs b/src/qspi0/txmark.rs index e3479dc..4f93a7b 100644 --- a/src/qspi0/txmark.rs +++ b/src/qspi0/txmark.rs @@ -1,80 +1,40 @@ #[doc = "Register `txmark` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `txmark` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `txmark` reader - Transmit watermark"] -pub type TXMARK_R = crate::FieldReader; +pub type TxmarkR = crate::FieldReader; #[doc = "Field `txmark` writer - Transmit watermark"] -pub type TXMARK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TXMARK_SPEC, u8, u8, 3, O>; +pub type TxmarkW<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Transmit watermark"] #[inline(always)] - pub fn txmark(&self) -> TXMARK_R { - TXMARK_R::new((self.bits & 7) as u8) + pub fn txmark(&self) -> TxmarkR { + TxmarkR::new((self.bits & 7) as u8) } } impl W { #[doc = "Bits 0:2 - Transmit watermark"] #[inline(always)] - pub fn txmark(&mut self) -> TXMARK_W<0> { - TXMARK_W::new(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 + #[must_use] + pub fn txmark(&mut self) -> TxmarkW { + TxmarkW::new(self, 0) } } -#[doc = "Transmit Watermark Register\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 [txmark](index.html) module"] -pub struct TXMARK_SPEC; -impl crate::RegisterSpec for TXMARK_SPEC { +#[doc = "Transmit Watermark Register\n\nYou can [`read`](crate::Reg::read) this register and get [`txmark::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`txmark::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct TxmarkSpec; +impl crate::RegisterSpec for TxmarkSpec { type Ux = u32; } -#[doc = "`read()` method returns [txmark::R](R) reader structure"] -impl crate::Readable for TXMARK_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [txmark::W](W) writer structure"] -impl crate::Writable for TXMARK_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`txmark::R`](R) reader structure"] +impl crate::Readable for TxmarkSpec {} +#[doc = "`write(|w| ..)` method takes [`txmark::W`](W) writer structure"] +impl crate::Writable for TxmarkSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets txmark to value 0"] -impl crate::Resettable for TXMARK_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for TxmarkSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/rtc.rs b/src/rtc.rs index f7e50da..bac2a73 100644 --- a/src/rtc.rs +++ b/src/rtc.rs @@ -1,37 +1,69 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { _reserved0: [u8; 0x40], - #[doc = "0x40 - RTC Configuration Register"] - pub rtccfg: RTCCFG, + rtccfg: Rtccfg, _reserved1: [u8; 0x04], + rtclo: Rtclo, + rtchi: Rtchi, + rtcs: Rtcs, + _reserved4: [u8; 0x0c], + rtccmp: Rtccmp, +} +impl RegisterBlock { + #[doc = "0x40 - RTC Configuration Register"] + #[inline(always)] + pub const fn rtccfg(&self) -> &Rtccfg { + &self.rtccfg + } #[doc = "0x48 - RTC Counter Low Register"] - pub rtclo: RTCLO, + #[inline(always)] + pub const fn rtclo(&self) -> &Rtclo { + &self.rtclo + } #[doc = "0x4c - RTC Counter High Register"] - pub rtchi: RTCHI, + #[inline(always)] + pub const fn rtchi(&self) -> &Rtchi { + &self.rtchi + } #[doc = "0x50 - RTC Scaled Counter Register"] - pub rtcs: RTCS, - _reserved4: [u8; 0x0c], + #[inline(always)] + pub const fn rtcs(&self) -> &Rtcs { + &self.rtcs + } #[doc = "0x60 - RTC Compare Register"] - pub rtccmp: RTCCMP, + #[inline(always)] + pub const fn rtccmp(&self) -> &Rtccmp { + &self.rtccmp + } } -#[doc = "rtccfg (rw) register accessor: an alias for `Reg`"] -pub type RTCCFG = crate::Reg; +#[doc = "rtccfg (rw) register accessor: RTC Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtccfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtccfg::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rtccfg`] +module"] +#[doc(alias = "rtccfg")] +pub type Rtccfg = crate::Reg; #[doc = "RTC Configuration Register"] pub mod rtccfg; -#[doc = "rtclo (rw) register accessor: an alias for `Reg`"] -pub type RTCLO = crate::Reg; +#[doc = "rtclo (rw) register accessor: RTC Counter Low Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtclo::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtclo::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rtclo`] +module"] +#[doc(alias = "rtclo")] +pub type Rtclo = crate::Reg; #[doc = "RTC Counter Low Register"] pub mod rtclo; -#[doc = "rtchi (rw) register accessor: an alias for `Reg`"] -pub type RTCHI = crate::Reg; +#[doc = "rtchi (rw) register accessor: RTC Counter High Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtchi::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtchi::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rtchi`] +module"] +#[doc(alias = "rtchi")] +pub type Rtchi = crate::Reg; #[doc = "RTC Counter High Register"] pub mod rtchi; -#[doc = "rtcs (rw) register accessor: an alias for `Reg`"] -pub type RTCS = crate::Reg; +#[doc = "rtcs (rw) register accessor: RTC Scaled Counter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtcs::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtcs::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rtcs`] +module"] +#[doc(alias = "rtcs")] +pub type Rtcs = crate::Reg; #[doc = "RTC Scaled Counter Register"] pub mod rtcs; -#[doc = "rtccmp (rw) register accessor: an alias for `Reg`"] -pub type RTCCMP = crate::Reg; +#[doc = "rtccmp (rw) register accessor: RTC Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtccmp::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtccmp::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rtccmp`] +module"] +#[doc(alias = "rtccmp")] +pub type Rtccmp = crate::Reg; #[doc = "RTC Compare Register"] pub mod rtccmp; diff --git a/src/rtc/rtccfg.rs b/src/rtc/rtccfg.rs index d46c630..3c377a2 100644 --- a/src/rtc/rtccfg.rs +++ b/src/rtc/rtccfg.rs @@ -1,108 +1,70 @@ #[doc = "Register `rtccfg` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rtccfg` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `scale` reader - "] -pub type SCALE_R = crate::FieldReader; +pub type ScaleR = crate::FieldReader; #[doc = "Field `scale` writer - "] -pub type SCALE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RTCCFG_SPEC, u8, u8, 4, O>; +pub type ScaleW<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `enalways` reader - "] -pub type ENALWAYS_R = crate::BitReader; +pub type EnalwaysR = crate::BitReader; #[doc = "Field `enalways` writer - "] -pub type ENALWAYS_W<'a, const O: u8> = crate::BitWriter<'a, u32, RTCCFG_SPEC, bool, O>; +pub type EnalwaysW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmpip` reader - "] -pub type CMPIP_R = crate::BitReader; +pub type CmpipR = crate::BitReader; #[doc = "Field `cmpip` writer - "] -pub type CMPIP_W<'a, const O: u8> = crate::BitWriter<'a, u32, RTCCFG_SPEC, bool, O>; +pub type CmpipW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:3"] #[inline(always)] - pub fn scale(&self) -> SCALE_R { - SCALE_R::new((self.bits & 0x0f) as u8) + pub fn scale(&self) -> ScaleR { + ScaleR::new((self.bits & 0x0f) as u8) } #[doc = "Bit 12"] #[inline(always)] - pub fn enalways(&self) -> ENALWAYS_R { - ENALWAYS_R::new(((self.bits >> 12) & 1) != 0) + pub fn enalways(&self) -> EnalwaysR { + EnalwaysR::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn cmpip(&self) -> CMPIP_R { - CMPIP_R::new(((self.bits >> 28) & 1) != 0) + pub fn cmpip(&self) -> CmpipR { + CmpipR::new(((self.bits >> 28) & 1) != 0) } } impl W { #[doc = "Bits 0:3"] #[inline(always)] - pub fn scale(&mut self) -> SCALE_W<0> { - SCALE_W::new(self) + #[must_use] + pub fn scale(&mut self) -> ScaleW { + ScaleW::new(self, 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn enalways(&mut self) -> ENALWAYS_W<12> { - ENALWAYS_W::new(self) + #[must_use] + pub fn enalways(&mut self) -> EnalwaysW { + EnalwaysW::new(self, 12) } #[doc = "Bit 28"] #[inline(always)] - pub fn cmpip(&mut self) -> CMPIP_W<28> { - CMPIP_W::new(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 + #[must_use] + pub fn cmpip(&mut self) -> CmpipW { + CmpipW::new(self, 28) } } -#[doc = "RTC Configuration Register\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 [rtccfg](index.html) module"] -pub struct RTCCFG_SPEC; -impl crate::RegisterSpec for RTCCFG_SPEC { +#[doc = "RTC Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtccfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtccfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RtccfgSpec; +impl crate::RegisterSpec for RtccfgSpec { type Ux = u32; } -#[doc = "`read()` method returns [rtccfg::R](R) reader structure"] -impl crate::Readable for RTCCFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rtccfg::W](W) writer structure"] -impl crate::Writable for RTCCFG_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rtccfg::R`](R) reader structure"] +impl crate::Readable for RtccfgSpec {} +#[doc = "`write(|w| ..)` method takes [`rtccfg::W`](W) writer structure"] +impl crate::Writable for RtccfgSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rtccfg to value 0"] -impl crate::Resettable for RTCCFG_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RtccfgSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/rtc/rtccmp.rs b/src/rtc/rtccmp.rs index 1f96f28..c273e34 100644 --- a/src/rtc/rtccmp.rs +++ b/src/rtc/rtccmp.rs @@ -1,64 +1,27 @@ #[doc = "Register `rtccmp` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rtccmp` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "RTC Compare Register\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 [rtccmp](index.html) module"] -pub struct RTCCMP_SPEC; -impl crate::RegisterSpec for RTCCMP_SPEC { +impl W {} +#[doc = "RTC Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtccmp::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtccmp::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RtccmpSpec; +impl crate::RegisterSpec for RtccmpSpec { type Ux = u32; } -#[doc = "`read()` method returns [rtccmp::R](R) reader structure"] -impl crate::Readable for RTCCMP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rtccmp::W](W) writer structure"] -impl crate::Writable for RTCCMP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rtccmp::R`](R) reader structure"] +impl crate::Readable for RtccmpSpec {} +#[doc = "`write(|w| ..)` method takes [`rtccmp::W`](W) writer structure"] +impl crate::Writable for RtccmpSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rtccmp to value 0"] -impl crate::Resettable for RTCCMP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RtccmpSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/rtc/rtchi.rs b/src/rtc/rtchi.rs index 303ca3c..948227e 100644 --- a/src/rtc/rtchi.rs +++ b/src/rtc/rtchi.rs @@ -1,80 +1,40 @@ #[doc = "Register `rtchi` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rtchi` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `value` reader - "] -pub type VALUE_R = crate::FieldReader; +pub type ValueR = crate::FieldReader; #[doc = "Field `value` writer - "] -pub type VALUE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RTCHI_SPEC, u16, u16, 16, O>; +pub type ValueW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&self) -> VALUE_R { - VALUE_R::new((self.bits & 0xffff) as u16) + pub fn value(&self) -> ValueR { + ValueR::new((self.bits & 0xffff) as u16) } } impl W { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&mut self) -> VALUE_W<0> { - VALUE_W::new(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 + #[must_use] + pub fn value(&mut self) -> ValueW { + ValueW::new(self, 0) } } -#[doc = "RTC Counter High Register\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 [rtchi](index.html) module"] -pub struct RTCHI_SPEC; -impl crate::RegisterSpec for RTCHI_SPEC { +#[doc = "RTC Counter High Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtchi::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtchi::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RtchiSpec; +impl crate::RegisterSpec for RtchiSpec { type Ux = u32; } -#[doc = "`read()` method returns [rtchi::R](R) reader structure"] -impl crate::Readable for RTCHI_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rtchi::W](W) writer structure"] -impl crate::Writable for RTCHI_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rtchi::R`](R) reader structure"] +impl crate::Readable for RtchiSpec {} +#[doc = "`write(|w| ..)` method takes [`rtchi::W`](W) writer structure"] +impl crate::Writable for RtchiSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rtchi to value 0"] -impl crate::Resettable for RTCHI_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RtchiSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/rtc/rtclo.rs b/src/rtc/rtclo.rs index 5c1a065..54fd75b 100644 --- a/src/rtc/rtclo.rs +++ b/src/rtc/rtclo.rs @@ -1,64 +1,27 @@ #[doc = "Register `rtclo` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rtclo` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "RTC Counter Low Register\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 [rtclo](index.html) module"] -pub struct RTCLO_SPEC; -impl crate::RegisterSpec for RTCLO_SPEC { +impl W {} +#[doc = "RTC Counter Low Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtclo::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtclo::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RtcloSpec; +impl crate::RegisterSpec for RtcloSpec { type Ux = u32; } -#[doc = "`read()` method returns [rtclo::R](R) reader structure"] -impl crate::Readable for RTCLO_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rtclo::W](W) writer structure"] -impl crate::Writable for RTCLO_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rtclo::R`](R) reader structure"] +impl crate::Readable for RtcloSpec {} +#[doc = "`write(|w| ..)` method takes [`rtclo::W`](W) writer structure"] +impl crate::Writable for RtcloSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rtclo to value 0"] -impl crate::Resettable for RTCLO_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RtcloSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/rtc/rtcs.rs b/src/rtc/rtcs.rs index 8e478aa..e3a0710 100644 --- a/src/rtc/rtcs.rs +++ b/src/rtc/rtcs.rs @@ -1,64 +1,27 @@ #[doc = "Register `rtcs` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rtcs` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "RTC Scaled Counter Register\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 [rtcs](index.html) module"] -pub struct RTCS_SPEC; -impl crate::RegisterSpec for RTCS_SPEC { +impl W {} +#[doc = "RTC Scaled Counter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtcs::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtcs::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RtcsSpec; +impl crate::RegisterSpec for RtcsSpec { type Ux = u32; } -#[doc = "`read()` method returns [rtcs::R](R) reader structure"] -impl crate::Readable for RTCS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rtcs::W](W) writer structure"] -impl crate::Writable for RTCS_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rtcs::R`](R) reader structure"] +impl crate::Readable for RtcsSpec {} +#[doc = "`write(|w| ..)` method takes [`rtcs::W`](W) writer structure"] +impl crate::Writable for RtcsSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rtcs to value 0"] -impl crate::Resettable for RTCS_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RtcsSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/uart0.rs b/src/uart0.rs index 6c1781a..a05af92 100644 --- a/src/uart0.rs +++ b/src/uart0.rs @@ -1,46 +1,90 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { + txdata: Txdata, + rxdata: Rxdata, + txctrl: Txctrl, + rxctrl: Rxctrl, + ie: Ie, + ip: Ip, + div: Div, +} +impl RegisterBlock { #[doc = "0x00 - Transmit Data Register"] - pub txdata: TXDATA, + #[inline(always)] + pub const fn txdata(&self) -> &Txdata { + &self.txdata + } #[doc = "0x04 - Receive Data Register"] - pub rxdata: RXDATA, + #[inline(always)] + pub const fn rxdata(&self) -> &Rxdata { + &self.rxdata + } #[doc = "0x08 - Transmit Control Register"] - pub txctrl: TXCTRL, + #[inline(always)] + pub const fn txctrl(&self) -> &Txctrl { + &self.txctrl + } #[doc = "0x0c - Receive Control Register"] - pub rxctrl: RXCTRL, + #[inline(always)] + pub const fn rxctrl(&self) -> &Rxctrl { + &self.rxctrl + } #[doc = "0x10 - Interrupt Enable Register"] - pub ie: IE, + #[inline(always)] + pub const fn ie(&self) -> &Ie { + &self.ie + } #[doc = "0x14 - Interrupt Pending Register"] - pub ip: IP, + #[inline(always)] + pub const fn ip(&self) -> &Ip { + &self.ip + } #[doc = "0x18 - Baud Rate Divisor Register"] - pub div: DIV, + #[inline(always)] + pub const fn div(&self) -> &Div { + &self.div + } } -#[doc = "txdata (rw) register accessor: an alias for `Reg`"] -pub type TXDATA = crate::Reg; +#[doc = "txdata (rw) register accessor: Transmit Data Register\n\nYou can [`read`](crate::Reg::read) this register and get [`txdata::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`txdata::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@txdata`] +module"] +#[doc(alias = "txdata")] +pub type Txdata = crate::Reg; #[doc = "Transmit Data Register"] pub mod txdata; -#[doc = "rxdata (rw) register accessor: an alias for `Reg`"] -pub type RXDATA = crate::Reg; +#[doc = "rxdata (rw) register accessor: Receive Data Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rxdata::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rxdata::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxdata`] +module"] +#[doc(alias = "rxdata")] +pub type Rxdata = crate::Reg; #[doc = "Receive Data Register"] pub mod rxdata; -#[doc = "txctrl (rw) register accessor: an alias for `Reg`"] -pub type TXCTRL = crate::Reg; +#[doc = "txctrl (rw) register accessor: Transmit Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`txctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`txctrl::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@txctrl`] +module"] +#[doc(alias = "txctrl")] +pub type Txctrl = crate::Reg; #[doc = "Transmit Control Register"] pub mod txctrl; -#[doc = "rxctrl (rw) register accessor: an alias for `Reg`"] -pub type RXCTRL = crate::Reg; +#[doc = "rxctrl (rw) register accessor: Receive Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rxctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rxctrl::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxctrl`] +module"] +#[doc(alias = "rxctrl")] +pub type Rxctrl = crate::Reg; #[doc = "Receive Control Register"] pub mod rxctrl; -#[doc = "ie (rw) register accessor: an alias for `Reg`"] -pub type IE = crate::Reg; +#[doc = "ie (rw) register accessor: Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ie::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ie::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ie`] +module"] +#[doc(alias = "ie")] +pub type Ie = crate::Reg; #[doc = "Interrupt Enable Register"] pub mod ie; -#[doc = "ip (rw) register accessor: an alias for `Reg`"] -pub type IP = crate::Reg; +#[doc = "ip (rw) register accessor: Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ip::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ip::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ip`] +module"] +#[doc(alias = "ip")] +pub type Ip = crate::Reg; #[doc = "Interrupt Pending Register"] pub mod ip; -#[doc = "div (rw) register accessor: an alias for `Reg`"] -pub type DIV = crate::Reg; +#[doc = "div (rw) register accessor: Baud Rate Divisor Register\n\nYou can [`read`](crate::Reg::read) this register and get [`div::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`div::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@div`] +module"] +#[doc(alias = "div")] +pub type Div = crate::Reg; #[doc = "Baud Rate Divisor Register"] pub mod div; diff --git a/src/uart0/div.rs b/src/uart0/div.rs index fb85d91..b319636 100644 --- a/src/uart0/div.rs +++ b/src/uart0/div.rs @@ -1,80 +1,40 @@ #[doc = "Register `div` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `div` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `value` reader - "] -pub type VALUE_R = crate::FieldReader; +pub type ValueR = crate::FieldReader; #[doc = "Field `value` writer - "] -pub type VALUE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIV_SPEC, u16, u16, 16, O>; +pub type ValueW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&self) -> VALUE_R { - VALUE_R::new((self.bits & 0xffff) as u16) + pub fn value(&self) -> ValueR { + ValueR::new((self.bits & 0xffff) as u16) } } impl W { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&mut self) -> VALUE_W<0> { - VALUE_W::new(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 + #[must_use] + pub fn value(&mut self) -> ValueW { + ValueW::new(self, 0) } } -#[doc = "Baud Rate Divisor Register\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 [div](index.html) module"] -pub struct DIV_SPEC; -impl crate::RegisterSpec for DIV_SPEC { +#[doc = "Baud Rate Divisor Register\n\nYou can [`read`](crate::Reg::read) this register and get [`div::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`div::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct DivSpec; +impl crate::RegisterSpec for DivSpec { type Ux = u32; } -#[doc = "`read()` method returns [div::R](R) reader structure"] -impl crate::Readable for DIV_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [div::W](W) writer structure"] -impl crate::Writable for DIV_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`div::R`](R) reader structure"] +impl crate::Readable for DivSpec {} +#[doc = "`write(|w| ..)` method takes [`div::W`](W) writer structure"] +impl crate::Writable for DivSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets div to value 0"] -impl crate::Resettable for DIV_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for DivSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/uart0/ie.rs b/src/uart0/ie.rs index e86a725..23bed86 100644 --- a/src/uart0/ie.rs +++ b/src/uart0/ie.rs @@ -1,94 +1,55 @@ #[doc = "Register `ie` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `ie` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `txwm` reader - "] -pub type TXWM_R = crate::BitReader; +pub type TxwmR = crate::BitReader; #[doc = "Field `txwm` writer - "] -pub type TXWM_W<'a, const O: u8> = crate::BitWriter<'a, u32, IE_SPEC, bool, O>; +pub type TxwmW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `rxwm` reader - "] -pub type RXWM_R = crate::BitReader; +pub type RxwmR = crate::BitReader; #[doc = "Field `rxwm` writer - "] -pub type RXWM_W<'a, const O: u8> = crate::BitWriter<'a, u32, IE_SPEC, bool, O>; +pub type RxwmW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn txwm(&self) -> TXWM_R { - TXWM_R::new((self.bits & 1) != 0) + pub fn txwm(&self) -> TxwmR { + TxwmR::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn rxwm(&self) -> RXWM_R { - RXWM_R::new(((self.bits >> 1) & 1) != 0) + pub fn rxwm(&self) -> RxwmR { + RxwmR::new(((self.bits >> 1) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn txwm(&mut self) -> TXWM_W<0> { - TXWM_W::new(self) + #[must_use] + pub fn txwm(&mut self) -> TxwmW { + TxwmW::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn rxwm(&mut self) -> RXWM_W<1> { - RXWM_W::new(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 + #[must_use] + pub fn rxwm(&mut self) -> RxwmW { + RxwmW::new(self, 1) } } -#[doc = "Interrupt Enable Register\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 [ie](index.html) module"] -pub struct IE_SPEC; -impl crate::RegisterSpec for IE_SPEC { +#[doc = "Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ie::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ie::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct IeSpec; +impl crate::RegisterSpec for IeSpec { type Ux = u32; } -#[doc = "`read()` method returns [ie::R](R) reader structure"] -impl crate::Readable for IE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [ie::W](W) writer structure"] -impl crate::Writable for IE_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`ie::R`](R) reader structure"] +impl crate::Readable for IeSpec {} +#[doc = "`write(|w| ..)` method takes [`ie::W`](W) writer structure"] +impl crate::Writable for IeSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets ie to value 0"] -impl crate::Resettable for IE_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for IeSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/uart0/ip.rs b/src/uart0/ip.rs index 1ba9050..e8a97e1 100644 --- a/src/uart0/ip.rs +++ b/src/uart0/ip.rs @@ -1,94 +1,55 @@ #[doc = "Register `ip` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `ip` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `txwm` reader - "] -pub type TXWM_R = crate::BitReader; +pub type TxwmR = crate::BitReader; #[doc = "Field `txwm` writer - "] -pub type TXWM_W<'a, const O: u8> = crate::BitWriter<'a, u32, IP_SPEC, bool, O>; +pub type TxwmW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `rxwm` reader - "] -pub type RXWM_R = crate::BitReader; +pub type RxwmR = crate::BitReader; #[doc = "Field `rxwm` writer - "] -pub type RXWM_W<'a, const O: u8> = crate::BitWriter<'a, u32, IP_SPEC, bool, O>; +pub type RxwmW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn txwm(&self) -> TXWM_R { - TXWM_R::new((self.bits & 1) != 0) + pub fn txwm(&self) -> TxwmR { + TxwmR::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn rxwm(&self) -> RXWM_R { - RXWM_R::new(((self.bits >> 1) & 1) != 0) + pub fn rxwm(&self) -> RxwmR { + RxwmR::new(((self.bits >> 1) & 1) != 0) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn txwm(&mut self) -> TXWM_W<0> { - TXWM_W::new(self) + #[must_use] + pub fn txwm(&mut self) -> TxwmW { + TxwmW::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn rxwm(&mut self) -> RXWM_W<1> { - RXWM_W::new(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 + #[must_use] + pub fn rxwm(&mut self) -> RxwmW { + RxwmW::new(self, 1) } } -#[doc = "Interrupt Pending Register\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 [ip](index.html) module"] -pub struct IP_SPEC; -impl crate::RegisterSpec for IP_SPEC { +#[doc = "Interrupt Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ip::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ip::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct IpSpec; +impl crate::RegisterSpec for IpSpec { type Ux = u32; } -#[doc = "`read()` method returns [ip::R](R) reader structure"] -impl crate::Readable for IP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [ip::W](W) writer structure"] -impl crate::Writable for IP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`ip::R`](R) reader structure"] +impl crate::Readable for IpSpec {} +#[doc = "`write(|w| ..)` method takes [`ip::W`](W) writer structure"] +impl crate::Writable for IpSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets ip to value 0"] -impl crate::Resettable for IP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for IpSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/uart0/rxctrl.rs b/src/uart0/rxctrl.rs index 226e087..82e9f35 100644 --- a/src/uart0/rxctrl.rs +++ b/src/uart0/rxctrl.rs @@ -1,94 +1,55 @@ #[doc = "Register `rxctrl` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rxctrl` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `enable` reader - "] -pub type ENABLE_R = crate::BitReader; +pub type EnableR = crate::BitReader; #[doc = "Field `enable` writer - "] -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, RXCTRL_SPEC, bool, O>; +pub type EnableW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `counter` reader - "] -pub type COUNTER_R = crate::FieldReader; +pub type CounterR = crate::FieldReader; #[doc = "Field `counter` writer - "] -pub type COUNTER_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RXCTRL_SPEC, u8, u8, 3, O>; +pub type CounterW<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn enable(&self) -> ENABLE_R { - ENABLE_R::new((self.bits & 1) != 0) + pub fn enable(&self) -> EnableR { + EnableR::new((self.bits & 1) != 0) } #[doc = "Bits 16:18"] #[inline(always)] - pub fn counter(&self) -> COUNTER_R { - COUNTER_R::new(((self.bits >> 16) & 7) as u8) + pub fn counter(&self) -> CounterR { + CounterR::new(((self.bits >> 16) & 7) as u8) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn enable(&mut self) -> ENABLE_W<0> { - ENABLE_W::new(self) + #[must_use] + pub fn enable(&mut self) -> EnableW { + EnableW::new(self, 0) } #[doc = "Bits 16:18"] #[inline(always)] - pub fn counter(&mut self) -> COUNTER_W<16> { - COUNTER_W::new(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 + #[must_use] + pub fn counter(&mut self) -> CounterW { + CounterW::new(self, 16) } } -#[doc = "Receive Control Register\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 [rxctrl](index.html) module"] -pub struct RXCTRL_SPEC; -impl crate::RegisterSpec for RXCTRL_SPEC { +#[doc = "Receive Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rxctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rxctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RxctrlSpec; +impl crate::RegisterSpec for RxctrlSpec { type Ux = u32; } -#[doc = "`read()` method returns [rxctrl::R](R) reader structure"] -impl crate::Readable for RXCTRL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rxctrl::W](W) writer structure"] -impl crate::Writable for RXCTRL_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rxctrl::R`](R) reader structure"] +impl crate::Readable for RxctrlSpec {} +#[doc = "`write(|w| ..)` method takes [`rxctrl::W`](W) writer structure"] +impl crate::Writable for RxctrlSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rxctrl to value 0"] -impl crate::Resettable for RXCTRL_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RxctrlSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/uart0/rxdata.rs b/src/uart0/rxdata.rs index 77787d9..186129a 100644 --- a/src/uart0/rxdata.rs +++ b/src/uart0/rxdata.rs @@ -1,94 +1,55 @@ #[doc = "Register `rxdata` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `rxdata` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `data` reader - "] -pub type DATA_R = crate::FieldReader; +pub type DataR = crate::FieldReader; #[doc = "Field `data` writer - "] -pub type DATA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RXDATA_SPEC, u8, u8, 8, O>; +pub type DataW<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `empty` reader - "] -pub type EMPTY_R = crate::BitReader; +pub type EmptyR = crate::BitReader; #[doc = "Field `empty` writer - "] -pub type EMPTY_W<'a, const O: u8> = crate::BitWriter<'a, u32, RXDATA_SPEC, bool, O>; +pub type EmptyW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:7"] #[inline(always)] - pub fn data(&self) -> DATA_R { - DATA_R::new((self.bits & 0xff) as u8) + pub fn data(&self) -> DataR { + DataR::new((self.bits & 0xff) as u8) } #[doc = "Bit 31"] #[inline(always)] - pub fn empty(&self) -> EMPTY_R { - EMPTY_R::new(((self.bits >> 31) & 1) != 0) + pub fn empty(&self) -> EmptyR { + EmptyR::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bits 0:7"] #[inline(always)] - pub fn data(&mut self) -> DATA_W<0> { - DATA_W::new(self) + #[must_use] + pub fn data(&mut self) -> DataW { + DataW::new(self, 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn empty(&mut self) -> EMPTY_W<31> { - EMPTY_W::new(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 + #[must_use] + pub fn empty(&mut self) -> EmptyW { + EmptyW::new(self, 31) } } -#[doc = "Receive Data Register\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 [rxdata](index.html) module"] -pub struct RXDATA_SPEC; -impl crate::RegisterSpec for RXDATA_SPEC { +#[doc = "Receive Data Register\n\nYou can [`read`](crate::Reg::read) this register and get [`rxdata::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rxdata::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct RxdataSpec; +impl crate::RegisterSpec for RxdataSpec { type Ux = u32; } -#[doc = "`read()` method returns [rxdata::R](R) reader structure"] -impl crate::Readable for RXDATA_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rxdata::W](W) writer structure"] -impl crate::Writable for RXDATA_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`rxdata::R`](R) reader structure"] +impl crate::Readable for RxdataSpec {} +#[doc = "`write(|w| ..)` method takes [`rxdata::W`](W) writer structure"] +impl crate::Writable for RxdataSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets rxdata to value 0"] -impl crate::Resettable for RXDATA_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for RxdataSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/uart0/txctrl.rs b/src/uart0/txctrl.rs index 0f1218a..de13546 100644 --- a/src/uart0/txctrl.rs +++ b/src/uart0/txctrl.rs @@ -1,108 +1,70 @@ #[doc = "Register `txctrl` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `txctrl` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `enable` reader - "] -pub type ENABLE_R = crate::BitReader; +pub type EnableR = crate::BitReader; #[doc = "Field `enable` writer - "] -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, TXCTRL_SPEC, bool, O>; +pub type EnableW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `nstop` reader - "] -pub type NSTOP_R = crate::BitReader; +pub type NstopR = crate::BitReader; #[doc = "Field `nstop` writer - "] -pub type NSTOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, TXCTRL_SPEC, bool, O>; +pub type NstopW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `counter` reader - "] -pub type COUNTER_R = crate::FieldReader; +pub type CounterR = crate::FieldReader; #[doc = "Field `counter` writer - "] -pub type COUNTER_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TXCTRL_SPEC, u8, u8, 3, O>; +pub type CounterW<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bit 0"] #[inline(always)] - pub fn enable(&self) -> ENABLE_R { - ENABLE_R::new((self.bits & 1) != 0) + pub fn enable(&self) -> EnableR { + EnableR::new((self.bits & 1) != 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn nstop(&self) -> NSTOP_R { - NSTOP_R::new(((self.bits >> 1) & 1) != 0) + pub fn nstop(&self) -> NstopR { + NstopR::new(((self.bits >> 1) & 1) != 0) } #[doc = "Bits 16:18"] #[inline(always)] - pub fn counter(&self) -> COUNTER_R { - COUNTER_R::new(((self.bits >> 16) & 7) as u8) + pub fn counter(&self) -> CounterR { + CounterR::new(((self.bits >> 16) & 7) as u8) } } impl W { #[doc = "Bit 0"] #[inline(always)] - pub fn enable(&mut self) -> ENABLE_W<0> { - ENABLE_W::new(self) + #[must_use] + pub fn enable(&mut self) -> EnableW { + EnableW::new(self, 0) } #[doc = "Bit 1"] #[inline(always)] - pub fn nstop(&mut self) -> NSTOP_W<1> { - NSTOP_W::new(self) + #[must_use] + pub fn nstop(&mut self) -> NstopW { + NstopW::new(self, 1) } #[doc = "Bits 16:18"] #[inline(always)] - pub fn counter(&mut self) -> COUNTER_W<16> { - COUNTER_W::new(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 + #[must_use] + pub fn counter(&mut self) -> CounterW { + CounterW::new(self, 16) } } -#[doc = "Transmit Control Register\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 [txctrl](index.html) module"] -pub struct TXCTRL_SPEC; -impl crate::RegisterSpec for TXCTRL_SPEC { +#[doc = "Transmit Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`txctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`txctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct TxctrlSpec; +impl crate::RegisterSpec for TxctrlSpec { type Ux = u32; } -#[doc = "`read()` method returns [txctrl::R](R) reader structure"] -impl crate::Readable for TXCTRL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [txctrl::W](W) writer structure"] -impl crate::Writable for TXCTRL_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`txctrl::R`](R) reader structure"] +impl crate::Readable for TxctrlSpec {} +#[doc = "`write(|w| ..)` method takes [`txctrl::W`](W) writer structure"] +impl crate::Writable for TxctrlSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets txctrl to value 0"] -impl crate::Resettable for TXCTRL_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for TxctrlSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/uart0/txdata.rs b/src/uart0/txdata.rs index d809315..e6e23e4 100644 --- a/src/uart0/txdata.rs +++ b/src/uart0/txdata.rs @@ -1,94 +1,55 @@ #[doc = "Register `txdata` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `txdata` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `data` reader - "] -pub type DATA_R = crate::FieldReader; +pub type DataR = crate::FieldReader; #[doc = "Field `data` writer - "] -pub type DATA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TXDATA_SPEC, u8, u8, 8, O>; +pub type DataW<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `full` reader - "] -pub type FULL_R = crate::BitReader; +pub type FullR = crate::BitReader; #[doc = "Field `full` writer - "] -pub type FULL_W<'a, const O: u8> = crate::BitWriter<'a, u32, TXDATA_SPEC, bool, O>; +pub type FullW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:7"] #[inline(always)] - pub fn data(&self) -> DATA_R { - DATA_R::new((self.bits & 0xff) as u8) + pub fn data(&self) -> DataR { + DataR::new((self.bits & 0xff) as u8) } #[doc = "Bit 31"] #[inline(always)] - pub fn full(&self) -> FULL_R { - FULL_R::new(((self.bits >> 31) & 1) != 0) + pub fn full(&self) -> FullR { + FullR::new(((self.bits >> 31) & 1) != 0) } } impl W { #[doc = "Bits 0:7"] #[inline(always)] - pub fn data(&mut self) -> DATA_W<0> { - DATA_W::new(self) + #[must_use] + pub fn data(&mut self) -> DataW { + DataW::new(self, 0) } #[doc = "Bit 31"] #[inline(always)] - pub fn full(&mut self) -> FULL_W<31> { - FULL_W::new(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 + #[must_use] + pub fn full(&mut self) -> FullW { + FullW::new(self, 31) } } -#[doc = "Transmit Data Register\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 [txdata](index.html) module"] -pub struct TXDATA_SPEC; -impl crate::RegisterSpec for TXDATA_SPEC { +#[doc = "Transmit Data Register\n\nYou can [`read`](crate::Reg::read) this register and get [`txdata::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`txdata::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct TxdataSpec; +impl crate::RegisterSpec for TxdataSpec { type Ux = u32; } -#[doc = "`read()` method returns [txdata::R](R) reader structure"] -impl crate::Readable for TXDATA_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [txdata::W](W) writer structure"] -impl crate::Writable for TXDATA_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`txdata::R`](R) reader structure"] +impl crate::Readable for TxdataSpec {} +#[doc = "`write(|w| ..)` method takes [`txdata::W`](W) writer structure"] +impl crate::Writable for TxdataSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets txdata to value 0"] -impl crate::Resettable for TXDATA_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for TxdataSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/wdog.rs b/src/wdog.rs index 77fe6ed..3a245c2 100644 --- a/src/wdog.rs +++ b/src/wdog.rs @@ -1,43 +1,81 @@ -#[doc = r"Register block"] #[repr(C)] +#[doc = "Register block"] pub struct RegisterBlock { - #[doc = "0x00 - Watchdog Configuration Register"] - pub wdogcfg: WDOGCFG, + wdogcfg: Wdogcfg, _reserved1: [u8; 0x04], - #[doc = "0x08 - Watchdog Counter Register"] - pub wdogcount: WDOGCOUNT, + wdogcount: Wdogcount, _reserved2: [u8; 0x04], - #[doc = "0x10 - Watchdog Scaled Counter Register"] - pub wdogs: WDOGS, + wdogs: Wdogs, _reserved3: [u8; 0x04], + wdogfeed: Wdogfeed, + wdogkey: Wdogkey, + wdogcmp: Wdogcmp, +} +impl RegisterBlock { + #[doc = "0x00 - Watchdog Configuration Register"] + #[inline(always)] + pub const fn wdogcfg(&self) -> &Wdogcfg { + &self.wdogcfg + } + #[doc = "0x08 - Watchdog Counter Register"] + #[inline(always)] + pub const fn wdogcount(&self) -> &Wdogcount { + &self.wdogcount + } + #[doc = "0x10 - Watchdog Scaled Counter Register"] + #[inline(always)] + pub const fn wdogs(&self) -> &Wdogs { + &self.wdogs + } #[doc = "0x18 - Watchdog Feed Register"] - pub wdogfeed: WDOGFEED, + #[inline(always)] + pub const fn wdogfeed(&self) -> &Wdogfeed { + &self.wdogfeed + } #[doc = "0x1c - Watchdog Key Register"] - pub wdogkey: WDOGKEY, + #[inline(always)] + pub const fn wdogkey(&self) -> &Wdogkey { + &self.wdogkey + } #[doc = "0x20 - Watchdog Compare Register"] - pub wdogcmp: WDOGCMP, + #[inline(always)] + pub const fn wdogcmp(&self) -> &Wdogcmp { + &self.wdogcmp + } } -#[doc = "wdogcfg (rw) register accessor: an alias for `Reg`"] -pub type WDOGCFG = crate::Reg; +#[doc = "wdogcfg (rw) register accessor: Watchdog Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`wdogcfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogcfg::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@wdogcfg`] +module"] +#[doc(alias = "wdogcfg")] +pub type Wdogcfg = crate::Reg; #[doc = "Watchdog Configuration Register"] pub mod wdogcfg; -#[doc = "wdogcount (rw) register accessor: an alias for `Reg`"] -pub type WDOGCOUNT = crate::Reg; +#[doc = "wdogcount (rw) register accessor: Watchdog Counter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`wdogcount::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogcount::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@wdogcount`] +module"] +#[doc(alias = "wdogcount")] +pub type Wdogcount = crate::Reg; #[doc = "Watchdog Counter Register"] pub mod wdogcount; -#[doc = "wdogs (rw) register accessor: an alias for `Reg`"] -pub type WDOGS = crate::Reg; +#[doc = "wdogs (rw) register accessor: Watchdog Scaled Counter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`wdogs::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogs::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@wdogs`] +module"] +#[doc(alias = "wdogs")] +pub type Wdogs = crate::Reg; #[doc = "Watchdog Scaled Counter Register"] pub mod wdogs; -#[doc = "wdogfeed (rw) register accessor: an alias for `Reg`"] -pub type WDOGFEED = crate::Reg; +#[doc = "wdogfeed (rw) register accessor: Watchdog Feed Register\n\nYou can [`read`](crate::Reg::read) this register and get [`wdogfeed::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogfeed::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@wdogfeed`] +module"] +#[doc(alias = "wdogfeed")] +pub type Wdogfeed = crate::Reg; #[doc = "Watchdog Feed Register"] pub mod wdogfeed; -#[doc = "wdogkey (w) register accessor: an alias for `Reg`"] -pub type WDOGKEY = crate::Reg; +#[doc = "wdogkey (w) register accessor: Watchdog Key Register\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogkey::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@wdogkey`] +module"] +#[doc(alias = "wdogkey")] +pub type Wdogkey = crate::Reg; #[doc = "Watchdog Key Register"] pub mod wdogkey; -#[doc = "wdogcmp (rw) register accessor: an alias for `Reg`"] -pub type WDOGCMP = crate::Reg; +#[doc = "wdogcmp (rw) register accessor: Watchdog Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`wdogcmp::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogcmp::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@wdogcmp`] +module"] +#[doc(alias = "wdogcmp")] +pub type Wdogcmp = crate::Reg; #[doc = "Watchdog Compare Register"] pub mod wdogcmp; diff --git a/src/wdog/wdogcfg.rs b/src/wdog/wdogcfg.rs index 097e624..35fc668 100644 --- a/src/wdog/wdogcfg.rs +++ b/src/wdog/wdogcfg.rs @@ -1,150 +1,115 @@ #[doc = "Register `wdogcfg` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `wdogcfg` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `scale` reader - "] -pub type SCALE_R = crate::FieldReader; +pub type ScaleR = crate::FieldReader; #[doc = "Field `scale` writer - "] -pub type SCALE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, WDOGCFG_SPEC, u8, u8, 4, O>; +pub type ScaleW<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `rsten` reader - "] -pub type RSTEN_R = crate::BitReader; +pub type RstenR = crate::BitReader; #[doc = "Field `rsten` writer - "] -pub type RSTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, WDOGCFG_SPEC, bool, O>; +pub type RstenW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `zerocmp` reader - "] -pub type ZEROCMP_R = crate::BitReader; +pub type ZerocmpR = crate::BitReader; #[doc = "Field `zerocmp` writer - "] -pub type ZEROCMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, WDOGCFG_SPEC, bool, O>; +pub type ZerocmpW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `enalways` reader - "] -pub type ENALWAYS_R = crate::BitReader; +pub type EnalwaysR = crate::BitReader; #[doc = "Field `enalways` writer - "] -pub type ENALWAYS_W<'a, const O: u8> = crate::BitWriter<'a, u32, WDOGCFG_SPEC, bool, O>; +pub type EnalwaysW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `encoreawake` reader - "] -pub type ENCOREAWAKE_R = crate::BitReader; +pub type EncoreawakeR = crate::BitReader; #[doc = "Field `encoreawake` writer - "] -pub type ENCOREAWAKE_W<'a, const O: u8> = crate::BitWriter<'a, u32, WDOGCFG_SPEC, bool, O>; +pub type EncoreawakeW<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `cmpip` reader - "] -pub type CMPIP_R = crate::BitReader; +pub type CmpipR = crate::BitReader; #[doc = "Field `cmpip` writer - "] -pub type CMPIP_W<'a, const O: u8> = crate::BitWriter<'a, u32, WDOGCFG_SPEC, bool, O>; +pub type CmpipW<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:3"] #[inline(always)] - pub fn scale(&self) -> SCALE_R { - SCALE_R::new((self.bits & 0x0f) as u8) + pub fn scale(&self) -> ScaleR { + ScaleR::new((self.bits & 0x0f) as u8) } #[doc = "Bit 8"] #[inline(always)] - pub fn rsten(&self) -> RSTEN_R { - RSTEN_R::new(((self.bits >> 8) & 1) != 0) + pub fn rsten(&self) -> RstenR { + RstenR::new(((self.bits >> 8) & 1) != 0) } #[doc = "Bit 9"] #[inline(always)] - pub fn zerocmp(&self) -> ZEROCMP_R { - ZEROCMP_R::new(((self.bits >> 9) & 1) != 0) + pub fn zerocmp(&self) -> ZerocmpR { + ZerocmpR::new(((self.bits >> 9) & 1) != 0) } #[doc = "Bit 12"] #[inline(always)] - pub fn enalways(&self) -> ENALWAYS_R { - ENALWAYS_R::new(((self.bits >> 12) & 1) != 0) + pub fn enalways(&self) -> EnalwaysR { + EnalwaysR::new(((self.bits >> 12) & 1) != 0) } #[doc = "Bit 13"] #[inline(always)] - pub fn encoreawake(&self) -> ENCOREAWAKE_R { - ENCOREAWAKE_R::new(((self.bits >> 13) & 1) != 0) + pub fn encoreawake(&self) -> EncoreawakeR { + EncoreawakeR::new(((self.bits >> 13) & 1) != 0) } #[doc = "Bit 28"] #[inline(always)] - pub fn cmpip(&self) -> CMPIP_R { - CMPIP_R::new(((self.bits >> 28) & 1) != 0) + pub fn cmpip(&self) -> CmpipR { + CmpipR::new(((self.bits >> 28) & 1) != 0) } } impl W { #[doc = "Bits 0:3"] #[inline(always)] - pub fn scale(&mut self) -> SCALE_W<0> { - SCALE_W::new(self) + #[must_use] + pub fn scale(&mut self) -> ScaleW { + ScaleW::new(self, 0) } #[doc = "Bit 8"] #[inline(always)] - pub fn rsten(&mut self) -> RSTEN_W<8> { - RSTEN_W::new(self) + #[must_use] + pub fn rsten(&mut self) -> RstenW { + RstenW::new(self, 8) } #[doc = "Bit 9"] #[inline(always)] - pub fn zerocmp(&mut self) -> ZEROCMP_W<9> { - ZEROCMP_W::new(self) + #[must_use] + pub fn zerocmp(&mut self) -> ZerocmpW { + ZerocmpW::new(self, 9) } #[doc = "Bit 12"] #[inline(always)] - pub fn enalways(&mut self) -> ENALWAYS_W<12> { - ENALWAYS_W::new(self) + #[must_use] + pub fn enalways(&mut self) -> EnalwaysW { + EnalwaysW::new(self, 12) } #[doc = "Bit 13"] #[inline(always)] - pub fn encoreawake(&mut self) -> ENCOREAWAKE_W<13> { - ENCOREAWAKE_W::new(self) + #[must_use] + pub fn encoreawake(&mut self) -> EncoreawakeW { + EncoreawakeW::new(self, 13) } #[doc = "Bit 28"] #[inline(always)] - pub fn cmpip(&mut self) -> CMPIP_W<28> { - CMPIP_W::new(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 + #[must_use] + pub fn cmpip(&mut self) -> CmpipW { + CmpipW::new(self, 28) } } -#[doc = "Watchdog Configuration Register\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 [wdogcfg](index.html) module"] -pub struct WDOGCFG_SPEC; -impl crate::RegisterSpec for WDOGCFG_SPEC { +#[doc = "Watchdog Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`wdogcfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogcfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct WdogcfgSpec; +impl crate::RegisterSpec for WdogcfgSpec { type Ux = u32; } -#[doc = "`read()` method returns [wdogcfg::R](R) reader structure"] -impl crate::Readable for WDOGCFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [wdogcfg::W](W) writer structure"] -impl crate::Writable for WDOGCFG_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`wdogcfg::R`](R) reader structure"] +impl crate::Readable for WdogcfgSpec {} +#[doc = "`write(|w| ..)` method takes [`wdogcfg::W`](W) writer structure"] +impl crate::Writable for WdogcfgSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets wdogcfg to value 0"] -impl crate::Resettable for WDOGCFG_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for WdogcfgSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/wdog/wdogcmp.rs b/src/wdog/wdogcmp.rs index 1683415..49dbb9a 100644 --- a/src/wdog/wdogcmp.rs +++ b/src/wdog/wdogcmp.rs @@ -1,80 +1,40 @@ #[doc = "Register `wdogcmp` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `wdogcmp` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `value` reader - "] -pub type VALUE_R = crate::FieldReader; +pub type ValueR = crate::FieldReader; #[doc = "Field `value` writer - "] -pub type VALUE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, WDOGCMP_SPEC, u16, u16, 16, O>; +pub type ValueW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&self) -> VALUE_R { - VALUE_R::new((self.bits & 0xffff) as u16) + pub fn value(&self) -> ValueR { + ValueR::new((self.bits & 0xffff) as u16) } } impl W { #[doc = "Bits 0:15"] #[inline(always)] - pub fn value(&mut self) -> VALUE_W<0> { - VALUE_W::new(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 + #[must_use] + pub fn value(&mut self) -> ValueW { + ValueW::new(self, 0) } } -#[doc = "Watchdog Compare Register\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 [wdogcmp](index.html) module"] -pub struct WDOGCMP_SPEC; -impl crate::RegisterSpec for WDOGCMP_SPEC { +#[doc = "Watchdog Compare Register\n\nYou can [`read`](crate::Reg::read) this register and get [`wdogcmp::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogcmp::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct WdogcmpSpec; +impl crate::RegisterSpec for WdogcmpSpec { type Ux = u32; } -#[doc = "`read()` method returns [wdogcmp::R](R) reader structure"] -impl crate::Readable for WDOGCMP_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [wdogcmp::W](W) writer structure"] -impl crate::Writable for WDOGCMP_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`wdogcmp::R`](R) reader structure"] +impl crate::Readable for WdogcmpSpec {} +#[doc = "`write(|w| ..)` method takes [`wdogcmp::W`](W) writer structure"] +impl crate::Writable for WdogcmpSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets wdogcmp to value 0"] -impl crate::Resettable for WDOGCMP_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for WdogcmpSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/wdog/wdogcount.rs b/src/wdog/wdogcount.rs index 3a4bfa5..e20ba45 100644 --- a/src/wdog/wdogcount.rs +++ b/src/wdog/wdogcount.rs @@ -1,64 +1,27 @@ #[doc = "Register `wdogcount` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `wdogcount` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Watchdog Counter Register\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 [wdogcount](index.html) module"] -pub struct WDOGCOUNT_SPEC; -impl crate::RegisterSpec for WDOGCOUNT_SPEC { +impl W {} +#[doc = "Watchdog Counter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`wdogcount::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogcount::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct WdogcountSpec; +impl crate::RegisterSpec for WdogcountSpec { type Ux = u32; } -#[doc = "`read()` method returns [wdogcount::R](R) reader structure"] -impl crate::Readable for WDOGCOUNT_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [wdogcount::W](W) writer structure"] -impl crate::Writable for WDOGCOUNT_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`wdogcount::R`](R) reader structure"] +impl crate::Readable for WdogcountSpec {} +#[doc = "`write(|w| ..)` method takes [`wdogcount::W`](W) writer structure"] +impl crate::Writable for WdogcountSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets wdogcount to value 0"] -impl crate::Resettable for WDOGCOUNT_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for WdogcountSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/wdog/wdogfeed.rs b/src/wdog/wdogfeed.rs index 3f81ecc..7b9b509 100644 --- a/src/wdog/wdogfeed.rs +++ b/src/wdog/wdogfeed.rs @@ -1,64 +1,27 @@ #[doc = "Register `wdogfeed` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `wdogfeed` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Watchdog Feed Register\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 [wdogfeed](index.html) module"] -pub struct WDOGFEED_SPEC; -impl crate::RegisterSpec for WDOGFEED_SPEC { +impl W {} +#[doc = "Watchdog Feed Register\n\nYou can [`read`](crate::Reg::read) this register and get [`wdogfeed::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogfeed::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct WdogfeedSpec; +impl crate::RegisterSpec for WdogfeedSpec { type Ux = u32; } -#[doc = "`read()` method returns [wdogfeed::R](R) reader structure"] -impl crate::Readable for WDOGFEED_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [wdogfeed::W](W) writer structure"] -impl crate::Writable for WDOGFEED_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`wdogfeed::R`](R) reader structure"] +impl crate::Readable for WdogfeedSpec {} +#[doc = "`write(|w| ..)` method takes [`wdogfeed::W`](W) writer structure"] +impl crate::Writable for WdogfeedSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets wdogfeed to value 0"] -impl crate::Resettable for WDOGFEED_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for WdogfeedSpec { + const RESET_VALUE: u32 = 0; } diff --git a/src/wdog/wdogkey.rs b/src/wdog/wdogkey.rs index 0fef7a5..7cfa4fc 100644 --- a/src/wdog/wdogkey.rs +++ b/src/wdog/wdogkey.rs @@ -1,45 +1,23 @@ #[doc = "Register `wdogkey` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 +pub type W = crate::W; +impl core::fmt::Debug for crate::generic::Reg { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "(not readable)") } } -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Watchdog Key Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wdogkey](index.html) module"] -pub struct WDOGKEY_SPEC; -impl crate::RegisterSpec for WDOGKEY_SPEC { +impl W {} +#[doc = "Watchdog Key Register\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogkey::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct WdogkeySpec; +impl crate::RegisterSpec for WdogkeySpec { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [wdogkey::W](W) writer structure"] -impl crate::Writable for WDOGKEY_SPEC { - type Writer = W; +#[doc = "`write(|w| ..)` method takes [`wdogkey::W`](W) writer structure"] +impl crate::Writable for WdogkeySpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets wdogkey to value 0x0051_f15e"] -impl crate::Resettable for WDOGKEY_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0x0051_f15e - } +impl crate::Resettable for WdogkeySpec { + const RESET_VALUE: u32 = 0x0051_f15e; } diff --git a/src/wdog/wdogs.rs b/src/wdog/wdogs.rs index a3bfe5b..9313c90 100644 --- a/src/wdog/wdogs.rs +++ b/src/wdog/wdogs.rs @@ -1,64 +1,27 @@ #[doc = "Register `wdogs` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `wdogs` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[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 +pub type W = crate::W; +impl core::fmt::Debug for R { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "{}", self.bits()) } } -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} -impl W { - #[doc = "Writes raw bits to the register."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); - self - } -} -#[doc = "Watchdog Scaled Counter Register\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 [wdogs](index.html) module"] -pub struct WDOGS_SPEC; -impl crate::RegisterSpec for WDOGS_SPEC { +impl W {} +#[doc = "Watchdog Scaled Counter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`wdogs::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wdogs::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] +pub struct WdogsSpec; +impl crate::RegisterSpec for WdogsSpec { type Ux = u32; } -#[doc = "`read()` method returns [wdogs::R](R) reader structure"] -impl crate::Readable for WDOGS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [wdogs::W](W) writer structure"] -impl crate::Writable for WDOGS_SPEC { - type Writer = W; +#[doc = "`read()` method returns [`wdogs::R`](R) reader structure"] +impl crate::Readable for WdogsSpec {} +#[doc = "`write(|w| ..)` method takes [`wdogs::W`](W) writer structure"] +impl crate::Writable for WdogsSpec { + type Safety = crate::Unsafe; + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; } #[doc = "`reset()` method sets wdogs to value 0"] -impl crate::Resettable for WDOGS_SPEC { - #[inline(always)] - fn reset_value() -> Self::Ux { - 0 - } +impl crate::Resettable for WdogsSpec { + const RESET_VALUE: u32 = 0; }