Page 1 of 2
【已解决】ESP32-S3如何驱动QSPI接口的LCD?
Posted: Fri Jun 30, 2023 12:01 pm
by seanfan@qq.com
目前项目用ESP32-S3来驱动QSPI接口的LCD,驱动IC为GC9B71(规格书参考附件)。试着在ESP-IDF的范例spi_lcd_touch_example_main基础修改了一下,没办法点亮屏,已修改部分请参考附件代码。发现应该要修改esp_lcd_panel_io_spi.c这个文件来适配QSPI的时序。
请问能否提供一些修改指南?或者类似项目参考,谢谢!
Re: ESP32-S3如何驱动QSPI接口的LCD?
Posted: Mon Jul 03, 2023 2:27 am
by liyang5945
目前lilygo有一款开发板配了QSPI的屏幕,你可以去他们github仓库看一下,里面有QSPI屏幕驱动,稍微改下参数应该就可以用
https://github.com/Xinyuan-LilyGO/T-Dis ... m67162.cpp
Re: ESP32-S3如何驱动QSPI接口的LCD?
Posted: Mon Jul 17, 2023 2:34 am
by mainy4210
请问一下是否已经点亮了吗,可以发一份资料到邮箱:
1443176576@qq.com吗?
Re: ESP32-S3如何驱动QSPI接口的LCD?
Posted: Tue Jul 18, 2023 11:50 am
by ESP_lzw655
目前官方仅适配过 ST77903 这一款 QSPI LCD(无内置 GRAM),参考 issue
https://github.com/espressif/esp-idf/is ... 1622838282.
而 GC9B71 有内置 GRAM,驱动方式有很大不同,但通过自行配置 SPI 是可以实现的,关键在于发送颜色数据时 spi_transaction_t 需要使用 SPI_TRANS_MODE_QIO 标志使能 4-bit 模式,而发送命令时 spi_transaction_t 仅使用 1-bit。
Re: ESP32-S3如何驱动QSPI接口的LCD?
Posted: Wed Jul 19, 2023 2:26 am
by ESP_lzw655
Re: ESP32-S3如何驱动QSPI接口的LCD?
Posted: Sun Aug 06, 2023 3:58 am
by gonghongliang
After using this example(SPD2010), I lit up the screen, but encountered the same problem as in the video(
https://www.bilibili.com/video/BV1Lj411 ... da6a91f2ad), which has incorrect pixels when only refreshing the arc.Other shapes were normal.
i have test it on gc9b71 and SPD2010(as you have mentiented), all are exactly the same error.
i use gc9b71 example in
https://github.com/DoctorTag/esp32S3_watch
I strongly suspect that this may be a bug in lvgl(no matter 8.0~8.3)
Re: ESP32-S3如何驱动QSPI接口的LCD?
Posted: Tue Aug 08, 2023 8:09 am
by ESP_lzw655
Sorry, I can't see the specific reason right now either.
However, the probability of LVGL having a bug is relatively low, as we've successfully run this demo on other screens.
In the next two weeks, I'll attempt to drive the SPD2010 and GC9B71 displays to see if the same issue arises.
Re: ESP32-S3如何驱动QSPI接口的LCD?
Posted: Thu Aug 17, 2023 5:35 am
by ESP_lzw655
gonghongliang wrote:
After using this example(SPD2010), I lit up the screen, but encountered the same problem as in the video(
https://www.bilibili.com/video/BV1Lj411 ... da6a91f2ad), which has incorrect pixels when only refreshing the arc.Other shapes were normal.
i have test it on gc9b71 and SPD2010(as you have mentiented), all are exactly the same error.
i use gc9b71 example in
https://github.com/DoctorTag/esp32S3_watch
I strongly suspect that this may be a bug in lvgl(no matter 8.0~8.3)
Good news, I successfully drive the GC9B71 QSPI LCD. The demo project is as below. Please carefully read the "README.md" and configure ESP-IDF as required.
- lvgl.jpg (116.39 KiB) Viewed 8171 times
And I also have the same problem as below before. This situation occurs when I draw color bars every 2N+1 (N is an integer) rows or columns, but when I refresh every 2N (N is an integer) rows or columns, the display appears normal.
- bad.jpg (211.16 KiB) Viewed 8171 times
So I use the below code to round the start coordinate into 2N, and round the end coordinate into 2M+1. Then register it into LVGL by rounder_cb of lv_disp_drv_t.
Code: Select all
void lvgl_port_rounder_callback(struct _lv_disp_drv_t * disp_drv, lv_area_t * area)
{
uint16_t x1 = area->x1;
uint16_t x2 = area->x2;
uint16_t y1 = area->y1;
uint16_t y2 = area->y2;
// round the start of area down to the nearest even number
area->x1 = x1 > 0 ? (((x1 - 1) >> 1) << 1) : 0;
area->y1 = y1 > 0 ? (((y1 - 1) >> 1) << 1) : 0;
// round the end of area up to the nearest odd number
area->x2 = ((x2 >> 1) << 1) + 1;
area->y2 = ((y2 >> 1) << 1) + 1;
}
Re: ESP32-S3如何驱动QSPI接口的LCD?
Posted: Thu Aug 17, 2023 5:37 am
by ESP_lzw655
seanfan@qq.com wrote: ↑Fri Jun 30, 2023 12:01 pm
目前项目用ESP32-S3来驱动QSPI接口的LCD,驱动IC为GC9B71(规格书参考附件)。试着在ESP-IDF的范例spi_lcd_touch_example_main基础修改了一下,没办法点亮屏,已修改部分请参考附件代码。发现应该要修改esp_lcd_panel_io_spi.c这个文件来适配QSPI的时序。
请问能否提供一些修改指南?或者类似项目参考,谢谢!
请参考最新回复。
Re: ESP32-S3如何驱动QSPI接口的LCD?
Posted: Thu Aug 17, 2023 2:31 pm
by gonghongliang
Code runs perfectly!