-
Notifications
You must be signed in to change notification settings - Fork 802
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/restore_lcd_st77903' into 'master'
feat(display): restore st77903 QSPI LCD See merge request ae_group/esp-iot-solution!990
- Loading branch information
Showing
43 changed files
with
3,654 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# ChangeLog | ||
|
||
## v0.4.1- 2024-05-09 | ||
|
||
### Enhancements: | ||
|
||
* Upload the driver to the espressif repository | ||
* Update test_apps | ||
* use `xPortInIsrContext()` to check whether the function is called in the ISR | ||
|
||
### bugfix | ||
|
||
* Fix the non-reentrant of the `lcd_write_cmd` function | ||
|
||
## v0.4.0- 2024-01-30 | ||
|
||
### Enhancements: | ||
|
||
* Retain the RGB interface driver in the esp-iot-solution repository, and keep only the QSPI interface driver in this repository | ||
|
||
## v0.3.1 - 2023-11-03 | ||
|
||
### bugfix | ||
|
||
* Fix the missing check of flags `auto_del_panel_io` and `mirror_by_cmd` for RGB interface | ||
* Remove LCD command `29h` from the initialization sequence for QSPI interface | ||
|
||
## v0.3.0 - 2023-09-08 | ||
|
||
### Enhancements: | ||
|
||
* Implement the driver for the ST77903 LCD controller | ||
* Support QSPI and RGB interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
idf_component_register( | ||
SRCS "esp_lcd_st77903_qspi.c" | ||
INCLUDE_DIRS "include" | ||
PRIV_REQUIRES esp_timer esp_psram | ||
REQUIRES driver esp_lcd | ||
) | ||
|
||
include(package_manager) | ||
cu_pkg_define_version(${CMAKE_CURRENT_LIST_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
menu "LCD ST77903 QSPI Configuration" | ||
config LCD_ST77903_ISR_IRAM_SAFE | ||
bool "LCD ISR IRAM-Safe" | ||
default n | ||
help | ||
Ensure the LCD interrupt is IRAM-Safe by allowing the interrupt handler to be | ||
executable when the cache is disabled (e.g. SPI Flash write). | ||
If you want the LCD driver to keep flushing the screen even when cache ops disabled, | ||
you can enable this option. Note, this will also increase the IRAM usage. | ||
|
||
config LCD_VSYNC_FRONT_NUM | ||
int "LCD VSYNC Front Porch" | ||
default 8 | ||
range 0 65535 | ||
|
||
config LCD_VSYNC_BACK_NUM | ||
int "LCD VSYNC Back Porch" | ||
default 8 | ||
range 0 65535 | ||
|
||
config LCD_LINE_INTERVAL_MIN_US | ||
int "Minimum LCD Line Interval (us)" | ||
default 42 | ||
range 40 100 | ||
|
||
config LCD_TASK_CHECK_TIME_MS | ||
int "LCD Task Check Time (ms)" | ||
default 10 | ||
range 1 100 | ||
|
||
config LCD_TASK_STOP_WAIT_TIME_MS | ||
int "LCD Task Stop Wait Time (ms)" | ||
default 200 | ||
range 1 1000 | ||
|
||
config LCD_TASK_STOP_TIME_MAX_MS | ||
int "Maximum LCD Task Stop Time (ms)" | ||
default 1000 | ||
range 1 10000 | ||
|
||
config LCD_READ_WAIT_TIME_MAX_MS | ||
int "LCD Read Wait Time (ms)" | ||
default 10 | ||
range 1 100 | ||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# ESP LCD ST77903 (QSPI) | ||
|
||
Implementation of the ST77903 QSPI LCD controller with [esp_lcd](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/lcd.html) component. | ||
|
||
| LCD controller | Communication interface | Component name | Link to datasheet | | ||
| :------------: | :---------------------: | :------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------: | | ||
| ST77903 | QSPI | esp_lcd_ST77903_qspi | [PDF1](https://dl.espressif.com/AE/esp-iot-solution/ST77903_SPEC_P0.5.pdf), [PDF2](https://dl.espressif.com/AE/esp-iot-solution/ST77903_Customer_Application_Notes.pdf) | | ||
|
||
## Initialization Code | ||
|
||
```c | ||
/** | ||
* Uncomment these line if use custom initialization commands. | ||
* The array should be declared as static const and positioned outside the function. | ||
*/ | ||
// static const st77903_lcd_init_cmd_t lcd_init_cmds[] = { | ||
// // {cmd, { data }, data_size, delay_ms} | ||
// {0xf0, (uint8_t []){0xc3}, 1, 0}, | ||
// {0xf0, (uint8_t []){0x96}, 1, 0}, | ||
// {0xf0, (uint8_t []){0xa5}, 1, 0}, | ||
// ... | ||
// }; | ||
|
||
ESP_LOGI(TAG, "Install st77903 panel driver"); | ||
esp_lcd_panel_handle_t panel_handle = NULL; | ||
st77903_qspi_config_t qspi_config = ST77903_QSPI_CONFIG_DEFAULT(EXAMPLE_LCD_HOST, | ||
EXAMPLE_PIN_NUM_LCD_QSPI_CS, | ||
EXAMPLE_PIN_NUM_LCD_QSPI_PCLK, | ||
EXAMPLE_PIN_NUM_LCD_QSPI_DATA0, | ||
EXAMPLE_PIN_NUM_LCD_QSPI_DATA1, | ||
EXAMPLE_PIN_NUM_LCD_QSPI_DATA2, | ||
EXAMPLE_PIN_NUM_LCD_QSPI_DATA3, | ||
1, | ||
EXAMPLE_LCD_QSPI_H_RES, | ||
EXAMPLE_LCD_QSPI_V_RES); | ||
st77903_vendor_config_t vendor_config = { | ||
.qspi_config = &qspi_config, | ||
// .init_cmds = lcd_init_cmds, // Uncomment these line if use custom initialization commands | ||
// .init_cmds_size = sizeof(lcd_init_cmds) / sizeof(st77903_lcd_init_cmd_t), | ||
.flags = { | ||
.mirror_by_cmd = 1, // Implemented by LCD command `36h` | ||
}, | ||
}; | ||
const esp_lcd_panel_dev_config_t panel_config = { | ||
.reset_gpio_num = EXAMPLE_PIN_NUM_LCD_RST, | ||
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, // Implemented by LCD command `36h` | ||
.bits_per_pixel = EXAMPLE_LCD_BIT_PER_PIXEL, // Implemented by LCD command `3Ah` (16/18/24) | ||
.vendor_config = &vendor_config, | ||
}; | ||
ESP_ERROR_CHECK(esp_lcd_new_panel_st77903(&panel_config, &panel_handle)); | ||
ESP_ERROR_CHECK(esp_lcd_panel_reset(panel_handle)); | ||
ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, true, false)); // This function can only be called when the refresh task is not running | ||
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_handle, true)); // This function can control the display on/off and the refresh task run/stop | ||
ESP_ERROR_CHECK(esp_lcd_panel_init(panel_handle)); // Start the refresh task | ||
``` |
Oops, something went wrong.