# Modify the screen driver (modify-lcd-c-file)= ## Modify the copied screen driver file (update-lcd-param)= ### Configure screen parameters Different screen interfaces require different parameters to be configured. The following screen interfaces each have their own corresponding parameters: ```{toctree} :titlesonly: DBI屏幕参数配置.md DPI屏幕参数配置.md DSI屏幕参数配置.md SPI屏幕参数配置.md JDI屏幕参数配置.md ``` ### Modify the screen driver callback functions Modify the contents of the copied screen driver to your own. The callback functions in the screen driver are described below: _Note: optional callback functions can be registered as NULL, or their function body can be left empty_ |Callback function| Description| |:---- | ---- | | [LCD_Init](lcd-cb-func-LCD-Init)| [Required], screen driver initialization function (including reset, initialization procedure, and so on) | | [LCD_ReadID](lcd-cb-func-LCD-ReadID)| [Required], screen presence detection function | | [LCD_DisplayOn](lcd-cb-func-LCD-DisplayOn)| [Required], turn on the screen | | [LCD_DisplayOff](lcd-cb-func-LCD-DisplayOff)| [Required], turn off the screen | | [LCD_SetRegion](lcd-cb-func-LCD-SetRegion)| [Required], set the area where the screen receives data (2A, 2B area)| | [LCD_WritePixel](lcd-cb-func-LCD-WritePixel)| Optional, write one pixel to the screen| | [LCD_WriteMultiplePixels](lcd-cb-func-LCD-WriteMultiplePixels)| [Required], write a batch of pixels to the screen| | [LCD_ReadPixel](lcd-cb-func-LCD-ReadPixel)| Optional, read one pixel of data from the screen and return the RGB value of the pixel| | [LCD_SetColorMode](lcd-cb-func-LCD-SetColorMode)| Optional, switch the color format output to the screen| | [LCD_SetBrightness](lcd-cb-func-LCD-SetBrightness)| Optional, set screen brightness | | [LCD_IdleModeOn](lcd-cb-func-LCD-IdleModeOn)| Optional, enter standby display mode (low-power mode) | | [LCD_IdleModeOff](lcd-cb-func-LCD-IdleModeOff)| Optional, exit standby display mode (low-power mode) | | [LCD_Rotate](lcd-cb-func-LCD-Rotate)| Optional, rotate the screen by a certain angle | | [LCD_TimeoutDbg](lcd-cb-func-LCD-TimeoutDbg)| Optional, screen self-test after bulk data transfer timeout | | [LCD_TimeoutReset](lcd-cb-func-LCD-TimeoutReset)| Optional, screen reset after bulk data transfer timeout | | [LCD_ESDCheck](lcd-cb-func-LCD-ESDCheck) | Optional, periodic screen ESD detection | ### Register the screen driver to the system Register the callback functions of the screen driver IC to the system through LCD_DRIVER_EXPORT2: ``` LCD_DRIVER_EXPORT2(nv3051f1, LCD_ID, &lcdc_int_cfg, &LCD_drv,2); ``` Parameter description: - nv3051f1 - name of the screen driver IC - LCD_ID - the value that the screen presence detection function [LCD_ReadID](./框架介绍.md#lcd-driver-detect-method) should return when the screen is present. - &lcdc_int_cfg - screen initialization parameters provided externally (read-only externally, used only to query screen bandwidth, color format, and other information) - &LCD_drv - collection of callback functions for all operations of the screen driver IC - 2 - this screen driver IC requires 2-[pixel alignment](./框架介绍.md#lcd-ic-pixel-alignment) when updating the screen area