FastLED_Protomatter_RGBPanel_FrameBuffer_GFX: FrameBuffer_GFX Driver for Adafruit_Protomatter RGB Panels
This is a display driver for Framebuffer::GFX that displays on RGB Panels using https://github.com/adafruit/Adafruit_Protomatter . It runs on top of the same code that https://github.com/marcmerlin/Framebuffer_GFX and therefore provides access to the usual trio of APIs: FastLED, Adafruit::GFX (via Adafruit::NeoMatrix compatibility using FastLED::NeoMatrix) and LEDMatrix compatibility too. To get more example demo code (outside of the few included here), go to: https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos
Here is a video demo of a 24bpp framebuffer based set of demos that simply can't run on Adafruit_Protomatter without this framebuffer driver: https://www.youtube.com/watch?v=1d6U-6twpCk (click for video)
Yes, the video above was actually made with an Adafruit S3 MatrixPortal, but the point is that it looks 100% the same with FastLED_Protomatter_RGBPanel_FrameBuffer_GFX
On top of many many other backends supported, with this driver you can switch back and forth between ESP32S3 like Adafruit ESP32-S3 MatrixPortal and RP2350 like Interstate 75W RGBPanel board. They look so similar, but trust me the driver code is not similar at all! However with this library, you get not to care as it's abstracted away for you:
https://youtu.be/iTXz6gqB7NY (click for video)
You need
- https://github.com/marcmerlin/Framebuffer_GFX (framebuffer that everything goes to)
- https://github.com/adafruit/Adafruit_Protomatter base hardware driver
- https://github.com/adafruit/Adafruit-GFX-Library 2D API
- https://github.com/FastLED/FastLED another 1D/2D API used by some demos and used for base RGB888 matrix storage class
- https://github.com/marcmerlin/LEDMatrix (optional, it's an added 2D API) that runs on top of Framebuffer
Please see this code to see how to use the framebuffer driver:
- This is where you edit or add a new matrix definition: https://github.com/marcmerlin/FastLED_Protomatter_RGBPanel_FrameBuffer_GFX/blame/4472926bdbb9d38f6c8285d43a72c5548803f7b5/neomatrix_config.h#L693
- Look forRP2350_INTERSTATE75W_64BY64 and RP2XXX_PROTOMATTER elsewhere in the file, although you should not need to modify anything but the first section with pin definition and layout, but if you have multiple kinds of panels, you're better off making new ifdefs for those new options
- the rest of the init code is in matrix_setup() which you call from your own setup(), and should not need to be modified: https://github.com/marcmerlin/FastLED_Protomatter_RGBPanel_FrameBuffer_GFX/blame/4472926bdbb9d38f6c8285d43a72c5548803f7b5/neomatrix_config.h#L1717
If you want something a bit simpler, you can look at https://github.com/marcmerlin/FastLED_Protomatter_RGBPanel_FrameBuffer_GFX/blob/main/matrixconfig.h . It gets the work done for basic demos, you can look at BasicTest, which shows you the beauty of those include files, as the demo file is super short
-
Framebuffer_GFX gives you full compatiblity with FastLED, Adafruit::GFX, and LEDMatrix APIs
-
As per its name, Framebuffer_GFX is a full RBG888 framebuffer, so you can read back its content, scroll a frame or portion thereof. Some of the hardware backends like ProtoMatter are only 16bit RGB565, and some backends are write only (you can't access the framebuffer to shift or mirror data), but this framebuffer allows all of this. , and most importantly with the same exact APIs, so you do not to modify your code for a new backend outside of the setup init section
-
Framebuffer_GFX comes with over 10 hardware backends that your code can run un-modified against (including native compile and running on linux). This means your code will run unmodified on plenty of other hardware
So this layer on top of Adafruit_Protomatter allows you to write your 24bpp framebuffer code, and run it against RGB Panel displays, as well as the 10+ other displays supported by https://github.com/marcmerlin/Framebuffer_GFX
What you get is this:
Low Level Drv|Glue Driver for FrameBuffer::GFX
FastLED - FastLED_NeoMatrix -------------\ FastLED CRGB Array
Adafruit_Protomatter vv \
FastLED_Protomatter_RGBPanel_FrameBuffer_GFX-|
ESP32-HUB75-MatrixPanel vvv |
FastLED_ESP32-HUB75-MatrixPanel_FrameBuffer_GFX-|
SmartMatrix - SmartMatrix_GFX ----------------- | 24bit FB storage API Support
\ CRGB methods like
AF:ILI9341-\ \ scale8/fadeToBlackBy
AF:SSD1331 |--- FastLED_ArduinoGFX_TFT ----------| | ,FastLED API
AF:ST7735 / FastLED_SPITFT_GFX (for AF) | | / (XY 2D to 1D mapping)
ArduinoGFX/ AF:Adafruit (ArduinoGFX is all in 1) | | /
| | /
ArduinoOnPc-FastLED-GFX-LEDMatrix arduino - FrameBuffer::GFX------ Adafruit::NeoMatrix +
emulation for linux / Raspberry Pi: | | \ Adafruit::GFX APIs
---------------------------------- / Adafruit::GFX \
rpi-rgb-led-matrix - FastLED_RPIRGBPanel_GFX ---/ LEDMatrix (optional) `LEDMatrix API
ArduinoOnPC X11/linux - FastLED_TFTWrapper_GFX /
FastLED_SDL (linux) - FastLED_NeoMatrix -/
Other examples FastLED Matrix vs SmartMatrix matrix, still running the same code:

And a 3 panel smartmatrix vs a tiny TFT of the exact same 96x64 resolution, both running the same code:
(don't miss the small TFT at the bottom).
So you write against any of the 3 APIs in Framebuffer::GFX, and you get to run on all hardware backends without having to change your code, including switching from teensy to ESP32, or rPi to display on RGBPanels.
I should stress that for RGBPanels, if you're writing code for RP2040/RP2350 and Adafruit_Protomatter, you
absolutely want to use this glue driver, because when you decide to scale up, you can switch to an rPi,
get 3 parallel outputs for a display that is 3 times as large or refreshes 3 times faster, and all your code
will just work with no changes required outside of the matrix init.
So the same code can run on these bigger displays (those run with rpi-rgb-panel):

https://youtu.be/MRRJw-Khkh0
And one more reminder of how awesome it is to be able to compile your arduino code on linux, run it on linux with full display, and debug it on linux with gdb and ASAN to find your memory leaks and dangling pointers. You get this for free by using FrameBuffer::GFX for all your code.

