From 2b6662e687b0c2d4c4ced9fad7d41ce4e588ef69 Mon Sep 17 00:00:00 2001 From: PeakRacing Date: Fri, 30 Jan 2026 00:35:07 +0800 Subject: [PATCH] =?UTF-8?q?add:=E6=B7=BB=E5=8A=A0lcd=20spi=20=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E9=A9=B1=E5=8A=A8=20=E8=BD=AF=E4=BB=B6=E5=8C=85=20lcd?= =?UTF-8?q?=5Fspi=5Fdriver?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- peripherals/Kconfig | 1 + peripherals/lcd_spi_driver/Kconfig | 151 ++++++++++++++++++++++++ peripherals/lcd_spi_driver/package.json | 30 +++++ 3 files changed, 182 insertions(+) create mode 100644 peripherals/lcd_spi_driver/Kconfig create mode 100644 peripherals/lcd_spi_driver/package.json diff --git a/peripherals/Kconfig b/peripherals/Kconfig index 95d3369379..bbc45eeac3 100644 --- a/peripherals/Kconfig +++ b/peripherals/Kconfig @@ -3,6 +3,7 @@ menu "peripheral libraries and drivers" source "$PKGS_DIR/packages/peripherals/hal-sdk/Kconfig" source "$PKGS_DIR/packages/peripherals/sensors/Kconfig" source "$PKGS_DIR/packages/peripherals/touch/Kconfig" +source "$PKGS_DIR/packages/peripherals/lcd_spi_driver/Kconfig" source "$PKGS_DIR/packages/peripherals/realtek_ameba/Kconfig" source "$PKGS_DIR/packages/peripherals/button/Kconfig" source "$PKGS_DIR/packages/peripherals/pcf8574/Kconfig" diff --git a/peripherals/lcd_spi_driver/Kconfig b/peripherals/lcd_spi_driver/Kconfig new file mode 100644 index 0000000000..5197902bbb --- /dev/null +++ b/peripherals/lcd_spi_driver/Kconfig @@ -0,0 +1,151 @@ + +# Kconfig file for package lcd_spi_driver +menuconfig PKG_USING_LCD_SPI_DRIVER + bool "The lcd spi driver " + default n + +if PKG_USING_LCD_SPI_DRIVER + + config PKG_LCD_SPI_DRIVER_PATH + string + default "/packages/peripherals/lcd_spi_driver" + + choice + prompt "Select LCD driver" + default PKG_LCD_SPI_USING_LCD_ST7789V2 + 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 + bool "0 Degree" + config PKG_LCD_SPI_DIRECTION_90 + bool "90 Degree" + config PKG_LCD_SPI_DIRECTION_180 + bool "180 Degree" + config PKG_LCD_SPI_DIRECTION_270 + bool "270 Degree" + endchoice + + config PKG_LCD_SPI_PIXEL_WIDTH + int "LCD Pixel Width" + range 0 1024 + default 0 + + config PKG_LCD_SPI_PIXEL_HEIGHT + int "LCD Pixel Height" + range 0 1024 + default 0 + + config PKG_LCD_SPI_X_OFFSET + int "LCD Pixel X Offset" + range -128 128 + default 0 + + config PKG_LCD_SPI_Y_OFFSET + int "LCD Pixel Y Offset" + range -128 128 + default 0 + + config PKG_LCD_SPI_FRAME_BUFF + bool "LCD Use Frame Buff" + default n + + config PKG_LCD_SPI_SWAP_ENDIAN + bool "LCD Swap Data Endian" + default n + + config PKG_LCD_SPI_COLOR_BGR + bool "LCD Use BGR Color Format" + default n + + config PKG_LCD_SPI_DISPLAY_INVERSION + bool "LCD Enable Display Inversion" + default n + + endmenu + + config PKG_LCD_SPI_BUS_NAME + string "LCD SPI Bus Name" + default "spi0" + + config PKG_LCD_SPI_DEVICE_NAME + string "LCD SPI Device Name" + default "spi00" + + config PKG_LCD_SPI_FREQ + int "SPI Frequency" + range 0 100000000 + default 25000000 + + config PKG_LCD_SPI_CS_PIN + int "CS Pin" + range -1 255 + default -1 + + config PKG_LCD_SPI_DC_PIN + int "DC Pin" + range -1 255 + default -1 + + config PKG_LCD_SPI_RES_PIN + int "RES Pin" + range -1 255 + default -1 + + choice + prompt "LCD Backlight Control Method" + default PKG_LCD_SPI_BLK_PIN + config PKG_LCD_SPI_BLK_PIN + bool "Control Backlight via GPIO Pin" + config PKG_LCD_SPI_BLK_PWM + bool "Control Backlight via PWM" + endchoice + + if PKG_LCD_SPI_BLK_PIN + config PKG_LCD_SPI_BLK_PIN_NUM + int "Backlight Control Pin Number" + range -1 255 + default -1 + endif + + if PKG_LCD_SPI_BLK_PWM + config PKG_LCD_SPI_BLK_PWM_NUM + int "Backlight Control PWM Number" + range -1 255 + default -1 + endif + + choice + prompt "Version" + default PKG_USING_LCD_SPI_DRIVER_LATEST_VERSION + help + Select the package version + + config PKG_USING_LCD_SPI_DRIVER_LATEST_VERSION + bool "latest" + endchoice + + config PKG_LCD_SPI_DRIVER_VER + string + default "latest" if PKG_USING_LCD_SPI_DRIVER_LATEST_VERSION + +endif + diff --git a/peripherals/lcd_spi_driver/package.json b/peripherals/lcd_spi_driver/package.json new file mode 100644 index 0000000000..bb4c17862b --- /dev/null +++ b/peripherals/lcd_spi_driver/package.json @@ -0,0 +1,30 @@ +{ + "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" + } + ] +}