1#[doc = "Register `DMA_CONF` reader"]
2pub type R = crate::R<DMA_CONF_SPEC>;
3#[doc = "Register `DMA_CONF` writer"]
4pub type W = crate::W<DMA_CONF_SPEC>;
5#[doc = "Field `DMA_OUTFIFO_EMPTY` reader - Records the status of DMA TX FIFO. 1: DMA TX FIFO is not ready for sending data. 0: DMA TX FIFO is ready for sending data."]
6pub type DMA_OUTFIFO_EMPTY_R = crate::BitReader;
7#[doc = "Field `DMA_INFIFO_FULL` reader - Records the status of DMA RX FIFO. 1: DMA RX FIFO is not ready for receiving data. 0: DMA RX FIFO is ready for receiving data."]
8pub type DMA_INFIFO_FULL_R = crate::BitReader;
9#[doc = "Field `DMA_SLV_SEG_TRANS_EN` reader - Enable dma segment transfer in spi dma half slave mode. 1: enable. 0: disable."]
10pub type DMA_SLV_SEG_TRANS_EN_R = crate::BitReader;
11#[doc = "Field `DMA_SLV_SEG_TRANS_EN` writer - Enable dma segment transfer in spi dma half slave mode. 1: enable. 0: disable."]
12pub type DMA_SLV_SEG_TRANS_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SLV_RX_SEG_TRANS_CLR_EN` reader - 1: spi_dma_infifo_full_vld is cleared by spi slave cmd 5. 0: spi_dma_infifo_full_vld is cleared by spi_trans_done."]
14pub type SLV_RX_SEG_TRANS_CLR_EN_R = crate::BitReader;
15#[doc = "Field `SLV_RX_SEG_TRANS_CLR_EN` writer - 1: spi_dma_infifo_full_vld is cleared by spi slave cmd 5. 0: spi_dma_infifo_full_vld is cleared by spi_trans_done."]
16pub type SLV_RX_SEG_TRANS_CLR_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `SLV_TX_SEG_TRANS_CLR_EN` reader - 1: spi_dma_outfifo_empty_vld is cleared by spi slave cmd 6. 0: spi_dma_outfifo_empty_vld is cleared by spi_trans_done."]
18pub type SLV_TX_SEG_TRANS_CLR_EN_R = crate::BitReader;
19#[doc = "Field `SLV_TX_SEG_TRANS_CLR_EN` writer - 1: spi_dma_outfifo_empty_vld is cleared by spi slave cmd 6. 0: spi_dma_outfifo_empty_vld is cleared by spi_trans_done."]
20pub type SLV_TX_SEG_TRANS_CLR_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `RX_EOF_EN` reader - 1: spi_dma_inlink_eof is set when the number of dma pushed data bytes is equal to the value of spi_slv/mst_dma_rd_bytelen\\[19:0\\] in spi dma transition. 0: spi_dma_inlink_eof is set by spi_trans_done in non-seg-trans or spi_dma_seg_trans_done in seg-trans."]
22pub type RX_EOF_EN_R = crate::BitReader;
23#[doc = "Field `RX_EOF_EN` writer - 1: spi_dma_inlink_eof is set when the number of dma pushed data bytes is equal to the value of spi_slv/mst_dma_rd_bytelen\\[19:0\\] in spi dma transition. 0: spi_dma_inlink_eof is set by spi_trans_done in non-seg-trans or spi_dma_seg_trans_done in seg-trans."]
24pub type RX_EOF_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `DMA_RX_ENA` reader - Set this bit to enable SPI DMA controlled receive data mode."]
26pub type DMA_RX_ENA_R = crate::BitReader;
27#[doc = "Field `DMA_RX_ENA` writer - Set this bit to enable SPI DMA controlled receive data mode."]
28pub type DMA_RX_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `DMA_TX_ENA` reader - Set this bit to enable SPI DMA controlled send data mode."]
30pub type DMA_TX_ENA_R = crate::BitReader;
31#[doc = "Field `DMA_TX_ENA` writer - Set this bit to enable SPI DMA controlled send data mode."]
32pub type DMA_TX_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `RX_AFIFO_RST` writer - Set this bit to reset RX AFIFO, which is used to receive data in SPI master and slave mode transfer."]
34pub type RX_AFIFO_RST_W<'a, REG> = crate::BitWriter<'a, REG>;
35#[doc = "Field `BUF_AFIFO_RST` writer - Set this bit to reset BUF TX AFIFO, which is used send data out in SPI slave CPU controlled mode transfer and master mode transfer."]
36pub type BUF_AFIFO_RST_W<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `DMA_AFIFO_RST` writer - Set this bit to reset DMA TX AFIFO, which is used to send data out in SPI slave DMA controlled mode transfer."]
38pub type DMA_AFIFO_RST_W<'a, REG> = crate::BitWriter<'a, REG>;
39impl R {
40 #[doc = "Bit 0 - Records the status of DMA TX FIFO. 1: DMA TX FIFO is not ready for sending data. 0: DMA TX FIFO is ready for sending data."]
41 #[inline(always)]
42 pub fn dma_outfifo_empty(&self) -> DMA_OUTFIFO_EMPTY_R {
43 DMA_OUTFIFO_EMPTY_R::new((self.bits & 1) != 0)
44 }
45 #[doc = "Bit 1 - Records the status of DMA RX FIFO. 1: DMA RX FIFO is not ready for receiving data. 0: DMA RX FIFO is ready for receiving data."]
46 #[inline(always)]
47 pub fn dma_infifo_full(&self) -> DMA_INFIFO_FULL_R {
48 DMA_INFIFO_FULL_R::new(((self.bits >> 1) & 1) != 0)
49 }
50 #[doc = "Bit 18 - Enable dma segment transfer in spi dma half slave mode. 1: enable. 0: disable."]
51 #[inline(always)]
52 pub fn dma_slv_seg_trans_en(&self) -> DMA_SLV_SEG_TRANS_EN_R {
53 DMA_SLV_SEG_TRANS_EN_R::new(((self.bits >> 18) & 1) != 0)
54 }
55 #[doc = "Bit 19 - 1: spi_dma_infifo_full_vld is cleared by spi slave cmd 5. 0: spi_dma_infifo_full_vld is cleared by spi_trans_done."]
56 #[inline(always)]
57 pub fn slv_rx_seg_trans_clr_en(&self) -> SLV_RX_SEG_TRANS_CLR_EN_R {
58 SLV_RX_SEG_TRANS_CLR_EN_R::new(((self.bits >> 19) & 1) != 0)
59 }
60 #[doc = "Bit 20 - 1: spi_dma_outfifo_empty_vld is cleared by spi slave cmd 6. 0: spi_dma_outfifo_empty_vld is cleared by spi_trans_done."]
61 #[inline(always)]
62 pub fn slv_tx_seg_trans_clr_en(&self) -> SLV_TX_SEG_TRANS_CLR_EN_R {
63 SLV_TX_SEG_TRANS_CLR_EN_R::new(((self.bits >> 20) & 1) != 0)
64 }
65 #[doc = "Bit 21 - 1: spi_dma_inlink_eof is set when the number of dma pushed data bytes is equal to the value of spi_slv/mst_dma_rd_bytelen\\[19:0\\] in spi dma transition. 0: spi_dma_inlink_eof is set by spi_trans_done in non-seg-trans or spi_dma_seg_trans_done in seg-trans."]
66 #[inline(always)]
67 pub fn rx_eof_en(&self) -> RX_EOF_EN_R {
68 RX_EOF_EN_R::new(((self.bits >> 21) & 1) != 0)
69 }
70 #[doc = "Bit 27 - Set this bit to enable SPI DMA controlled receive data mode."]
71 #[inline(always)]
72 pub fn dma_rx_ena(&self) -> DMA_RX_ENA_R {
73 DMA_RX_ENA_R::new(((self.bits >> 27) & 1) != 0)
74 }
75 #[doc = "Bit 28 - Set this bit to enable SPI DMA controlled send data mode."]
76 #[inline(always)]
77 pub fn dma_tx_ena(&self) -> DMA_TX_ENA_R {
78 DMA_TX_ENA_R::new(((self.bits >> 28) & 1) != 0)
79 }
80}
81#[cfg(feature = "impl-register-debug")]
82impl core::fmt::Debug for R {
83 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
84 f.debug_struct("DMA_CONF")
85 .field(
86 "dma_outfifo_empty",
87 &format_args!("{}", self.dma_outfifo_empty().bit()),
88 )
89 .field(
90 "dma_infifo_full",
91 &format_args!("{}", self.dma_infifo_full().bit()),
92 )
93 .field(
94 "dma_slv_seg_trans_en",
95 &format_args!("{}", self.dma_slv_seg_trans_en().bit()),
96 )
97 .field(
98 "slv_rx_seg_trans_clr_en",
99 &format_args!("{}", self.slv_rx_seg_trans_clr_en().bit()),
100 )
101 .field(
102 "slv_tx_seg_trans_clr_en",
103 &format_args!("{}", self.slv_tx_seg_trans_clr_en().bit()),
104 )
105 .field("rx_eof_en", &format_args!("{}", self.rx_eof_en().bit()))
106 .field("dma_rx_ena", &format_args!("{}", self.dma_rx_ena().bit()))
107 .field("dma_tx_ena", &format_args!("{}", self.dma_tx_ena().bit()))
108 .finish()
109 }
110}
111#[cfg(feature = "impl-register-debug")]
112impl core::fmt::Debug for crate::generic::Reg<DMA_CONF_SPEC> {
113 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
114 core::fmt::Debug::fmt(&self.read(), f)
115 }
116}
117impl W {
118 #[doc = "Bit 18 - Enable dma segment transfer in spi dma half slave mode. 1: enable. 0: disable."]
119 #[inline(always)]
120 #[must_use]
121 pub fn dma_slv_seg_trans_en(&mut self) -> DMA_SLV_SEG_TRANS_EN_W<DMA_CONF_SPEC> {
122 DMA_SLV_SEG_TRANS_EN_W::new(self, 18)
123 }
124 #[doc = "Bit 19 - 1: spi_dma_infifo_full_vld is cleared by spi slave cmd 5. 0: spi_dma_infifo_full_vld is cleared by spi_trans_done."]
125 #[inline(always)]
126 #[must_use]
127 pub fn slv_rx_seg_trans_clr_en(&mut self) -> SLV_RX_SEG_TRANS_CLR_EN_W<DMA_CONF_SPEC> {
128 SLV_RX_SEG_TRANS_CLR_EN_W::new(self, 19)
129 }
130 #[doc = "Bit 20 - 1: spi_dma_outfifo_empty_vld is cleared by spi slave cmd 6. 0: spi_dma_outfifo_empty_vld is cleared by spi_trans_done."]
131 #[inline(always)]
132 #[must_use]
133 pub fn slv_tx_seg_trans_clr_en(&mut self) -> SLV_TX_SEG_TRANS_CLR_EN_W<DMA_CONF_SPEC> {
134 SLV_TX_SEG_TRANS_CLR_EN_W::new(self, 20)
135 }
136 #[doc = "Bit 21 - 1: spi_dma_inlink_eof is set when the number of dma pushed data bytes is equal to the value of spi_slv/mst_dma_rd_bytelen\\[19:0\\] in spi dma transition. 0: spi_dma_inlink_eof is set by spi_trans_done in non-seg-trans or spi_dma_seg_trans_done in seg-trans."]
137 #[inline(always)]
138 #[must_use]
139 pub fn rx_eof_en(&mut self) -> RX_EOF_EN_W<DMA_CONF_SPEC> {
140 RX_EOF_EN_W::new(self, 21)
141 }
142 #[doc = "Bit 27 - Set this bit to enable SPI DMA controlled receive data mode."]
143 #[inline(always)]
144 #[must_use]
145 pub fn dma_rx_ena(&mut self) -> DMA_RX_ENA_W<DMA_CONF_SPEC> {
146 DMA_RX_ENA_W::new(self, 27)
147 }
148 #[doc = "Bit 28 - Set this bit to enable SPI DMA controlled send data mode."]
149 #[inline(always)]
150 #[must_use]
151 pub fn dma_tx_ena(&mut self) -> DMA_TX_ENA_W<DMA_CONF_SPEC> {
152 DMA_TX_ENA_W::new(self, 28)
153 }
154 #[doc = "Bit 29 - Set this bit to reset RX AFIFO, which is used to receive data in SPI master and slave mode transfer."]
155 #[inline(always)]
156 #[must_use]
157 pub fn rx_afifo_rst(&mut self) -> RX_AFIFO_RST_W<DMA_CONF_SPEC> {
158 RX_AFIFO_RST_W::new(self, 29)
159 }
160 #[doc = "Bit 30 - Set this bit to reset BUF TX AFIFO, which is used send data out in SPI slave CPU controlled mode transfer and master mode transfer."]
161 #[inline(always)]
162 #[must_use]
163 pub fn buf_afifo_rst(&mut self) -> BUF_AFIFO_RST_W<DMA_CONF_SPEC> {
164 BUF_AFIFO_RST_W::new(self, 30)
165 }
166 #[doc = "Bit 31 - Set this bit to reset DMA TX AFIFO, which is used to send data out in SPI slave DMA controlled mode transfer."]
167 #[inline(always)]
168 #[must_use]
169 pub fn dma_afifo_rst(&mut self) -> DMA_AFIFO_RST_W<DMA_CONF_SPEC> {
170 DMA_AFIFO_RST_W::new(self, 31)
171 }
172}
173#[doc = "SPI DMA control register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dma_conf::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 [`dma_conf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
174pub struct DMA_CONF_SPEC;
175impl crate::RegisterSpec for DMA_CONF_SPEC {
176 type Ux = u32;
177}
178#[doc = "`read()` method returns [`dma_conf::R`](R) reader structure"]
179impl crate::Readable for DMA_CONF_SPEC {}
180#[doc = "`write(|w| ..)` method takes [`dma_conf::W`](W) writer structure"]
181impl crate::Writable for DMA_CONF_SPEC {
182 type Safety = crate::Unsafe;
183 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
184 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
185}
186#[doc = "`reset()` method sets DMA_CONF to value 0x03"]
187impl crate::Resettable for DMA_CONF_SPEC {
188 const RESET_VALUE: u32 = 0x03;
189}