Skip to content

Commit 44971a2

Browse files
authored
Merge pull request #23 from riscv-rust/update_deps
update to svd2rust v0.19.0
2 parents cd0fd4c + fe513e2 commit 44971a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+17611
-5285
lines changed

src/common/aonclk.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
#[doc = r"Register block"]
22
#[repr(C)]
33
pub struct RegisterBlock {
4-
_reserved0: [u8; 112usize],
4+
_reserved0: [u8; 0x70],
55
#[doc = "0x70 - AON Clock Configuration Register"]
6-
pub lfrosccfg: LFROSCCFG,
6+
pub lfrosccfg: crate::Reg<lfrosccfg::LFROSCCFG_SPEC>,
77
}
8-
#[doc = "AON Clock Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lfrosccfg](lfrosccfg) module"]
9-
pub type LFROSCCFG = crate::Reg<u32, _LFROSCCFG>;
10-
#[allow(missing_docs)]
11-
#[doc(hidden)]
12-
pub struct _LFROSCCFG;
13-
#[doc = "`read()` method returns [lfrosccfg::R](lfrosccfg::R) reader structure"]
14-
impl crate::Readable for LFROSCCFG {}
15-
#[doc = "`write(|w| ..)` method takes [lfrosccfg::W](lfrosccfg::W) writer structure"]
16-
impl crate::Writable for LFROSCCFG {}
8+
#[doc = "lfrosccfg register accessor: an alias for `Reg<LFROSCCFG_SPEC>`"]
9+
pub type LFROSCCFG = crate::Reg<lfrosccfg::LFROSCCFG_SPEC>;
1710
#[doc = "AON Clock Configuration Register"]
1811
pub mod lfrosccfg;

src/common/aonclk/lfrosccfg.rs

