|
@@ -0,0 +1,44 @@
|
|
|
|
|
+# gxepd2 capture harness
|
|
|
|
|
+
|
|
|
|
|
+Host-side tooling that **generates a panel descriptor by observing a real
|
|
|
|
|
+GxEPD2 driver run**, instead of hand-writing one. See `claude/DESIGN.md` for
|
|
|
|
|
+the full model; this is the how-to.
|
|
|
|
|
+
|
|
|
|
|
+The vendored GxEPD2 source it compiles against lives in `third_party/GxEPD2/`.
|
|
|
|
|
+Everything here runs on a dev machine with plain `g++` — no ESP toolchain.
|
|
|
|
|
+
|
|
|
|
|
+## Emit a descriptor
|
|
|
|
|
+
|
|
|
|
|
+Each panel has a 4-line `run_<panel>_emit.cpp`. Build and run it (from the
|
|
|
|
|
+`code/` root):
|
|
|
|
|
+
|
|
|
|
|
+```sh
|
|
|
|
|
+VSRC=third_party/GxEPD2/src
|
|
|
|
|
+g++ -std=c++17 -I tools/gxepd2_harness/spy -I $VSRC -I tools/gxepd2_harness \
|
|
|
|
|
+ tools/gxepd2_harness/run_<panel>_emit.cpp \
|
|
|
|
|
+ $VSRC/GxEPD2_EPD.cpp $VSRC/<subdir>/GxEPD2_<Class>.cpp \
|
|
|
|
|
+ -o /tmp/emit_<panel>
|
|
|
|
|
+/tmp/emit_<panel> > /tmp/panel_<panel>.h # candidate descriptor — review it
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+`emit_descriptor.h` phase-segments the captured command stream into the
|
|
|
|
|
+init / window / refresh sequences + plane-write command(s), reads
|
|
|
|
|
+resolution / busy-polarity / timeout from the driver, and derives
|
|
|
|
|
+`plane_invert` and 1bpp-vs-packed from a fill probe. Review the result, add any
|
|
|
|
|
+packed-format fields the diag passes own (`bits_per_pixel` / `palette` for
|
|
|
|
|
+packed panels; `plane_width` / `row_interleave` for dual-region), then save it
|
|
|
|
|
+as `components/gxepd2/panel_<panel>.h` and wire it into `display.py`'s `MODELS`.
|
|
|
|
|
+
|
|
|
|
|
+`EMIT_DEBUG=1 /tmp/emit_<panel>` dumps the image-stage command/burst structure.
|
|
|
|
|
+
|
|
|
|
|
+## Other programs
|
|
|
|
|
+
|
|
|
|
|
+- `run_<panel>.cpp` + `run_harness.h` — bare-driver capture plus the
|
|
|
|
|
+ window-encoder sweep (`window_sweep.h`), for deriving the coordinate →
|
|
|
|
|
+ window-byte mapping.
|
|
|
|
|
+- `run_<panel>_probe.cpp` + `probe_plane_invert.h` — print the `plane_invert`
|
|
|
|
|
+ probe result on its own.
|
|
|
|
|
+- `run_*diag*.cpp` — the diagnostic-fill passes that derive pixel packing,
|
|
|
|
|
+ palette codes, and row order for packed / multi-region panels.
|
|
|
|
|
+- `spy/` — the host stand-ins for the Arduino/SPI APIs a GxEPD2 driver calls;
|
|
|
|
|
+ `trace.h` records what the driver does.
|