RA8875 Glitch on Screen

Hi,
I use an Adafruit RA8875 Board and I have a glitch problem on the screen (spinner widget cause this), and in other time, apart from the screen being slow, it works. I modified this in ra8875.ccp to increase the speed
(with removed spinner widget ,no glitch)

Changed value in RA8875.cpp

#if defined(ARDUINO_ARCH_ARC32)
/// @endcond
spi_speed = 12000000L;
#else
// spi_speed = 4000000L; <====== too Slow
spi_speed = 20000000L; <====== this ,seem to be maximum

Using Nucleo L476RG
Screen 470x 272

My Include

//#include “Adafruit_SPIDevice.h”
#include “Adafruit_GFX.h”
#include “Adafruit_RA8875.h”
#include <Wire.h>
#include “lvgl.h”
#include “ui.h”
#define RA8875_INT 3
#define RA8875_CS 10
#define RA8875_RESET 9
#define DIS_WIDTH_PX 480 //Width
#define DIS_HEIGHT_PX 272 //Height
#define BUFFER_SIZE (LV_HOR_RES_MAX * 10)
#define NBR_PIXELS_IN_BUFFER (BUFFER_SIZE

Display Flush

void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t color_p)
{
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);
uint32_t wh = w
h;

tft.startWrite();
tft.drawPixels(&color_p->full, (w * h), area->x1, area->y1);

// while (wh–) tft.pushColor(color_p+±>full);//for Adafruit library
tft.endWrite();

lv_disp_flush_ready(disp);

}

In Setup

lv_init();

lv_disp_draw_buf_init( &draw_buf, buf, NULL, DIS_WIDTH_PX * 10 );
  
static lv_disp_drv_t disp_drv;
lv_disp_drv_init( &disp_drv );

disp_drv.hor_res = DIS_WIDTH_PX;
disp_drv.ver_res = DIS_HEIGHT_PX;

disp_drv.flush_cb = my_disp_flush;
disp_drv.draw_buf = &draw_buf;
lv_disp_drv_register( &disp_drv );

any help would be appreciated

Thanks In Advance

Currently Work Great in my Bench,
(LVGL on ESP32S3_470x272 , LVGL on ILI9341_320x240 using Nucleo L476RG)

On My List:
RA8875
SSD1963
STM32F with LTDC (paused…With F469BIT6)

Hi , SOLVED!

Here is My Solution ,

void my_flush_cb(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p) {
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);

tft.startWrite();
for (uint32_t y = 0; y < h; y++) {
    tft.drawPixels((uint16_t *)(color_p + y * w), w, area->x1, area->y1 + y);
}
tft.endWrite();
lv_disp_flush_ready(disp_drv);

}

Hope This will Help Someone!

(Next FT813,SSD1963,STM32F469 Custom)
Currently Work:

ILI9341 with Nucleo (Thanks For Help Tinus !)
Ra8875 With SAMD51
ESP32S3 480x270