Lines changed: 124 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,54 @@
1-
#[doc = "Reader of register lfrosccfg"]
2-
pub type R = crate::R<u32, super::LFROSCCFG>;
3-
#[doc = "Writer for register lfrosccfg"]
4-
pub type W = crate::W<u32, super::LFROSCCFG>;
5-
#[doc = "Register lfrosccfg `reset()`'s with value 0"]
6-
impl crate::ResetValue for super::LFROSCCFG {
7-
type Type = u32;
8-
#[inline(always)]
9-
fn reset_value() -> Self::Type {
10-
0
1+
#[doc = "Register `lfrosccfg` reader"]
2+
pub struct R(crate::R<LFROSCCFG_SPEC>);
3+
impl core::ops::Deref for R {
4+
type Target = crate::R<LFROSCCFG_SPEC>;
5+
#[inline(always)]
6+
fn deref(&self) -> &Self::Target {
7+
&self.0
8+
}
9+
}
10+
impl From<crate::R<LFROSCCFG_SPEC>> for R {
11+
#[inline(always)]
12+
fn from(reader: crate::R<LFROSCCFG_SPEC>) -> Self {
13+
R(reader)
14+
}
15+
}
16+
#[doc = "Register `lfrosccfg` writer"]
17+
pub struct W(crate::W<LFROSCCFG_SPEC>);
18+
impl core::ops::Deref for W {
19+
type Target = crate::W<LFROSCCFG_SPEC>;
20+
#[inline(always)]
21+
fn deref(&self) -> &Self::Target {
22+
&self.0
23+
}
24+
}
25+
impl core::ops::DerefMut for W {
26+
#[inline(always)]
27+
fn deref_mut(&mut self) -> &mut Self::Target {
28+
&mut self.0
1129
}
1230
}
13-
#[doc = "Reader of field `ready`"]
14-
pub type READY_R = crate::R<bool, bool>;
15-
#[doc = "Write proxy for field `ready`"]
31+
impl From<crate::W<LFROSCCFG_SPEC>> for W {
32+
#[inline(always)]
33+
fn from(writer: crate::W<LFROSCCFG_SPEC>) -> Self {
34+
W(writer)
35+
}
36+
}
37+
#[doc = "Field `ready` reader - "]
38+
pub struct READY_R(crate::FieldReader<bool, bool>);
39+
impl READY_R {
40+
pub(crate) fn new(bits: bool) -> Self {
41+
READY_R(crate::FieldReader::new(bits))
42+
}
43+
}
44+
impl core::ops::Deref for READY_R {
45+
type Target = crate::FieldReader<bool, bool>;
46+
#[inline(always)]
47+
fn deref(&self) -> &Self::Target {
48+
&self.0
49+
}
50+
}
51+
#[doc = "Field `ready` writer - "]
1652
pub struct READY_W<'a> {
1753
w: &'a mut W,
1854
}
@@ -30,13 +66,25 @@ impl<'a> READY_W<'a> {
3066
#[doc = r"Writes raw bits to the field"]
3167
#[inline(always)]
3268
pub fn bit(self, value: bool) -> &'a mut W {
33-
self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31);
69+
self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31);
3470
self.w
3571
}
3672
}
37-
#[doc = "Reader of field `enable`"]
38-
pub type ENABLE_R = crate::R<bool, bool>;
39-
#[doc = "Write proxy for field `enable`"]
73+
#[doc = "Field `enable` reader - "]
74+
pub struct ENABLE_R(crate::FieldReader<bool, bool>);
75+
impl ENABLE_R {
76+
pub(crate) fn new(bits: bool) -> Self {
77+
ENABLE_R(crate::FieldReader::new(bits))
78+
}
79+
}
80+
impl core::ops::Deref for ENABLE_R {
81+
type Target = crate::FieldReader<bool, bool>;
82+
#[inline(always)]
83+
fn deref(&self) -> &Self::Target {
84+
&self.0
85+
}
86+
}
87+
#[doc = "Field `enable` writer - "]
4088
pub struct ENABLE_W<'a> {
4189
w: &'a mut W,
4290
}
@@ -54,35 +102,59 @@ impl<'a> ENABLE_W<'a> {
54102
#[doc = r"Writes raw bits to the field"]
55103
#[inline(always)]
56104
pub fn bit(self, value: bool) -> &'a mut W {
57-
self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30);
105+
self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30);
58106
self.w
59107
}
60108
}
61-
#[doc = "Reader of field `trim`"]
62-
pub type TRIM_R = crate::R<u8, u8>;
63-
#[doc = "Write proxy for field `trim`"]
109+
#[doc = "Field `trim` reader - "]
110+
pub struct TRIM_R(crate::FieldReader<u8, u8>);
111+
impl TRIM_R {
112+
pub(crate) fn new(bits: u8) -> Self {
113+
TRIM_R(crate::FieldReader::new(bits))
114+
}
115+
}
116+
impl core::ops::Deref for TRIM_R {
117+
type Target = crate::FieldReader<u8, u8>;
118+
#[inline(always)]
119+
fn deref(&self) -> &Self::Target {
120+
&self.0
121+
}
122+
}
123+
#[doc = "Field `trim` writer - "]
64124
pub struct TRIM_W<'a> {
65125
w: &'a mut W,
66126
}
67127
impl<'a> TRIM_W<'a> {
68128
#[doc = r"Writes raw bits to the field"]
69129
#[inline(always)]
70130
pub unsafe fn bits(self, value: u8) -> &'a mut W {
71-
self.w.bits = (self.w.bits & !(0x1f << 16)) | (((value as u32) & 0x1f) << 16);
131+
self.w.bits = (self.w.bits & !(0x1f << 16)) | ((value as u32 & 0x1f) << 16);
72132
self.w
73133
}
74134
}
75-
#[doc = "Reader of field `div`"]
76-
pub type DIV_R = crate::R<u8, u8>;
77-
#[doc = "Write proxy for field `div`"]
135+
#[doc = "Field `div` reader - "]
136+
pub struct DIV_R(crate::FieldReader<u8, u8>);
137+
impl DIV_R {
138+
pub(crate) fn new(bits: u8) -> Self {
139+
DIV_R(crate::FieldReader::new(bits))
140+
}
141+
}
142+
impl core::ops::Deref for DIV_R {
143+
type Target = crate::FieldReader<u8, u8>;
144+
#[inline(always)]
145+
fn deref(&self) -> &Self::Target {
146+
&self.0
147+
}
148+
}
149+
#[doc = "Field `div` writer - "]
78150
pub struct DIV_W<'a> {
79151
w: &'a mut W,
80152
}
81153
impl<'a> DIV_W<'a> {
82154
#[doc = r"Writes raw bits to the field"]
83155
#[inline(always)]
84156
pub unsafe fn bits(self, value: u8) -> &'a mut W {
85-
self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f);
157+
self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f);
86158
self.w
87159
}
88160
}
@@ -129,4 +201,30 @@ impl W {
129201
pub fn div(&mut self) -> DIV_W {
130202
DIV_W { w: self }
131203
}
204+
#[doc = "Writes raw bits to the register."]
205+
#[inline(always)]
206+
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
207+
self.0.bits(bits);
208+
self
209+
}
210+
}
211+
#[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"]
212+
pub struct LFROSCCFG_SPEC;
213+
impl crate::RegisterSpec for LFROSCCFG_SPEC {
214+
type Ux = u32;
215+
}
216+
#[doc = "`read()` method returns [lfrosccfg::R](R) reader structure"]
217+
impl crate::Readable for LFROSCCFG_SPEC {
218+
type Reader = R;
219+
}
220+
#[doc = "`write(|w| ..)` method takes [lfrosccfg::W](W) writer structure"]
221+
impl crate::Writable for LFROSCCFG_SPEC {
222+
type Writer = W;
223+
}
224+
#[doc = "`reset()` method sets lfrosccfg to value 0"]
225+
impl crate::Resettable for LFROSCCFG_SPEC {
226+
#[inline(always)]
227+
fn reset_value() -> Self::Ux {
228+
0
229+
}
132230
}

