velxio/test/test_epaper
David Montero Crespo 3bb6f95a67 fix(epaper): wrap RAM Y counter at window end (tri-colour red plane)
The 2.9" tri-colour ESP32 alert badge rendered the red ALERT pill as white:
the red plane (0x26) was received but landed out of bounds and was dropped.

GxEPD2_3C writes the 0x24 (black) plane then the 0x26 (red) plane WITHOUT
re-seeking the RAM address counter between them — it relies on the SSD168x
counter wrapping back to the window start after the last byte of the window.
Our decoder advanced Y past the window end instead of wrapping, so every
0x26 byte hit y >= rows and was discarded (red_ram stayed all-init).

Mirror the hardware: when the X cursor wraps at the end of a row, advance Y
with a wrap at the active window boundary (yrange), honouring the data-entry
Y direction. Applied identically to the worker slave, the browser decoder,
and the Python golden reference so the three stay in lockstep. No regression
on the mono panels (their counter is re-seeked per plane, so the wrap is a
no-op for them); verified the tri-colour pill now renders red and the 2.9"
weather / 2.13" clock / 1.54" hello panels are unchanged.
2026-06-04 23:15:37 -03:00
..
autosearch
sketches
README.md
__init__.py
ssd168x_decoder.py fix(epaper): wrap RAM Y counter at window end (tri-colour red plane) 2026-06-04 23:15:37 -03:00
test_compile_helloworld.py
test_ssd168x_protocol.py fix(epaper): correct orientation across all boards + Pico VCC wire 2026-06-04 23:15:37 -03:00
test_uc8159c_protocol.py

README.md

test_epaper — ePaper / e-Ink display emulation

Workspace for adding ePaper (electrophoretic) display support to Velxio. Built off the ILI9341 / SSD1306 patterns already living in frontend/src/simulation/parts/ComplexParts.ts and frontend/src/simulation/parts/ProtocolParts.ts.

Layout

test_epaper/
├── README.md                    ← this file
├── autosearch/                  ← research dossier (markdown only)
│   ├── 00_overview.md           ← what ePaper is + why emulation differs
│   ├── 01_seeed_models.md       ← target panels from seeedstudio.com
│   ├── 02_controllers.md        ← SSD1675 / SSD1681 / UC8159 / IT8951 …
│   ├── 03_spi_protocol.md       ← command/data framing, BUSY pin, refresh sequence
│   ├── 04_arduino_libraries.md  ← GxEPD2, Adafruit_EPD, Pervasive matrix
│   ├── 05_velxio_existing.md    ← how SSD1306 + ILI9341 are wired today
│   ├── 06_svg_layouts.md        ← physical dimensions for the SVG components
│   └── 07_emulation_plan.md     ← phased implementation plan
├── datasheets/                  ← controller PDFs (gitignored — fetched on demand)
├── sketches/                    ← Arduino sketches used by the E2E tests
└── test_*.py / test_*.ts        ← actual tests (TBD)

Status

  • Research phase: read autosearch/ to see what's been investigated.
  • Tests phase: pytest tests verify SPI protocol decoding without QEMU; sketch tests verify cross-board compilation; E2E pixel-buffer tests come last (blocked on emulator scaffold).

How to run (when tests exist)

# Pure Python protocol decoder tests (no backend, no QEMU)
pytest test/test_epaper/ -v

# Cross-board sketch compile (requires backend on :8765)
VELXIO_BACKEND_URL=http://127.0.0.1:8765 pytest test/test_epaper/test_compile_*.py -v