Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
Resolving conflicts
  • Loading branch information
tore-espressif committed Apr 11, 2022
2 parents 7c6bdc5 + 26fe6e7 commit b22cb1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
16 changes: 2 additions & 14 deletions lvgl_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,6 @@ bool lvgl_spi_driver_init(int host,
int dma_channel,
int quadwp_pin, int quadhd_pin)
{
#if defined (SPI_HOST_MAX)
assert((SPI1_HOST <= host) && (SPI_HOST_MAX > host));
#else
assert((SPI1_HOST <= host) && ((SPI3_HOST + 1) > host));
#endif

const char *spi_names[] = {
"SPI1_HOST", "SPI2_HOST", "SPI3_HOST"
};
Expand All @@ -293,13 +287,7 @@ bool lvgl_spi_driver_init(int 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((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

assert(ret == ESP_OK);

return ESP_OK != ret;
Expand All @@ -308,7 +296,7 @@ bool lvgl_spi_driver_init(int host,
static int calculate_spi_max_transfer_size(const int display_buffer_size)
{
int retval = 0;

#if defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9481) || \
defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9488)
retval = display_buffer_size * 3;
Expand All @@ -325,7 +313,7 @@ static int calculate_spi_max_transfer_size(const int display_buffer_size)
#else
retval = display_buffer_size * 2;
#endif

return retval;
}

Expand Down
7 changes: 5 additions & 2 deletions lvgl_spi_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ extern "C" {
* If the user sets the same MOSI and CLK pins for both display and indev
* controllers then we can assume the user is using the same SPI bus
* If so verify the user specified the same SPI bus for both */
#if !defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_FT81X)
#if defined (CONFIG_LV_TOUCH_CONTROLLER_SPI2_HOST)
#define TOUCH_SPI_HOST SPI2_HOST
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_SPI3_HOST)
#define TOUCH_SPI_HOST SPI3_HOST
#endif

#if defined (CONFIG_LV_TFT_DISPLAY_PROTOCOL_SPI) && \
(CONFIG_LV_TFT_DISPLAY_PROTOCOL_SPI == 1) && \
Expand Down Expand Up @@ -170,7 +174,6 @@ extern "C" {
#else
#define SPI_TFT_SPI_MODE (0U)
#endif
#endif

/* Touch driver */
#if (CONFIG_LV_TOUCH_CONTROLLER == TOUCH_CONTROLLER_STMPE610)
Expand Down
5 changes: 3 additions & 2 deletions lvgl_tft/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,9 @@ menu "LVGL TFT Display controller"

choice
prompt "TFT SPI Bus." if LV_TFT_DISPLAY_PROTOCOL_SPI
default LV_TFT_DISPLAY_SPI2_HOST if LV_PREDEFINED_DISPLAY_TTGO
default LV_TFT_DISPLAY_SPI3_HOST if !LV_PREDEFINED_DISPLAY_TTGO
default LV_TFT_DISPLAY_SPI2_HOST
help
Select the SPI Bus the TFT Display is attached to.

config LV_TFT_DISPLAY_SPI2_HOST
bool "SPI2_HOST"
Expand Down

0 comments on commit b22cb1f

Please sign in to comment.