https://github.com/TillFleisch/ESPHome-HUB75-MatrixDisplayWrapper ... but for my FPGA project.
This custom component is a ESPHome wrapper for the ESP32-FPGA-MatrixPanel library. For more details regarding wiring, choosing the correct parameters and more complex configurations please refer to the above linked documentation. This ESPHome component wraps the library into an ESPHome display component which can be used to show text, sensor values and images.
This wrapper currently only supports horizontally chained panels.
The custom component can be added to a yaml configuration by adding the external component like this:
esphome:
name: matrix-display
friendly_name: Matrix Display
external_components:
- source: github://w531t4/ESPHome-FPGA-MatrixDisplayWrapper@main
esp32:
board: esp32dev
framework:
type: arduinoNote that the component will only compile on ESP32-based devices. An example configuration can be found here.
A minimum working example for setting up the display. A more complex configuration can be found here.
display:
- platform: fpga_matrix_display
id: matrix
width: 64
height: 32- id(Required, string): Matrix ID which will be used for entity configuration.
- width(Required, int): Width of the individual panels.
- height(Required, int): Height of the individual panels.
- chain_length(Optional, int): The number of panels chained one after another. Defaults to
1. - brightness(Optional, int): Initial brightness of the display (0-255). Defaults to
128.
SPI_CE_PIN = "SPI_CE_pin" SPI_CLK_PIN = "SPI_CLK_pin" SPI_MOSI_PIN = "SPI_MOSI_pin"
-
SPI_CE_PIN(Optional, Pin): Pin connected to the S_CE pin on the FPGA. Defaults to
15. -
SPI_CLK_PIN(Optional, Pin): Pin connected to the SCLK pin on the FPGA. Defaults to
14. -
SPI_MOSI_PIN(Optional, Pin): Pin connected to the MOSI pin on the FPGA. Defaults to
2. -
spispeed(Optional): I2SSpeed used for configuring the display. Select one of
HZ_8M,HZ_10M,HZ_15M,HZ_16M,HZ_20M. -
use_custom_library(Optional, boolean): If set to
truea custom library must be defined usingplatformio_options:lib_deps. Defaults tofalse. See this example for more details. -
All other options from Display
A helper test graphic emits FPGA commands (clear, fill, rect, pixels, brightness, swap) so you can verify the command path before resuming normal rendering. Call enter_test_state() to show the graphic and exit_test_state() to return to the usual layout.
on_boot:
then:
- lambda: |-
id(matrix).enter_test_state();Trigger the logic from automations or scripts; the display stays in the test state until you call exit_test_state().
Note that the default pin configurations are the ones mentioned in the ESP32-FPGA-MatrixPanel library. Some of these pins are used as strapping pins on ESPs. It is recommended to not use these.
This switch can be used to turn the display on or off. In it's off state the display is showing a blank screen.
- matrix_id(Required, string): The matrix display entity to which this power switch belongs.
- All other options from Switch
This number entity can be used to set the display brightness. In combination with a brightness sensor this can used to adaptively change matrix displays brightness.
- matrix_id(Required, string): The matrix display entity to which this brightness value belongs.
- All other options from Number
esptool --baud 1152000 write_flash 0x0000 .esphome/build/blah/.pioenvs/blah/firmware.factory.bin
- Library used in this Project: ESP32-HUB75-MatrixPanel-DMA by @mrcodetastic
- Library used in this Project: ESPHome-HUB75-MatrixDisplayWrapper by @TillFleisch
cd .esphome/build/<project>pio run -t compiledb
"clangd.arguments": [
"--compile-commands-dir=${workspaceFolder}/.esphome/build/<project>",
"--background-index",
"--query-driver=**/xtensa-esp32-elf-g++",
],
CompileFlags:
Remove:
- -fno-tree-switch-conversion
- -fstrict-volatile-bitfields
- -mlongcalls
Add:
- -Qunused-arguments
- -I${FULLPATH}$/config/.esphome/build/<project>/src
- mkdir -p ~/.config/environment.d
- edit ~/.config/environment.d/esphome.conf
- add
ESPHOME_HOME_GIT_URL=ssh://[email protected]/YourOrg/YourPrivateRepo.git
- reboot/login-out
- click link from above section to launch vscode container
This project is based on and incorporates code from:
- ESPHome-HUB75-MatrixDisplayWrapper by TillFleisch
- https://github.com/TillFleisch/ESPHome-HUB75-MatrixDisplayWrapper
- License: Portions are GPL-3.0-or-later, Portions are MIT