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 |
---|---|
Required, screen driver initialization function (including reset, initialization procedures, etc.) |
|
Required, screen presence detection function |
|
Required, turn on the screen |
|
Required, turn off the screen |
|
Required, set the area where the screen accepts data (2A, 2B area) |
|
Optional, write a single pixel to the screen |
|
Required, write multiple pixels to the screen |
|
Optional, read a pixel data from the screen, return the RGB value of the pixel |
|
Optional, switch the color format output to the screen |
|
Optional, set the screen brightness |
|
Optional, enter standby display mode (low power mode) |
|
Optional, exit standby display mode (low power mode) |
|
Optional, rotate the screen by a certain angle |
|
Optional, screen self-check after batch data transfer timeout |
|
Optional, screen reset after batch data transfer timeout |
|
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.