Hi all,
I am using EVE4 display, BT817Q graphics controller and XMC4700.
On a previous project, I only used EVE commands.
I learned about LVGL and I found your example on GitHub.
I integrated the LVGL library into my new project, running LVGL benchmark on an XMC controller and use part of your example, eve_display_flush function to refresh the content.
The screen content update is triggered by LVGL only for the changed pixels. However, if the update area is a small square, using eve_display_flush, as written ,
this will rewrite screen pixels of that area but for the entire screen width, the height will be the square height, avoiding pixel corruption.
By doing this, there will be multiple SPI commands, one for each line written, line that will be longer then square width, which will lead to an increase delay time.
How can I update the square without sending the pixels for the entire screen width , using only the length of pixels that are being changed ?
I tried using scissor functions, after I read about scissor functions, but without success, my guess is that EVE commands cannot be combined with EVE_memWrite_sram_buffer function.
Here I have one of the best variants that I could get, but the data is corrupted when the surface is smaller then the screen width:
void display_flush_exemple(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t *color_p)
{
eve_scissor(x, y, width, height);
uint32_t ram_offset = (y * EVE_HSIZE + x) * 2;
EVE_cmd_dl( DL_BEGIN | EVE_BITMAPS );
EVE_cmd_dl(VERTEX2F(x * 16, y * 16));
EVE_memWrite_sram_buffer(ram_offset, (uint8_t *)color_p, width * height * BYTES_PER_PIXEL);
EVE_cmd_dl(DL_END);
eve_scissor(0, 0, EVE_HSIZE, EVE_VSIZE);
}
where eve_scissor is as below:
void eve_scissor(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
{
if (x1 != scissor_x1 || y1 != scissor_y1)
{
int16_t adjusted_x1 = x1 > 0 ? x1 - 1 : 0;
int16_t adjusted_y1 = y1 > 0 ? y1 - 1 : 0;
EVE_cmd_dl(SCISSOR_XY(adjusted_x1, adjusted_y1));
scissor_x1 = x1;
scissor_y1 = y1;
}
if (x2 != scissor_x2 || y2 != scissor_y2)
{
uint16_t w = x2 - x1 + 3;
uint16_t h = y2 - y1 + 3;
EVE_cmd_dl(SCISSOR_SIZE(w, h));
scissor_x2 = x2;
scissor_y2 = y2;
}
}
You can see in the bellow pictures, that when I tried to switch the color of a square, the color is not filling the rectangle.
Thank you!
Best regards!