Skip to content

Commit

Permalink
Renamed defines
Browse files Browse the repository at this point in the history
Updated manual
  • Loading branch information
rzeldent committed Dec 17, 2023
1 parent d457883 commit 165b615
Show file tree
Hide file tree
Showing 15 changed files with 310 additions and 260 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
- name: Check boards
run: pio boards espressif32
- name: Build firmware
run: pio ci --lib=src --lib=include --exclude=assets --exclude=example --exclude=boards --project-conf="example/platformio.ini" "example/main.cpp"
run: pio ci --lib=src --lib=include --exclude=assets --exclude=example --exclude=boards --project-conf="examples/ci/platformio.ini" "examples/ci/main.cpp"
env:
PLATFORMIO_BUILD_FLAGS: -DLV_CONF_PATH="${{github.workspace}}/example/lv_conf.h"
341 changes: 195 additions & 146 deletions README.md

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
15 changes: 1 addition & 14 deletions example/platformio.ini → examples/ci/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,7 @@ build_flags =
#-Wall
-D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
# LVGL settings
#-D LV_CONF_PATH=${PROJECT_INCLUDE_DIR}/lv_conf.h
# EspressIf library defines
-D ESP_LCD_ST7796_VER_MAJOR=1
-D ESP_LCD_ST7796_VER_MINOR=2
-D ESP_LCD_ST7796_VER_PATCH=0
-D ESP_LCD_ILI9341_VER_MAJOR=1
-D ESP_LCD_ILI9341_VER_MINOR=2
-D ESP_LCD_ILI9341_VER_PATCH=0
-D ESP_LCD_GC9A01_VER_MAJOR=1
-D ESP_LCD_GC9A01_VER_MINOR=2
-D ESP_LCD_GC9A01_VER_PATCH=0
-D CONFIG_ESP_LCD_TOUCH_MAX_POINTS=1
-D CONFIG_XPT2046_CONVERT_ADC_TO_COORDS
-D CONFIG_XPT2046_Z_THRESHOLD=600
-D LV_CONF_PATH=${PROJECT_INCLUDE_DIR}/lv_conf.h

