mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
spi_common: add interface to get whether the bus is on IOMUX
This commit is contained in:
parent
b76ab9142d
commit
65c0d354e4
@ -310,6 +310,17 @@ void spicommon_cs_free_io(int cs_gpio_num);
|
||||
*/
|
||||
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
|
||||
*
|
||||
|
@ -352,6 +352,17 @@ void spicommon_cs_free_io(int cs_gpio_num)
|
||||
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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user