From e58ce2141d92cf0c49c9e93267e5530fc7d3353c Mon Sep 17 00:00:00 2001 From: Armando Date: Tue, 14 Jul 2020 13:55:18 +0800 Subject: [PATCH] spi_master: rename the hal layer function that calculates clock and timing --- components/driver/spi_master.c | 2 +- components/soc/include/hal/spi_hal.h | 4 ++-- components/soc/src/hal/spi_hal.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/driver/spi_master.c b/components/driver/spi_master.c index 981d8b73de..ecae17e197 100644 --- a/components/driver/spi_master.c +++ b/components/driver/spi_master.c @@ -352,7 +352,7 @@ esp_err_t spi_bus_add_device(spi_host_device_t host_id, const spi_device_interfa spi_hal_timing_conf_t temp_timing_conf; - esp_err_t ret = spi_hal_get_clock_conf(hal, dev_config->clock_speed_hz, duty_cycle, + esp_err_t ret = spi_hal_cal_clock_conf(hal, dev_config->clock_speed_hz, duty_cycle, !(bus_attr->flags & SPICOMMON_BUSFLAG_IOMUX_PINS), dev_config->input_delay_ns, &freq, &temp_timing_conf); diff --git a/components/soc/include/hal/spi_hal.h b/components/soc/include/hal/spi_hal.h index 2012433a26..3324110baf 100644 --- a/components/soc/include/hal/spi_hal.h +++ b/components/soc/include/hal/spi_hal.h @@ -169,7 +169,7 @@ void spi_hal_fetch_result(const spi_hal_context_t *hal); * Utils * ---------------------------------------------------------*/ /** - * Get the configuration of clock and timing. The configuration will be used when ``spi_hal_setup_device``. + * Calculate the configuration of clock and timing. The configuration will be used when ``spi_hal_setup_device``. * * It is highly suggested to do this at initialization, since it takes long time. * @@ -185,7 +185,7 @@ void spi_hal_fetch_result(const spi_hal_context_t *hal); * * @return ESP_OK if desired is available, otherwise fail. */ -esp_err_t spi_hal_get_clock_conf(const spi_hal_context_t *hal, int speed_hz, int duty_cycle, bool use_gpio, int input_delay_ns, int *out_freq, spi_hal_timing_conf_t *timing_conf); +esp_err_t spi_hal_cal_clock_conf(const spi_hal_context_t *hal, int speed_hz, int duty_cycle, bool use_gpio, int input_delay_ns, int *out_freq, spi_hal_timing_conf_t *timing_conf); /** * Get the frequency actual used. diff --git a/components/soc/src/hal/spi_hal.c b/components/soc/src/hal/spi_hal.c index 83c00d58a1..d6df0d323b 100644 --- a/components/soc/src/hal/spi_hal.c +++ b/components/soc/src/hal/spi_hal.c @@ -49,7 +49,7 @@ void spi_hal_deinit(spi_hal_context_t *hal) } } -esp_err_t spi_hal_get_clock_conf(const spi_hal_context_t *hal, int speed_hz, int duty_cycle, bool use_gpio, int input_delay_ns, int *out_freq, spi_hal_timing_conf_t *timing_conf) +esp_err_t spi_hal_cal_clock_conf(const spi_hal_context_t *hal, int speed_hz, int duty_cycle, bool use_gpio, int input_delay_ns, int *out_freq, spi_hal_timing_conf_t *timing_conf) { spi_hal_timing_conf_t temp_conf;