[env:esp32-2424S012C]
board = esp32-2424S012C
Expand Down
20 changes: 17 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,29 @@
"$schema": "https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/schema/library.json",
"name": "esp32_smartdisplay",
"version": "2.0.0",
"description": "LVGL driver for Sunton ESP32 TFT display boards",
"keywords": "LVGL Sunton CYD TFT",
"description": "LVGL driver for Sunton ESP32 display boards",
"keywords": "LVGL Sunton CYD - Cheap Yellow Display LCD TFT Touch",
"repository": {
"type": "git",
"url": "https://github.com/rzeldent/esp32-smartdisplay"
},
"build": {
"srcDir": "src",
"includeDir": "include"
"includeDir": "include",
"flags": [
"-DESP_LCD_ST7796_VER_MAJOR=1",
"-DESP_LCD_ST7796_VER_MINOR=2",
"-DESP_LCD_ST7796_VER_PATCH=0",
"-DESP_LCD_ILI9341_VER_MAJOR=1",
"-DESP_LCD_ILI9341_VER_MINOR=2",
"-DESP_LCD_ILI9341_VER_PATCH=0",
"-DESP_LCD_GC9A01_VER_MAJOR=1",
"-DESP_LCD_GC9A01_VER_MINOR=2",
"-DESP_LCD_GC9A01_VER_PATCH=0",
"-DCONFIG_ESP_LCD_TOUCH_MAX_POINTS=1",
"-DCONFIG_XPT2046_CONVERT_ADC_TO_COORDS",
"-DCONFIG_XPT2046_Z_THRESHOLD=600"
]
},
"export": {
"include": [
Expand Down
100 changes: 50 additions & 50 deletions src/esp32_smartdisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,70 +27,70 @@ static void lvgl_update_callback(lv_disp_drv_t *drv)
switch (drv->rotated)
{
case LV_DISP_ROT_NONE:
#if defined(PANEL_SWAP_XY) && defined(PANEL_MIRROR_X) && defined(PANEL_MIRROR_Y)
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, PANEL_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, PANEL_MIRROR_X, PANEL_MIRROR_Y));
#if defined(LCD_SWAP_XY) && defined(LCD_MIRROR_X) && defined(LCD_MIRROR_Y)
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, LCD_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, LCD_MIRROR_X, LCD_MIRROR_Y));
#endif
#if defined(PANEL_GAP_X) || defined(PANEL_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, PANEL_GAP_X, PANEL_GAP_Y));
#if defined(LCD_GAP_X) || defined(LCD_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, LCD_GAP_X, LCD_GAP_Y));
#endif
#ifdef HAS_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, TOUCH_ROT_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, TOUCH_ROT_SWAP_Y));
#ifdef BOARD_HAS_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, TOUCH_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, TOUCH_SWAP_Y));
#endif
break;
case LV_DISP_ROT_90:
#if defined(PANEL_SWAP_XY) && defined(PANEL_MIRROR_X) && defined(PANEL_MIRROR_Y)
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, !PANEL_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, !PANEL_MIRROR_X, PANEL_MIRROR_Y));
#if defined(LCD_SWAP_XY) && defined(LCD_MIRROR_X) && defined(LCD_MIRROR_Y)
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, !LCD_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, !LCD_MIRROR_X, LCD_MIRROR_Y));
#endif
#if defined(PANEL_GAP_X) || defined(PANEL_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, PANEL_GAP_Y, PANEL_GAP_X));
#if defined(LCD_GAP_X) || defined(LCD_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, LCD_GAP_Y, LCD_GAP_X));
#endif
#ifdef HAS_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, !TOUCH_ROT_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, !TOUCH_ROT_SWAP_Y));
#ifdef BOARD_HAS_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, !TOUCH_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, !TOUCH_SWAP_Y));
#endif
break;
case LV_DISP_ROT_180:
#if defined(PANEL_SWAP_XY) && defined(PANEL_MIRROR_X) && defined(PANEL_MIRROR_Y)
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, PANEL_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, !PANEL_MIRROR_X, !PANEL_MIRROR_Y));
#if defined(LCD_SWAP_XY) && defined(LCD_MIRROR_X) && defined(LCD_MIRROR_Y)
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, LCD_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, !LCD_MIRROR_X, !LCD_MIRROR_Y));
#endif
#if defined(PANEL_GAP_X) || defined(PANEL_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, PANEL_GAP_X, PANEL_GAP_Y));
#if defined(LCD_GAP_X) || defined(LCD_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, LCD_GAP_X, LCD_GAP_Y));
#endif
#ifdef HAS_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, TOUCH_ROT_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, TOUCH_ROT_SWAP_Y));
#ifdef BOARD_HAS_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, TOUCH_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, TOUCH_SWAP_Y));
#endif
break;
case LV_DISP_ROT_270:
#if defined(PANEL_SWAP_XY) && defined(PANEL_MIRROR_X) && defined(PANEL_MIRROR_Y)
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, !PANEL_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, PANEL_MIRROR_X, !PANEL_MIRROR_Y));
#if defined(LCD_SWAP_XY) && defined(LCD_MIRROR_X) && defined(LCD_MIRROR_Y)
ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, !LCD_SWAP_XY));
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, LCD_MIRROR_X, !LCD_MIRROR_Y));
#endif
#if defined(PANEL_GAP_X) || defined(PANEL_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, PANEL_GAP_Y, PANEL_GAP_X));
#if defined(LCD_GAP_X) || defined(LCD_GAP_Y)
ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, LCD_GAP_Y, LCD_GAP_X));
#endif
#ifdef HAS_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, !TOUCH_ROT_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, !TOUCH_ROT_SWAP_Y));
#ifdef BOARD_HAS_TOUCH
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_x(touch_handle, !TOUCH_SWAP_X));
ESP_ERROR_CHECK(esp_lcd_touch_set_mirror_y(touch_handle, !TOUCH_SWAP_Y));
#endif
break;
}
}

