Skip to content

fix(examples): fix LVGL_PORT_ROTATION_DEGREE issue #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# ChangeLog

## v0.1.6 - 2024-07-30

### Enhancements:

* feat(board): add support for Fitipower EK9716B LCD controller for CrowPanel 7.0" board by @lboue (#78)

### Bugfixes:

* fix(examples): fix `LVGL_PORT_ROTATION_DEGREE` issue by @lboue (#76)
* fix(examples): fix issue with I2C.ino `EXAMPLE_TOUCH_ADDRESS` missing as variable by @lboue (#84)
* fix(examples): fix WiFiClock wrong name `ScreenPassord` by @lboue (#82)
* fix(examples): fix LCD using `configVendorCommands()` before `init()`
* fix(examples): fix `LV_USE_DEMO_WIDGETS` typo by @lboue (#98)
* fix(examples): fix `Tearing fucntion` typo by @lboue (#96)
* fix(examples): fix WiFiClock log HTTP error code to serial console by @lboue (#97)
* fix(gt911): allow to set the GT911 touch device address by @lboue (#86)
* fix(conf): fix the issue that the `ESP_PANEL_EXPANDER_HOST_ID` flag is not working properly
* fix(conf): fix `LCD Venbdor` typo (#92)

## v0.1.5 - 2024-07-09

### Enhancements:
Expand Down
16 changes: 10 additions & 6 deletions ESP_Panel_Board_Custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#if ESP_PANEL_USE_LCD
/**
* LCD Controller Name. Choose one of the following:
* - EK9716B
* - GC9A01, GC9B71, GC9503
* - ILI9341
* - NV3022B
Expand Down Expand Up @@ -164,7 +165,7 @@
#endif /* ESP_PANEL_LCD_BUS_TYPE */

/**
* LCD Venbdor Initialization Commands.
* LCD Vendor Initialization Commands.
*
* Vendor specific initialization can be different between manufacturers, should consult the LCD supplier for
* initialization sequence code. Please uncomment and change the following macro definitions. Otherwise, the LCD driver
Expand Down Expand Up @@ -247,8 +248,11 @@
/* Touch panel bus parameters */
#if ESP_PANEL_TOUCH_BUS_TYPE == ESP_PANEL_BUS_TYPE_I2C

#define ESP_PANEL_TOUCH_BUS_HOST_ID (0) // Typically set to 0 to use the default address
#define ESP_PANEL_TOUCH_I2C_ADDRESS (0) // For GT911, there are two addresses: 0x5D(default) and 0x14
#define ESP_PANEL_TOUCH_BUS_HOST_ID (0) // Typically set to 0
#define ESP_PANEL_TOUCH_I2C_ADDRESS (0) // Typically set to 0 to use the default address.
// - For touchs with only one address, set to 0
// - For touchs with multiple addresses, set to 0 or the address
// Like GT911, there are two addresses: 0x5D(default) and 0x14
#if !ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST
#define ESP_PANEL_TOUCH_I2C_CLK_HZ (400 * 1000)
// Typically set to 400K
Expand Down Expand Up @@ -331,11 +335,11 @@
*/
#define ESP_PANEL_EXPANDER_SKIP_INIT_HOST (0) // 0/1
/* IO expander parameters */
#define ESP_PANEL_EXPANDER_HOST_ID (0) // Typically set to 0
#define ESP_PANEL_EXPANDER_I2C_ADDRESS (0x20) // The actual I2C address. Even for the same model of IC,
// the I2C address may be different, and confirmation based on
// the actual hardware connection is required
#if !ESP_PANEL_EXPANDER_SKIP_INIT_HOST
#define ESP_PANEL_EXPANDER_HOST_ID (0) // Typically set to 0
#define ESP_PANEL_EXPANDER_I2C_CLK_HZ (400 * 1000)
// Typically set to 400K
#define ESP_PANEL_EXPANDER_I2C_SCL_PULLUP (1) // 0/1
Expand Down Expand Up @@ -371,8 +375,8 @@
*
*/
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 3
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 2
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1

#endif /* ESP_PANEL_USE_CUSTOM_BOARD */

Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ ESP32_Display_Panel 会根据 [ESP_Panel_Board_Custom.h](./ESP_Panel_Board_Custo
#endif /* ESP_PANEL_LCD_BUS_TYPE */
...
/**
* LCD Venbdor Initialization Commands.
* LCD Vendor Initialization Commands.
*
* Vendor specific initialization can be different between manufacturers, should consult the LCD supplier for
* initialization sequence code. Please uncomment and change the following macro definitions. Otherwise, the LCD driver
Expand Down
105 changes: 57 additions & 48 deletions examples/LCD/3wireSPI_RGB/3wireSPI_RGB.ino
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,21 @@
* - GC9503
* - ST7701
*/
#define EXAMPLE_LCD_NAME ST7701
#define EXAMPLE_LCD_WIDTH (480)
#define EXAMPLE_LCD_HEIGHT (480)
#define EXAMPLE_LCD_COLOR_BITS (18)
#define EXAMPLE_LCD_RGB_DATA_WIDTH (16)
#define EXAMPLE_LCD_RGB_TIMING_FREQ_HZ (16 * 1000 * 1000)
#define EXAMPLE_LCD_RGB_TIMING_HPW (10)
#define EXAMPLE_LCD_RGB_TIMING_HBP (10)
#define EXAMPLE_LCD_RGB_TIMING_HFP (20)
#define EXAMPLE_LCD_RGB_TIMING_VPW (10)
#define EXAMPLE_LCD_RGB_TIMING_VBP (10)
#define EXAMPLE_LCD_RGB_TIMING_VFP (10)
#define EXAMPLE_LCD_NAME ST7701
#define EXAMPLE_LCD_WIDTH (480)
#define EXAMPLE_LCD_HEIGHT (480)
// | 8-bit RGB888 | 16-bit RGB565 |
#define EXAMPLE_LCD_COLOR_BITS (18) // | 24 | 16/18/24 |
#define EXAMPLE_LCD_RGB_DATA_WIDTH (16) // | 8 | 16 |
#define EXAMPLE_LCD_RGB_TIMING_FREQ_HZ (16 * 1000 * 1000)
#define EXAMPLE_LCD_RGB_TIMING_HPW (10)
#define EXAMPLE_LCD_RGB_TIMING_HBP (10)
#define EXAMPLE_LCD_RGB_TIMING_HFP (20)
#define EXAMPLE_LCD_RGB_TIMING_VPW (10)
#define EXAMPLE_LCD_RGB_TIMING_VBP (10)
#define EXAMPLE_LCD_RGB_TIMING_VFP (10)
#define EXAMPLE_LCD_USE_EXTERNAL_CMD (0)
#if EXAMPLE_LCD_USE_EXTERNAL_CMD
/**
* LCD initialization commands.
*
Expand All @@ -77,17 +80,18 @@
* 2. Formater: ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(delay_ms, command, { data0, data1, ... }) and
* ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(delay_ms, command)
*/
// const esp_lcd_panel_vendor_init_cmd_t lcd_init_cmd[] = {
// {0xFF, (uint8_t []){0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0},
// {0xC0, (uint8_t []){0x3B, 0x00}, 2, 0},
// {0xC1, (uint8_t []){0x0D, 0x02}, 2, 0},
// {0x29, (uint8_t []){0x00}, 0, 120},
// // or
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x10}),
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC0, {0x3B, 0x00}),
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x0D, 0x02}),
// ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(120, 0x29),
// };
const esp_lcd_panel_vendor_init_cmd_t lcd_init_cmd[] = {
// {0xFF, (uint8_t []){0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0},
// {0xC0, (uint8_t []){0x3B, 0x00}, 2, 0},
// {0xC1, (uint8_t []){0x0D, 0x02}, 2, 0},
// {0x29, (uint8_t []){0x00}, 0, 120},
// // or
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x10}),
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC0, {0x3B, 0x00}),
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x0D, 0x02}),
// ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(120, 0x29),
};
#endif

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////// Please update the following configuration according to your board spec ////////////////////////////
Expand All @@ -97,29 +101,31 @@
#define EXAMPLE_LCD_PIN_NUM_RGB_HSYNC (16)
#define EXAMPLE_LCD_PIN_NUM_RGB_DE (18)
#define EXAMPLE_LCD_PIN_NUM_RGB_PCLK (21)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA0 (4)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA1 (5)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA2 (6)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA3 (7)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA4 (15)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA5 (8)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA6 (20)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA7 (3)
// | RGB565 | RGB666 | RGB888 |
// |--------|--------|--------|
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA0 (4) // | B0 | B0-1 | B0-3 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA1 (5) // | B1 | B2 | B4 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA2 (6) // | B2 | B3 | B5 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA3 (7) // | B3 | B4 | B6 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA4 (15) // | B4 | B5 | B7 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA5 (8) // | G0 | G0 | G0-2 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA6 (20) // | G1 | G1 | G3 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA7 (3) // | G2 | G2 | G4 |
#if EXAMPLE_LCD_RGB_DATA_WIDTH > 8
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA8 (46)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA9 (9)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA10 (10)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA11 (11)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA12 (12)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA13 (13)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA14 (14)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA15 (0)
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA8 (46) // | G3 | G3 | G5 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA9 (9) // | G4 | G4 | G6 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA10 (10) // | G5 | G5 | G7 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA11 (11) // | R0 | R0-1 | R0-3 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA12 (12) // | R1 | R2 | R4 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA13 (13) // | R2 | R3 | R5 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA14 (14) // | R3 | R4 | R6 |
#define EXAMPLE_LCD_PIN_NUM_RGB_DATA15 (0) // | R4 | R5 | R7 |
#endif
#define EXAMPLE_LCD_PIN_NUM_SPI_CS (39)
#define EXAMPLE_LCD_PIN_NUM_SPI_SCK (48)
#define EXAMPLE_LCD_PIN_NUM_SPI_SDA (47)
#define EXAMPLE_LCD_PIN_NUM_RST (-1)
#define EXAMPLE_LCD_PIN_NUM_BK_LIGHT (38)
#define EXAMPLE_LCD_PIN_NUM_RST (-1) // Set to -1 if not used
#define EXAMPLE_LCD_PIN_NUM_BK_LIGHT (38) // Set to -1 if not used
#define EXAMPLE_LCD_BK_LIGHT_ON_LEVEL (1)
#define EXAMPLE_LCD_BK_LIGHT_OFF_LEVEL !EXAMPLE_LCD_BK_LIGHT_ON_LEVEL

