Skip to content

Commit

Permalink
Regenerate using svd2rust 0.31.3
Browse files Browse the repository at this point in the history
  • Loading branch information
abt8601 committed Dec 31, 2023
1 parent ef74c21 commit 8055e82
Show file tree
Hide file tree
Showing 18 changed files with 306 additions and 759 deletions.
2 changes: 1 addition & 1 deletion crates/bcm2711-lpa/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bcm2711-lpa"
version = "0.3.0"
version = "0.4.0"
authors = ["Po-Yi Tsai <abt8601@protonmail.ch>"]
edition = "2021"
rust-version = "1.65.0"
Expand Down
4 changes: 2 additions & 2 deletions crates/bcm2711-lpa/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![doc = "Peripheral access API for BCM2711_LPA microcontrollers (generated using svd2rust v0.31.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.31.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"]
#![doc = "Peripheral access API for BCM2711_LPA microcontrollers (generated using svd2rust v0.31.3 ( ))\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.31.3/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]
Expand Down
12 changes: 12 additions & 0 deletions crates/bcm2711-lpa/src/spi1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,23 @@ impl RegisterBlock {
pub const fn io(&self, n: usize) -> &IO {
&self.io[n]
}
#[doc = "Iterator for array of:"]
#[doc = "0x10..0x20 - Writing to the FIFO will deassert CS at the end of the access"]
#[inline(always)]
pub fn io_iter(&self) -> impl Iterator<Item = &IO> {
self.io.iter()
}
#[doc = "0x20..0x30 - Writing to the FIFO will maintain CS at the end of the access"]
#[inline(always)]
pub const fn txhold(&self, n: usize) -> &TXHOLD {
&self.txhold[n]
}
#[doc = "Iterator for array of:"]
#[doc = "0x20..0x30 - Writing to the FIFO will maintain CS at the end of the access"]
#[inline(always)]
pub fn txhold_iter(&self) -> impl Iterator<Item = &TXHOLD> {
self.txhold.iter()
}
}
#[doc = "CNTL0 (rw) register accessor: Control 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cntl0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cntl0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cntl0`]
module"]
Expand Down
218 changes: 52 additions & 166 deletions crates/bcm2711-lpa/src/usb_otg_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,53 +21,9 @@ pub struct RegisterBlock {
_reserved14: [u8; 0x3c],
doepeachmsk1: DOEPEACHMSK1,
_reserved15: [u8; 0x7c],
in_endpoint0: IN_ENDPOINT,
_reserved16: [u8; 0x04],
in_endpoint1: IN_ENDPOINT,
_reserved17: [u8; 0x04],
in_endpoint2: IN_ENDPOINT,
_reserved18: [u8; 0x04],
in_endpoint3: IN_ENDPOINT,
_reserved19: [u8; 0x04],
in_endpoint4: IN_ENDPOINT,
_reserved20: [u8; 0x04],
in_endpoint5: IN_ENDPOINT,
_reserved21: [u8; 0x04],
in_endpoint6: IN_ENDPOINT,
_reserved22: [u8; 0x04],
in_endpoint7: IN_ENDPOINT,
_reserved23: [u8; 0x04],
in_endpoint8: IN_ENDPOINT,
_reserved24: [u8; 0x04],
in_endpoint9: IN_ENDPOINT,
_reserved25: [u8; 0x04],
in_endpoint10: IN_ENDPOINT,
_reserved26: [u8; 0x04],
in_endpoint11: IN_ENDPOINT,
_reserved27: [u8; 0x84],
out_endpoint0: OUT_ENDPOINT,
_reserved28: [u8; 0x08],
out_endpoint1: OUT_ENDPOINT,
_reserved29: [u8; 0x08],
out_endpoint2: OUT_ENDPOINT,
_reserved30: [u8; 0x08],
out_endpoint3: OUT_ENDPOINT,
_reserved31: [u8; 0x08],
out_endpoint4: OUT_ENDPOINT,
_reserved32: [u8; 0x08],
out_endpoint5: OUT_ENDPOINT,
_reserved33: [u8; 0x08],
out_endpoint6: OUT_ENDPOINT,
_reserved34: [u8; 0x08],
out_endpoint7: OUT_ENDPOINT,
_reserved35: [u8; 0x08],
out_endpoint8: OUT_ENDPOINT,
_reserved36: [u8; 0x08],
out_endpoint9: OUT_ENDPOINT,
_reserved37: [u8; 0x08],
out_endpoint10: OUT_ENDPOINT,
_reserved38: [u8; 0x08],
out_endpoint11: OUT_ENDPOINT,
in_endpoint: (),
_reserved16: [u8; 0x0200],
out_endpoint: (),
}
impl RegisterBlock {
#[doc = "0x00 - OTG_HS device configuration register"]
Expand Down Expand Up @@ -145,125 +101,55 @@ impl RegisterBlock {
pub const fn doepeachmsk1(&self) -> &DOEPEACHMSK1 {
&self.doepeachmsk1
}
#[doc = "0x100..0x11c - IN Endpoint 0"]
#[inline(always)]
pub const fn in_endpoint0(&self) -> &IN_ENDPOINT {
&self.in_endpoint0
}
#[doc = "0x120..0x13c - IN Endpoint 1"]
#[inline(always)]
pub const fn in_endpoint1(&self) -> &IN_ENDPOINT {
&self.in_endpoint1
}
#[doc = "0x140..0x15c - IN Endpoint 2"]
#[inline(always)]
pub const fn in_endpoint2(&self) -> &IN_ENDPOINT {
&self.in_endpoint2
}
#[doc = "0x160..0x17c - IN Endpoint 3"]
#[inline(always)]
pub const fn in_endpoint3(&self) -> &IN_ENDPOINT {
&self.in_endpoint3
}
#[doc = "0x180..0x19c - IN Endpoint 4"]
#[inline(always)]
pub const fn in_endpoint4(&self) -> &IN_ENDPOINT {
&self.in_endpoint4
}
#[doc = "0x1a0..0x1bc - IN Endpoint 5"]
#[inline(always)]
pub const fn in_endpoint5(&self) -> &IN_ENDPOINT {
&self.in_endpoint5
}
#[doc = "0x1c0..0x1dc - IN Endpoint 6"]
#[inline(always)]
pub const fn in_endpoint6(&self) -> &IN_ENDPOINT {
&self.in_endpoint6
}
#[doc = "0x1e0..0x1fc - IN Endpoint 7"]
#[inline(always)]
pub const fn in_endpoint7(&self) -> &IN_ENDPOINT {
&self.in_endpoint7
}
#[doc = "0x200..0x21c - IN Endpoint 8"]
#[inline(always)]
pub const fn in_endpoint8(&self) -> &IN_ENDPOINT {
&self.in_endpoint8
}
#[doc = "0x220..0x23c - IN Endpoint 9"]
#[inline(always)]
pub const fn in_endpoint9(&self) -> &IN_ENDPOINT {
&self.in_endpoint9
}
#[doc = "0x240..0x25c - IN Endpoint 10"]
#[inline(always)]
pub const fn in_endpoint10(&self) -> &IN_ENDPOINT {
&self.in_endpoint10
}
#[doc = "0x260..0x27c - IN Endpoint 11"]
#[inline(always)]
pub const fn in_endpoint11(&self) -> &IN_ENDPOINT {
&self.in_endpoint11
}
#[doc = "0x300..0x318 - OUT Endpoint 0"]
#[inline(always)]
pub const fn out_endpoint0(&self) -> &OUT_ENDPOINT {
&self.out_endpoint0
}
#[doc = "0x320..0x338 - OUT Endpoint 1"]
#[inline(always)]
pub const fn out_endpoint1(&self) -> &OUT_ENDPOINT {
&self.out_endpoint1
}
#[doc = "0x340..0x358 - OUT Endpoint 2"]
#[inline(always)]
pub const fn out_endpoint2(&self) -> &OUT_ENDPOINT {
&self.out_endpoint2
}
#[doc = "0x360..0x378 - OUT Endpoint 3"]
#[inline(always)]
pub const fn out_endpoint3(&self) -> &OUT_ENDPOINT {
&self.out_endpoint3
}
#[doc = "0x380..0x398 - OUT Endpoint 4"]
#[inline(always)]
pub const fn out_endpoint4(&self) -> &OUT_ENDPOINT {
&self.out_endpoint4
}
#[doc = "0x3a0..0x3b8 - OUT Endpoint 5"]
#[inline(always)]
pub const fn out_endpoint5(&self) -> &OUT_ENDPOINT {
&self.out_endpoint5
}
#[doc = "0x3c0..0x3d8 - OUT Endpoint 6"]
#[inline(always)]
pub const fn out_endpoint6(&self) -> &OUT_ENDPOINT {
&self.out_endpoint6
}
#[doc = "0x3e0..0x3f8 - OUT Endpoint 7"]
#[inline(always)]
pub const fn out_endpoint7(&self) -> &OUT_ENDPOINT {
&self.out_endpoint7
}
#[doc = "0x400..0x418 - OUT Endpoint 8"]
#[inline(always)]
pub const fn out_endpoint8(&self) -> &OUT_ENDPOINT {
&self.out_endpoint8
}
#[doc = "0x420..0x438 - OUT Endpoint 9"]
#[inline(always)]
pub const fn out_endpoint9(&self) -> &OUT_ENDPOINT {
&self.out_endpoint9
}
#[doc = "0x440..0x458 - OUT Endpoint 10"]
#[inline(always)]
pub const fn out_endpoint10(&self) -> &OUT_ENDPOINT {
&self.out_endpoint10
}
#[doc = "0x460..0x478 - OUT Endpoint 11"]
#[inline(always)]
pub const fn out_endpoint11(&self) -> &OUT_ENDPOINT {
&self.out_endpoint11
#[doc = "0x100..0x250 - IN Endpoint %s"]
#[inline(always)]
pub const fn in_endpoint(&self, n: usize) -> &IN_ENDPOINT {
#[allow(clippy::no_effect)]
[(); 12][n];
unsafe {
&*(self as *const Self)
.cast::<u8>()
.add(256)
.add(32 * n)
.cast()
}
}
#[doc = "Iterator for array of:"]
#[doc = "0x100..0x250 - IN Endpoint %s"]
#[inline(always)]
pub fn in_endpoint_iter(&self) -> impl Iterator<Item = &IN_ENDPOINT> {
(0..12).map(|n| unsafe {
&*(self as *const Self)
.cast::<u8>()
.add(256)
.add(32 * n)
.cast()
})
}
#[doc = "0x300..0x420 - OUT Endpoint %s"]
#[inline(always)]
pub const fn out_endpoint(&self, n: usize) -> &OUT_ENDPOINT {
#[allow(clippy::no_effect)]
[(); 12][n];
unsafe {
&*(self as *const Self)
.cast::<u8>()
.add(768)
.add(32 * n)
.cast()
}
}
#[doc = "Iterator for array of:"]
#[doc = "0x300..0x420 - OUT Endpoint %s"]
#[inline(always)]
pub fn out_endpoint_iter(&self) -> impl Iterator<Item = &OUT_ENDPOINT> {
(0..12).map(|n| unsafe {
&*(self as *const Self)
.cast::<u8>()
.add(768)
.add(32 * n)
.cast()
})
}
}
#[doc = "DCFG (rw) register accessor: OTG_HS device configuration register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dcfg`]
Expand Down
12 changes: 10 additions & 2 deletions crates/bcm2711-lpa/src/usb_otg_global/hw_direction.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[doc = "Register `HW_DIRECTION` reader"]
pub type R = crate::R<HW_DIRECTION_SPEC>;
#[doc = "Field `DIRECTION[0-15]` reader - Direction %s"]
#[doc = "Field `DIRECTION(0-15)` reader - Direction %s"]
pub type DIRECTION_R = crate::FieldReader<DIRECTION_A>;
#[doc = "Direction %s"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -50,13 +50,21 @@ impl DIRECTION_R {
}
}
impl R {
#[doc = "Direction [0-15]\n\nNOTE: `n` is number of field in register. `n == 0` corresponds to `DIRECTION0` field"]
#[doc = "Direction (0-15)"]
#[doc = ""]
#[doc = "NOTE: `n` is number of field in register. `n == 0` corresponds to `DIRECTION0` field"]
#[inline(always)]
pub fn direction(&self, n: u8) -> DIRECTION_R {
#[allow(clippy::no_effect)]
[(); 16][n as usize];
DIRECTION_R::new(((self.bits >> (n * 2)) & 3) as u8)
}
#[doc = "Iterator for array of:"]
#[doc = "Direction (0-15)"]
#[inline(always)]
pub fn direction_iter(&self) -> impl Iterator<Item = DIRECTION_R> + '_ {
(0..16).map(move |n| DIRECTION_R::new(((self.bits >> (n * 2)) & 3) as u8))
}
#[doc = "Bits 0:1 - Direction 0"]
#[inline(always)]
pub fn direction0(&self) -> DIRECTION_R {
Expand Down
Loading

0 comments on commit 8055e82

Please sign in to comment.