src/common/backup.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
#[doc = r"Register block"]
22
#[repr(C)]
33
pub struct RegisterBlock {
4-
_reserved0: [u8; 128usize],
5-
#[doc = "0x80 - Backup Register"]
6-
pub backup: [BACKUP; 16],
4+
_reserved0: [u8; 0x80],
5+
#[doc = "0x80..0xc0 - Backup Register"]
6+
pub backup: [crate::Reg<backup::BACKUP_SPEC>; 16],
77
}
8-
#[doc = "Backup Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [backup](backup) module"]
9-
pub type BACKUP = crate::Reg<u32, _BACKUP>;
10-
#[allow(missing_docs)]
11-
#[doc(hidden)]
12-
pub struct _BACKUP;
13-
#[doc = "`read()` method returns [backup::R](backup::R) reader structure"]
14-
impl crate::Readable for BACKUP {}
15-
#[doc = "`write(|w| ..)` method takes [backup::W](backup::W) writer structure"]
16-
impl crate::Writable for BACKUP {}
8+
#[doc = "backup register accessor: an alias for `Reg<BACKUP_SPEC>`"]
9+
pub type BACKUP = crate::Reg<backup::BACKUP_SPEC>;
1710
#[doc = "Backup Register"]
1811
pub mod backup;

src/common/backup/backup.rs

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,65 @@
1-
#[doc = "Reader of register backup[%s]"]
2-
pub type R = crate::R<u32, super::BACKUP>;
3-
#[doc = "Writer for register backup[%s]"]
4-
pub type W = crate::W<u32, super::BACKUP>;
5-
#[doc = "Register backup[%s]
6-
`reset()`'s with value 0"]
7-
impl crate::ResetValue for super::BACKUP {
8-
type Type = u32;
9-
#[inline(always)]
10-
fn reset_value() -> Self::Type {
1+
#[doc = "Register `backup[%s]` reader"]
2+
pub struct R(crate::R<BACKUP_SPEC>);
3+
impl core::ops::Deref for R {
4+
type Target = crate::R<BACKUP_SPEC>;
5+
#[inline(always)]
6+
fn deref(&self) -> &Self::Target {
7+
&self.0
8+
}
9+
}
10+
impl From<crate::R<BACKUP_SPEC>> for R {
11+
#[inline(always)]
12+
fn from(reader: crate::R<BACKUP_SPEC>) -> Self {
13+
R(reader)
14+
}
15+
}
16+
#[doc = "Register `backup[%s]` writer"]
17+
pub struct W(crate::W<BACKUP_SPEC>);
18+
impl core::ops::Deref for W {
19+
type Target = crate::W<BACKUP_SPEC>;
20+
#[inline(always)]
21+
fn deref(&self) -> &Self::Target {
22+
&self.0
23+
}
24+
}
25+
impl core::ops::DerefMut for W {
26+
#[inline(always)]
27+
fn deref_mut(&mut self) -> &mut Self::Target {
28+
&mut self.0
29+
}
30+
}
31+
impl From<crate::W<BACKUP_SPEC>> for W {
32+
#[inline(always)]
33+
fn from(writer: crate::W<BACKUP_SPEC>) -> Self {
34+
W(writer)
35+
}
36+
}
37+
impl W {
38+
#[doc = "Writes raw bits to the register."]
39+
#[inline(always)]
40+
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
41+
self.0.bits(bits);
42+
self
43+
}
44+
}
45+
#[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"]
46+
pub struct BACKUP_SPEC;
47+
impl crate::RegisterSpec for BACKUP_SPEC {
48+
type Ux = u32;
49+
}
50+
#[doc = "`read()` method returns [backup::R](R) reader structure"]
51+
impl crate::Readable for BACKUP_SPEC {
52+
type Reader = R;
53+
}
54+
#[doc = "`write(|w| ..)` method takes [backup::W](W) writer structure"]
55+
impl crate::Writable for BACKUP_SPEC {
56+
type Writer = W;
57+
}
58+
#[doc = "`reset()` method sets backup[%s]
59+
to value 0"]
60+
impl crate::Resettable for BACKUP_SPEC {
61+
#[inline(always)]
62+
fn reset_value() -> Self::Ux {
1163
0
1264
}
1365
}
14-
impl R {}
15-
impl W {}

0 commit comments

Comments
 (0)