LittlevGL on RA8875 LCD with Teensy 4.0

Has anyone got LittlevGL on RA8875 LCD with Teensy 4.0 working ?

I’m trying to follow this example:

but it won’t compile. In this line:

 color_row[x] = color565(color_array->red, color_array->green, color_array->blue);

It give an error of "has no member named ‘red’ "

color_array is from the struct lv_color_t *color_array and in the file iv_color.h it is a typedef union and has red as a member, so it looks ok.

Any idea of how to fix this ?

1 Like

I almost got it to work. In display flush I have:

/* Display flushing */
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)

uint16_t width = (area->x2 - area->x1 +1);
uint16_t height = (area->y2 - area->y1+1);

display.drawPixels((uint16_t )color_p, (width * height), area->x1 , area->y1);
lv_disp_flush_ready(disp); /
tell lvgl that flushing is done */


but the display looks corrupted by a few pixels.

Any idea of how to fix this ?

1 Like

Please update your GitHub, when it’s works, I was waiting for this very long.
Thank you !

Does (width * height) reflect the pixel or byte count?

I think it is expecting pixel but I’m sending it bytes count. So I’ve tried to / 8 like this:

display.drawPixels((uint16_t *)color_p, (width * height / 8 ), area->x1 , area->y1);

and I only get half the screen and it looks like it is skipping a line but the text is not slanted anymore.

The calculation is still wrong.

1 Like

With your original code your width value may have been off-by-one. That usually results in slanted rendering.

1 Like