*/
bool spicommon_bus_using_iomux(spi_host_device_t host);
+/**
+ * @brief Check whether all pins used by a host are through IOMUX.
+ *
+ * @param host SPI peripheral
+ *
+ * @note This public API is deprecated.
+ *
+ * @return false if any pins are through the GPIO matrix, otherwise true.
+ */
+bool spicommon_bus_using_iomux(spi_host_device_t host);
+
/**
* @brief Get the IRQ source for a specific SPI host
*
gpio_reset_pin(cs_gpio_num);
}
+bool spicommon_bus_using_iomux(spi_host_device_t host)
+{
+#define CHECK_IOMUX_PIN(HOST, PIN_NAME) if (GPIO.func_in_sel_cfg[spi_periph_signal[(HOST)].PIN_NAME##_in].sig_in_sel) return false
+
+ CHECK_IOMUX_PIN(host, spid);
+ CHECK_IOMUX_PIN(host, spiq);
+ CHECK_IOMUX_PIN(host, spiwp);
+ CHECK_IOMUX_PIN(host, spihd);
+ return true;
+}
+
/*
Code for workaround for DMA issue in ESP32 v0/v1 silicon
*/