Skip to content

Commit ea6316e

Browse files
authored
ESP32 SPI: explode INT_EN bits (#304)
1 parent cfcabec commit ea6316e

File tree

2 files changed

+94
-11
lines changed

2 files changed

+94
-11
lines changed

esp32/src/spi0/slave.rs

+71-11
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,26 @@ pub type SLV_WR_STA_DONE_W<'a, REG> = crate::BitWriter<'a, REG>;
2222
pub type TRANS_DONE_R = crate::BitReader;
2323
#[doc = "Field `TRANS_DONE` writer - The interrupt raw bit for the completion of any operation in both the master mode and the slave mode."]
2424
pub type TRANS_DONE_W<'a, REG> = crate::BitWriter<'a, REG>;
25-
#[doc = "Field `INT_EN` reader - Interrupt enable bits for the below 5 sources"]
26-
pub type INT_EN_R = crate::FieldReader;
27-
#[doc = "Field `INT_EN` writer - Interrupt enable bits for the below 5 sources"]
28-
pub type INT_EN_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
25+
#[doc = "Field `SLV_RD_BUF_INTEN` reader - The interrupt enable bit for the SPI_SLV_RD_BUF_INT interrupt."]
26+
pub type SLV_RD_BUF_INTEN_R = crate::BitReader;
27+
#[doc = "Field `SLV_RD_BUF_INTEN` writer - The interrupt enable bit for the SPI_SLV_RD_BUF_INT interrupt."]
28+
pub type SLV_RD_BUF_INTEN_W<'a, REG> = crate::BitWriter<'a, REG>;
29+
#[doc = "Field `SLV_WR_BUF_INTEN` reader - The interrupt enable bit for the SPI_SLV_WR_BUF_INT interrupt."]
30+
pub type SLV_WR_BUF_INTEN_R = crate::BitReader;
31+
#[doc = "Field `SLV_WR_BUF_INTEN` writer - The interrupt enable bit for the SPI_SLV_WR_BUF_INT interrupt."]
32+
pub type SLV_WR_BUF_INTEN_W<'a, REG> = crate::BitWriter<'a, REG>;
33+
#[doc = "Field `SLV_RD_STA_INTEN` reader - The interrupt enable bit for the SPI_SLV_RD_STA_INT interrupt."]
34+
pub type SLV_RD_STA_INTEN_R = crate::BitReader;
35+
#[doc = "Field `SLV_RD_STA_INTEN` writer - The interrupt enable bit for the SPI_SLV_RD_STA_INT interrupt."]
36+
pub type SLV_RD_STA_INTEN_W<'a, REG> = crate::BitWriter<'a, REG>;
37+
#[doc = "Field `SLV_WR_STA_INTEN` reader - The interrupt enable bit for the SPI_SLV_WR_STA_INT interrupt."]
38+
pub type SLV_WR_STA_INTEN_R = crate::BitReader;
39+
#[doc = "Field `SLV_WR_STA_INTEN` writer - The interrupt enable bit for the SPI_SLV_WR_STA_INT interrupt."]
40+
pub type SLV_WR_STA_INTEN_W<'a, REG> = crate::BitWriter<'a, REG>;
41+
#[doc = "Field `TRANS_INTEN` reader - The interrupt enable bit for the SPI_TRANS_DONE_INT interrupt."]
42+
pub type TRANS_INTEN_R = crate::BitReader;
43+
#[doc = "Field `TRANS_INTEN` writer - The interrupt enable bit for the SPI_TRANS_DONE_INT interrupt."]
44+
pub type TRANS_INTEN_W<'a, REG> = crate::BitWriter<'a, REG>;
2945
#[doc = "Field `CS_I_MODE` reader - In the slave mode this bits used to synchronize the input spi cs signal and eliminate spi cs jitter."]
3046
pub type CS_I_MODE_R = crate::FieldReader;
3147
#[doc = "Field `CS_I_MODE` writer - In the slave mode this bits used to synchronize the input spi cs signal and eliminate spi cs jitter."]
@@ -82,10 +98,30 @@ impl R {
8298
pub fn trans_done(&self) -> TRANS_DONE_R {
8399
TRANS_DONE_R::new(((self.bits >> 4) & 1) != 0)
84100
}
85-
#[doc = "Bits 5:9 - Interrupt enable bits for the below 5 sources"]
101+
#[doc = "Bit 5 - The interrupt enable bit for the SPI_SLV_RD_BUF_INT interrupt."]
86102
#[inline(always)]
87-
pub fn int_en(&self) -> INT_EN_R {
88-
INT_EN_R::new(((self.bits >> 5) & 0x1f) as u8)
103+
pub fn slv_rd_buf_inten(&self) -> SLV_RD_BUF_INTEN_R {
104+
SLV_RD_BUF_INTEN_R::new(((self.bits >> 5) & 1) != 0)
105+
}
106+
#[doc = "Bit 6 - The interrupt enable bit for the SPI_SLV_WR_BUF_INT interrupt."]
107+
#[inline(always)]
108+
pub fn slv_wr_buf_inten(&self) -> SLV_WR_BUF_INTEN_R {
109+
SLV_WR_BUF_INTEN_R::new(((self.bits >> 6) & 1) != 0)
110+
}
111+
#[doc = "Bit 7 - The interrupt enable bit for the SPI_SLV_RD_STA_INT interrupt."]
112+
#[inline(always)]
113+
pub fn slv_rd_sta_inten(&self) -> SLV_RD_STA_INTEN_R {
114+
SLV_RD_STA_INTEN_R::new(((self.bits >> 7) & 1) != 0)
115+
}
116+
#[doc = "Bit 8 - The interrupt enable bit for the SPI_SLV_WR_STA_INT interrupt."]
117+
#[inline(always)]
118+
pub fn slv_wr_sta_inten(&self) -> SLV_WR_STA_INTEN_R {
119+
SLV_WR_STA_INTEN_R::new(((self.bits >> 8) & 1) != 0)
120+
}
121+
#[doc = "Bit 9 - The interrupt enable bit for the SPI_TRANS_DONE_INT interrupt."]
122+
#[inline(always)]
123+
pub fn trans_inten(&self) -> TRANS_INTEN_R {
124+
TRANS_INTEN_R::new(((self.bits >> 9) & 1) != 0)
89125
}
90126
#[doc = "Bits 10:11 - In the slave mode this bits used to synchronize the input spi cs signal and eliminate spi cs jitter."]
91127
#[inline(always)]
@@ -142,7 +178,6 @@ impl core::fmt::Debug for R {
142178
.field("slv_rd_sta_done", &self.slv_rd_sta_done())
143179
.field("slv_wr_sta_done", &self.slv_wr_sta_done())
144180
.field("trans_done", &self.trans_done())
145-
.field("int_en", &self.int_en())
146181
.field("cs_i_mode", &self.cs_i_mode())
147182
.field("slv_last_command", &self.slv_last_command())
148183
.field("slv_last_state", &self.slv_last_state())
@@ -152,6 +187,11 @@ impl core::fmt::Debug for R {
152187
.field("slv_wr_rd_buf_en", &self.slv_wr_rd_buf_en())
153188
.field("mode", &self.mode())
154189
.field("sync_reset", &self.sync_reset())
190+
.field("trans_inten", &self.trans_inten())
191+
.field("slv_wr_sta_inten", &self.slv_wr_sta_inten())
192+
.field("slv_rd_sta_inten", &self.slv_rd_sta_inten())
193+
.field("slv_wr_buf_inten", &self.slv_wr_buf_inten())
194+
.field("slv_rd_buf_inten", &self.slv_rd_buf_inten())
155195
.finish()
156196
}
157197
}
@@ -181,10 +221,30 @@ impl W {
181221
pub fn trans_done(&mut self) -> TRANS_DONE_W<SLAVE_SPEC> {
182222
TRANS_DONE_W::new(self, 4)
183223
}
184-
#[doc = "Bits 5:9 - Interrupt enable bits for the below 5 sources"]
224+
#[doc = "Bit 5 - The interrupt enable bit for the SPI_SLV_RD_BUF_INT interrupt."]
225+
#[inline(always)]
226+
pub fn slv_rd_buf_inten(&mut self) -> SLV_RD_BUF_INTEN_W<SLAVE_SPEC> {
227+
SLV_RD_BUF_INTEN_W::new(self, 5)
228+
}
229+
#[doc = "Bit 6 - The interrupt enable bit for the SPI_SLV_WR_BUF_INT interrupt."]
230+
#[inline(always)]
231+
pub fn slv_wr_buf_inten(&mut self) -> SLV_WR_BUF_INTEN_W<SLAVE_SPEC> {
232+
SLV_WR_BUF_INTEN_W::new(self, 6)
233+
}
234+
#[doc = "Bit 7 - The interrupt enable bit for the SPI_SLV_RD_STA_INT interrupt."]
235+
#[inline(always)]
236+
pub fn slv_rd_sta_inten(&mut self) -> SLV_RD_STA_INTEN_W<SLAVE_SPEC> {
237+
SLV_RD_STA_INTEN_W::new(self, 7)
238+
}
239+
#[doc = "Bit 8 - The interrupt enable bit for the SPI_SLV_WR_STA_INT interrupt."]
240+
#[inline(always)]
241+
pub fn slv_wr_sta_inten(&mut self) -> SLV_WR_STA_INTEN_W<SLAVE_SPEC> {
242+
SLV_WR_STA_INTEN_W::new(self, 8)
243+
}
244+
#[doc = "Bit 9 - The interrupt enable bit for the SPI_TRANS_DONE_INT interrupt."]
185245
#[inline(always)]
186-
pub fn int_en(&mut self) -> INT_EN_W<SLAVE_SPEC> {
187-
INT_EN_W::new(self, 5)
246+
pub fn trans_inten(&mut self) -> TRANS_INTEN_W<SLAVE_SPEC> {
247+
TRANS_INTEN_W::new(self, 9)
188248
}
189249
#[doc = "Bits 10:11 - In the slave mode this bits used to synchronize the input spi cs signal and eliminate spi cs jitter."]
190250
#[inline(always)]

esp32/svd/patches/esp32.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,29 @@ SPI0:
145145
bitOffset: 0
146146
bitWidth: 1
147147
access: read-write
148+
SLAVE:
149+
_delete: ["INT_EN"]
150+
_add:
151+
TRANS_INTEN:
152+
description: "The interrupt enable bit for the SPI_TRANS_DONE_INT interrupt."
153+
bitOffset: 9
154+
bitWidth: 1
155+
SLV_WR_STA_INTEN:
156+
description: "The interrupt enable bit for the SPI_SLV_WR_STA_INT interrupt."
157+
bitOffset: 8
158+
bitWidth: 1
159+
SLV_RD_STA_INTEN:
160+
description: "The interrupt enable bit for the SPI_SLV_RD_STA_INT interrupt."
161+
bitOffset: 7
162+
bitWidth: 1
163+
SLV_WR_BUF_INTEN:
164+
description: "The interrupt enable bit for the SPI_SLV_WR_BUF_INT interrupt."
165+
bitOffset: 6
166+
bitWidth: 1
167+
SLV_RD_BUF_INTEN:
168+
description: "The interrupt enable bit for the SPI_SLV_RD_BUF_INT interrupt."
169+
bitOffset: 5
170+
bitWidth: 1
148171
_include:
149172
- ../../../common_patches/spi_dma_int_strip.yaml
150173
- ../../../common_patches/spi_w.yaml

0 commit comments

Comments
 (0)