Hub75Driver
Source:
Hub75Driver.h
Hub75Driver¶
src/light/drivers/Hub75Driver.h:31Inherits:
DriverBase
Output driver: HUB75 panels driven directly from the board's own pins, with no receiving card.
The sibling of PanelCardDriver, which reaches the same panels over raw Ethernet to a 5A-75B/E card and wins above roughly 16,384 pixels. The bit-plane wire format is [Hub75Slots.h], pure data and host-tested.
Prior art: the HUB75 lineage generally (mrcodetastic/ESP32-HUB75-MatrixPanel-DMA, hzeller/rpi-rgb-led-matrix, ESPHome's hub75 component). The scan and bit-plane structure belongs to the panel rather than to any library; studied, not copied.
Public Attributes¶
uint8_t boardSel = 0
: Which board's wiring to use; index into boardOptions_, 0 being MoonHub75.
int8_t r1 = -1
: Red, green and blue for the upper half-panel.
int8_t g1 = -1
: Green, upper half-panel.
int8_t b1 = -1
: Blue, upper half-panel.
int8_t r2 = -1
: Red, green and blue for the lower half-panel.
int8_t g2 = -1
: Green, lower half-panel.
int8_t b2 = -1
: Blue, lower half-panel.
int8_t addrA = -1
: Row address lines; a 1/16 panel leaves addrE unset.
int8_t addrB = -1
: Row address bit 1.
int8_t addrC = -1
: Row address bit 2.
int8_t addrD = -1
: Row address bit 3.
int8_t addrE = -1
: Row address bit 4, on 1/32 panels.
int8_t clk = -1
: The pixel clock.
int8_t lat = -1
: Latch: moves the shift register to the output drivers.
int8_t oe = -1
: Output enable, active LOW.
uint8_t clockEdgeSel = 0
: Which clock edge the panel's chips sample on; index into kEdgeOptions.
uint8_t scanSel = 1
: The panel's own scan rate; index into kScanOptions.
uint8_t bitDepth = 4
: Bit planes per frame, and therefore the refresh tradeoff.
uint8_t peripheralSel_ = 0
: Which silicon block drives the panel, where the chip offers a choice.
Public Methods¶
virtual inline const char * tags() const override
: The card's tag: this driver is two-dimensional.
virtual inline LedHwBlock hwBlock() const override
: The peripheral block this driver holds, for the sibling claim guard.
virtual inline void setSourceBuffer(Buffer * buf) override
: Bind the rendered frame this driver encodes from.
virtual inline void defineDriverControls() override
: Publish the board select, the fourteen pin controls, the geometry and the measured refresh.
virtual inline void onControlChanged(const char * name) override
: Apply a control change; picking a board writes its map into the pin controls.
virtual inline bool affectsPrepare(const char * name) const override
: Whether changing name forces a rebuild: the wire format and the geometry do.
virtual inline void release() override
: Stop the scan and release the panel's peripheral.
virtual inline void prepare() override
: Build the geometry, claim the peripheral, and arm the continuous scan.
virtual inline void tick() override
: The hot tick, which by default ticks every enabled child and times each.
virtual inline void onCorrectionChanged() override
: Resize the correction scratch when the wiring changes.
virtual inline void tick1s() override
: Publish the measured refresh rate.
More info¶
Output is continuous. A WS2812 strand latches a frame and holds it; a HUB75 panel holds nothing and is lit only while being clocked, so the platform arms one scan and re-sends the same buffer forever. This driver writes the next frame into that buffer between scans, which is why [tick()] transmits nothing and waits for nothing. Hub75Slots.h covers scanning and why brightness is time.
The board select supplies the pins, defaulting to MoonHub75 and prefilling all fourteen on first definition, because a soldered line must never be guessed from nothing. Each map is taken from that board's own published source. The maps themselves are on the driver's page. A user wiring a panel reads them beside the rest of the card.
Two naming traps, both worth knowing before wiring. A panel's ribbon numbers its color lines R1/G1/B1 (upper half) and R2/G2/B2 (lower half); some board docs call the same pairs R0/G0/B0 and R1/G1/B1. WLED's pin array ends ...LAT,OE,CLK, so a map transcribed as ...CLK,LAT,OE swaps three lines silently. Every map here is already in this driver's control order (clk, lat, oe).