Skip to content

Commit 597664a

Browse files
committed
SPI collect W regs
1 parent efd414c commit 597664a

File tree

281 files changed

+1064
-15472
lines changed

Some content is hidden

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

281 files changed

+1064
-15472
lines changed

common_patches/spi_w.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_array:
2+
"W*":
3+
_modify:
4+
"BUF*":
5+
name: BUF
6+
BUF: [0, 0xffff_ffff]

esp32/src/spi0.rs

+13-157
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,9 @@ pub struct RegisterBlock {
2929
sram_dwr_cmd: SRAM_DWR_CMD,
3030
slv_rd_bit: SLV_RD_BIT,
3131
_reserved26: [u8; 0x18],
32-
w0: W0,
33-
w1: W1,
34-
w2: W2,
35-
w3: W3,
36-
w4: W4,
37-
w5: W5,
38-
w6: W6,
39-
w7: W7,
40-
w8: W8,
41-
w9: W9,
42-
w10: W10,
43-
w11: W11,
44-
w12: W12,
45-
w13: W13,
46-
w14: W14,
47-
w15: W15,
32+
w: [W; 16],
4833
tx_crc: TX_CRC,
49-
_reserved43: [u8; 0x2c],
34+
_reserved28: [u8; 0x2c],
5035
ext0: EXT0,
5136
ext1: EXT1,
5237
ext2: EXT2,
@@ -71,7 +56,7 @@ pub struct RegisterBlock {
7156
outlink_dscr_bf1: OUTLINK_DSCR_BF1,
7257
dma_rstatus: DMA_RSTATUS,
7358
dma_tstatus: DMA_TSTATUS,
74-
_reserved67: [u8; 0x02ac],
59+
_reserved52: [u8; 0x02ac],
7560
date: DATE,
7661
}
7762
impl RegisterBlock {
@@ -205,85 +190,16 @@ impl RegisterBlock {
205190
pub const fn slv_rd_bit(&self) -> &SLV_RD_BIT {
206191
&self.slv_rd_bit
207192
}
208-
#[doc = "0x80 - "]
193+
#[doc = "0x80..0xc0 - "]
209194
#[inline(always)]
210-
pub const fn w0(&self) -> &W0 {
211-
&self.w0
195+
pub const fn w(&self, n: usize) -> &W {
196+
&self.w[n]
212197
}
213-
#[doc = "0x84 - "]
198+
#[doc = "Iterator for array of:"]
199+
#[doc = "0x80..0xc0 - "]
214200
#[inline(always)]
215-
pub const fn w1(&self) -> &W1 {
216-
&self.w1
217-
}
218-
#[doc = "0x88 - "]
219-
#[inline(always)]
220-
pub const fn w2(&self) -> &W2 {
221-
&self.w2
222-
}
223-
#[doc = "0x8c - "]
224-
#[inline(always)]
225-
pub const fn w3(&self) -> &W3 {
226-
&self.w3
227-
}
228-
#[doc = "0x90 - "]
229-
#[inline(always)]
230-
pub const fn w4(&self) -> &W4 {
231-
&self.w4
232-
}
233-
#[doc = "0x94 - "]
234-
#[inline(always)]
235-
pub const fn w5(&self) -> &W5 {
236-
&self.w5
237-
}
238-
#[doc = "0x98 - "]
239-
#[inline(always)]
240-
pub const fn w6(&self) -> &W6 {
241-
&self.w6
242-
}
243-
#[doc = "0x9c - "]
244-
#[inline(always)]
245-
pub const fn w7(&self) -> &W7 {
246-
&self.w7
247-
}
248-
#[doc = "0xa0 - "]
249-
#[inline(always)]
250-
pub const fn w8(&self) -> &W8 {
251-
&self.w8
252-
}
253-
#[doc = "0xa4 - "]
254-
#[inline(always)]
255-
pub const fn w9(&self) -> &W9 {
256-
&self.w9
257-
}
258-
#[doc = "0xa8 - "]
259-
#[inline(always)]
260-
pub const fn w10(&self) -> &W10 {
261-
&self.w10
262-
}
263-
#[doc = "0xac - "]
264-
#[inline(always)]
265-
pub const fn w11(&self) -> &W11 {
266-
&self.w11
267-
}
268-
#[doc = "0xb0 - "]
269-
#[inline(always)]
270-
pub const fn w12(&self) -> &W12 {
271-
&self.w12
272-
}
273-
#[doc = "0xb4 - "]
274-
#[inline(always)]
275-
pub const fn w13(&self) -> &W13 {
276-
&self.w13
277-
}
278-
#[doc = "0xb8 - "]
279-
#[inline(always)]
280-
pub const fn w14(&self) -> &W14 {
281-
&self.w14
282-
}
283-
#[doc = "0xbc - "]
284-
#[inline(always)]
285-
pub const fn w15(&self) -> &W15 {
286-
&self.w15
201+
pub fn w_iter(&self) -> impl Iterator<Item = &W> {
202+
self.w.iter()
287203
}
288204
#[doc = "0xc0 - "]
289205
#[inline(always)]
@@ -520,70 +436,10 @@ pub mod sram_dwr_cmd;
520436
pub type SLV_RD_BIT = crate::Reg<slv_rd_bit::SLV_RD_BIT_SPEC>;
521437
#[doc = ""]
522438
pub mod slv_rd_bit;
523-
#[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"]
524-
pub type W0 = crate::Reg<w0::W0_SPEC>;
525-
#[doc = ""]
526-
pub mod w0;
527-
#[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"]
528-
pub type W1 = crate::Reg<w1::W1_SPEC>;
529-
#[doc = ""]
530-
pub mod w1;
531-
#[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"]
532-
pub type W2 = crate::Reg<w2::W2_SPEC>;
533-
#[doc = ""]
534-
pub mod w2;
535-
#[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"]
536-
pub type W3 = crate::Reg<w3::W3_SPEC>;
537-
#[doc = ""]
538-
pub mod w3;
539-
#[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"]
540-
pub type W4 = crate::Reg<w4::W4_SPEC>;
541-
#[doc = ""]
542-
pub mod w4;
543-
#[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"]
544-
pub type W5 = crate::Reg<w5::W5_SPEC>;
545-
#[doc = ""]
546-
pub mod w5;
547-
#[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"]
548-
pub type W6 = crate::Reg<w6::W6_SPEC>;
549-
#[doc = ""]
550-
pub mod w6;
551-
#[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"]
552-
pub type W7 = crate::Reg<w7::W7_SPEC>;
553-
#[doc = ""]
554-
pub mod w7;
555-
#[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"]
556-
pub type W8 = crate::Reg<w8::W8_SPEC>;
557-
#[doc = ""]
558-
pub mod w8;
559-
#[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"]
560-
pub type W9 = crate::Reg<w9::W9_SPEC>;
561-
#[doc = ""]
562-
pub mod w9;
563-
#[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"]
564-
pub type W10 = crate::Reg<w10::W10_SPEC>;
565-
#[doc = ""]
566-
pub mod w10;
567-
#[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"]
568-
pub type W11 = crate::Reg<w11::W11_SPEC>;
569-
#[doc = ""]
570-
pub mod w11;
571-
#[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"]
572-
pub type W12 = crate::Reg<w12::W12_SPEC>;
573-
#[doc = ""]
574-
pub mod w12;
575-
#[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"]
576-
pub type W13 = crate::Reg<w13::W13_SPEC>;
577-
#[doc = ""]
578-
pub mod w13;
579-
#[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"]
580-
pub type W14 = crate::Reg<w14::W14_SPEC>;
581-
#[doc = ""]
582-
pub mod w14;
583-
#[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"]
584-
pub type W15 = crate::Reg<w15::W15_SPEC>;
439+
#[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"]
440+
pub type W = crate::Reg<w::W_SPEC>;
585441
#[doc = ""]
586-
pub mod w15;
442+
pub mod w;
587443
#[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"]
588444
pub type TX_CRC = crate::Reg<tx_crc::TX_CRC_SPEC>;
589445
#[doc = ""]

esp32/src/spi0/w.rs

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#[doc = "Register `W%s` reader"]
2+
pub type R = crate::R<W_SPEC>;
3+
#[doc = "Register `W%s` writer"]
4+
pub type W = crate::W<W_SPEC>;
5+
#[doc = "Field `BUF` reader - data buffer"]
6+
pub type BUF_R = crate::FieldReader<u32>;
7+
#[doc = "Field `BUF` writer - data buffer"]
8+
pub type BUF_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 32, u32>;
9+
impl R {
10+
#[doc = "Bits 0:31 - data buffer"]
11+
#[inline(always)]
12+
pub fn buf(&self) -> BUF_R {
13+
BUF_R::new(self.bits)
14+
}
15+
}
16+
#[cfg(feature = "impl-register-debug")]
17+
impl core::fmt::Debug for R {
18+
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
19+
f.debug_struct("W")
20+
.field("buf", &format_args!("{}", self.buf().bits()))
21+
.finish()
22+
}
23+
}
24+
#[cfg(feature = "impl-register-debug")]
25+
impl core::fmt::Debug for crate::generic::Reg<W_SPEC> {
26+
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
27+
core::fmt::Debug::fmt(&self.read(), f)
28+
}
29+
}
30+
impl W {
31+
#[doc = "Bits 0:31 - data buffer"]
32+
#[inline(always)]
33+
#[must_use]
34+
pub fn buf(&mut self) -> BUF_W<W_SPEC> {
35+
BUF_W::new(self, 0)
36+
}
37+
}
38+
#[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)."]
39+
pub struct W_SPEC;
40+
impl crate::RegisterSpec for W_SPEC {
41+
type Ux = u32;
42+
}
43+
#[doc = "`read()` method returns [`w::R`](R) reader structure"]
44+
impl crate::Readable for W_SPEC {}
45+
#[doc = "`write(|w| ..)` method takes [`w::W`](W) writer structure"]
46+
impl crate::Writable for W_SPEC {
47+
type Safety = crate::Safe;
48+
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
49+
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
50+
}
51+
#[doc = "`reset()` method sets W%s to value 0"]
52+
impl crate::Resettable for W_SPEC {
53+
const RESET_VALUE: u32 = 0;
54+
}

esp32/src/spi0/w0.rs

-54
This file was deleted.

esp32/src/spi0/w1.rs

-54
This file was deleted.

0 commit comments

Comments
 (0)