mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
feat(driver_spi): update p4 eco5 spi support on real chip
This commit is contained in:
@@ -591,7 +591,8 @@ esp_err_t spicommon_bus_initialize_io(spi_host_device_t host, const spi_bus_conf
|
||||
}
|
||||
//set flags for DUAL mode according to output-capability of MOSI and MISO pins.
|
||||
if ((bus_config->mosi_io_num < 0 || GPIO_IS_VALID_OUTPUT_GPIO(bus_config->mosi_io_num)) &&
|
||||
(bus_config->miso_io_num < 0 || GPIO_IS_VALID_OUTPUT_GPIO(bus_config->miso_io_num))) {
|
||||
(bus_config->miso_io_num < 0 || GPIO_IS_VALID_OUTPUT_GPIO(bus_config->miso_io_num)) &&
|
||||
(bus_config->miso_io_num != bus_config->mosi_io_num)) {
|
||||
temp_flag |= SPICOMMON_BUSFLAG_DUAL;
|
||||
}
|
||||
|
||||
|
||||
@@ -620,9 +620,7 @@ esp_err_t spi_bus_remove_device(spi_device_handle_t handle)
|
||||
|
||||
esp_err_t spi_device_get_actual_freq(spi_device_handle_t handle, int* freq_khz)
|
||||
{
|
||||
if ((spi_device_t *)handle == NULL || freq_khz == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
SPI_CHECK(handle && freq_khz, "invalid arg", ESP_ERR_INVALID_ARG);
|
||||
|
||||
*freq_khz = handle->hal_dev.timing_conf.real_freq / 1000;
|
||||
return ESP_OK;
|
||||
|
||||
@@ -100,20 +100,26 @@ static inline bool SPI_SLAVE_ISR_ATTR bus_is_iomux(spi_slave_t *host)
|
||||
return host->flags & SPICOMMON_BUSFLAG_IOMUX_PINS;
|
||||
}
|
||||
|
||||
static void SPI_SLAVE_ISR_ATTR freeze_cs(spi_slave_t *host)
|
||||
static inline void SPI_SLAVE_ISR_ATTR freeze_cs(spi_slave_t *host)
|
||||
{
|
||||
#if SPI_LL_SLAVE_NEEDS_CS_WORKAROUND
|
||||
// This workaround only for ESP32 due to old hardware design, see MR !3207
|
||||
esp_rom_gpio_connect_in_signal(GPIO_MATRIX_CONST_ONE_INPUT, host->cs_in_signal, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Use this function instead of cs_initial to avoid overwrite the output config
|
||||
// This is used in test by internal gpio matrix connections
|
||||
static inline void SPI_SLAVE_ISR_ATTR restore_cs(spi_slave_t *host)
|
||||
{
|
||||
#if SPI_LL_SLAVE_NEEDS_CS_WORKAROUND
|
||||
// This workaround only for ESP32 due to old hardware design, see MR !3207
|
||||
if (host->cs_iomux) {
|
||||
gpio_ll_iomux_in(GPIO_HAL_GET_HW(GPIO_PORT_0), host->cfg.spics_io_num, host->cs_in_signal);
|
||||
} else {
|
||||
esp_rom_gpio_connect_in_signal(host->cfg.spics_io_num, host->cs_in_signal, false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (SOC_CPU_CORES_NUM > 1) && (!CONFIG_FREERTOS_UNICORE)
|
||||
|
||||
Reference in New Issue
Block a user