void smartdisplay_init()
{
#ifdef HAS_RGB_LED
#ifdef BOARD_HAS_RGB_LED
// Setup RGB LED. High is off
pinMode(LED_R, OUTPUT);
digitalWrite(LED_R, true);
pinMode(LED_G, OUTPUT);
digitalWrite(LED_G, true);
pinMode(LED_B, OUTPUT);
digitalWrite(LED_B, true);
pinMode(LED_R_GPIO, OUTPUT);
digitalWrite(LED_R_GPIO, true);
pinMode(LED_G_GPIO, OUTPUT);
digitalWrite(LED_G_GPIO, true);
pinMode(LED_B_GPIO, OUTPUT);
digitalWrite(LED_B_GPIO, true);
#endif

#ifdef HAS_LIGHTSENSOR
Expand All @@ -99,10 +99,10 @@ void smartdisplay_init()
pinMode(LIGHTSENSOR_IN, INPUT);
#endif

#ifdef HAS_SPEAK
#ifdef BOARD_HAS_SPEAK_GPIO
// Speaker
// Note: tone function uses PWM channel 0
pinMode(SPEAKER, INPUT); // Set high impedance
pinMode(SPEAK_GPIO, OUTPUT);
#endif

#if LV_USE_LOG
Expand All @@ -111,21 +111,21 @@ void smartdisplay_init()

lv_init();
// Setup backlight
pinMode(PIN_BCKL, OUTPUT);
pinMode(LCD_BCKL_GPIO, OUTPUT);
#if ESP_ARDUINO_VERSION_MAJOR >= 3
ledcAttach(PIN_BCKL, PWM_FREQ_BCKL, PWM_BITS_BCKL);
ledcAttach(LCD_BCKL_GPIO, PWM_FREQ_BCKL, PWM_BITS_BCKL);
#else
ledcSetup(PWM_CHANNEL_BCKL, PWM_FREQ_BCKL, PWM_BITS_BCKL);
ledcAttachPin(PIN_BCKL, PWM_CHANNEL_BCKL);
ledcAttachPin(LCD_BCKL_GPIO, PWM_CHANNEL_BCKL);
#endif
digitalWrite(PIN_BCKL, LOW);
digitalWrite(LCD_BCKL_GPIO, LOW);
// Setup TFT display
lv_disp_drv_init(&disp_drv);
disp_drv.hor_res = TFT_WIDTH;
disp_drv.ver_res = TFT_HEIGHT;
disp_drv.hor_res = LCD_WIDTH;
disp_drv.ver_res = LCD_HEIGHT;
// Create drawBuffer
disp_drv.draw_buf = (lv_disp_draw_buf_t *)malloc(sizeof(lv_disp_draw_buf_t));
uint drawBufferPixels = TFT_WIDTH * LVGL_PIXEL_BUFFER_LINES;
uint drawBufferPixels = LCD_WIDTH * LVGL_PIXEL_BUFFER_LINES;
void *drawBuffer = heap_caps_malloc(sizeof(lv_color16_t) * drawBufferPixels, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
lv_disp_draw_buf_init(disp_drv.draw_buf, drawBuffer, NULL, drawBufferPixels);
// Initialize specific driver
Expand All @@ -137,7 +137,7 @@ void smartdisplay_init()
smartdisplay_tft_set_backlight(0.5f);

// If there is a touch controller defined
#ifdef HAS_TOUCH
#ifdef BOARD_HAS_TOUCH
// Setup touch
lv_indev_drv_init(&indev_drv);
indev_drv.disp = display;
Expand All @@ -154,7 +154,7 @@ void smartdisplay_init()
void smartdisplay_tft_set_backlight(float duty)
{
#if ESP_ARDUINO_VERSION_MAJOR >= 3
ledcWrite(PIN_BCKL, dut * PWM_MAX_BCKL);
ledcWrite(LCD_BCKL_GPIO, dut * PWM_MAX_BCKL);
#else
ledcWrite(PWM_CHANNEL_BCKL, duty * PWM_MAX_BCKL);
#endif
Expand Down
14 changes: 7 additions & 7 deletions src/lvgl_cst816s.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <esp32_smartdisplay.h>

#ifdef USES_CST816S
#ifdef TOUCH_USES_CST816S

#include "driver/i2c.h"
#include "esp_lcd_touch.h"
Expand Down Expand Up @@ -31,18 +31,18 @@ static void cst816s_lvgl_touch_cb(lv_indev_drv_t *drv, lv_indev_data_t *data)
void lvgl_touch_init(lv_indev_drv_t *drv)
{
// Create I2C bus
const i2c_config_t i2c_config = CST816S_I2C_CONFIG;
ESP_ERROR_CHECK(i2c_param_config(CST816S_I2C_HOST, &i2c_config));
ESP_ERROR_CHECK(i2c_driver_install(CST816S_I2C_HOST, i2c_config.mode, 0, 0, 0));
const i2c_config_t i2c_config = TOUCH_I2C_CONFIG;
ESP_ERROR_CHECK(i2c_param_config(TOUCH_I2C_HOST, &i2c_config));
ESP_ERROR_CHECK(i2c_driver_install(TOUCH_I2C_HOST, i2c_config.mode, 0, 0, 0));

// Create IO handle
esp_lcd_panel_io_i2c_config_t io_i2c_config = CST816S_IO_I2C_CONFIG;
esp_lcd_panel_io_i2c_config_t io_i2c_config = TOUCH_IO_I2C_CONFIG;
io_i2c_config.user_ctx = drv;
esp_lcd_panel_io_handle_t io_handle;
ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)CST816S_I2C_HOST, &io_i2c_config, &io_handle));
ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)TOUCH_I2C_HOST, &io_i2c_config, &io_handle));

