Modify the screen driver

Modify the copied screen driver file

Configure screen parameters

Different screen interfaces require different parameters to be configured. The following screen interfaces each have their own corresponding parameters:

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

[Required], screen driver initialization function (including reset, initialization procedure, and so on)

LCD_ReadID

[Required], screen presence detection function

LCD_DisplayOn

[Required], turn on the screen

LCD_DisplayOff

[Required], turn off the screen

LCD_SetRegion

[Required], set the area where the screen receives data (2A, 2B area)

LCD_WritePixel

Optional, write one pixel to the screen

LCD_WriteMultiplePixels

[Required], write a batch of pixels to the screen

LCD_ReadPixel

Optional, read one pixel of data from the screen and return the RGB value of the pixel

LCD_SetColorMode

Optional, switch the color format output to the screen

LCD_SetBrightness

Optional, set screen brightness

LCD_IdleModeOn

Optional, enter standby display mode (low-power mode)

LCD_IdleModeOff

Optional, exit standby display mode (low-power mode)

LCD_Rotate

Optional, rotate the screen by a certain angle

LCD_TimeoutDbg

Optional, screen self-test after bulk data transfer timeout

LCD_TimeoutReset

Optional, screen reset after bulk data transfer timeout

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 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 when updating the screen area