To clear the screen you have to send 320*480*3*8 =
3686400 bits to the display.
At 40 MHz spi clock (1 bit time is 25 ns) the
theoretical minimum time is
92.16 ms.
With some optimization I've got 160 ms for clear screen function, I don't think you can get much faster clear screen with any driver on any microcontroller.
Code: Select all
-------------
Disp clock = 40.00 MHz (requested: 40.00)
Lines = 1574 ms (320 lines of 480 pixels)
Pixels = 1757 ms (480x320)
Cls = 160 ms (480x320)
-------------
Some optimization can still be made for other functions.
In pixel writing functions color values are converted from 16-bit RGB565 to 24-bit values, which take some time. If you use 3-byte RGB color values as a base for display functions, write time can be improved.
I have the complete set of optimized graphics functions (drawing, fonts, images etc) implemented as part of Lua-RTOS-ESP32 project.
Look at
https://github.com/loboris/Lua-RTOS-ESP ... les/screen.
Video:
https://www.youtube.com/watch?v=esOO3fN1xDw
You can easily
extract needed functions to use in any project. If I find some time, I'll make it independent library to use with esp-idf.
Reading from display RAM does not work on my display (returns all zeroes).
You can check if it is working on yours by setting
#define DISPLAY_READ 1 in
spi_master_demo.c.
You can also uncomment the lines
Code: Select all
/*
for (int i=25; i<48; i+=3) {
printf("[%02x,%02x,%02x] ",rbuf[i],rbuf[i+1],rbuf[i+2]);
}
printf("\r\n");
*/
in
disp_spi_read_data function in
tftfunc.c to get first 16 color values read printed on screen.