Screen Module Debug Program
Overview
This is a screen refresh display and touch data reading and printing program based on rt-thread’s rt driver framework.
Suitable for debugging and testing screen drivers and touch drivers.
The screen can display content that changes every 3 seconds:
Color bar with 8 gradient colors (white, gray, red, green, blue, cyan, purple, yellow), each gradient color transitions from black.
Vertical grayscale gradient (cycles every 256 lines)
Solid colors (red, green, blue, white, black)
main Function
The main function creates 2 threads:
LCD screen refresh thread
Touch reading thread
1. LCD Screen Refresh Thread
Open lcd rt device
Get and search screen information, print its width, height, set color depth, screen refresh pixel alignment requirement information
Fill framebuffer (see overview description)
Refresh framebuffer to screen
After refresh completion, set backlight brightness
Wait 3 seconds
If it’s a ramless screen, switch to another framebuffer
Jump to step 3
2. Touch Reading Thread
Open touch rt device
Set touch interrupt trigger function tp_rx_indicate to release semaphore
In while loop, if semaphore is acquired, read touch data and print it on serial port.