From 06185a3e2d6e8c123412f3dc29efe85b5c554945 Mon Sep 17 00:00:00 2001 From: C47D Date: Tue, 11 Jan 2022 19:35:14 -0600 Subject: [PATCH] lvgl_helpers: Use spi_host_device_t from v4.3 onwards --- lvgl_helpers.c | 4 ++-- lvgl_helpers.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lvgl_helpers.c b/lvgl_helpers.c index ce3bfc1..13cb9fc 100644 --- a/lvgl_helpers.c +++ b/lvgl_helpers.c @@ -259,7 +259,7 @@ size_t lvgl_get_display_buffer_size(void) * We could use the ESP_IDF_VERSION_VAL macro available in the "esp_idf_version.h" * header available since ESP-IDF v4. */ -bool lvgl_spi_driver_init(spi_host_device_t host, +bool lvgl_spi_driver_init(int host, int miso_pin, int mosi_pin, int sclk_pin, int max_transfer_sz, int dma_channel, @@ -293,7 +293,7 @@ bool lvgl_spi_driver_init(spi_host_device_t host, ESP_LOGI(TAG, "Initializing SPI bus..."); #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0) - esp_err_t ret = spi_bus_initialize(host, &buscfg, (spi_dma_chan_t)dma_channel); + esp_err_t ret = spi_bus_initialize((spi_host_device_t) host, &buscfg, (spi_dma_chan_t)dma_channel); #else esp_err_t ret = spi_bus_initialize(host, &buscfg, dma_channel); #endif diff --git a/lvgl_helpers.h b/lvgl_helpers.h index ce0d814..6031036 100644 --- a/lvgl_helpers.h +++ b/lvgl_helpers.h @@ -37,7 +37,7 @@ void lvgl_i2c_locking(void* leader); void lvgl_interface_init(void); /* Initialize SPI master */ -bool lvgl_spi_driver_init(spi_host_device_t host, int miso_pin, int mosi_pin, int sclk_pin, +bool lvgl_spi_driver_init(int host, int miso_pin, int mosi_pin, int sclk_pin, int max_transfer_sz, int dma_channel, int quadwp_pin, int quadhd_pin); /* Initialize display GPIOs, e.g. DC and RST pins */