skpang
Well-known member
I'm trying to use the LittlevGL library with RA8875 LCD on Teensy 4.0. The LCD is a 800x480 and the RA8875 library is from sumotoy v0.70b11p11
There is no LittlevGL port for the Teensy 4.0 so I've attempted my own but with partial success.
lvgl needs to copy the display buffer to the actual LCD. I've managed to get it to work by copying one pixel at a time but it is very slow.
This bit of code work:
display.drawPixels() should be able to take the whole buffer and draw it. So have update my code to:
It is now drawing a lot faster but the text is slanted. It looks like something is off a few pixel and I can't figure out where.
Is it something inside the function display.drawPixels() ? Anyone can help ?
There is no LittlevGL port for the Teensy 4.0 so I've attempted my own but with partial success.
lvgl needs to copy the display buffer to the actual LCD. I've managed to get it to work by copying one pixel at a time but it is very slow.
This bit of code work:
Code:
/* Display flushing */
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
int16_t x, y;
for(y = area->y1; y <= area->y2; y++) {
for(x = area->x1; x <= area->x2; x++) {
display.drawPixels((uint16_t *)color_p, 1, x,y);
color_p++;
}
}
lv_disp_flush_ready(disp); /* tell lvgl that flushing is done */
}
display.drawPixels() should be able to take the whole buffer and draw it. So have update my code to:
Code:
/* 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 */
}
It is now drawing a lot faster but the text is slanted. It looks like something is off a few pixel and I can't figure out where.
Is it something inside the function display.drawPixels() ? Anyone can help ?