Skip to content

Commit 23fe2c9

Browse files
committed
update for svd2rust v0.26.0
1 parent f0ee4d5 commit 23fe2c9

File tree

150 files changed

+14075
-34698
lines changed

Some content is hidden

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

150 files changed

+14075
-34698
lines changed

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ license = "ISC"
1010
rust-version = "1.59"
1111

1212
[dependencies]
13+
critical-section = "1.1.1"
1314
vcell = "0.1.3"
14-
riscv = "0.10.1"
15+
riscv = { version = "0.10.1", features = ["critical-section-single-hart"] }
1516

1617
[features]
18+
default = ["critical-section"]
19+
critical-section = []
1720
rt = []
1821
g002 = []
1922

src/common/aonclk.rs renamed to src/aonclk.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
pub struct RegisterBlock {
44
_reserved0: [u8; 0x70],
55
#[doc = "0x70 - AON Clock Configuration Register"]
6-
pub lfrosccfg: crate::Reg<lfrosccfg::LFROSCCFG_SPEC>,
6+
pub lfrosccfg: LFROSCCFG,
77
}
8-
#[doc = "lfrosccfg register accessor: an alias for `Reg<LFROSCCFG_SPEC>`"]
8+
#[doc = "lfrosccfg (rw) register accessor: an alias for `Reg<LFROSCCFG_SPEC>`"]
99
pub type LFROSCCFG = crate::Reg<lfrosccfg::LFROSCCFG_SPEC>;
1010
#[doc = "AON Clock Configuration Register"]
1111
pub mod lfrosccfg;

src/aonclk/lfrosccfg.rs

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
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
29+
}
30+
}
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 `div` reader - "]
38+
pub type DIV_R = crate::FieldReader<u8, u8>;
39+
#[doc = "Field `div` writer - "]
40+
pub type DIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LFROSCCFG_SPEC, u8, u8, 6, O>;
41+
#[doc = "Field `trim` reader - "]
42+
pub type TRIM_R = crate::FieldReader<u8, u8>;
43+
#[doc = "Field `trim` writer - "]
44+
pub type TRIM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LFROSCCFG_SPEC, u8, u8, 5, O>;
45+
#[doc = "Field `enable` reader - "]
46+
pub type ENABLE_R = crate::BitReader<bool>;
47+
#[doc = "Field `enable` writer - "]
48+
pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, LFROSCCFG_SPEC, bool, O>;
49+
#[doc = "Field `ready` reader - "]
50+
pub type READY_R = crate::BitReader<bool>;
51+
#[doc = "Field `ready` writer - "]
52+
pub type READY_W<'a, const O: u8> = crate::BitWriter<'a, u32, LFROSCCFG_SPEC, bool, O>;
53+
impl R {
54+
#[doc = "Bits 0:5"]
55+
#[inline(always)]
56+
pub fn div(&self) -> DIV_R {
57+
DIV_R::new((self.bits & 0x3f) as u8)
58+
}
59+
#[doc = "Bits 16:20"]
60+
#[inline(always)]
61+
pub fn trim(&self) -> TRIM_R {
62+
TRIM_R::new(((self.bits >> 16) & 0x1f) as u8)
63+
}
64+
#[doc = "Bit 30"]
65+
#[inline(always)]
66+
pub fn enable(&self) -> ENABLE_R {
67+
ENABLE_R::new(((self.bits >> 30) & 1) != 0)
68+
}
69+
#[doc = "Bit 31"]
70+
#[inline(always)]
71+
pub fn ready(&self) -> READY_R {
72+
READY_R::new(((self.bits >> 31) & 1) != 0)
73+
}
74+
}
75+
impl W {
76+
#[doc = "Bits 0:5"]
77+
#[inline(always)]
78+
pub fn div(&mut self) -> DIV_W<0> {
79+
DIV_W::new(self)
80+
}
81+
#[doc = "Bits 16:20"]
82+
#[inline(always)]
83+
pub fn trim(&mut self) -> TRIM_W<16> {
84+
TRIM_W::new(self)
85+
}
86+
#[doc = "Bit 30"]
87+
#[inline(always)]
88+
pub fn enable(&mut self) -> ENABLE_W<30> {
89+
ENABLE_W::new(self)
90+
}
91+
#[doc = "Bit 31"]
92+
#[inline(always)]
93+
pub fn ready(&mut self) -> READY_W<31> {
94+
READY_W::new(self)
95+
}
96+
#[doc = "Writes raw bits to the register."]
97+
#[inline(always)]
98+
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
99+
self.0.bits(bits);
100+
self
101+
}
102+
}
103+
#[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"]
104+
pub struct LFROSCCFG_SPEC;
105+
impl crate::RegisterSpec for LFROSCCFG_SPEC {
106+
type Ux = u32;
107+
}
108+
#[doc = "`read()` method returns [lfrosccfg::R](R) reader structure"]
109+
impl crate::Readable for LFROSCCFG_SPEC {
110+
type Reader = R;
111+
}
112+
#[doc = "`write(|w| ..)` method takes [lfrosccfg::W](W) writer structure"]
113+
impl crate::Writable for LFROSCCFG_SPEC {
114+
type Writer = W;
115+
}
116+
#[doc = "`reset()` method sets lfrosccfg to value 0"]
117+
impl crate::Resettable for LFROSCCFG_SPEC {
118+
#[inline(always)]
119+
fn reset_value() -> Self::Ux {
120+
0
121+
}
122+
}