// Create touch configuration
esp_lcd_touch_config_t touch_config = CST816S_TOUCH_CONFIG;
esp_lcd_touch_config_t touch_config = TOUCH_DEV_CONFIG;
touch_config.user_data = io_handle;
esp_lcd_touch_handle_t touch_handle;
ESP_ERROR_CHECK(esp_lcd_touch_new_i2c_cst816s(io_handle, &touch_config, &touch_handle));
Expand Down
12 changes: 6 additions & 6 deletions src/lvgl_gc9a01.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <esp32_smartdisplay.h>

#ifdef USES_GC9A01
#ifdef LCD_USES_GC9A01

#include <driver/spi_master.h>
#include <esp_lcd_panel_io.h>
Expand Down Expand Up @@ -36,18 +36,18 @@ void lvgl_tft_init(lv_disp_drv_t *drv)
drv->rotated = LV_DISP_ROT_NONE;

// Create SPI bus
const spi_bus_config_t spi_bus_config = GC9A01_SPI_BUS_CONFIG;
ESP_ERROR_CHECK_WITHOUT_ABORT(spi_bus_initialize(GC9A01_SPI_HOST, &spi_bus_config, SPI_DMA_CH_AUTO));
const spi_bus_config_t spi_bus_config = LCD_SPI_BUS_CONFIG;
ESP_ERROR_CHECK_WITHOUT_ABORT(spi_bus_initialize(LCD_SPI_HOST, &spi_bus_config, SPI_DMA_CH_AUTO));

// Attach the LCD controller to the SPI bus
esp_lcd_panel_io_spi_config_t io_config = GC9A01_IO_SPI_CONFIG;
esp_lcd_panel_io_spi_config_t io_config = LCD_IO_SPI_CONFIG;
io_config.user_ctx = drv;
io_config.on_color_trans_done = gc9a01_color_trans_done;
esp_lcd_panel_io_handle_t io_handle;
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)GC9A01_SPI_HOST, &io_config, &io_handle));
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)LCD_SPI_HOST, &io_config, &io_handle));

// Create gc9a01 panel handle
esp_lcd_panel_dev_config_t panel_dev_config = GC9A01_PANEL_DEV_CONFIG;
esp_lcd_panel_dev_config_t panel_dev_config = LCD_PANEL_DEV_CONFIG;
esp_lcd_panel_handle_t panel_handle;
ESP_ERROR_CHECK(esp_lcd_new_panel_gc9a01(io_handle, &panel_dev_config, &panel_handle));

Expand Down
14 changes: 7 additions & 7 deletions src/lvgl_gt911.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <esp32_smartdisplay.h>

#ifdef USES_GT911
#ifdef TOUCH_USES_GT911

#include "driver/i2c.h"
#include "esp_lcd_touch.h"
Expand Down Expand Up @@ -31,18 +31,18 @@ static void gt911_lvgl_touch_cb(lv_indev_drv_t *drv, lv_indev_data_t *data)
void lvgl_touch_init(lv_indev_drv_t *drv)
{
// Create I2C bus
const i2c_config_t i2c_config = GT911_I2C_CONFIG;
ESP_ERROR_CHECK(i2c_param_config(GT911_I2C_HOST, &i2c_config));
ESP_ERROR_CHECK(i2c_driver_install(GT911_I2C_HOST, i2c_config.mode, 0, 0, 0));
const i2c_config_t i2c_config = TOUCH_I2C_CONFIG;
ESP_ERROR_CHECK(i2c_param_config(TOUCH_I2C_HOST, &i2c_config));
ESP_ERROR_CHECK(i2c_driver_install(TOUCH_I2C_HOST, i2c_config.mode, 0, 0, 0));

// Create IO handle
esp_lcd_panel_io_i2c_config_t io_i2c_config = GT911_IO_I2C_CONFIG;
esp_lcd_panel_io_i2c_config_t io_i2c_config = TOUCH_IO_I2C_CONFIG;
io_i2c_config.user_ctx = drv;
esp_lcd_panel_io_handle_t io_handle;
ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)GT911_I2C_HOST, &io_i2c_config, &io_handle));
ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)TOUCH_I2C_HOST, &io_i2c_config, &io_handle));

