Ver código fonte

spi: fix spi_ll.h func name

On esp32 and esp32s2:
``spi_ll_dma_set_out_eof_generation`` is modified to
``spi_ll_dma_set_rx_eof_generation``.

``spi_dma_ll_set_rx_eof_generation`` is modified to
``spi_dma_ll_set_out_eof_generation``.

Because on ESP32S3, this bit ``out_eof_mode`` is moved to DMA related
registers.
Armando 5 anos atrás
pai
commit
9c507982aa

+ 23 - 12
components/hal/esp32/include/hal/spi_ll.h

@@ -219,6 +219,17 @@ static inline void spi_ll_dma_tx_enable(spi_dev_t *hw, bool enable)
     //This is not used in esp32
 }
 
+/**
+ * Configuration of RX DMA EOF interrupt generation way
+ *
+ * @param hw     Beginning address of the peripheral registers.
+ * @param enable 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.
+ */
+static inline void spi_ll_dma_set_rx_eof_generation(spi_dev_t *hw, bool enable)
+{
+    //This is not used in esp32
+}
+
 /*------------------------------------------------------------------------------
  * Buffer
  *----------------------------------------------------------------------------*/
@@ -936,7 +947,7 @@ static inline void spi_dma_ll_rx_start(spi_dma_dev_t *dma_in, lldesc_t *addr)
  * @param dma_in  Beginning address of the DMA peripheral registers which stores the data received from a peripheral into RAM.
  * @param enable  True to enable, false to disable
  */
-static inline void spi_dma_ll_rx_enable_burst_data(spi_dma_dev_t *dma_out, bool enable)
+static inline void spi_dma_ll_rx_enable_burst_data(spi_dma_dev_t *dma_in, bool enable)
 {
     //This is not supported in esp32
 }
@@ -952,17 +963,6 @@ static inline void spi_dma_ll_rx_enable_burst_desc(spi_dma_dev_t *dma_in, bool e
     dma_in->dma_conf.indscr_burst_en = enable;
 }
 
-/**
- * Configuration of RX DMA EOF interrupt generation way
- *
- * @param dma_in  Beginning address of the DMA peripheral registers which stores the data received from a peripheral into RAM.
- * @param enable 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.
- */
-static inline void spi_dma_ll_set_rx_eof_generation(spi_dma_dev_t *dma_in, bool enable)
-{
-    //does not available in ESP32
-}
-
 /**
  * Reset TX DMA which transmits the data from RAM to a peripheral.
  *
@@ -1009,6 +1009,17 @@ static inline void spi_dma_ll_tx_enable_burst_desc(spi_dma_dev_t *dma_out, bool
     dma_out->dma_conf.outdscr_burst_en = enable;
 }
 
+/**
+ * Configuration of OUT EOF flag generation way
+ *
+ * @param dma_out Beginning address of the DMA peripheral registers which transmits the data from RAM to a peripheral.
+ * @param enable  1: when dma pop all data from fifo  0:when ahb push all data to fifo.
+ */
+static inline void spi_dma_ll_set_out_eof_generation(spi_dma_dev_t *dma_out, bool enable)
+{
+    dma_out->dma_conf.out_eof_mode = enable;
+}
+
 /**
  * Enable automatic outlink-writeback
  *

+ 17 - 17
components/hal/esp32s2/include/hal/spi_ll.h

@@ -266,14 +266,14 @@ static inline void spi_ll_dma_tx_enable(spi_dev_t *hw, bool enable)
 }
 
 /**
- * Configuration of OUT EOF flag generation way
+ * Configuration of RX DMA EOF interrupt generation way
  *
- * @param dma_out Beginning address of the DMA peripheral registers which transmits the data from RAM to a peripheral.
- * @param enable  1: when dma pop all data from fifo  0:when ahb push all data to fifo.
+ * @param hw     Beginning address of the peripheral registers.
+ * @param enable 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.
  */
-static inline void spi_ll_dma_set_out_eof_generation(spi_dma_dev_t *dma_out, bool enable)
+static inline void spi_ll_dma_set_rx_eof_generation(spi_dev_t *hw, bool enable)
 {
-    dma_out->dma_conf.out_eof_mode = enable;
+    hw->dma_conf.rx_eof_en = enable;
 }
 
 /*------------------------------------------------------------------------------
@@ -1085,7 +1085,7 @@ static inline void spi_dma_ll_rx_start(spi_dma_dev_t *dma_in, lldesc_t *addr)
  * @param dma_in  Beginning address of the DMA peripheral registers which stores the data received from a peripheral into RAM.
  * @param enable  True to enable, false to disable
  */
-static inline void spi_dma_ll_rx_enable_burst_data(spi_dma_dev_t *dma_out, bool enable)
+static inline void spi_dma_ll_rx_enable_burst_data(spi_dma_dev_t *dma_in, bool enable)
 {
     //This is not supported in esp32s2
 }
@@ -1101,17 +1101,6 @@ static inline void spi_dma_ll_rx_enable_burst_desc(spi_dma_dev_t *dma_in, bool e
     dma_in->dma_conf.indscr_burst_en = enable;
 }
 
-/**
- * Configuration of RX DMA EOF interrupt generation way
- *
- * @param dma_in  Beginning address of the DMA peripheral registers which stores the data received from a peripheral into RAM.
- * @param enable 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.
- */
-static inline void spi_dma_ll_set_rx_eof_generation(spi_dma_dev_t *dma_in, bool enable)
-{
-    dma_in->dma_conf.rx_eof_en = enable;
-}
-
 /**
  * Reset TX DMA which transmits the data from RAM to a peripheral.
  *
@@ -1159,6 +1148,17 @@ static inline void spi_dma_ll_tx_enable_burst_desc(spi_dma_dev_t *dma_out, bool
     dma_out->dma_conf.outdscr_burst_en = enable;
 }
 
+/**
+ * Configuration of OUT EOF flag generation way
+ *
+ * @param dma_out Beginning address of the DMA peripheral registers which transmits the data from RAM to a peripheral.
+ * @param enable  1: when dma pop all data from fifo  0:when ahb push all data to fifo.
+ */
+static inline void spi_dma_ll_set_out_eof_generation(spi_dma_dev_t *dma_out, bool enable)
+{
+    dma_out->dma_conf.out_eof_mode = enable;
+}
+
 /**
  * Enable automatic outlink-writeback
  *