src/common/backup.rs renamed to src/backup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
pub struct RegisterBlock {
44
_reserved0: [u8; 0x80],
55
#[doc = "0x80..0xc0 - Backup Register"]
6-
pub backup: [crate::Reg<backup::BACKUP_SPEC>; 16],
6+
pub backup: [BACKUP; 16],
77
}
8-
#[doc = "backup register accessor: an alias for `Reg<BACKUP_SPEC>`"]
8+
#[doc = "backup (rw) register accessor: an alias for `Reg<BACKUP_SPEC>`"]
99
pub type BACKUP = crate::Reg<backup::BACKUP_SPEC>;
1010
#[doc = "Backup Register"]
1111
pub mod backup;
File renamed without changes.

src/common/clint.rs renamed to src/clint.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
#[repr(C)]
33
pub struct RegisterBlock {
44
#[doc = "0x00 - Hart 0 software interrupt register"]
5-
pub msip: crate::Reg<msip::MSIP_SPEC>,
5+
pub msip: MSIP,
66
_reserved1: [u8; 0x3ffc],
77
#[doc = "0x4000 - Hart 0 time comparator register"]
8-
pub mtimecmp: crate::Reg<mtimecmp::MTIMECMP_SPEC>,
8+
pub mtimecmp: MTIMECMP,
99
#[doc = "0x4004 - Hart 0 time comparator register"]
10-
pub mtimecmph: crate::Reg<mtimecmph::MTIMECMPH_SPEC>,
10+
pub mtimecmph: MTIMECMPH,
1111
_reserved3: [u8; 0x7ff0],
1212
#[doc = "0xbff8 - Timer register"]
13-
pub mtime: crate::Reg<mtime::MTIME_SPEC>,
13+
pub mtime: MTIME,
1414
#[doc = "0xbffc - Timer register"]
15-
pub mtimeh: crate::Reg<mtimeh::MTIMEH_SPEC>,
15+
pub mtimeh: MTIMEH,
1616
}
17-
#[doc = "msip register accessor: an alias for `Reg<MSIP_SPEC>`"]
17+
#[doc = "msip (rw) register accessor: an alias for `Reg<MSIP_SPEC>`"]
1818
pub type MSIP = crate::Reg<msip::MSIP_SPEC>;
1919
#[doc = "Hart 0 software interrupt register"]
2020
pub mod msip;
21-
#[doc = "mtimecmp register accessor: an alias for `Reg<MTIMECMP_SPEC>`"]
21+
#[doc = "mtimecmp (rw) register accessor: an alias for `Reg<MTIMECMP_SPEC>`"]
2222
pub type MTIMECMP = crate::Reg<mtimecmp::MTIMECMP_SPEC>;
2323
#[doc = "Hart 0 time comparator register"]
2424
pub mod mtimecmp;
25-
#[doc = "mtimecmph register accessor: an alias for `Reg<MTIMECMPH_SPEC>`"]
25+
#[doc = "mtimecmph (rw) register accessor: an alias for `Reg<MTIMECMPH_SPEC>`"]
2626
pub type MTIMECMPH = crate::Reg<mtimecmph::MTIMECMPH_SPEC>;
2727
#[doc = "Hart 0 time comparator register"]
2828
pub mod mtimecmph;
29-
#[doc = "mtime register accessor: an alias for `Reg<MTIME_SPEC>`"]
29+
#[doc = "mtime (rw) register accessor: an alias for `Reg<MTIME_SPEC>`"]
3030
pub type MTIME = crate::Reg<mtime::MTIME_SPEC>;
3131
#[doc = "Timer register"]
3232
pub mod mtime;
33-
#[doc = "mtimeh register accessor: an alias for `Reg<MTIMEH_SPEC>`"]
33+
#[doc = "mtimeh (rw) register accessor: an alias for `Reg<MTIMEH_SPEC>`"]
3434
pub type MTIMEH = crate::Reg<mtimeh::MTIMEH_SPEC>;
3535
#[doc = "Timer register"]
3636
pub mod mtimeh;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)