Add portal web simulator, SPI bridges, and Pico firmware updates.

Bring the five-panel hex portal online with a browser 3D/schematic preview, Pi SPI backends, and renamed multi-panel Pico UDP firmware.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-30 14:54:51 +12:00
parent d5cab2efdf
commit 5094c7bcee
78 changed files with 62251 additions and 832 deletions

View File

@@ -13,7 +13,7 @@ except ImportError:
MATRIX_SPI_BUS = 0
MATRIX_SPI_DEVICE = 0
BackendName = Literal["auto", "pio", "spi", "ws281x"]
BackendName = Literal["auto", "pio", "spi", "rpi5_ws2812", "ws281x"]
@dataclass
@@ -25,7 +25,41 @@ class StripConfig:
device: str = "/dev/leds0"
spi_bus: int = 0
spi_device: int = 0
spi_max_speed_hz: int | None = None
wire_order: str | None = None
brightness: float = 1.0
passthrough: bool = False
swap_rg: bool = True
def panel_strip_config(
panel_index: int,
count: int,
*,
spi_max_speed_hz: int | None = None,
wire_order: str | None = None,
brightness: float = 1.0,
passthrough: bool = True,
swap_rg: bool = True,
) -> StripConfig:
from leds.array_config import LOCAL_PANEL_INDICES, PANEL_SPI_BUS_BY_INDEX
if panel_index in PANEL_SPI_BUS_BY_INDEX:
spi_bus = PANEL_SPI_BUS_BY_INDEX[panel_index]
elif panel_index in LOCAL_PANEL_INDICES:
spi_bus = pi5_second_spi_bus()
else:
spi_bus = MATRIX_SPI_BUS
return spi_strip_config(
count,
spi_bus=spi_bus,
spi_device=MATRIX_SPI_DEVICE,
spi_max_speed_hz=spi_max_speed_hz,
wire_order=wire_order,
brightness=brightness,
passthrough=passthrough,
swap_rg=swap_rg,
)
def spi_strip_config(
@@ -33,14 +67,25 @@ def spi_strip_config(
*,
spi_bus: int = MATRIX_SPI_BUS,
spi_device: int = MATRIX_SPI_DEVICE,
spi_max_speed_hz: int | None = None,
wire_order: str | None = None,
brightness: float = 1.0,
backend: BackendName | None = None,
passthrough: bool = False,
swap_rg: bool = True,
) -> StripConfig:
if backend is None:
backend = "rpi5_ws2812" if board_family() == "pi5" else "spi"
return StripConfig(
count,
backend="spi",
backend=backend,
spi_bus=spi_bus,
spi_device=spi_device,
spi_max_speed_hz=spi_max_speed_hz,
wire_order=wire_order,
brightness=brightness,
passthrough=passthrough,
swap_rg=swap_rg,
)