// Create touch configuration
esp_lcd_touch_config_t touch_config = GT911_TOUCH_CONFIG;
esp_lcd_touch_config_t touch_config = TOUCH_DEV_CONFIG;
touch_config.user_data = io_handle;

esp_lcd_touch_handle_t touch_handle;
Expand Down
12 changes: 6 additions & 6 deletions src/lvgl_ili9341.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <esp32_smartdisplay.h>

#ifdef USES_ILI9341
#ifdef LCD_USES_ILI9341

#include <driver/spi_master.h>
#include <esp_lcd_panel_io.h>
Expand Down Expand Up @@ -36,18 +36,18 @@ void lvgl_tft_init(lv_disp_drv_t *drv)
drv->rotated = LV_DISP_ROT_NONE;

// Create SPI bus
const spi_bus_config_t spi_bus_config = ILI9341_SPI_BUS_CONFIG;
ESP_ERROR_CHECK_WITHOUT_ABORT(spi_bus_initialize(ILI9341_SPI_HOST, &spi_bus_config, SPI_DMA_CH_AUTO));
const spi_bus_config_t spi_bus_config = LCD_SPI_BUS_CONFIG;
ESP_ERROR_CHECK_WITHOUT_ABORT(spi_bus_initialize(LCD_SPI_HOST, &spi_bus_config, SPI_DMA_CH_AUTO));

// Attach the LCD controller to the SPI bus
esp_lcd_panel_io_spi_config_t io_config = ILI9341_IO_SPI_CONFIG;
esp_lcd_panel_io_spi_config_t io_config = LCD_IO_SPI_CONFIG;
io_config.on_color_trans_done = ili9341_color_trans_done;
io_config.user_ctx = drv;
esp_lcd_panel_io_handle_t io_handle;
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)ILI9341_SPI_HOST, &io_config, &io_handle));
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)LCD_SPI_HOST, &io_config, &io_handle));

// Create ili9341 panel handle
const esp_lcd_panel_dev_config_t panel_dev_config = ILI9341_PANEL_DEV_CONFIG;
const esp_lcd_panel_dev_config_t panel_dev_config = LCD_PANEL_DEV_CONFIG;
esp_lcd_panel_handle_t panel_handle;
ESP_ERROR_CHECK(esp_lcd_new_panel_ili9341(io_handle, &panel_dev_config, &panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_reset(panel_handle));
Expand Down
6 changes: 3 additions & 3 deletions src/lvgl_parallel16.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <esp32_smartdisplay.h>

#ifdef USES_PARALLEL_16
#ifdef LCD_USES_DIRECT_IO

#include <esp_lcd_panel_rgb.h>
#include <esp_lcd_panel_ops.h>
Expand All @@ -27,9 +27,9 @@ void lvgl_tft_init(lv_disp_drv_t *drv)

// Create direct_io panel handle
#if LV_COLOR_16_SWAP != 0
esp_lcd_rgb_panel_config_t tft_panel_config = TFT_RGB_CONFIG_COLOR_16_SWAP;
esp_lcd_rgb_panel_config_t tft_panel_config = LCD_RGB_PANEL_CONFIG_COLOR_16_SWAP;
#else
esp_lcd_rgb_panel_config_t tft_panel_config = TFT_RGB_CONFIG;
esp_lcd_rgb_panel_config_t tft_panel_config = LCD_RGB_PANEL_CONFIG;
#endif
tft_panel_config.on_frame_trans_done = direct_io_frame_trans_done;
tft_panel_config.user_ctx = drv;
Expand Down
Loading

0 comments on commit 165b615

Please sign in to comment.