lvgl_helpers: Use spi_host_device_t from v4.3 onwards

This commit is contained in:
C47D 2022-01-11 19:35:14 -06:00
parent 31247430df
commit 06185a3e2d
2 changed files with 3 additions and 3 deletions

View file

@ -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" * We could use the ESP_IDF_VERSION_VAL macro available in the "esp_idf_version.h"
* header available since ESP-IDF v4. * 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 miso_pin, int mosi_pin, int sclk_pin,
int max_transfer_sz, int max_transfer_sz,
int dma_channel, int dma_channel,
@ -293,7 +293,7 @@ bool lvgl_spi_driver_init(spi_host_device_t host,
ESP_LOGI(TAG, "Initializing SPI bus..."); ESP_LOGI(TAG, "Initializing SPI bus...");
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0) #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 #else
esp_err_t ret = spi_bus_initialize(host, &buscfg, dma_channel); esp_err_t ret = spi_bus_initialize(host, &buscfg, dma_channel);
#endif #endif

View file

@ -37,7 +37,7 @@ void lvgl_i2c_locking(void* leader);
void lvgl_interface_init(void); void lvgl_interface_init(void);
/* Initialize SPI master */ /* 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); int max_transfer_sz, int dma_channel, int quadwp_pin, int quadhd_pin);
/* Initialize display GPIOs, e.g. DC and RST pins */ /* Initialize display GPIOs, e.g. DC and RST pins */