|
|
@@ -16,32 +16,29 @@
|
|
|
// All the tests using the header should use this definition as much as possible,
|
|
|
// so that the working host can be changed easily in the future.
|
|
|
#if CONFIG_IDF_TARGET_ESP32
|
|
|
-#define TEST_SPI_HOST HSPI_HOST
|
|
|
-#define TEST_SLAVE_HOST VSPI_HOST
|
|
|
-
|
|
|
-#define PIN_NUM_MISO HSPI_IOMUX_PIN_NUM_MISO
|
|
|
-#define PIN_NUM_MOSI HSPI_IOMUX_PIN_NUM_MOSI
|
|
|
-#define PIN_NUM_CLK HSPI_IOMUX_PIN_NUM_CLK
|
|
|
-#define PIN_NUM_CS HSPI_IOMUX_PIN_NUM_CS
|
|
|
-#define PIN_NUM_WP HSPI_IOMUX_PIN_NUM_WP
|
|
|
-#define PIN_NUM_HD HSPI_IOMUX_PIN_NUM_HD
|
|
|
-
|
|
|
-#define SLAVE_PIN_NUM_MISO VSPI_IOMUX_PIN_NUM_MISO
|
|
|
-#define SLAVE_PIN_NUM_MOSI VSPI_IOMUX_PIN_NUM_MOSI
|
|
|
-#define SLAVE_PIN_NUM_CLK VSPI_IOMUX_PIN_NUM_CLK
|
|
|
-#define SLAVE_PIN_NUM_CS VSPI_IOMUX_PIN_NUM_CS
|
|
|
-#define SLAVE_PIN_NUM_WP VSPI_IOMUX_PIN_NUM_WP
|
|
|
-#define SLAVE_PIN_NUM_HD VSPI_IOMUX_PIN_NUM_HD
|
|
|
-
|
|
|
-#define SLAVE_IOMUX_PIN_MISO VSPI_IOMUX_PIN_NUM_MISO
|
|
|
-#define SLAVE_IOMUX_PIN_MOSI VSPI_IOMUX_PIN_NUM_MOSI
|
|
|
-#define SLAVE_IOMUX_PIN_SCLK VSPI_IOMUX_PIN_NUM_CLK
|
|
|
-#define SLAVE_IOMUX_PIN_CS VSPI_IOMUX_PIN_NUM_CS
|
|
|
-
|
|
|
-#define MASTER_IOMUX_PIN_MISO HSPI_IOMUX_PIN_NUM_MISO
|
|
|
-#define MASTER_IOMUX_PIN_MOSI HSPI_IOMUX_PIN_NUM_MOSI
|
|
|
-#define MASTER_IOMUX_PIN_SCLK HSPI_IOMUX_PIN_NUM_CLK
|
|
|
-#define MASTER_IOMUX_PIN_CS HSPI_IOMUX_PIN_NUM_CS
|
|
|
+#define TEST_SPI_HOST SPI2_HOST
|
|
|
+#define TEST_SLAVE_HOST SPI3_HOST
|
|
|
+
|
|
|
+#define PIN_NUM_MISO SPI2_IOMUX_PIN_NUM_MISO
|
|
|
+#define PIN_NUM_MOSI SPI2_IOMUX_PIN_NUM_MOSI
|
|
|
+#define PIN_NUM_CLK SPI2_IOMUX_PIN_NUM_CLK
|
|
|
+#define PIN_NUM_CS SPI2_IOMUX_PIN_NUM_CS
|
|
|
+#define PIN_NUM_WP SPI2_IOMUX_PIN_NUM_WP
|
|
|
+#define PIN_NUM_HD SPI2_IOMUX_PIN_NUM_HD
|
|
|
+
|
|
|
+#define MASTER_IOMUX_PIN_MISO SPI2_IOMUX_PIN_NUM_MISO
|
|
|
+#define MASTER_IOMUX_PIN_MOSI SPI2_IOMUX_PIN_NUM_MOSI
|
|
|
+#define MASTER_IOMUX_PIN_SCLK SPI2_IOMUX_PIN_NUM_CLK
|
|
|
+#define MASTER_IOMUX_PIN_CS SPI2_IOMUX_PIN_NUM_CS
|
|
|
+#define MASTER_IOMUX_PIN_WP SPI2_IOMUX_PIN_NUM_WP
|
|
|
+#define MASTER_IOMUX_PIN_HD SPI2_IOMUX_PIN_NUM_HD
|
|
|
+
|
|
|
+#define SLAVE_IOMUX_PIN_MISO SPI3_IOMUX_PIN_NUM_MISO
|
|
|
+#define SLAVE_IOMUX_PIN_MOSI SPI3_IOMUX_PIN_NUM_MOSI
|
|
|
+#define SLAVE_IOMUX_PIN_SCLK SPI3_IOMUX_PIN_NUM_CLK
|
|
|
+#define SLAVE_IOMUX_PIN_CS SPI3_IOMUX_PIN_NUM_CS
|
|
|
+#define SLAVE_IOMUX_PIN_WP SPI3_IOMUX_PIN_NUM_WP
|
|
|
+#define SLAVE_IOMUX_PIN_HD SPI3_IOMUX_PIN_NUM_HD
|
|
|
|
|
|
#define UNCONNECTED_PIN 27
|
|
|
#define INPUT_ONLY_PIN 34
|
|
|
@@ -50,34 +47,29 @@
|
|
|
#define WIRE_DELAY 12.5
|
|
|
|
|
|
#elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
|
|
|
-
|
|
|
-#define TEST_SPI_HOST FSPI_HOST
|
|
|
-#define TEST_SLAVE_HOST HSPI_HOST
|
|
|
-
|
|
|
-#define PIN_NUM_MISO FSPI_IOMUX_PIN_NUM_MISO
|
|
|
-#define PIN_NUM_MOSI FSPI_IOMUX_PIN_NUM_MOSI
|
|
|
-#define PIN_NUM_CLK FSPI_IOMUX_PIN_NUM_CLK
|
|
|
-#define PIN_NUM_CS FSPI_IOMUX_PIN_NUM_CS
|
|
|
-
|
|
|
-#define PIN_NUM_WP FSPI_IOMUX_PIN_NUM_WP
|
|
|
-#define PIN_NUM_HD FSPI_IOMUX_PIN_NUM_HD
|
|
|
-
|
|
|
-#define SLAVE_PIN_NUM_MISO HSPI_IOMUX_PIN_NUM_MISO
|
|
|
-#define SLAVE_PIN_NUM_MOSI HSPI_IOMUX_PIN_NUM_MOSI
|
|
|
-#define SLAVE_PIN_NUM_CLK HSPI_IOMUX_PIN_NUM_CLK
|
|
|
-#define SLAVE_PIN_NUM_CS HSPI_IOMUX_PIN_NUM_CS
|
|
|
-#define SLAVE_PIN_NUM_WP -1
|
|
|
-#define SLAVE_PIN_NUM_HD -1
|
|
|
+#define TEST_SPI_HOST SPI2_HOST
|
|
|
+#define TEST_SLAVE_HOST SPI3_HOST
|
|
|
+
|
|
|
+#define PIN_NUM_MISO SPI2_IOMUX_PIN_NUM_MISO
|
|
|
+#define PIN_NUM_MOSI SPI2_IOMUX_PIN_NUM_MOSI
|
|
|
+#define PIN_NUM_CLK SPI2_IOMUX_PIN_NUM_CLK
|
|
|
+#define PIN_NUM_CS SPI2_IOMUX_PIN_NUM_CS
|
|
|
+#define PIN_NUM_WP SPI2_IOMUX_PIN_NUM_WP
|
|
|
+#define PIN_NUM_HD SPI2_IOMUX_PIN_NUM_HD
|
|
|
+
|
|
|
+#define MASTER_IOMUX_PIN_MISO SPI2_IOMUX_PIN_NUM_MISO
|
|
|
+#define MASTER_IOMUX_PIN_MOSI SPI2_IOMUX_PIN_NUM_MOSI
|
|
|
+#define MASTER_IOMUX_PIN_SCLK SPI2_IOMUX_PIN_NUM_CLK
|
|
|
+#define MASTER_IOMUX_PIN_CS SPI2_IOMUX_PIN_NUM_CS
|
|
|
+#define MASTER_IOMUX_PIN_WP SPI2_IOMUX_PIN_NUM_WP
|
|
|
+#define MASTER_IOMUX_PIN_HD SPI2_IOMUX_PIN_NUM_HD
|
|
|
|
|
|
#define SLAVE_IOMUX_PIN_MISO -1
|
|
|
#define SLAVE_IOMUX_PIN_MOSI -1
|
|
|
#define SLAVE_IOMUX_PIN_SCLK -1
|
|
|
#define SLAVE_IOMUX_PIN_CS -1
|
|
|
-
|
|
|
-#define MASTER_IOMUX_PIN_MISO FSPI_IOMUX_PIN_NUM_MISO
|
|
|
-#define MASTER_IOMUX_PIN_MOSI FSPI_IOMUX_PIN_NUM_MOSI
|
|
|
-#define MASTER_IOMUX_PIN_SCLK FSPI_IOMUX_PIN_NUM_CLK
|
|
|
-#define MASTER_IOMUX_PIN_CS FSPI_IOMUX_PIN_NUM_CS
|
|
|
+#define SLAVE_IOMUX_PIN_NUM_WP -1
|
|
|
+#define SLAVE_IOMUX_PIN_NUM_HD -1
|
|
|
|
|
|
#define UNCONNECTED_PIN 41
|
|
|
#define INPUT_ONLY_PIN 46
|
|
|
@@ -86,40 +78,30 @@
|
|
|
#define WIRE_DELAY 12.5
|
|
|
|
|
|
#elif CONFIG_IDF_TARGET_ESP32C3
|
|
|
-
|
|
|
-#define TEST_SPI_HOST FSPI_HOST
|
|
|
-#define TEST_SLAVE_HOST FSPI_HOST
|
|
|
-
|
|
|
-#define PIN_NUM_MISO FSPI_IOMUX_PIN_NUM_MISO
|
|
|
-#define PIN_NUM_MOSI FSPI_IOMUX_PIN_NUM_MOSI
|
|
|
-#define PIN_NUM_CLK FSPI_IOMUX_PIN_NUM_CLK
|
|
|
-#define PIN_NUM_CS FSPI_IOMUX_PIN_NUM_CS
|
|
|
-
|
|
|
-#define PIN_NUM_WP FSPI_IOMUX_PIN_NUM_WP
|
|
|
-#define PIN_NUM_HD FSPI_IOMUX_PIN_NUM_HD
|
|
|
-
|
|
|
-#define SLAVE_PIN_NUM_MISO -1
|
|
|
-#define SLAVE_PIN_NUM_MOSI -1
|
|
|
-#define SLAVE_PIN_NUM_CLK -1
|
|
|
-#define SLAVE_PIN_NUM_CS -1
|
|
|
-#define SLAVE_PIN_NUM_WP -1
|
|
|
-#define SLAVE_PIN_NUM_HD -1
|
|
|
-
|
|
|
//NOTE: On esp32c3, there is only 1 GPSPI controller, so master-slave test on single board should be disabled
|
|
|
-#define SLAVE_IOMUX_PIN_MISO FSPI_IOMUX_PIN_NUM_MISO
|
|
|
-#define SLAVE_IOMUX_PIN_MOSI FSPI_IOMUX_PIN_NUM_MOSI
|
|
|
-#define SLAVE_IOMUX_PIN_SCLK FSPI_IOMUX_PIN_NUM_CLK
|
|
|
-#define SLAVE_IOMUX_PIN_CS FSPI_IOMUX_PIN_NUM_CS
|
|
|
-
|
|
|
-#define MASTER_IOMUX_PIN_MISO FSPI_IOMUX_PIN_NUM_MISO
|
|
|
-#define MASTER_IOMUX_PIN_MOSI FSPI_IOMUX_PIN_NUM_MOSI
|
|
|
-#define MASTER_IOMUX_PIN_SCLK FSPI_IOMUX_PIN_NUM_CLK
|
|
|
-#define MASTER_IOMUX_PIN_CS FSPI_IOMUX_PIN_NUM_CS
|
|
|
+#define TEST_SPI_HOST SPI2_HOST
|
|
|
+#define TEST_SLAVE_HOST SPI2_HOST
|
|
|
+
|
|
|
+#define PIN_NUM_MISO SPI2_IOMUX_PIN_NUM_MISO
|
|
|
+#define PIN_NUM_MOSI SPI2_IOMUX_PIN_NUM_MOSI
|
|
|
+#define PIN_NUM_CLK SPI2_IOMUX_PIN_NUM_CLK
|
|
|
+#define PIN_NUM_CS SPI2_IOMUX_PIN_NUM_CS
|
|
|
+#define PIN_NUM_WP SPI2_IOMUX_PIN_NUM_WP
|
|
|
+#define PIN_NUM_HD SPI2_IOMUX_PIN_NUM_HD
|
|
|
+
|
|
|
+#define SLAVE_IOMUX_PIN_MISO SPI2_IOMUX_PIN_NUM_MISO
|
|
|
+#define SLAVE_IOMUX_PIN_MOSI SPI2_IOMUX_PIN_NUM_MOSI
|
|
|
+#define SLAVE_IOMUX_PIN_SCLK SPI2_IOMUX_PIN_NUM_CLK
|
|
|
+#define SLAVE_IOMUX_PIN_CS SPI2_IOMUX_PIN_NUM_CS
|
|
|
+
|
|
|
+#define MASTER_IOMUX_PIN_MISO SPI2_IOMUX_PIN_NUM_MISO
|
|
|
+#define MASTER_IOMUX_PIN_MOSI SPI2_IOMUX_PIN_NUM_MOSI
|
|
|
+#define MASTER_IOMUX_PIN_SCLK SPI2_IOMUX_PIN_NUM_CLK
|
|
|
+#define MASTER_IOMUX_PIN_CS SPI2_IOMUX_PIN_NUM_CS
|
|
|
|
|
|
#define GPIO_DELAY 0
|
|
|
#define ESP_SPI_SLAVE_TV 0
|
|
|
#define WIRE_DELAY 12.5
|
|
|
-
|
|
|
#endif
|
|
|
|
|
|
#define GET_DMA_CHAN(HOST) (HOST)
|