mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-03 00:21:44 +01:00
spi: multichip support
move hardcoded numbers, etc. into soc files. create headers for shared types which needs to be documented. (MINOR CHANGE)
This commit is contained in:
@@ -12,8 +12,11 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef _SOC_SPI_PINS_H_
|
||||
#define _SOC_SPI_PINS_H_
|
||||
#ifndef _SOC_SPI_CAPS_H_
|
||||
#define _SOC_SPI_CAPS_H_
|
||||
|
||||
#define SOC_SPI_PERIPH_NUM 3
|
||||
#define SOC_SPI_DMA_CHAN_NUM 2
|
||||
|
||||
#define SPI_PERIPH_NUM 3
|
||||
|
||||
@@ -41,4 +44,8 @@
|
||||
#define VSPI_IOMUX_PIN_NUM_WP 22
|
||||
#define VSPI_IOMUX_PIN_NUM_HD 21
|
||||
|
||||
#endif /* _SOC_SPI_PINS_H_ */
|
||||
#define SOC_SPI_MAXIMUM_BUFFER_SIZE 64
|
||||
|
||||
#define SOC_SPI_SUPPORT_AS_CS 1 //Support to toggle the CS while the clock toggles
|
||||
|
||||
#endif /* _SOC_SPI_CAPS_H_ */
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "soc/spi_periph.h"
|
||||
|
||||
#define FUNC_SPI 1 //all pins of SPI1, HSPI and VSPI shares this function number
|
||||
|
||||
/*
|
||||
Bunch of constants for every SPI peripheral: GPIO signals, irqs, hw addr of registers etc
|
||||
*/
|
||||
@@ -40,8 +42,8 @@ const spi_signal_conn_t spi_periph_signal[3] = {
|
||||
.irq = ETS_SPI1_INTR_SOURCE,
|
||||
.irq_dma = ETS_SPI1_DMA_INTR_SOURCE,
|
||||
.module = PERIPH_SPI_MODULE,
|
||||
.hw = &SPI1,
|
||||
.func = SPI_FUNC_NUM
|
||||
.func = FUNC_SPI,
|
||||
.hw = &SPI1
|
||||
}, {
|
||||
.spiclk_out = HSPICLK_OUT_IDX,
|
||||
.spiclk_in = HSPICLK_IN_IDX,
|
||||
@@ -64,8 +66,8 @@ const spi_signal_conn_t spi_periph_signal[3] = {
|
||||
.irq = ETS_SPI2_INTR_SOURCE,
|
||||
.irq_dma = ETS_SPI2_DMA_INTR_SOURCE,
|
||||
.module = PERIPH_HSPI_MODULE,
|
||||
.hw = &SPI2,
|
||||
.func = HSPI_FUNC_NUM
|
||||
.func = FUNC_SPI,
|
||||
.hw = &SPI2
|
||||
}, {
|
||||
.spiclk_out = VSPICLK_OUT_IDX,
|
||||
.spiclk_in = VSPICLK_IN_IDX,
|
||||
@@ -88,7 +90,7 @@ const spi_signal_conn_t spi_periph_signal[3] = {
|
||||
.irq = ETS_SPI3_INTR_SOURCE,
|
||||
.irq_dma = ETS_SPI3_DMA_INTR_SOURCE,
|
||||
.module = PERIPH_VSPI_MODULE,
|
||||
.hw = &SPI3,
|
||||
.func = VSPI_FUNC_NUM
|
||||
.func = FUNC_SPI,
|
||||
.hw = &SPI3
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user