Expand All @@ -132,15 +138,15 @@
#if EXAMPLE_ENABLE_PRINT_LCD_FPS
#define EXAMPLE_LCD_FPS_COUNT_MAX (100)

DRAM_ATTR int frame_count = 0;
DRAM_ATTR int fps = 0;
DRAM_ATTR long start_time = 0;

IRAM_ATTR bool onVsyncEndCallback(void *user_data)
{
long frame_start_time = *(long *)user_data;
DRAM_ATTR static int frame_count = 0;
DRAM_ATTR static long frame_start_time = 0;

if (frame_start_time == 0) {
(*(long *)user_data) = millis();
frame_start_time = millis();

return false;
}
Expand All @@ -149,7 +155,7 @@ IRAM_ATTR bool onVsyncEndCallback(void *user_data)
if (frame_count >= EXAMPLE_LCD_FPS_COUNT_MAX) {
fps = EXAMPLE_LCD_FPS_COUNT_MAX * 1000 / (millis() - frame_start_time);
frame_count = 0;
(*(long *)user_data) = millis();
frame_start_time = millis();
}

return false;
Expand Down Expand Up @@ -204,13 +210,16 @@ void setup()

Serial.println("Create LCD device");
ESP_PanelLcd *lcd = new EXAMPLE_LCD_CLASS(EXAMPLE_LCD_NAME, lcd_bus, EXAMPLE_LCD_COLOR_BITS, EXAMPLE_LCD_PIN_NUM_RST);
// lcd->configVendorCommands(lcd_init_cmd, sizeof(lcd_init_cmd)/sizeof(lcd_init_cmd[0]));
#if EXAMPLE_LCD_USE_EXTERNAL_CMD
// Configure external initialization commands, should called before `init()`
lcd->configVendorCommands(lcd_init_cmd, sizeof(lcd_init_cmd)/sizeof(lcd_init_cmd[0]));
#endif
lcd->init();
lcd->reset();
lcd->begin();
lcd->displayOn();
#if EXAMPLE_ENABLE_PRINT_LCD_FPS
lcd->attachRefreshFinishCallback(onVsyncEndCallback, (void *)&start_time);
lcd->attachRefreshFinishCallback(onVsyncEndCallback, nullptr);
#endif

Serial.println("Draw color bar from top left to bottom right, the order is B - G - R");
Expand Down
35 changes: 20 additions & 15 deletions examples/LCD/QSPI/QSPI.ino
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
#define EXAMPLE_LCD_HEIGHT (300)
#define EXAMPLE_LCD_COLOR_BITS (16)
#define EXAMPLE_LCD_SPI_FREQ_HZ (40 * 1000 * 1000)
#define EXAMPLE_LCD_USE_EXTERNAL_CMD (0)
#if EXAMPLE_LCD_USE_EXTERNAL_CMD
/**
* LCD initialization commands.
*
Expand All @@ -85,17 +87,18 @@
* 2. Formater: ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(delay_ms, command, { data0, data1, ... }) and
* ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(delay_ms, command)
*/
// const esp_lcd_panel_vendor_init_cmd_t lcd_init_cmd[] = {
// {0xFF, (uint8_t []){0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0},
// {0xC0, (uint8_t []){0x3B, 0x00}, 2, 0},
// {0xC1, (uint8_t []){0x0D, 0x02}, 2, 0},
// {0x29, (uint8_t []){0x00}, 0, 120},
// // or
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x10}),
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC0, {0x3B, 0x00}),
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x0D, 0x02}),
// ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(120, 0x29),
// };
const esp_lcd_panel_vendor_init_cmd_t lcd_init_cmd[] = {
// {0xFF, (uint8_t []){0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0},
// {0xC0, (uint8_t []){0x3B, 0x00}, 2, 0},
// {0xC1, (uint8_t []){0x0D, 0x02}, 2, 0},
// {0x29, (uint8_t []){0x00}, 0, 120},
// // or
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x10}),
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC0, {0x3B, 0x00}),
// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x0D, 0x02}),
// ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(120, 0x29),
};
#endif

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////// Please update the following configuration according to your board spec ////////////////////////////
Expand All @@ -106,10 +109,9 @@
#define EXAMPLE_LCD_PIN_NUM_SPI_DATA1 (12)
#define EXAMPLE_LCD_PIN_NUM_SPI_DATA2 (13)
#define EXAMPLE_LCD_PIN_NUM_SPI_DATA3 (14)
#define EXAMPLE_LCD_PIN_NUM_RST (3)
#define EXAMPLE_LCD_PIN_NUM_BK_LIGHT (-1)
#define EXAMPLE_LCD_PIN_NUM_RST (3) // Set to -1 if not used
#define EXAMPLE_LCD_PIN_NUM_BK_LIGHT (-1) // Set to -1 if not used
#define EXAMPLE_LCD_BK_LIGHT_ON_LEVEL (1)

