-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from riscv-rust/svd2rust0.33.4
svd2rust 0.33.4
- Loading branch information
Showing
123 changed files
with
9,526 additions
and
11,516 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<LFROSCCFG_SPEC>`"] | ||
pub type LFROSCCFG = crate::Reg<lfrosccfg::LFROSCCFG_SPEC>; | ||
#[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<lfrosccfg::LfrosccfgSpec>; | ||
#[doc = "AON Clock Configuration Register"] | ||
pub mod lfrosccfg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,122 +1,85 @@ | ||
#[doc = "Register `lfrosccfg` reader"] | ||
pub struct R(crate::R<LFROSCCFG_SPEC>); | ||
impl core::ops::Deref for R { | ||
type Target = crate::R<LFROSCCFG_SPEC>; | ||
#[inline(always)] | ||
fn deref(&self) -> &Self::Target { | ||
&self.0 | ||
} | ||
} | ||
impl From<crate::R<LFROSCCFG_SPEC>> for R { | ||
#[inline(always)] | ||
fn from(reader: crate::R<LFROSCCFG_SPEC>) -> Self { | ||
R(reader) | ||
} | ||
} | ||
pub type R = crate::R<LfrosccfgSpec>; | ||
#[doc = "Register `lfrosccfg` writer"] | ||
pub struct W(crate::W<LFROSCCFG_SPEC>); | ||
impl core::ops::Deref for W { | ||
type Target = crate::W<LFROSCCFG_SPEC>; | ||
#[inline(always)] | ||
fn deref(&self) -> &Self::Target { | ||
&self.0 | ||
} | ||
} | ||
impl core::ops::DerefMut for W { | ||
#[inline(always)] | ||
fn deref_mut(&mut self) -> &mut Self::Target { | ||
&mut self.0 | ||
} | ||
} | ||
impl From<crate::W<LFROSCCFG_SPEC>> for W { | ||
#[inline(always)] | ||
fn from(writer: crate::W<LFROSCCFG_SPEC>) -> Self { | ||
W(writer) | ||
} | ||
} | ||
pub type W = crate::W<LfrosccfgSpec>; | ||
#[doc = "Field `div` reader - "] | ||
pub type DIV_R = crate::FieldReader<u8, u8>; | ||
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<u8, u8>; | ||
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<bool>; | ||
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<bool>; | ||
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<LfrosccfgSpec> { | ||
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<LfrosccfgSpec> { | ||
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<LfrosccfgSpec> { | ||
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<LfrosccfgSpec> { | ||
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Item = &Backup> { | ||
self.backup.iter() | ||
} | ||
} | ||
#[doc = "backup (rw) register accessor: an alias for `Reg<BACKUP_SPEC>`"] | ||
pub type BACKUP = crate::Reg<backup::BACKUP_SPEC>; | ||
#[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<backup::BackupSpec>; | ||
#[doc = "Backup Register"] | ||
pub mod backup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,28 @@ | ||
#[doc = "Register `backup[%s]` reader"] | ||
pub struct R(crate::R<BACKUP_SPEC>); | ||
impl core::ops::Deref for R { | ||
type Target = crate::R<BACKUP_SPEC>; | ||
#[inline(always)] | ||
fn deref(&self) -> &Self::Target { | ||
&self.0 | ||
} | ||
} | ||
impl From<crate::R<BACKUP_SPEC>> for R { | ||
#[inline(always)] | ||
fn from(reader: crate::R<BACKUP_SPEC>) -> Self { | ||
R(reader) | ||
} | ||
} | ||
pub type R = crate::R<BackupSpec>; | ||
#[doc = "Register `backup[%s]` writer"] | ||
pub struct W(crate::W<BACKUP_SPEC>); | ||
impl core::ops::Deref for W { | ||
type Target = crate::W<BACKUP_SPEC>; | ||
#[inline(always)] | ||
fn deref(&self) -> &Self::Target { | ||
&self.0 | ||
} | ||
} | ||
impl core::ops::DerefMut for W { | ||
#[inline(always)] | ||
fn deref_mut(&mut self) -> &mut Self::Target { | ||
&mut self.0 | ||
pub type W = crate::W<BackupSpec>; | ||
impl core::fmt::Debug for R { | ||
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { | ||
write!(f, "{}", self.bits()) | ||
} | ||
} | ||
impl From<crate::W<BACKUP_SPEC>> for W { | ||
#[inline(always)] | ||
fn from(writer: crate::W<BACKUP_SPEC>) -> 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; | ||
} |
Oops, something went wrong.