spi_common: add interface to get whether the bus is on IOMUX
This commit is contained in:
parent
b76ab9142d
commit
65c0d354e4
2 changed files with 22 additions and 0 deletions
|
@ -310,6 +310,17 @@ void spicommon_cs_free_io(int cs_gpio_num);
|
||||||
*/
|
*/
|
||||||
bool spicommon_bus_using_iomux(spi_host_device_t host);
|
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
|
* @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);
|
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
|
Code for workaround for DMA issue in ESP32 v0/v1 silicon
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue