为新的屏幕模组添加menuconfig选项¶
The menuconfig option for the screen module is a comprehensive menu option that combines the screen driver IC, backlight IC, and touch control IC,It specifies which screen IC this module uses, which touch control IC, what type of backlight is used, and also specifies the resolution, DPI, shape and other information of the liquid crystal glass of the module。添加后就可以在工程里面使用这个新的menuconfig菜单选项。
Divided into the following steps in total:
Open the Kconfig_lcd file
Add screen module options
Configure the resolution and DPI of the screen module LCD
1 打开SDK\customer\boards\Kconfig_lcd文件¶
2 Add screen module options¶
The general form of the macro for the new screen module is
LCD_USING_AAA_BBB_CCC
, AAA is the manufacturer of the module, BBB is the model of the module, CCC is the number and manufacture date of the module, etc.,这些信息在模组厂提供的屏幕模组信息里面有。屏幕模组的名称,尽量写上尺寸,接口类型,模组厂家,模组编号,分辨率,等信息
config LCD_USING_TFT_AH034A01ZJINV4C30 <<<<<<新的屏幕模组的宏,不能跟其他的有重名
bool "3.4 round DSI Video TFT LCD(800x800)" <<<<<<屏幕模组的名称,在menuconfig中显示的名称
select TSC_USING_GT911 if BSP_USING_TOUCHD <<<<<<<模组使用的TP的IC宏
select LCD_USING_NV3051F1 <<<<<<模组使用的屏驱IC宏
select BL_USING_AW9364 <<<<<<可选项,选择背光驱动 见注3
select BSP_USING_ROUND_TYPE_LCD <<<<<<可选项,建议圆形屏幕添加,方形屏幕可删除这行
select BSP_LCDC_USING_DSI_VIDEO <<<<<<见注1
depends on BSP_SUPPORT_DSI_VIDEO <<<<<<可选项,见注2
注1: Specifies what interface type the screen uses, supports the following options:
宏定义 |
屏驱接口类型 |
---|---|
BSP_LCDC_USING_SPI_NODCX_1DATA |
3SPI 1DATA(代表3线SPI,使用1根数据线,下同) |
BSP_LCDC_USING_SPI_NODCX_2DATA |
3SPI 2DATA |
BSP_LCDC_USING_SPI_DCX_1DATA |
4SPI 1DATA |
BSP_LCDC_USING_SPI_DCX_2DATA |
4SPI 2DATA |
BSP_LCDC_USING_QADSPI |
4SPI 4DATA,目前比较常用的QSPI接口 |
BSP_LCDC_USING_DDR_QADSPI |
4SPI 4DATA DDR(QSPI的接口基础上,使用双沿通信) |
BSP_LCDC_USING_DBI |
DBI |
BSP_LCDC_USING_DSI |
DSI Command |
BSP_LCDC_USING_DSI_VIDEO |
DSI Video |
BSP_LCDC_USING_DPI |
DPI(RGB) |
BSP_LCDC_USING_JDI_PARALLEL |
JDI 并口 |
注2: Optional, depending on whether the current development board supports this type of interface, to decide whether to display the menuconfig option。 支持的选项如下(其他接口默认都支持,可以不设置):
宏定义 |
屏驱接口类型 |
---|---|
BSP_SUPPORT_DSI |
DSI Command |
BSP_SUPPORT_DSI_VIDEO |
DSI Video |
BSP_SUPPORT_DPI |
DPI(RGB) |
注3: Optional, backlight drive only applies to screen modules with backlight. If AMOLED screens do not need backlight, it can be unset 支持的选项如下:
宏定义 |
屏驱接口类型 |
---|---|
BL_USING_AW9364 |
使用AW9364背光芯片 |
LCD_USING_PWM_AS_BACKLIGHT |
直接使用芯片的PWM驱动背光 |
3 Configure the resolution and DPI of the screen module LCD¶
The resolution is relatively easy to find in the module manual
The value of DPI (Dot Per Inch, sometimes called PPI - Pixel Per Inch) may need to be calculated based on the physical size and resolution of the screen。But this value will not affect the lighting of the screen, usually this value will be used at the UI layer。
config LCD_HOR_RES_MAX
int
default 368 if LCD_USING_ED_LB55DSI17801
default 368 if LCD_USING_ED_LB55DSI17801_QADSPI
...
default 800 if LCD_USING_TFT_AH034A01ZJINV4C30 <<<<<<新增项,前面的数字代表水平分辨率是800
config LCD_VER_RES_MAX
int
default 448 if LCD_USING_ED_LB55DSI17801
default 448 if LCD_USING_ED_LB55DSI17801_QADSPI
...
default 800 if LCD_USING_TFT_AH034A01ZJINV4C30 <<<<<<新增项,前面的数字代表垂直分辨率是800
config LCD_DPI
int
default 315 if LCD_USING_ED_LB55DSI17801
default 315 if LCD_USING_ED_LB55DSI17801_QADSPI
...
default 235 if LCD_USING_TFT_AH034A01ZJINV4C30 <<<<<<新增项,前面的数字代表DPI值是235