micropython-ili9341 icon indicating copy to clipboard operation
micropython-ili9341 copied to clipboard

request to use Framebuf module

Open nanditha1214 opened this issue 1 year ago • 1 comments

Instead of letting self.block() function send pixels to the LCD, it might be faster if block() updated an internal array, and a display.push_pixels() sent all the pixels directly to the display. You could allow the user to access display.push_pixels(), and call it when the user is done updating the pixel array. It would improve pervormance significantly(especially on ESP32)

I also believe that (most) esp32s have around 1-2 MB psram, if not more

nanditha1214 avatar Oct 05 '24 15:10 nanditha1214

Thank you for your suggestion! You can draw directly to a framebuffer and then copy it to the display, as demonstrated in the example demo_pbm.py. While this example is designed for portable bitmaps, you can still use all of the framebuffer's native drawing and text routines to render graphics and text.

I agree that buffering could improve performance in some cases. However, implementing this change might break compatibility with many boards. There are over 60 ESP32 modules and countless development boards, each with varying features. For example, the ESP32-WROOM series typically does not include PSRAM, while the ESP32-WROVER series almost always does. The ESP32-S series offers models both with and without PSRAM, and the ESP32-C and ESP32-H series generally do not include PSRAM.

It's also important to consider compatibility across all MicroPython boards—not just the ESP32—since many other boards, such as the RP2040, ARM Cortex series, and nRF52, have variants with limited RAM or PSRAM.

Thanks again for your input!

rdagger avatar Oct 06 '24 16:10 rdagger

Essentially repeating the above. I have an ESP32 (in a CYD) and the Micropython build I'm using, it does not have enough RAM for a fullscreen (color) framebuffer. Thanks for the library and great examples!

clach04 avatar Dec 24 '24 03:12 clach04