SPI E-Paper panels update in two steps: first you transfer bitmap data over SPI, then you issue a command to update the image on the screen.
The first step can be done “in the background” over DMA, and you are notified via a callback when it is done. Starting from that moment, transferred buffer can be reused. The step may take 100 - 200 milliseconds max.
At this moment you can initiate display refresh. It’s an SPI command that returns quickly, but the process itself may take several seconds. When it is over, you can get notification over GPIO IRQ.
My question is: what would be the optimal / most logical way to synchronise lvgl workflow? I could tell lvgl that the buffer is free (lv_display_flush_ready()) right after the DMA transfer is done, but it’s probably not right to execute flush_cb() (that will initiate the next SPI data transfer) before screen refresh is complete.
So, what be more reasonable - to call lv_display_flush_ready() only after display refresh, or to call it after DMA operation completes, and then on the next cycle wait at the beginning of the flush_cb() until the completion of the (slow) display refresh?
Thanks for reading ![]()