Stm32+ft812+lvgl?

Description

Has anyone successfully use stm32 + ft812 eve module with lvgl library??
I need guidance on how to created lvgl_flush() function for ft812 display module.

What MCU/Processor/Board and compiler are you using?

NUCLEO F446ZE + FT812 Display module
Compiler : arm gcc + makefile

What do you want to achieve?

I already have a working library for driving the display, however, i can’t figure out how to implement lvgl_flush() function. Any help is greatly appreciated.

Hi!

Working library for the display is a great start, I was in a similar position to you. So lvgl_flush() function should copy some display data from RAM to the display - so if your driver has some memory copying functions (which I found here! → FT800-FT813/EVE_commands.h at 5.x · RudolphRiedel/FT800-FT813 · GitHub)
all you need to do is parse the lv_color_t information into the correct format for your display, and then perform memory operations to write this to the display.

Example - I am attempting to get an SSD1608 eINK display working with LVGL. My display (as far as I understand) takes a byte of information with each bit signalling a pixel because the display is monochrome. It should update every 8 pixels in x direction, after 25 bytes (200 pixels) it jumps down a row (y increment) and goes on. You will need to deduce from the driver how the display needs image data presented to it, and then implement this behavior. You can see my example flush, unfortunately it seems to be a bit buggy but you can see the logic and what I am trying to do:

void epd_flush( lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p )
{
  
  uint8_t x_end, y_end;
  uint8_t *buffer = (uint8_t*) color_p;
  
  x_end = area->x2 >= epd.width ? epd.width-1 : area->x2 -1;
  y_end = area->y2 >= epd.height ? epd.height-1 : area->y2-1;
  epd.SetMemoryArea(area->x1, area->y1, x_end, y_end);
  epd.SetMemoryPointer(area->x1, area->y1);
  epd.SendCommand(WRITE_RAM);
  for (int j = 0; j < y_end - area->y1 + 1; j++) {
      for (int i = 0; i < (x_end - area->x1 + 1) / 8; i++) {
          epd.SendData(buffer[i + j * ((x_end - area->x1 + 1) / 8)]);
      }
  }
  //epd.SetFrameMemory(buffer, area->x1, area->y1, area->x2 - area->x1 + 1, area->y2-area->y1+1);
  if(lv_disp_flush_is_last(disp))
  {
    epd.DisplayFrame();
    //epd.WaitUntilIdle();
  }
  lv_disp_flush_ready(disp);
}

Don’t forget to call the lv_disp_flush_ready( driverinstance ) function at the end of your function. Also read this: Display interface — LVGL documentation - it is extremely useful. Good luck!

Yuvraj

1 Like

Hi,

So from your response, i actually managed to get it to work!! YAY.
Here is the result, if you wanna see the result, it’s here on Youtube.

The chart update still bothers me a bit because of the screen tearing effect but overall i’m quite happy with the result.

Hi,

I’m working on a similar setup for ST32F4xx + FT81x +lvgl.
Is it possible that share your code for your working example?

Thanks,

GeGe997

Hi, GeGe997

Sure. Here is the repo hosted on gitlab.

34yui34