-
Notifications
You must be signed in to change notification settings - Fork 5.3k
新增gd32470z-lckfb配套LCD驱动 #10311
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
新增gd32470z-lckfb配套LCD驱动 #10311
Conversation
|
CI问题解决一下,参考https://club.rt-thread.org/ask/article/5c41835bb8ff9b41.html 添加一下yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds official support for the GD32470Z-LCKFB board’s 800×480 RGB LCD and FT5206 capacitive touch panel, including display drivers, touch drivers, example application, and build configuration updates.
- Integrated TLI and GPU source files into the GD32F4xx firmware SConscript
- Added font bitmap array, LCD driver, touch driver, and drawing panel example
- Updated Kconfig, board README, and top-level SConstruct to enable new features
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| bsp/gd32/arm/libraries/GD32F4xx_Firmware_Library/SConscript | Conditionally include TLI and GPU source files |
| bsp/gd32/arm/gd32470z-lckfb/board/ports/font.h | Added ASCII font bitmap array |
| bsp/gd32/arm/gd32470z-lckfb/board/ports/drv_touch.h | Introduced FT5206 touch controller macros and APIs |
| bsp/gd32/arm/gd32470z-lckfb/board/ports/drv_touch.c | Implemented I²C bit-banged touch routines |
| bsp/gd32/arm/gd32470z-lckfb/board/ports/drv_lcd.h | Defined LCD parameters and frame buffer extern |
| bsp/gd32/arm/gd32470z-lckfb/board/ports/draw_panel.c | Added interactive draw panel example |
| bsp/gd32/arm/gd32470z-lckfb/board/ports/SConscript | Build script to compile new drivers and example |
| bsp/gd32/arm/gd32470z-lckfb/board/ports/README.md | Usage instructions for enabling LCD and touch modules |
| bsp/gd32/arm/gd32470z-lckfb/board/Kconfig | Configuration options for LCD, touch, GPU, examples |
| bsp/gd32/arm/gd32470z-lckfb/SConstruct | Top-level inclusion of the new ports SConscript |
Comments suppressed due to low confidence (1)
bsp/gd32/arm/gd32470z-lckfb/board/ports/font.h:4
- [nitpick] The font array asc2_1608 is globally visible. Consider adding 'static' to limit its linkage or moving it to .c if it’s internal, to avoid symbol collisions.
const unsigned char asc2_1608[95][16]={
| #define CT_SDA_IN() gpio_mode_set(SCL_PORT, GPIO_MODE_INPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=0<<2*11;} //PF11输入模式 | ||
| #define CT_SDA_OUT() gpio_mode_set(SCL_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=1<<2*11;} //PF11输出模式 |
Copilot
AI
May 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CT_SDA_IN macro configures SDA_PIN on SCL_PORT instead of SDA_PORT. It should use SDA_PORT to set the correct pin direction.
| #define CT_SDA_IN() gpio_mode_set(SCL_PORT, GPIO_MODE_INPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=0<<2*11;} //PF11输入模式 | |
| #define CT_SDA_OUT() gpio_mode_set(SCL_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=1<<2*11;} //PF11输出模式 | |
| #define CT_SDA_IN() gpio_mode_set(SDA_PORT, GPIO_MODE_INPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=0<<2*11;} //PF11输入模式 | |
| #define CT_SDA_OUT() gpio_mode_set(SDA_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=1<<2*11;} //PF11输出模式 |
| #define CT_SDA_IN() gpio_mode_set(SCL_PORT, GPIO_MODE_INPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=0<<2*11;} //PF11输入模式 | ||
| #define CT_SDA_OUT() gpio_mode_set(SCL_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=1<<2*11;} //PF11输出模式 |
Copilot
AI
May 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CT_SDA_OUT macro also configures SDA_PIN on SCL_PORT instead of SDA_PORT; update to use SDA_PORT.
| #define CT_SDA_IN() gpio_mode_set(SCL_PORT, GPIO_MODE_INPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=0<<2*11;} //PF11输入模式 | |
| #define CT_SDA_OUT() gpio_mode_set(SCL_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=1<<2*11;} //PF11输出模式 | |
| #define CT_SDA_IN() gpio_mode_set(SDA_PORT, GPIO_MODE_INPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=0<<2*11;} //PF11输入模式 | |
| #define CT_SDA_OUT() gpio_mode_set(SDA_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=1<<2*11;} //PF11输出模式 |
| #define CT_SDA_IN() gpio_mode_set(SCL_PORT, GPIO_MODE_INPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=0<<2*11;} //PF11输入模式 | ||
| #define CT_SDA_OUT() gpio_mode_set(SCL_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_PULLUP, SDA_PIN); //{GPIOF->MODER&=~(3<<(2*11));GPIOF->MODER|=1<<2*11;} //PF11输出模式 | ||
| // IO操作函数 | ||
| #define CT_IIC_SCL // PBout(0) //SCL |
Copilot
AI
May 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CT_IIC_SCL macro is defined as empty, making it a no-op. Either implement it or remove the unused macro to avoid confusion.
| #define CT_IIC_SCL // PBout(0) //SCL | |
| #define CT_IIC_SCL SCL_TOGGLE // PBout(0) //SCL |
| #define FT_CMD_WR 0X70 // 写命令 | ||
| #define FT_CMD_RD 0X71 // 读命令 | ||
| // FT5206 部分寄存器定义 | ||
| #define FT_DEVIDE_MODE 0x00 // FT5206模式控制寄存器 |
Copilot
AI
May 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The macro name FT_DEVIDE_MODE has a typo (‘DEVIDE’); it should be renamed to FT_DEVICE_MODE for clarity.
| #define FT_DEVIDE_MODE 0x00 // FT5206模式控制寄存器 | |
| #define FT_DEVICE_MODE 0x00 // FT5206模式控制寄存器 |
| return; | ||
| } | ||
| //如果离开了y轴触摸范围 | ||
| if (tp_dev.y[contact] <= sy && tp_dev.y[contact] >= ey) |
Copilot
AI
May 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In letgo_scan the y-axis check uses && but should use || to detect leaving the vertical range (y <= sy OR y >= ey).
| if (tp_dev.y[contact] <= sy && tp_dev.y[contact] >= ey) | |
| if (tp_dev.y[contact] <= sy || tp_dev.y[contact] >= ey) |
| // 返回从机有无应答 | ||
| // 1,有应答 | ||
| // 0,无应答 |
Copilot
AI
May 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment above CT_IIC_Send_Byte describes return values, but the function signature returns void. Update or remove the inaccurate comment.
| // 返回从机有无应答 | |
| // 1,有应答 | |
| // 0,无应答 | |
| // 发送一个字节数据到I2C总线 |
| extern uint16_t ltdc_lcd_framebuf0[800][480] __attribute__((at(LCD_FRAME_BUF_ADDR))); | ||
| #elif defined(__GNUC__) | ||
| // GCC 编译器 (如 RT-Thread 使用的 GCC) | ||
| extern uint16_t ltdc_lcd_framebuf0[10][10]; |
Copilot
AI
May 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The frame buffer is declared as [10][10] in the GCC branch, which doesn’t match the LCD dimensions (800×480). It should be declared [800][480].
| extern uint16_t ltdc_lcd_framebuf0[10][10]; | |
| extern uint16_t ltdc_lcd_framebuf0[LCD_WIDTH][LCD_HEIGHT]; |
|
ci有时候抽风,可能是因为速率问题导致没拿到这里的api,下次遇到这种情况重新触发一下就好了 |
|
@godmial 代码需要格式化下,可以详见ci的报错:https://github.com/RT-Thread/rt-thread/actions/runs/15200966966/job/42754910481?pr=10311 |
| _widget_object_struct button_clear, button_color, button_pixel, button_eraser; | ||
|
|
||
|
|
||
| /********************************************************** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.使用RTT的编程规范修改注释 2.readme文件新增注意事项以及原作者信息
|
可以的话作者可以把自己添加到 rtthread/MAINTAINERS 中,这样后续有人改动相关文件,可以由您来负责审核 |
那太好了 |
|
@godmial 能否参与到对该BSP:GD32407z-lckfb 的维护?我们最低只接受bsp及其递归目录下的维护申请,如果您有意向重点维护此bsp,可以提个PR修改MAINTAINERS,修改您的信息如下: tag: bsp_gd32470z-lckfb
path: bsp/gd32/arm/gd32470z-lckfb
owners: Wu Ying Xiang(godmial)<2633967641@qq.com>同时请遵循MAINTAINERS修改规则,根据tag按字母顺序排序 |
我个人是非常愿意的,但是我并不是本BSP的作者,我需要征求一下BSP作者的同意 |
|
@godmial 你可以以协助者的身份来review此bsp相关的PR,审核团不强制要求必须是作为作者来review |
目前已经征得BSP作者同意 |
拉取/合并请求描述:(PR description)
为什么提交这份PR (why to submit this PR)
gd32470z-lckfb新增官方配套800x480 RGB LCD屏幕的显示驱动与触摸驱动,开发板运行比较稳定。

请提供验证的bsp和config (provide the config and bsp)
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up