#define EXAMPLE_LCD_BK_LIGHT_OFF_LEVEL !EXAMPLE_LCD_BK_LIGHT_ON_LEVEL

/* Enable or disable the attachment of a callback function that is called after each bitmap drawing is completed */
Expand Down Expand Up @@ -148,9 +150,12 @@ void setup()

Serial.println("Create LCD device");
ESP_PanelLcd *lcd = new EXAMPLE_LCD_CLASS(EXAMPLE_LCD_NAME, panel_bus, EXAMPLE_LCD_COLOR_BITS, EXAMPLE_LCD_PIN_NUM_RST);
#if EXAMPLE_LCD_USE_EXTERNAL_CMD
// Configure external initialization commands, should called before `init()`
lcd->configVendorCommands(lcd_init_cmd, sizeof(lcd_init_cmd)/sizeof(lcd_init_cmd[0]));
#endif
lcd->init();
lcd->reset();
// lcd->configVendorCommands(lcd_init_cmd, sizeof(lcd_init_cmd)/sizeof(lcd_init_cmd[0]));
lcd->begin();
lcd->displayOn();
#if EXAMPLE_ENABLE_ATTACH_CALLBACK
Expand Down
12 changes: 4 additions & 8 deletions examples/LCD/RGB/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
| Supported ESP SoCs |
| ------------------ |
| ESP32-S3 |

| Supported LCD Controllers |
| ------------------------- |
| EK9716B |
| ST7262 |
| Supported ESP SoCs | ESP32-S3 |
| ------------------ | -------- |

| Supported LCD Controllers | EK9716B | ST7262 |
| ------------------------- | ------- | ------ |

# Single RGB LCD Example

Expand Down
Loading
Loading