Modify Screen Driver

Modify the Copied Screen Driver File

Configure Screen Parameters

Depending on the interface, the parameters that need to be configured for each screen will differ. The following screen interfaces each have their own corresponding parameters for configuration:

Modify Screen Driver Callback Functions

Modify the content of the copied screen driver to your own. The screen driver callback functions are described as follows:

Note: Optional callback functions can be registered as NULL, or the function can be implemented as empty

Callback Function

Description

LCD_Init

Required, screen driver initialization function (including reset, initialization procedures, etc.)

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 accepts data (2A, 2B area)

LCD_WritePixel

Optional, write a single pixel to the screen

LCD_WriteMultiplePixels

Required, write multiple pixels to the screen

LCD_ReadPixel

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

LCD_SetColorMode

Optional, switch the color format output to the screen

LCD_SetBrightness

Optional, set the 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-check after batch data transfer timeout

LCD_TimeoutReset

Optional, screen reset after batch data transfer timeout

LCD_ESDCheck

Optional, periodic ESD check for the screen

Register Screen Driver to the System

Register the screen driver IC’s callback functions to the system using 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](./Framework Introduction.md#lcd-driver-detect-method) should return when the screen is present.

  • &lcdc_int_cfg - Provide screen initialization parameters externally (read-only, used to query screen bandwidth, color format, etc.)

  • &LCD_drv - Collection of all callback functions for the screen driver IC

  • 2 - The screen driver IC requires 2 [pixel alignment](./Framework Introduction.md#lcd-ic-pixel-alignment) for updating the screen area.