Skip to main content

Module pinmap

Module pinmap 

Source
Expand description

Compile-time HUB75-signal → DMA-word bit mapping.

Exposes pinmap::PINMAP and pinmap::LATCHED_PINMAP so a driver crate can validate at compile time that its own board wiring matches the bit assignments this crate assumes. Compile-time mapping of the HUB75 signals onto the bits of the DMA word.

The plain and bitplane::plain framebuffers store one 16-bit word per pixel-clock cycle, while latched and bitplane::latched store 8-bit words. In every case each HUB75 signal occupies a fixed bit, and which bit depends on the board (for the 16-bit layouts) or on the external latch circuit (for the 8-bit layouts). This module is the single source of truth for those positions.

§The layouts

16-bit plain / bitplane::plain
default (ESP32 I2S / generic)          interstate75 (RP2040/RP2350 PIO)
15 .. 13  spare (dummy2, B1, G1)       15 .. 14  spare
    12    R1      Red   - lower half       13    OE    Output-Enable / Blank
    11    B0      Blue  - upper half       12    LAT   Latch / STB
    10    G0      Green - upper half       11    spare (unused)
     9    R0      Red   - upper half    10..6    E D C B A   Row address
     8    OE      Output-Enable / Blank  5..3    B1 G1 R1    lower half
     7    spare                          2..0    B0 G0 R0    upper half
     6    spare
     5    LAT     Latch / STB
   4..0   A..E     Row address

8-bit latched (fixed by the external latch circuit)
   7    OE   Output-Enable / Blank
   6    LAT  Latch / STB
   5    B2   Blue  - sub-pixel group 2
   4    G2   Green - sub-pixel group 2
   3    R2   Red   - sub-pixel group 2
   2    B1   Blue  - sub-pixel group 1
   1    G1   Green - sub-pixel group 1
   0    R1   Red   - sub-pixel group 1

Everything is a const, so the layout is folded away during compilation: the generated code is identical to hand-written bit literals, with no runtime branch and no lookup table. PINMAP and LATCHED_PINMAP are exported so a calling crate (the driver that owns the DMA/PIO peripheral) can validate at compile time that it drives the panel with the same bit assignments this crate assumes — e.g.

// The caller pins its own board definition to this crate's assumptions.
const _: () = assert!(hub75_framebuffer::pinmap::PINMAP.oe == 8);

Structs§

PinMap
Bit position of every HUB75 signal within one framebuffer word.

Constants§

LATCHED_PINMAP
Layout for the 8-bit latched and bitplane::latched framebuffers.
PINMAP
Layout for the 16-bit plain and bitplane::plain framebuffers, selected per board.