add:添加lcd spi 通用驱动 软件包 lcd_spi_driver#1964
add:添加lcd spi 通用驱动 软件包 lcd_spi_driver#1964PeakRacing wants to merge 1 commit intoRT-Thread:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new package lcd_spi_driver to the RT-Thread Packages repository under the peripherals category. The package provides a generic SPI driver for LCD displays, supporting multiple LCD controller types including ST7789V2, ST7735S, ST7796S, ILI9341, ILI9486, GC9A01, and NV3030B.
Note on PR Metadata:
- PR Title: The current title "add:添加lcd spi 通用驱动 软件包 lcd_spi_driver" mixes English and Chinese and should follow repository conventions. Suggested format:
add(lcd_spi_driver): add LCD SPI generic driver packageor[peripherals/lcd_spi_driver] add LCD SPI generic driver package. - PR Description: The description is minimal and should be expanded to include What/Why/How, a list of modified files, and a reference to the upstream repository release/tag.
Changes:
- Added
package.jsonwith package metadata including name, description, author, license, and repository information - Added comprehensive
Kconfigwith configuration options for LCD controller selection, orientation, dimensions, SPI settings, and pin configurations - Updated peripherals category
Kconfigto source the new package
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| peripherals/lcd_spi_driver/package.json | Defines package metadata and version information for the lcd_spi_driver package |
| peripherals/lcd_spi_driver/Kconfig | Provides configuration options for LCD controller selection, display parameters, SPI settings, and backlight control |
| peripherals/Kconfig | Adds source directive to include the new lcd_spi_driver package in peripherals menu |
| { | ||
| "version": "latest", | ||
| "URL": "https://github.com/PeakRacing/lcd_spi_driver.git", | ||
| "filename": "", |
There was a problem hiding this comment.
The "filename" field should not be an empty string. For git-based "latest" versions, it should contain a descriptive filename.
English: Update the "filename" field to a descriptive name, such as "lcd_spi_driver-latest.zip" or "Null for git package" (as seen in other packages). An empty string is not an appropriate value.
中文:将 "filename" 字段更新为描述性名称,例如 "lcd_spi_driver-latest.zip" 或 "Null for git package"(如其他软件包所示)。空字符串不是合适的值。
Reference examples: peripherals/ili9341/package.json:28, peripherals/gc9a01/package.json:26
| config PKG_LCD_SPI_USING_LCD_ST7789V2 | ||
| bool "ST7789V2" | ||
| config PKG_LCD_SPI_USING_LCD_ST7735S | ||
| bool "ST7735S" | ||
| config PKG_LCD_SPI_USING_LCD_ST7796S | ||
| bool "ST7796S" | ||
| config PKG_LCD_SPI_USING_LCD_ILI9341 | ||
| bool "ILI9341" | ||
| config PKG_LCD_SPI_USING_LCD_ILI9486 | ||
| bool "ILI9486" | ||
| config PKG_LCD_SPI_USING_LCD_GC9A01 | ||
| bool "GC9A01" | ||
| config PKG_LCD_SPI_USING_LCD_NV3030B | ||
| bool "NV3030B" | ||
| endchoice | ||
|
|
||
| menu "LCD Configuration" | ||
|
|
||
| choice | ||
| prompt "LCD Orientation" | ||
| default PKG_LCD_SPI_DIRECTION_0 | ||
| config PKG_LCD_SPI_DIRECTION_0 |
There was a problem hiding this comment.
Kconfig option naming is inconsistent. The package uses "PKG_LCD_SPI_DRIVER" as the base, but feature options use "PKG_LCD_SPI_" prefix instead of the full package name prefix.
English: For consistency with RT-Thread Packages conventions, feature options should use a consistent prefix. Consider:
- Option 1: Use "LCD_SPI_DRIVER_" prefix for all feature options (e.g., "LCD_SPI_DRIVER_USING_LCD_ST7789V2", "LCD_SPI_DRIVER_DIRECTION_0")
- Option 2: Keep "PKG_LCD_SPI_" but ensure it's consistently applied
Current mixing of "PKG_LCD_SPI_DRIVER_" (main option) with "PKG_LCD_SPI_" (feature options) can cause confusion.
中文:Kconfig 选项命名不一致。软件包使用 "PKG_LCD_SPI_DRIVER" 作为基础,但功能选项使用 "PKG_LCD_SPI_" 前缀而非完整的包名前缀。
为了与 RT-Thread Packages 规范保持一致,功能选项应使用一致的前缀。建议:
- 方案 1:所有功能选项使用 "LCD_SPI_DRIVER_" 前缀(例如 "LCD_SPI_DRIVER_USING_LCD_ST7789V2"、"LCD_SPI_DRIVER_DIRECTION_0")
- 方案 2:保持 "PKG_LCD_SPI_" 但确保一致应用
当前混用 "PKG_LCD_SPI_DRIVER_"(主选项)和 "PKG_LCD_SPI_"(功能选项)可能造成混淆。
Reference example: peripherals/st7789/Kconfig uses consistent "PKG_ST_7789_" prefix for all options.
| { | ||
| "name": "lcd_spi_driver", | ||
| "description": "The lcd spi driver ", | ||
| "description_zh": "lcd spi驱动", | ||
| "enable": "PKG_USING_LCD_SPI_DRIVER", | ||
| "keywords": [ | ||
| "lcd", | ||
| "spi", | ||
| "driver" | ||
| ], | ||
| "category": "peripherals", | ||
| "author": { | ||
| "name": "PeakRacing", | ||
| "email": "1473454180@qq.com", | ||
| "github": "PeakRacing" | ||
| }, | ||
| "license": "Apache-2.0", | ||
| "repository": "https://github.com/PeakRacing/lcd_spi_driver", | ||
| "icon": "unknown", | ||
| "homepage": "https://github.com/PeakRacing/lcd_spi_driver#readme", | ||
| "doc": "unknown", | ||
| "site": [ | ||
| { | ||
| "version": "latest", | ||
| "URL": "https://github.com/PeakRacing/lcd_spi_driver.git", | ||
| "filename": "", | ||
| "VER_SHA": "main" | ||
| } | ||
| ] | ||
| } |
There was a problem hiding this comment.
The package.json file uses 2-space indentation instead of the required 4-space indentation. RT-Thread Packages repository requires all package.json files to use 4-space indentation.
English: Update the indentation in package.json to use 4 spaces instead of 2 spaces. All nested content should be indented with 4 spaces per level.
中文:将 package.json 的缩进更新为 4 个空格而非 2 个空格。所有嵌套内容应使用每级 4 个空格的缩进。
Reference examples: peripherals/ili9341/package.json, peripherals/st7789/package.json use 4-space indentation.
|
|
||
| # Kconfig file for package lcd_spi_driver | ||
| menuconfig PKG_USING_LCD_SPI_DRIVER | ||
| bool "The lcd spi driver " |
There was a problem hiding this comment.
The description has a trailing space which should be removed for cleaner formatting.
English: Remove the trailing space after "driver" in the description on line 4.
中文:删除第 4 行描述中 "driver" 后的尾随空格。
| bool "The lcd spi driver " | |
| bool "The lcd spi driver" |
| "site": [ | ||
| { | ||
| "version": "latest", | ||
| "URL": "https://github.com/PeakRacing/lcd_spi_driver.git", | ||
| "filename": "", | ||
| "VER_SHA": "main" | ||
| } |
There was a problem hiding this comment.
The package is missing a fixed version entry. According to RT-Thread Packages repository policy, packages should provide at least one fixed version (e.g., v1.0.0) in addition to "latest".
English: Add at least one fixed version entry before the "latest" entry in the "site" array. Use a tag from the upstream repository. Example:
- version: "v1.0.0"
- URL: "https://github.com/PeakRacing/lcd_spi_driver/archive/v1.0.0.zip"
- filename: "lcd_spi_driver-1.0.0.zip"
Having fixed versions allows users to pin to stable releases and ensures reproducible builds.
中文:在 "site" 数组中的 "latest" 条目之前添加至少一个固定版本条目。使用上游仓库的标签。示例:
- version: "v1.0.0"
- URL: "https://github.com/PeakRacing/lcd_spi_driver/archive/v1.0.0.zip"
- filename: "lcd_spi_driver-1.0.0.zip"
固定版本允许用户锁定稳定版本,确保可重现的构建。
| { | ||
| "version": "latest", | ||
| "URL": "https://github.com/PeakRacing/lcd_spi_driver.git", | ||
| "filename": "", |
There was a problem hiding this comment.
主线git的并没有文件名,要填成什么?
添加lcd spi 通用驱动 软件包 lcd_spi_driver