rzeldent / platformio-espressif32-sunton

Board definitions for the Sunton Smart display boards (CYD Cheap Yellow Display). These definitions contain not only contain the CPU information but also the connections and devices present on the board.
https://github.com/rzeldent/esp32-smartdisplay
99 stars 30 forks source link

[Question] - How to access framebuffer? #63

Open paaspaas00 opened 2 months ago

paaspaas00 commented 2 months ago

Hi, I'm working on a simple VNC server for one of the boards, the esp32-8048S050C. I need to have access to the framebuffer to reply properly to VNC clients. In the readme here https://github.com/rzeldent/platformio-espressif32-sunton/tree/main?tab=readme-ov-file#psram you imply that for boards with direct io (like mine I think) there's actually a framebuffer at all times. Is there a way to access it (maybe with some kind of mutex from another FreeRTOS task) easily or at all? Could you provide a little guidance?

Thank you!

rzeldent commented 1 month ago

The framebuffer is in the LVGL drivers. In lvgl_lcd_init the framebuffer is created:

//  Create drawBuffer
    uint32_t drawBufferSize = sizeof(lv_color_t) * LVGL_BUFFER_PIXELS;
    void *drawBuffer = heap_caps_malloc(drawBufferSize, LVGL_BUFFER_MALLOC_FLAGS);
    lv_display_set_buffers(display, drawBuffer, NULL, drawBufferSize, LV_DISPLAY_RENDER_MODE_PARTIAL);

You can access it, just reading it should not hurt... The format is R5G6B5