Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPI collect W && UHCI::REG_Q regs #224

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions common_patches/spi_w.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_array:
"W*":
_modify:
"BUF*":
name: BUF
BUF: [0, 0xffff_ffff]
14 changes: 14 additions & 0 deletions common_patches/uhci_collect.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
REG_Q?_WORD?:
_modify:
SEND_Q?_WORD?:
name: SEND_WORD

_cluster:
REG_Q%s:
REG_Q?_WORD0:
name: WORD0
REG_Q?_WORD1:
name: WORD1

_array:
ESC_CONF?: {}
170 changes: 13 additions & 157 deletions esp32/src/spi0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,9 @@ pub struct RegisterBlock {
sram_dwr_cmd: SRAM_DWR_CMD,
slv_rd_bit: SLV_RD_BIT,
_reserved26: [u8; 0x18],
w0: W0,
w1: W1,
w2: W2,
w3: W3,
w4: W4,
w5: W5,
w6: W6,
w7: W7,
w8: W8,
w9: W9,
w10: W10,
w11: W11,
w12: W12,
w13: W13,
w14: W14,
w15: W15,
w: [W; 16],
tx_crc: TX_CRC,
_reserved43: [u8; 0x2c],
_reserved28: [u8; 0x2c],
ext0: EXT0,
ext1: EXT1,
ext2: EXT2,
Expand All @@ -71,7 +56,7 @@ pub struct RegisterBlock {
outlink_dscr_bf1: OUTLINK_DSCR_BF1,
dma_rstatus: DMA_RSTATUS,
dma_tstatus: DMA_TSTATUS,
_reserved67: [u8; 0x02ac],
_reserved52: [u8; 0x02ac],
date: DATE,
}
impl RegisterBlock {
Expand Down Expand Up @@ -205,85 +190,16 @@ impl RegisterBlock {
pub const fn slv_rd_bit(&self) -> &SLV_RD_BIT {
&self.slv_rd_bit
}
#[doc = "0x80 - "]
#[doc = "0x80..0xc0 - "]
#[inline(always)]
pub const fn w0(&self) -> &W0 {
&self.w0
pub const fn w(&self, n: usize) -> &W {
MabezDev marked this conversation as resolved.
Show resolved Hide resolved
&self.w[n]
}
#[doc = "0x84 - "]
#[doc = "Iterator for array of:"]
#[doc = "0x80..0xc0 - "]
#[inline(always)]
pub const fn w1(&self) -> &W1 {
&self.w1
}
#[doc = "0x88 - "]
#[inline(always)]
pub const fn w2(&self) -> &W2 {
&self.w2
}
#[doc = "0x8c - "]
#[inline(always)]
pub const fn w3(&self) -> &W3 {
&self.w3
}
#[doc = "0x90 - "]
#[inline(always)]
pub const fn w4(&self) -> &W4 {
&self.w4
}
#[doc = "0x94 - "]
#[inline(always)]
pub const fn w5(&self) -> &W5 {
&self.w5
}
#[doc = "0x98 - "]
#[inline(always)]
pub const fn w6(&self) -> &W6 {
&self.w6
}
#[doc = "0x9c - "]
#[inline(always)]
pub const fn w7(&self) -> &W7 {
&self.w7
}
#[doc = "0xa0 - "]
#[inline(always)]
pub const fn w8(&self) -> &W8 {
&self.w8
}
#[doc = "0xa4 - "]
#[inline(always)]
pub const fn w9(&self) -> &W9 {
&self.w9
}
#[doc = "0xa8 - "]
#[inline(always)]
pub const fn w10(&self) -> &W10 {
&self.w10
}
#[doc = "0xac - "]
#[inline(always)]
pub const fn w11(&self) -> &W11 {
&self.w11
}
#[doc = "0xb0 - "]
#[inline(always)]
pub const fn w12(&self) -> &W12 {
&self.w12
}
#[doc = "0xb4 - "]
#[inline(always)]
pub const fn w13(&self) -> &W13 {
&self.w13
}
#[doc = "0xb8 - "]
#[inline(always)]
pub const fn w14(&self) -> &W14 {
&self.w14
}
#[doc = "0xbc - "]
#[inline(always)]
pub const fn w15(&self) -> &W15 {
&self.w15
pub fn w_iter(&self) -> impl Iterator<Item = &W> {
self.w.iter()
}
#[doc = "0xc0 - "]
#[inline(always)]
Expand Down Expand Up @@ -520,70 +436,10 @@ pub mod sram_dwr_cmd;
pub type SLV_RD_BIT = crate::Reg<slv_rd_bit::SLV_RD_BIT_SPEC>;
#[doc = ""]
pub mod slv_rd_bit;
#[doc = "W0 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w0::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 [`w0::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@w0`] module"]
pub type W0 = crate::Reg<w0::W0_SPEC>;
#[doc = ""]
pub mod w0;
#[doc = "W1 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w1::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 [`w1::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@w1`] module"]
pub type W1 = crate::Reg<w1::W1_SPEC>;
#[doc = ""]
pub mod w1;
#[doc = "W2 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w2::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 [`w2::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@w2`] module"]
pub type W2 = crate::Reg<w2::W2_SPEC>;
#[doc = ""]
pub mod w2;
#[doc = "W3 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w3::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 [`w3::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@w3`] module"]
pub type W3 = crate::Reg<w3::W3_SPEC>;
#[doc = ""]
pub mod w3;
#[doc = "W4 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w4::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 [`w4::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@w4`] module"]
pub type W4 = crate::Reg<w4::W4_SPEC>;
#[doc = ""]
pub mod w4;
#[doc = "W5 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w5::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 [`w5::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@w5`] module"]
pub type W5 = crate::Reg<w5::W5_SPEC>;
#[doc = ""]
pub mod w5;
#[doc = "W6 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w6::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 [`w6::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@w6`] module"]
pub type W6 = crate::Reg<w6::W6_SPEC>;
#[doc = ""]
pub mod w6;
#[doc = "W7 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w7::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 [`w7::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@w7`] module"]
pub type W7 = crate::Reg<w7::W7_SPEC>;
#[doc = ""]
pub mod w7;
#[doc = "W8 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w8::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 [`w8::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@w8`] module"]
pub type W8 = crate::Reg<w8::W8_SPEC>;
#[doc = ""]
pub mod w8;
#[doc = "W9 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w9::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 [`w9::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@w9`] module"]
pub type W9 = crate::Reg<w9::W9_SPEC>;
#[doc = ""]
pub mod w9;
#[doc = "W10 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w10::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 [`w10::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@w10`] module"]
pub type W10 = crate::Reg<w10::W10_SPEC>;
#[doc = ""]
pub mod w10;
#[doc = "W11 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w11::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 [`w11::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@w11`] module"]
pub type W11 = crate::Reg<w11::W11_SPEC>;
#[doc = ""]
pub mod w11;
#[doc = "W12 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w12::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 [`w12::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@w12`] module"]
pub type W12 = crate::Reg<w12::W12_SPEC>;
#[doc = ""]
pub mod w12;
#[doc = "W13 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w13::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 [`w13::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@w13`] module"]
pub type W13 = crate::Reg<w13::W13_SPEC>;
#[doc = ""]
pub mod w13;
#[doc = "W14 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w14::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 [`w14::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@w14`] module"]
pub type W14 = crate::Reg<w14::W14_SPEC>;
#[doc = ""]
pub mod w14;
#[doc = "W15 (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w15::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 [`w15::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@w15`] module"]
pub type W15 = crate::Reg<w15::W15_SPEC>;
#[doc = "W (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w::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 [`w::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@w`] module"]
pub type W = crate::Reg<w::W_SPEC>;
#[doc = ""]
pub mod w15;
pub mod w;
#[doc = "TX_CRC (rw) register accessor: \n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_crc::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 [`tx_crc::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@tx_crc`] module"]
pub type TX_CRC = crate::Reg<tx_crc::TX_CRC_SPEC>;
#[doc = ""]
Expand Down
54 changes: 54 additions & 0 deletions esp32/src/spi0/w.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#[doc = "Register `W%s` reader"]
pub type R = crate::R<W_SPEC>;
#[doc = "Register `W%s` writer"]
pub type W = crate::W<W_SPEC>;
#[doc = "Field `BUF` reader - data buffer"]
pub type BUF_R = crate::FieldReader<u32>;
#[doc = "Field `BUF` writer - data buffer"]
pub type BUF_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32, crate::Safe>;
impl R {
#[doc = "Bits 0:31 - data buffer"]
#[inline(always)]
pub fn buf(&self) -> BUF_R {
BUF_R::new(self.bits)
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("W")
.field("buf", &format_args!("{}", self.buf().bits()))
.finish()
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for crate::generic::Reg<W_SPEC> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
core::fmt::Debug::fmt(&self.read(), f)
}
}
impl W {
#[doc = "Bits 0:31 - data buffer"]
#[inline(always)]
#[must_use]
pub fn buf(&mut self) -> BUF_W<W_SPEC> {
BUF_W::new(self, 0)
}
}
#[doc = "\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`w::R`](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 [`w::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct W_SPEC;
impl crate::RegisterSpec for W_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [`w::R`](R) reader structure"]
impl crate::Readable for W_SPEC {}
#[doc = "`write(|w| ..)` method takes [`w::W`](W) writer structure"]
impl crate::Writable for W_SPEC {
type Safety = crate::Safe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets W%s to value 0"]
impl crate::Resettable for W_SPEC {
const RESET_VALUE: u32 = 0;
}
54 changes: 0 additions & 54 deletions esp32/src/spi0/w0.rs

This file was deleted.

54 changes: 0 additions & 54 deletions esp32/src/spi0/w1.rs

This file was deleted.

Loading