What MCU/Processor/Board and compiler are you using?
STM32L4, on NuttX
What do you want to achieve?
In NuttX I can mmap() a framebuffer into memory, which represents the interface to the display. In reality this is really an LCD which is offered as a framebuffer to avoid writing back to the LCD for every change to the video memory. I would like to make littlevgl draw into this buffer and then simply call the “flush” operation of my framebuffer. The point is to minimize memory usage since I already have a display-size framebuffer, I would like to avoid extra memory used by littlevgl and have littlevgl draw directly on my existing framebuffer.
What have you tried so far?
I have configured a single display buffer pointing to the mmaped area of the framebuffer. I have implemented the set_px and rounder operations apropriately. I have the display working and can write text to screen.
While performing a basic test where I initially set a text label at (0,0) and then move it by (1,1) in a loop (expecting the text to move diagonally on the display), I saw that the text only moved horizontally.
Looking at set_px I saw it was being invoked with y values corresponding to the range [0,10] (the height of the text). I realized that littlevgl is asking me to always write in the beggining of the supplied buffer and then expects me to copy these lines in the appropriate row in flush_cb.
Is it possible to tell littlevgl that I’m supplying a complete framebuffer and that when drawing it should draw directly on the absolute position of the supplied buffer? This way on my flush_cb I only need to call my display’s flush option since memory is already written at the apropriate location.