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 |
|---|---|
[Required], screen driver initialization function (including reset, initialization procedure, and so on) |
|
[Required], screen presence detection function |
|
[Required], turn on the screen |
|
[Required], turn off the screen |
|
[Required], set the area where the screen receives data (2A, 2B area) |
|
Optional, write one pixel to the screen |
|
[Required], write a batch of pixels to the screen |
|
Optional, read one pixel of data from the screen and return the RGB value of the pixel |
|
Optional, switch the color format output to the screen |
|
Optional, set 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-test after bulk data transfer timeout |
|
Optional, screen reset after bulk data transfer timeout |
|
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