4 Commits af3e1cf753 ... 7bd500fbca

Author SHA1 Message Date
  ZiB 7bd500fbca Hook deep_sleep/safe_reboot via Component::on_powerdown(), add idle() 1 month ago
  ZiB 7ff01ebccf Drop 213c inter-panel notes; flip 730c to verified 1 month ago
  ZiB cd1730f91c Dedupe generalized engine facts out of generated panel headers 1 month ago
  ZiB 187fa75490 Capture writeImageForFullRefresh's extra RAM-bank write for partial refresh 1 month ago
41 changed files with 294 additions and 190 deletions
  1. 42 4
      CONTRIBUTING.md
  2. 1 4
      components/gxepd2/display.py
  3. 16 0
      components/gxepd2/epd_command.h
  4. 40 3
      components/gxepd2/gxepd2_display.h
  5. 1 0
      components/gxepd2/panel_102.h
  6. 1 0
      components/gxepd2/panel_1020_gdem102t91.h
  7. 1 0
      components/gxepd2/panel_1160_t91.h
  8. 1 0
      components/gxepd2/panel_1330_gdem133t91.h
  9. 1 0
      components/gxepd2/panel_150_bn.h
  10. 1 0
      components/gxepd2/panel_154_d67.h
  11. 1 0
      components/gxepd2/panel_154_gdey0154d67.h
  12. 1 0
      components/gxepd2/panel_213_b74.h
  13. 1 0
      components/gxepd2/panel_213_bn.h
  14. 1 0
      components/gxepd2/panel_213_gdey0213b74.h
  15. 1 0
      components/gxepd2/panel_213_t5d.h
  16. 2 15
      components/gxepd2/panel_213c_gdey0213f51.h
  17. 1 3
      components/gxepd2/panel_213c_gdey0213f52.h
  18. 1 0
      components/gxepd2/panel_266_bn.h
  19. 1 0
      components/gxepd2/panel_270_gdey027t91.h
  20. 1 0
      components/gxepd2/panel_290_bs.h
  21. 1 0
      components/gxepd2/panel_290_gdey029t71h.h
  22. 1 0
      components/gxepd2/panel_290_gdey029t94.h
  23. 1 0
      components/gxepd2/panel_290_i6fd.h
  24. 4 2
      components/gxepd2/panel_290_t5d.h
  25. 1 0
      components/gxepd2/panel_290_t94.h
  26. 1 0
      components/gxepd2/panel_290_t94_v2.h
  27. 0 7
      components/gxepd2/panel_290c_gdey029f51.h
  28. 1 0
      components/gxepd2/panel_310_gdeq031t10.h
  29. 1 0
      components/gxepd2/panel_370_tc1.h
  30. 1 0
      components/gxepd2/panel_397_gdem0397t81.h
  31. 1 0
      components/gxepd2/panel_420_gdey042t81.h
  32. 1 0
      components/gxepd2/panel_420_gye042a87.h
  33. 4 1
      components/gxepd2/panel_426_gdeq0426t82.h
  34. 6 17
      components/gxepd2/panel_579c_gdey0579f51.h
  35. 0 127
      components/gxepd2/panel_579c_gdey0579f51_master_only.h
  36. 1 0
      components/gxepd2/panel_583_gdeq0583t31.h
  37. 0 2
      components/gxepd2/panel_730c_gdep073e01.h
  38. 13 2
      tools/capture.py
  39. 2 1
      tools/check_descriptors.py
  40. 2 2
      tools/gxepd2_harness/README.md
  41. 136 0
      tools/gxepd2_harness/emit_descriptor.h

+ 42 - 4
CONTRIBUTING.md

@@ -168,6 +168,14 @@ Every command and data byte is its own SPI transaction with CS toggled around
 it — wasteful versus a burst transfer, but deliberate: matching the vendor
 `_writeCommand()`/`_writeData()` cycle byte-for-byte is the point.
 
+A vendor driver often gates its own reset pulse on `_hibernating ||
+_initial_write` (real RST only on the first cycle or after a hibernate,
+re-issuing the command sequence with no reset otherwise) - this engine's
+`RESET_LOW` is unconditional every single cycle instead, a superset of that
+first-cycle behavior, so a panel descriptor never needs to special-case it.
+Don't re-derive or re-document this per panel_*.h; it's a property of
+`request_full_update()`, true for every panel.
+
 `power_off_sequence`/`hibernate_sequence` are a separate, standalone entry
 point (`CycleEngine::request_power_off()`/`request_hibernate()`, exposed as
 `GxEPD2Display::power_off()`/`hibernate()` for a user's own lambda) - no reset
@@ -175,14 +183,45 @@ pulse, no init/window/plane-write, just that one command table then `DONE`.
 Not run automatically by `request_full_update()`: this engine does a full
 hardware reset every cycle regardless of prior power state, so correctness
 never depends on calling either - they exist purely for panel longevity
-(reduced fading between infrequent updates) and, eventually, MCU-side
-deep-sleep pairing. `request_hibernate()` runs `power_off_sequence` then
+(reduced fading between infrequent updates) and MCU-side deep-sleep pairing
+(see below). `request_hibernate()` runs `power_off_sequence` then
 `hibernate_sequence` (hibernate()'s *tail* only, past whatever it shares with
 powerOff() - see below); no paired "wake" call exists or is needed, since
 `request_full_update()`'s `RESET_LOW` is an unconditional hardware reset pulse
 every cycle, which is exactly how GxEPD2 wakes a hibernating (RST-wakeable)
 panel.
 
+**Deep-sleep pairing.** `GxEPD2Display::on_powerdown()` overrides
+`Component::on_powerdown()`, which ESPHome calls on every component right
+before `deep_sleep` actually suspends the MCU, and on `safe_reboot()` (see
+`Application::run_powerdown_hooks()`; `deep_sleep`'s `should_teardown_()` is
+unconditional on every supported platform, so this always fires before a
+sleep). It calls `hibernate()` if a reset pin is configured, else
+`power_off()` - no YAML/lambda needed for the common case, and no engine
+change, since `hibernate()`'s "no paired wake call needed" property already
+makes this free.
+
+This is deliberately NOT paired with a `Component::teardown()` override to
+wait out a mid-flight refresh. ESPHome's teardown budget is short and fixed
+by the *caller*, not by us - 1s on `safe_reboot()`
+(`Application::TEARDOWN_TIMEOUT_REBOOT_MS`), 5s on `deep_sleep`
+(`TEARDOWN_TIMEOUT_DEEP_SLEEP_MS`) - and it's a hard cap: `teardown_components()`
+busy-polls every component's `teardown()` until all return `true` or the
+budget expires, then logs one warning per straggler and proceeds regardless.
+That budget is sized for a network flush (see `api_server::teardown()`,
+one of only two overrides in ESPHome core, both networking), not a hardware
+operation - it's far shorter than this engine's slower `busy_timeout_ms`
+classes (up to 45-60s for 4bpp/7-color panels), so stalling `teardown()`
+here would just lose that race every time and get force-advanced anyway.
+If a refresh is still running when `on_powerdown()` fires,
+`power_off()`/`hibernate()`'s own idle-check skips it with a warning instead.
+`GxEPD2Display::idle()` (wraps `CycleEngine::idle()`) is exposed publicly for
+exactly this: a caller who cares about the race - or a more complex
+application tracking its own multi-step update sequence - can check it and
+decide for themselves whether to hold off triggering deep sleep, rather than
+the component trying to enforce a resolution the framework itself won't
+support.
+
 Verifying `power_off()`/`hibernate()` actually took effect needs the panel on
 a bench, since the real effect is electrical (driving voltage off, or deep
 sleep) - nothing the MCU can see directly. `hibernate()`'s documented
@@ -305,11 +344,10 @@ from it, and a non-verified panel logs a warning in its boot `dump_config`.
 | `GxEPD2_426_GDEQ0426T82` | GDEQ0426T82 | SSD1677 | mono | ✅ verified |
 | `GxEPD2_583` | GDEW0583T7 | UC8159c | mono | ⚪ structural |
 | `GxEPD2_583_GDEQ0583T31` | GDEQ0583T31 | UC8179 | mono | ✅ verified |
-| `GxEPD2_730c_GDEP073E01` | GDEP073E01 | unknown | 7-color | ⚪ structural |
+| `GxEPD2_730c_GDEP073E01` | GDEP073E01 | unknown | 7-color | ✅ verified |
 | `GxEPD2_750_GDEY075T7` | GDEY075T7 | UC8179 | mono | ✅ verified |
 | `GxEPD2_290c_GDEY029F51` | GDEY029F51 | JD79667 | 4-color | ⚪ structural |
 | `GxEPD2_579c_GDEY0579F51` | GDEY0579F51 | HX8717 | 4-color | ✅ verified |
-| `GxEPD2_579c_GDEY0579F51_MASTER_ONLY` | GDEY0579F51 | HX8717 | 4-color | 🔧 diagnostic |
 
 ✅ rendered correctly on real hardware · ⚪ captured, not yet bench-confirmed · 🔧 diagnostic variant.
 

+ 1 - 4
components/gxepd2/display.py

@@ -76,7 +76,7 @@ PANELS = {
     "GxEPD2_426_GDEQ0426T82": Panel("PANEL_426_GDEQ0426T82", "GDEQ0426T82", "SSD1677", "mono", "verified"),
     "GxEPD2_583": Panel("PANEL_583", "GDEW0583T7", "UC8159c", "mono", "structural"),
     "GxEPD2_583_GDEQ0583T31": Panel("PANEL_583_GDEQ0583T31", "GDEQ0583T31", "UC8179", "mono", "verified"),
-    "GxEPD2_730c_GDEP073E01": Panel("PANEL_730C_GDEP073E01", "GDEP073E01", "unknown", "7-color", "structural"),
+    "GxEPD2_730c_GDEP073E01": Panel("PANEL_730C_GDEP073E01", "GDEP073E01", "unknown", "7-color", "verified"),
     "GxEPD2_750_GDEY075T7": Panel("PANEL_750_GDEY075T7", "GDEY075T7", "UC8179", "mono", "verified"),
     "GxEPD2_290c_GDEY029F51": Panel("PANEL_290C_GDEY029F51", "GDEY029F51", "JD79667", "4-color", "structural"),
     "GxEPD2_579c_GDEY0579F51": Panel("PANEL_579C_GDEY0579F51", "GDEY0579F51", "HX8717", "4-color", "verified"),
@@ -126,9 +126,6 @@ PANELS = {
     "GxEPD2_583_T8": Panel("PANEL_583_T8", "GDEW0583T8", "GD7965", "mono", "structural"),
     "GxEPD2_750": Panel("PANEL_750", "TODO", "IL0371", "mono", "structural"),
     "GxEPD2_750_T7": Panel("PANEL_750_T7", "GDEW075T7", "GD7965", "mono", "structural"),
-    # Diagnostic variant: the 396x272 master region as a self-contained panel.
-    "GxEPD2_579c_GDEY0579F51_MASTER_ONLY": Panel(
-        "PANEL_579C_GDEY0579F51_MASTER_ONLY", "GDEY0579F51", "HX8717", "4-color", "diagnostic"),
 }
 
 

+ 16 - 0
components/gxepd2/epd_command.h

@@ -119,6 +119,22 @@ struct EpdPanelDescriptor {
 
   uint8_t plane_count;          // 1 (BW), 2 (BW + accent color), or 2 physical regions
   uint8_t plane_write_cmd[2];   // e.g. {0x24, 0x26}
+
+  // The extra "previous RAM bank" write GxEPD2's writeImageForFullRefresh()
+  // makes that plain writeImage() doesn't, on controllers where the two
+  // diverge (SSD1680/SSD1681/SSD1619-family: 0x26 then 0x24, or 0x10 then
+  // 0x13 - same bitmap written twice, to two different commands). 0x00 (the
+  // default, and every panel captured before this field existed) means no
+  // divergence was observed: writeImageForFullRefresh falls back to
+  // writeImage for that controller, the common case. NOT read by CycleEngine
+  // today - this engine always does a plain single write per plane, correct
+  // for full-refresh-only operation, since the full-refresh waveform doesn't
+  // depend on the "previous" bank's content. It matters once partial refresh
+  // reads that bank to compute its diff, so it's captured now rather than
+  // needing a second capture pass later - see emit_descriptor.h's
+  // probe_full_refresh_extra_write_cmd.
+  uint8_t plane_write_cmd_for_full_refresh[2]{0, 0};
+
   bool plane_invert[2];         // true if the byte must be bit-inverted on write
 
   // When window_per_plane is true, each plane's own buffer is sized for

+ 40 - 3
components/gxepd2/gxepd2_display.h

@@ -62,7 +62,6 @@
 #include "panel_420.h"
 #include "panel_426_gdeq0426t82.h"
 #include "panel_579c_gdey0579f51.h"
-#include "panel_579c_gdey0579f51_master_only.h"
 #include "panel_583.h"
 #include "panel_583_gdeq0583t31.h"
 #include "panel_730c_gdep073e01.h"
@@ -259,12 +258,21 @@ class GxEPD2Display : public display::DisplayBuffer {
 
   void loop() override { this->engine_.step(); }
 
+  // True once the engine has returned to idle after the last update()/
+  // power_off()/hibernate() call. Lets a more complex application (a lambda
+  // chaining several updates, a deep_sleep automation deciding whether to
+  // wait) check "is the panel still mid-refresh" instead of guessing from
+  // timing - the same thing power_off()/hibernate()'s own guards below check
+  // internally.
+  bool idle() const { return this->engine_.idle(); }
+
   // Turns off the panel's driving-voltage generation (reduces fading over
   // time between refreshes). Call from a lambda, e.g.
   // id(<display_id>).power_off(); - not called automatically by update(),
   // since this engine does a full hardware reset every cycle regardless of
-  // prior power state, so correctness never depends on it. A no-op (with a
-  // warning) while a refresh is still in progress.
+  // prior power state, so correctness never depends on it. (It IS called
+  // automatically from on_powerdown() below.) A no-op (with a warning) while
+  // a refresh is still in progress.
   void power_off() {
     if (!this->engine_.idle()) {
       ESP_LOGW(TAG, "Skipping power_off: display refresh still in progress");
@@ -285,6 +293,35 @@ class GxEPD2Display : public display::DisplayBuffer {
     this->engine_.request_hibernate();
   }
 
+  // ESPHome calls this on every component right before deep_sleep actually
+  // suspends the MCU, and on safe_reboot() - see
+  // Application::run_powerdown_hooks() (fires after teardown_components()
+  // completes or times out, deep_sleep's should_teardown_() is unconditional
+  // on every supported platform). Powers the panel down with no YAML/lambda
+  // needed for the common case: hibernate() when a reset pin is wired (the
+  // next update()'s unconditional RESET_LOW wakes it - see hibernate()
+  // above), else power_off() (needs no reset pulse to recover, so it's safe
+  // with no rst pin at all).
+  //
+  // Deliberately NOT paired with a teardown() override to wait out a
+  // mid-flight refresh: ESPHome's teardown budget (1s on reboot, 5s on deep
+  // sleep) is far shorter than this engine's slower busy_timeout_ms classes
+  // (up to 45-60s for 4bpp/7-color panels), so stalling teardown here would
+  // just lose that race every time and get force-advanced anyway - the
+  // budget is sized for a network flush (see api_server::teardown()), not a
+  // hardware operation. If a refresh is still running when this fires,
+  // power_off()/hibernate()'s own guard above skips it with a warning rather
+  // than fighting the panel for the bus mid-write. A caller who cares about
+  // that race can check idle() (above) and hold off triggering deep sleep
+  // themselves.
+  void on_powerdown() override {
+    if (this->rst_ != nullptr) {
+      this->hibernate();
+    } else {
+      this->power_off();
+    }
+  }
+
 #ifdef USE_GXEPD2_DIAGNOSTICS
   // Dev-time diagnostics - compiled out entirely unless this display's YAML
   // sets `diagnostics: true` (display.py then adds -DUSE_GXEPD2_DIAGNOSTICS),

+ 1 - 0
components/gxepd2/panel_102.h

@@ -109,6 +109,7 @@ inline const EpdPanelDescriptor PANEL_102 = {
     .window_sequence_len = {sizeof(PANEL_102_WINDOW_SEQ0) / sizeof(PANEL_102_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x13, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x10, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x13 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_1020_gdem102t91.h

@@ -60,6 +60,7 @@ inline const EpdPanelDescriptor PANEL_1020_GDEM102T91 = {
     .window_sequence_len = {sizeof(PANEL_1020_GDEM102T91_WINDOW_SEQ0) / sizeof(PANEL_1020_GDEM102T91_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_1160_t91.h

@@ -70,6 +70,7 @@ inline const EpdPanelDescriptor PANEL_1160_T91 = {
     .window_sequence_len = {sizeof(PANEL_1160_T91_WINDOW_SEQ0) / sizeof(PANEL_1160_T91_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_1330_gdem133t91.h

@@ -60,6 +60,7 @@ inline const EpdPanelDescriptor PANEL_1330_GDEM133T91 = {
     .window_sequence_len = {sizeof(PANEL_1330_GDEM133T91_WINDOW_SEQ0) / sizeof(PANEL_1330_GDEM133T91_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_150_bn.h

@@ -61,6 +61,7 @@ inline const EpdPanelDescriptor PANEL_150_BN = {
     .window_sequence_len = {sizeof(PANEL_150_BN_WINDOW_SEQ0) / sizeof(PANEL_150_BN_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_154_d67.h

@@ -58,6 +58,7 @@ inline const EpdPanelDescriptor PANEL_154_D67 = {
     .window_sequence_len = {sizeof(PANEL_154_D67_WINDOW_SEQ0) / sizeof(PANEL_154_D67_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_154_gdey0154d67.h

@@ -60,6 +60,7 @@ inline const EpdPanelDescriptor PANEL_154_GDEY0154D67 = {
     .window_sequence_len = {sizeof(PANEL_154_GDEY0154D67_WINDOW_SEQ0) / sizeof(PANEL_154_GDEY0154D67_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_213_b74.h

@@ -60,6 +60,7 @@ inline const EpdPanelDescriptor PANEL_213_B74 = {
     .window_sequence_len = {sizeof(PANEL_213_B74_WINDOW_SEQ0) / sizeof(PANEL_213_B74_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_213_bn.h

@@ -61,6 +61,7 @@ inline const EpdPanelDescriptor PANEL_213_BN = {
     .window_sequence_len = {sizeof(PANEL_213_BN_WINDOW_SEQ0) / sizeof(PANEL_213_BN_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_213_gdey0213b74.h

@@ -56,6 +56,7 @@ inline const EpdPanelDescriptor PANEL_213_GDEY0213B74 = {
     .window_sequence_len = {sizeof(PANEL_213_GDEY0213B74_WINDOW_SEQ0) / sizeof(PANEL_213_GDEY0213B74_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_213_t5d.h

@@ -77,6 +77,7 @@ inline const EpdPanelDescriptor PANEL_213_T5D = {
     .window_sequence_len = {sizeof(PANEL_213_T5D_WINDOW_SEQ0) / sizeof(PANEL_213_T5D_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x13, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x10, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x13 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 2 - 15
components/gxepd2/panel_213c_gdey0213f51.h

@@ -2,24 +2,11 @@
 
 // Hand-derived from third_party/GxEPD2/src/epd4c/GxEPD2_213c_GDEY0213F51.{h,cpp}
 // (GDEY0213F51, JD79661 controller, 128x250 buffer / 122x250 visible,
-// 4-color BWRY). Same Good Display 4-color command template as
-// panel_290c_gdey029f51.h (JD79667) - the _InitDisplay() command sequence is
-// byte-for-byte identical except TRES (0x61, the resolution), so this is the
-// 290c descriptor retargeted to 128x250. See panel_290c_gdey029f51.h for the
-// per-command rationale (0x00 PSR / 0x01 PWRR / 0x03 POFS / 0x06 BTST / 0x50
-// CDI / 0x60 TCON / 0x61 TRES / 0x83 window-set / refresh via 0x50+0x12), and
-// GxEPD2Display::draw_packed_ for the 2bpp/4-pixels-per-byte buffer side.
+// 4-color BWRY).
 //
 // Pixel codes black=0x00, white=0x01, yellow=0x02, red=0x03 (GXEPD2_PALETTE_4C,
 // per GxEPD2_4C.h color4()); the vendor's own white clear writes 0x55 (code
-// 0x01 x4), confirming white=0x01. JD79661 vs JD79667 could in principle order
-// yellow/red differently - the bit-depth-aware test pattern's color bars will
-// show it directly if so, and only the palette codes would need swapping.
-//
-// NOTE: bench hardware is marked GDEY0213F52 (a V2 revision); this descriptor
-// is the F51 vendor driver, tried on F52 as a starting point pending a
-// datasheet/product-page diff. Same label (0213F52 vs 0213F51) aside, if the
-// F52 needs init tweaks they go in a separate descriptor.
+// 0x01 x4), confirming white=0x01.
 
 #include "epd_command.h"
 

+ 1 - 3
components/gxepd2/panel_213c_gdey0213f52.h

@@ -1,8 +1,6 @@
 #pragma once
 
-// GDEY0213F52, JD79676 controller, 128x250, 4-color (BWRY). The V2 revision of
-// the GDEY0213F51 (JD79661) on a different controller - this is the part the
-// bench F52 panels actually are (see the F51-vs-F52 control-diff memory).
+// GDEY0213F52, JD79676 controller, 128x250, 4-color (BWRY).
 //
 // Emitter-derived (tools/gxepd2_harness/emit_descriptor.h) from the vendor
 // GxEPD2_213c_GDEY0213F52 driver pulled into third_party/GxEPD2/ from the zGxEPD2 fork.

+ 1 - 0
components/gxepd2/panel_266_bn.h

@@ -61,6 +61,7 @@ inline const EpdPanelDescriptor PANEL_266_BN = {
     .window_sequence_len = {sizeof(PANEL_266_BN_WINDOW_SEQ0) / sizeof(PANEL_266_BN_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_270_gdey027t91.h

@@ -54,6 +54,7 @@ inline const EpdPanelDescriptor PANEL_270_GDEY027T91 = {
     .window_sequence_len = {sizeof(PANEL_270_GDEY027T91_WINDOW_SEQ0) / sizeof(PANEL_270_GDEY027T91_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_290_bs.h

@@ -54,6 +54,7 @@ inline const EpdPanelDescriptor PANEL_290_BS = {
     .window_sequence_len = {sizeof(PANEL_290_BS_WINDOW_SEQ0) / sizeof(PANEL_290_BS_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_290_gdey029t71h.h

@@ -67,6 +67,7 @@ inline const EpdPanelDescriptor PANEL_290_GDEY029T71H = {
     .window_sequence_len = {sizeof(PANEL_290_GDEY029T71H_WINDOW_SEQ0) / sizeof(PANEL_290_GDEY029T71H_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_290_gdey029t94.h

@@ -62,6 +62,7 @@ inline const EpdPanelDescriptor PANEL_290_GDEY029T94 = {
     .window_sequence_len = {sizeof(PANEL_290_GDEY029T94_WINDOW_SEQ0) / sizeof(PANEL_290_GDEY029T94_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_290_i6fd.h

@@ -77,6 +77,7 @@ inline const EpdPanelDescriptor PANEL_290_I6FD = {
     .window_sequence_len = {sizeof(PANEL_290_I6FD_WINDOW_SEQ0) / sizeof(PANEL_290_I6FD_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x13, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x10, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x13 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 4 - 2
components/gxepd2/panel_290_t5d.h

@@ -55,6 +55,7 @@ inline const EpdCommand PANEL_290_T5D_REFRESH[] = {
     {0x12, nullptr, 0, /*delay_before_ms=*/0, /*delay_after_ms=*/0, /*wait_busy_after=*/true},
 };
 
+
 inline const EpdCommand PANEL_290_T5D_POWER_OFF[] = {
     {0x02, nullptr, 0, /*delay_before_ms=*/0, /*delay_after_ms=*/0, /*wait_busy_after=*/true},
 };
@@ -76,15 +77,16 @@ inline const EpdPanelDescriptor PANEL_290_T5D = {
     .window_sequence_len = {sizeof(PANEL_290_T5D_WINDOW_SEQ0) / sizeof(PANEL_290_T5D_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x13, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x10, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x13 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,
     .palette_len = 0,
     .refresh_sequence = PANEL_290_T5D_REFRESH,
     .refresh_sequence_len = sizeof(PANEL_290_T5D_REFRESH) / sizeof(PANEL_290_T5D_REFRESH[0]),
-    .power_off_sequence = PANEL_290_T5D_POWER_OFF,
+    .power_off_sequence = PANEL_290_T5D_POWER_OFF,  // probe: powerOff(), fresh session after a normal refresh
     .power_off_sequence_len = sizeof(PANEL_290_T5D_POWER_OFF) / sizeof(PANEL_290_T5D_POWER_OFF[0]),
-    .hibernate_sequence = PANEL_290_T5D_HIBERNATE,
+    .hibernate_sequence = PANEL_290_T5D_HIBERNATE,  // probe: hibernate()'s tail past powerOff() (see file header)
     .hibernate_sequence_len = sizeof(PANEL_290_T5D_HIBERNATE) / sizeof(PANEL_290_T5D_HIBERNATE[0]),
 };
 

+ 1 - 0
components/gxepd2/panel_290_t94.h

@@ -54,6 +54,7 @@ inline const EpdPanelDescriptor PANEL_290_T94 = {
     .window_sequence_len = {sizeof(PANEL_290_T94_WINDOW_SEQ0) / sizeof(PANEL_290_T94_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_290_t94_v2.h

@@ -54,6 +54,7 @@ inline const EpdPanelDescriptor PANEL_290_T94_V2 = {
     .window_sequence_len = {sizeof(PANEL_290_T94_V2_WINDOW_SEQ0) / sizeof(PANEL_290_T94_V2_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 0 - 7
components/gxepd2/panel_290c_gdey029f51.h

@@ -10,13 +10,6 @@
 // (black=0x00, white=0x01, yellow=0x02, red=0x03 per GxEPD2_4C.h color4()),
 // not 1-bit-per-pixel planes - see EpdPanelDescriptor::bits_per_pixel /
 // palette and GxEPD2Display's draw_packed_() for the buffer-side half.
-//
-// _InitDisplay()'s reset pulse is itself gated on `_hibernating ||
-// _initial_write` in the vendor driver (steady-state cycles skip the
-// physical RST and go straight to re-issuing the command sequence) - this
-// engine always does a real hardware reset every cycle regardless (see
-// CycleEngine::request_full_update()), a superset of what the vendor
-// driver does on its own first cycle, so no special-casing needed here.
 
 #include "epd_command.h"
 

+ 1 - 0
components/gxepd2/panel_310_gdeq031t10.h

@@ -59,6 +59,7 @@ inline const EpdPanelDescriptor PANEL_310_GDEQ031T10 = {
     .window_sequence_len = {sizeof(PANEL_310_GDEQ031T10_WINDOW_SEQ0) / sizeof(PANEL_310_GDEQ031T10_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x13, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x10, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x13 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_370_tc1.h

@@ -61,6 +61,7 @@ inline const EpdPanelDescriptor PANEL_370_TC1 = {
     .window_sequence_len = {sizeof(PANEL_370_TC1_WINDOW_SEQ0) / sizeof(PANEL_370_TC1_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_397_gdem0397t81.h

@@ -64,6 +64,7 @@ inline const EpdPanelDescriptor PANEL_397_GDEM0397T81 = {
     .window_sequence_len = {sizeof(PANEL_397_GDEM0397T81_WINDOW_SEQ0) / sizeof(PANEL_397_GDEM0397T81_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_420_gdey042t81.h

@@ -62,6 +62,7 @@ inline const EpdPanelDescriptor PANEL_420_GDEY042T81 = {
     .window_sequence_len = {sizeof(PANEL_420_GDEY042T81_WINDOW_SEQ0) / sizeof(PANEL_420_GDEY042T81_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 1 - 0
components/gxepd2/panel_420_gye042a87.h

@@ -62,6 +62,7 @@ inline const EpdPanelDescriptor PANEL_420_GYE042A87 = {
     .window_sequence_len = {sizeof(PANEL_420_GYE042A87_WINDOW_SEQ0) / sizeof(PANEL_420_GYE042A87_WINDOW_SEQ0[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x24 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},  // probe-derived
     .bits_per_pixel = 1,  // probe: white fill => all-bits wire byte 0xFF
     .palette = nullptr,

+ 4 - 1
components/gxepd2/panel_426_gdeq0426t82.h

@@ -10,7 +10,9 @@
 // command (0x24) is ever written here - 0x26 is dropped entirely, same as
 // GxEPD2's own _initial_write priming pass (a dummy full-buffer clear
 // before the real content write) is dropped, since this engine always
-// writes real content directly and re-initializes fully every cycle.
+// writes real content directly and re-initializes fully every cycle. The
+// 0x26 write is still recorded below, in plane_write_cmd_for_full_refresh,
+// so a future partial-refresh engine has it without a second capture pass.
 //
 // Also the first panel whose RAM-window-set (_setPartialRamArea) layout
 // differs from GxEPD2_213_Z98c's: SSD1677 addresses 0x44/0x45 in raw
@@ -81,6 +83,7 @@ inline const EpdPanelDescriptor PANEL_426_GDEQ0426T82 = {
     .window_sequence_len = {sizeof(PANEL_426_GDEQ0426T82_WINDOW) / sizeof(PANEL_426_GDEQ0426T82_WINDOW[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x24, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x26, 0x00},  // see file header
     .plane_invert = {false, false},
     .refresh_sequence = PANEL_426_GDEQ0426T82_REFRESH,
     .refresh_sequence_len = sizeof(PANEL_426_GDEQ0426T82_REFRESH) / sizeof(PANEL_426_GDEQ0426T82_REFRESH[0]),

+ 6 - 17
components/gxepd2/panel_579c_gdey0579f51.h

@@ -13,18 +13,11 @@
 // panel correctly when run natively, so a byte-faithful replay is correct by
 // construction.
 //
-// History worth not repeating: an earlier revision carried hand-"fixes" from
-// Waveshare's epd5in79g.cpp (swapped PSR, power-on under select=Both, changed
-// BTST) plus, on 2026-10-18, a PSR scan-direction swap + window-order swap to
-// chase a left-right mirror and swapped halves. The bench showed those were
-// ALL compensating for two separate real issues, neither a driver bug:
-//   - the "slave never converges" symptom was DRIVE-CURRENT STARVATION on the
-//     bench MCU (same panel + firmware renders on an adequately-powered
-//     board), so power-on-select and BTST are back to stock;
-//   - the mirror + swapped halves were the engine sending ONE line per row
-//     where GxEPD2 sends TWO (line_order below), so the PSR/window swaps are
-//     gone too.
-// Only busy_timeout_ms is tuned (engine hard-aborts where GxEPD2 polls on).
+// Every value below is stock (PSR/BTST/power-on included) - earlier hand-
+// "fixes" chasing a mirror/convergence bug turned out to be compensating for
+// drive-current starvation and the missing line_order, not a driver bug; see
+// project memory (gxepd2_579_retest_plan) for that history. Only
+// busy_timeout_ms is tuned (engine hard-aborts where GxEPD2 polls on).
 //
 // Dual-region layer assembled by hand from the driver source, per
 // CONTRIBUTING.md "Limits - True dual-region command structure": the
@@ -49,11 +42,7 @@ inline const uint8_t PANEL_579C_GDEY0579F51_SELECT_MASTER[] = {0x01};
 inline const uint8_t PANEL_579C_GDEY0579F51_SELECT_SLAVE[] = {0x02};
 inline const uint8_t PANEL_579C_GDEY0579F51_SELECT_BOTH[] = {0x00};
 // Stock PSR values, matching GxEPD2's _InitDisplay() exactly: master
-// {0x07,0x29}, slave {0x03,0x29}. (A brief detour on 2026-10-18 swapped
-// these to "fix" a left-right mirror, but the mirror was an artifact of the
-// engine sending one line per row instead of GxEPD2's two - see line_order
-// below. With the line order faithful, the stock PSR is correct and the
-// swap is gone.)
+// {0x07,0x29}, slave {0x03,0x29}.
 inline const uint8_t PANEL_579C_GDEY0579F51_PSR_MASTER[] = {0x07, 0x29};
 inline const uint8_t PANEL_579C_GDEY0579F51_PSR_SLAVE[] = {0x03, 0x29};
 inline const uint8_t PANEL_579C_GDEY0579F51_BTST[] = {0x32, 0x32, 0x32, 0x32};

+ 0 - 127
components/gxepd2/panel_579c_gdey0579f51_master_only.h

@@ -1,127 +0,0 @@
-#pragma once
-
-// Hand-derived from third_party/GxEPD2/src/epd4c/GxEPD2_579c_GDEY0579F51.{h,cpp}
-// (GDEY0579F51, HX8717 controller, 792x272, same JD79667-family 2bpp/4-color
-// packing as GDEY029F51 - see panel_290c_gdey029f51.h). This is the actual
-// dual-CS-like split panel from the original bench list: NOT two physical
-// CS pins, but two logical regions ("master"/"slave", left/right halves)
-// selected over one bus via an 0xA2 command, each with its own window-set
-// and its own 0x10 plane-write burst.
-//
-// Deliberate scope cut (2026-09-19, per user): CycleEngine's state machine
-// only knows one window-set + one plane-write per update cycle, and
-// extending it to loop over two regions is real work, not just descriptor
-// data - so this descriptor addresses the "master" half ONLY, as if it
-// were a self-contained 396x272 single-region panel, to validate the 2bpp
-// packing and this controller family's init/refresh shape before building
-// the master+slave loop.
-//
-// First hardware run (2026-09-19) showed real content, correctly decoded,
-// but compressed/duplicated within roughly half the driven region, plus
-// noise/black bands on the untouched half - not yet fully explained. One
-// finding so far: don't assume "master" = the physically-left/near-
-// connector half. GxEPD2_579_GDEY0579T93.cpp (SSD1683, same 792x272
-// panel family, comments explicit) maps "near connector" -> SLAVE and
-// "opposite to connector" -> MASTER - the reverse of what might be
-// guessed. GDEY0579F51's own driver has no such comment, so which
-// physical side "master" actually addresses here is unverified, not
-// assumed-correct. A slave-only variant of this same descriptor (swap
-// every SELECT_MASTER for SELECT_MASTER->0x02) would empirically test
-// whether content moves to the other half - not yet done.
-//
-// The refresh sequence originally used select=Both (0x00) before the
-// 0x12 trigger, matching the vendor's own refresh(bool)'s
-// _setPartialRamAreaBoth() call - but 0x12 appears to fire a real
-// electrical refresh across the WHOLE physical panel regardless of which
-// side's RAM was ever written, which explains the noise/black bands as
-// slave's never-initialized RAM being "developed" onto glass. Changed to
-// select=Master only, since we only ever want to touch the side we wrote.
-// Does not yet explain the duplication/compression artifact.
-//
-// _InitDisplay()'s reset pulse is gated the same way GDEY029F51's is
-// (`_hibernating || _initial_write`) - this engine always does a real
-// hardware reset every cycle regardless, a superset of the vendor
-// driver's own first-cycle behavior, so no special-casing needed.
-
-#include "epd_command.h"
-
-namespace esphome::gxepd2 {
-
-inline const uint8_t PANEL_579C_GDEY0579F51_MO_SELECT_MASTER[] = {0x01};
-inline const uint8_t PANEL_579C_GDEY0579F51_MO_SELECT_BOTH[] = {0x00};
-// 0x03, not 0x07 - see panel_579c_gdey0579f51.h's header comment: this
-// value's SHL bit was backwards relative to Waveshare's own reference
-// driver for this panel (2026-09-19).
-inline const uint8_t PANEL_579C_GDEY0579F51_MO_PSR_MASTER[] = {0x03, 0x29};
-inline const uint8_t PANEL_579C_GDEY0579F51_MO_BTST[] = {0x32, 0x32, 0x32, 0x32};
-inline const uint8_t PANEL_579C_GDEY0579F51_MO_TRES[] = {0x01, 0x8C, 0x01, 0x10};  // 396x272
-inline const uint8_t PANEL_579C_GDEY0579F51_MO_CDI_INIT[] = {0x97};
-inline const uint8_t PANEL_579C_GDEY0579F51_MO_E9[] = {0x01};
-inline const uint8_t PANEL_579C_GDEY0579F51_MO_E0[] = {0x01};
-
-inline const EpdCommand PANEL_579C_GDEY0579F51_MO_INIT[] = {
-    {0xA2, PANEL_579C_GDEY0579F51_MO_SELECT_MASTER, 1},
-    {0x00, PANEL_579C_GDEY0579F51_MO_PSR_MASTER, 2},
-    {0xA2, PANEL_579C_GDEY0579F51_MO_SELECT_BOTH, 1},
-    {0x06, PANEL_579C_GDEY0579F51_MO_BTST, 4},
-    {0x61, PANEL_579C_GDEY0579F51_MO_TRES, 4},
-    {0x50, PANEL_579C_GDEY0579F51_MO_CDI_INIT, 1},
-    {0xE9, PANEL_579C_GDEY0579F51_MO_E9, 1},
-    {0xE0, PANEL_579C_GDEY0579F51_MO_E0, 1},
-    {0xA2, PANEL_579C_GDEY0579F51_MO_SELECT_MASTER, 1},
-    {0x04, nullptr, 0, /*delay_before_ms=*/0, /*delay_after_ms=*/0, /*wait_busy_after=*/true},  // power on
-};
-
-// _setPartialRamAreaMaster(0, 0, 396, 272), default partial_mode=true.
-inline const uint8_t PANEL_579C_GDEY0579F51_MO_WINDOW[] = {
-    0x00, 0x00,  // x/256, x%256   = 0
-    0x01, 0x8B,  // xe/256, xe%256 = 395
-    0x00, 0x00,  // y/256, y%256   = 0
-    0x01, 0x0F,  // ye/256, ye%256 = 271
-    0x01,
-};
-
-inline const EpdCommand PANEL_579C_GDEY0579F51_MO_WINDOW_SEQ[] = {
-    {0xA2, PANEL_579C_GDEY0579F51_MO_SELECT_MASTER, 1},
-    {0x83, PANEL_579C_GDEY0579F51_MO_WINDOW, 9},
-};
-
-// refresh(false): vendor's own refresh(bool) uses _setPartialRamAreaBoth()
-// here, but see file header - deliberately using select=Master instead so
-// the 0x12 trigger's real electrical refresh never touches slave's
-// never-written RAM (that Both selection is what produced the noise/black
-// bands on the untouched half in the first hardware run).
-inline const uint8_t PANEL_579C_GDEY0579F51_MO_CDI_REFRESH[] = {0x37};
-inline const uint8_t PANEL_579C_GDEY0579F51_MO_REFRESH_TRIGGER[] = {0x00};
-
-inline const EpdCommand PANEL_579C_GDEY0579F51_MO_REFRESH[] = {
-    {0xA2, PANEL_579C_GDEY0579F51_MO_SELECT_MASTER, 1},
-    {0x83, PANEL_579C_GDEY0579F51_MO_WINDOW, 9},
-    {0x50, PANEL_579C_GDEY0579F51_MO_CDI_REFRESH, 1},
-    {0x12, PANEL_579C_GDEY0579F51_MO_REFRESH_TRIGGER, 1, /*delay_before_ms=*/0, /*delay_after_ms=*/0,
-     /*wait_busy_after=*/true},
-};
-
-inline const EpdPanelDescriptor PANEL_579C_GDEY0579F51_MASTER_ONLY = {
-    .width = 396,   // WIDTH/2 of the real 792-wide panel - master half only
-    .height = 272,
-    .busy_active_level = false,  // GxEPD2_EPD(..., /*busy_level=*/LOW, ...)
-    .busy_timeout_ms = 25000,    // full_refresh_time is 21000ms
-    .init_sequence = PANEL_579C_GDEY0579F51_MO_INIT,
-    .init_sequence_len = sizeof(PANEL_579C_GDEY0579F51_MO_INIT) / sizeof(PANEL_579C_GDEY0579F51_MO_INIT[0]),
-    .window_sequence = {PANEL_579C_GDEY0579F51_MO_WINDOW_SEQ, nullptr},
-    .window_sequence_len = {sizeof(PANEL_579C_GDEY0579F51_MO_WINDOW_SEQ) / sizeof(PANEL_579C_GDEY0579F51_MO_WINDOW_SEQ[0]),
-                             0},
-    .plane_count = 1,
-    .plane_write_cmd = {0x10, 0x00},
-    .plane_invert = {false, false},
-    .line_order = LineOrder::PAIRED_EDGES,
-    .bits_per_pixel = 2,
-    .palette = GXEPD2_PALETTE_4C,
-    .palette_len = GXEPD2_PALETTE_4C_LEN,
-    .blank_code = 0x01,
-    .refresh_sequence = PANEL_579C_GDEY0579F51_MO_REFRESH,
-    .refresh_sequence_len = sizeof(PANEL_579C_GDEY0579F51_MO_REFRESH) / sizeof(PANEL_579C_GDEY0579F51_MO_REFRESH[0]),
-};
-
-}  // namespace esphome::gxepd2

+ 1 - 0
components/gxepd2/panel_583_gdeq0583t31.h

@@ -99,6 +99,7 @@ inline const EpdPanelDescriptor PANEL_583_GDEQ0583T31 = {
     .window_sequence_len = {sizeof(PANEL_583_GDEQ0583T31_WINDOW) / sizeof(PANEL_583_GDEQ0583T31_WINDOW[0]), 0},
     .plane_count = 1,
     .plane_write_cmd = {0x13, 0x00},
+    .plane_write_cmd_for_full_refresh = {0x10, 0x00},  // writeImageForFullRefresh also re-writes this "previous RAM" bank before the 0x13 write above - not read by this full-refresh-only engine yet, captured for future partial-refresh use
     .plane_invert = {false, false},
     .refresh_sequence = PANEL_583_GDEQ0583T31_REFRESH,
     .refresh_sequence_len = sizeof(PANEL_583_GDEQ0583T31_REFRESH) / sizeof(PANEL_583_GDEQ0583T31_REFRESH[0]),

+ 0 - 2
components/gxepd2/panel_730c_gdep073e01.h

@@ -35,8 +35,6 @@
 // Single plane, single region, plain row-major writeNative addressing (no
 // row_interleave, no window_per_plane) - structurally the simplest shape
 // once the above two facts are captured correctly.
-//
-// STATUS: structural only - not yet bench-verified (see display.py).
 
 #include "epd_command.h"
 

+ 13 - 2
tools/capture.py

@@ -267,6 +267,14 @@ def run_program(model: str, catalog: dict, mode: str, cxx: str) -> str:
             f'#include "{hdr_rel}"\n'
             f'int main() {{ emit::print_power_sequences<{real_class}>("{macro_of(model)}"); return 0; }}\n'
         )
+    elif mode == "full-refresh":
+        # emit_descriptor.h's print_full_refresh_extra_write - same splice
+        # workflow as --power, for plane_write_cmd_for_full_refresh.
+        main_src = (
+            f'#include "emit_descriptor.h"\n'
+            f'#include "{hdr_rel}"\n'
+            f'int main() {{ emit::print_full_refresh_extra_write<{real_class}>(); return 0; }}\n'
+        )
     else:
         header, fn = _PROGRAMS[mode]
         main_src = (
@@ -309,6 +317,9 @@ def main() -> None:
     ap.add_argument("--power", action="store_true",
                      help="print just power_off_sequence/hibernate_sequence (for splicing into an existing "
                           "panel_*.h), instead of emitting a full descriptor")
+    ap.add_argument("--full-refresh", action="store_true", dest="full_refresh",
+                     help="print just plane_write_cmd_for_full_refresh (for splicing into an existing "
+                          "panel_*.h), instead of emitting a full descriptor")
     ap.add_argument("--cxx", default="g++", help="C++ compiler (default: g++)")
     args = ap.parse_args()
 
@@ -318,8 +329,8 @@ def main() -> None:
         return
     if not args.model:
         ap.error("a model is required (or use --list)")
-    if args.sweep or args.diag or args.power:
-        mode = "sweep" if args.sweep else "diag" if args.diag else "power"
+    if args.sweep or args.diag or args.power or args.full_refresh:
+        mode = "sweep" if args.sweep else "diag" if args.diag else "power" if args.power else "full-refresh"
         out = run_program(args.model, catalog, mode, args.cxx)
         if args.out:
             pathlib.Path(args.out).write_text(out)

+ 2 - 1
tools/check_descriptors.py

@@ -20,7 +20,8 @@ review it). Exit non-zero on any unexpected mismatch.
 Panels the emitter does not yet fully model (dual-region, see KNOWN_DIFF) are
 expected to differ and don't fail; if one of them starts MATCHING, that's an
 emitter improvement - remove it from KNOWN_DIFF. Panels with no GxEPD2 driver
-source (e.g. the synthetic MASTER_ONLY variant) are skipped.
+source (a synthetic model with no third_party/GxEPD2/ .cpp of its own) are
+skipped.
 """
 
 import argparse

+ 2 - 2
tools/gxepd2_harness/README.md

@@ -86,8 +86,8 @@ vendor bump changed that driver — review the panel). Any panel the emitter
 can't yet segment is listed in its `KNOWN_DIFF` and reported as `XFAIL` (none
 at present — the dual-region GDEY0579F51 was promoted out once the emitter
 modelled the region-select layer; an `XPASS` means a `KNOWN_DIFF` entry now
-reproduces and should be removed). Panels with no GxEPD2 driver source (the
-synthetic `MASTER_ONLY` variant) are skipped. Run it after any
+reproduces and should be removed). Panels with no GxEPD2 driver source of
+their own (a synthetic model) are skipped. Run it after any
 `third_party/GxEPD2/` update.
 
 ## Other programs

+ 136 - 0
tools/gxepd2_harness/emit_descriptor.h

@@ -335,6 +335,118 @@ template<typename Driver> PackedResolverFn make_resolver_bw_packed(uint8_t p0cmd
   };
 }
 
+// Plane-sized (>= PLANE_BURST_MIN) burst commands one call makes, from a
+// fresh instance with an untraced writeScreenBuffer() first (same trick
+// probe_plane_invert_values uses) to absorb the lazy _InitDisplay()/
+// _initial_write clear. Shared by probe_full_refresh_extra_write_cmd below so
+// it can tell a genuinely NEW burst from one the plain single-bitmap
+// writeImage() already makes on its own - a 2-plane (3-colour) driver's
+// single-bitmap writeImage(bitmap,...) forwards to writeImage(black, NULL,
+// ...), which bursts to BOTH its real plane_write_cmd[0] (real data) AND
+// plane_write_cmd[1] (a NULL-color blank-fill burst, same size) every time,
+// with no full-refresh involved at all - diffing against just plane_write_cmd
+// [0] would misread that second plane's ordinary burst as a full-refresh-only
+// extra write.
+template<typename Driver, typename Call> std::set<uint8_t> plane_burst_cmds(Call call) {
+  constexpr int16_t CS = 10, DC = 11, RST = 12, BUSY = 13;
+  Trace::set_dc_pin(DC);
+  Peek<Driver> d(CS, DC, RST, BUSY);
+  Trace::last_busy_release_value = d.busy_level() == HIGH ? LOW : HIGH;
+  d.selectSPI(SPI, SPISettings());
+  d.init(0);
+  d.writeScreenBuffer();  // untraced: absorb lazy init + the _initial_write clear
+
+  const uint32_t plane_bytes = (uint32_t) Driver::WIDTH * Driver::HEIGHT / 8;
+  auto *buf = new uint8_t[plane_bytes];
+  memset(buf, 0xA5, plane_bytes);
+  Trace::start_event_record();
+  call(d, buf);
+  Trace::stop_event_record();
+  delete[] buf;
+
+  std::set<uint8_t> cmds;
+  for (const auto &c : group(0, Trace::events.size()))
+    if (c.data.size() >= PLANE_BURST_MIN)
+      cmds.insert(c.cmd);
+  return cmds;
+}
+
+// Detects a controller whose writeImageForFullRefresh() diverges from plain
+// writeImage() - e.g. SSD1680/SSD1619-family controllers write the same
+// bitmap to a "previous RAM" bank (a different command) before the normal
+// "current RAM" write plane_write_cmd[plane] already captures. GxEPD2_EPD's
+// base class defaults writeImageForFullRefresh() to call writeImage()
+// unchanged, so this probe generalizes across every controller without
+// hardcoding the known-affected families: it diffs the two calls' burst-
+// command sets and returns whatever writeImageForFullRefresh() adds. Returns
+// 0x00 (no divergence - by far the common case) or the extra command byte.
+template<typename Driver> uint8_t probe_full_refresh_extra_write_cmd() {
+  auto write_cmds = plane_burst_cmds<Driver>(
+      [](Peek<Driver> &d, uint8_t *buf) { d.writeImage(buf, 0, 0, Driver::WIDTH, Driver::HEIGHT); });
+  auto full_cmds = plane_burst_cmds<Driver>(
+      [](Peek<Driver> &d, uint8_t *buf) { d.writeImageForFullRefresh(buf, 0, 0, Driver::WIDTH, Driver::HEIGHT); });
+  for (uint8_t c : full_cmds)
+    if (!write_cmds.count(c))
+      return c;
+  return 0x00;
+}
+
+// Prints just the plane_write_cmd_for_full_refresh{} line (for splicing into
+// an existing hand-maintained panel_*.h, same workflow as
+// print_power_sequences / tools/capture.py --power). Self-contained like
+// print_power_sequences: derives p0cmd itself (the first plane-sized burst a
+// plain writeImage() produces) rather than trusting a shipped panel_*.h's
+// plane_write_cmd, which may have been hand-adjusted since it was captured.
+template<typename Driver> void print_full_refresh_extra_write() {
+  constexpr int16_t CS = 10, DC = 11, RST = 12, BUSY = 13;
+  Trace::set_dc_pin(DC);
+  Peek<Driver> probe(CS, DC, RST, BUSY);
+  Trace::last_busy_release_value = probe.busy_level() == HIGH ? LOW : HIGH;
+  probe.selectSPI(SPI, SPISettings());
+  probe.init(0);
+  probe.writeScreenBuffer();  // untraced: absorb lazy init + the _initial_write clear
+
+  const uint32_t plane_bytes = (uint32_t) Driver::WIDTH * Driver::HEIGHT / 8;
+  auto *buf = new uint8_t[plane_bytes];
+  memset(buf, 0xFF, plane_bytes);  // 0xFF/0x00, not a filler byte: doubles as the 1bpp-vs-packed check below
+  Trace::start_event_record();
+  probe.writeImage(buf, 0, 0, Driver::WIDTH, Driver::HEIGHT);
+  Trace::stop_event_record();
+  delete[] buf;
+
+  uint8_t p0cmd = 0x00;
+  int w0_white = -1;
+  for (const auto &c : group(0, Trace::events.size()))
+    if (c.data.size() >= PLANE_BURST_MIN) {
+      p0cmd = c.cmd;
+      w0_white = c.data[0];
+      break;
+    }
+
+  // A packed (>1bpp) driver's writeImageForFullRefresh expects its own packed
+  // bit depth, not the 1bpp-sized buffer above - probing it the same way a
+  // 1bpp panel is probed can over/under-read and crash (seen on GDEP073E01,
+  // 4bpp 7-colour). A 1bpp panel's white-fill wire byte is always 0x00 or
+  // 0xFF (see probe_plane_invert_values); anything else means packed, so bail
+  // instead of guessing - this field isn't meaningful there anyway (see
+  // emit_descriptor_impl's pv.is_1bpp gate).
+  if (w0_white != 0x00 && w0_white != 0xFF) {
+    printf("    // SKIPPED: packed (>1bpp) panel - writeImageForFullRefresh's dual-write behaviour is "
+           "specific to the 1bpp plane model, not applicable here\n");
+    return;
+  }
+
+  const uint8_t extra = probe_full_refresh_extra_write_cmd<Driver>();
+  if (extra)
+    printf("    .plane_write_cmd_for_full_refresh = {0x%02X, 0x00},  // writeImageForFullRefresh also "
+           "re-writes this \"previous RAM\" bank before the 0x%02X write above - captured for future "
+           "partial-refresh use, not read by this full-refresh-only engine yet\n",
+           extra, p0cmd);
+  else
+    printf("    // writeImageForFullRefresh == writeImage for this controller: no "
+           ".plane_write_cmd_for_full_refresh entry needed (0x00 default already correct)\n");
+}
+
 // Captures powerOff() or hibernate() as its own standalone command sequence -
 // NOT folded into the refresh_seq phase-segmentation above, and NOT captured
 // from the same live session as each other. Every GxEPD2 driver's powerOff()
@@ -705,6 +817,18 @@ void emit_descriptor_impl(const char *class_name, const char *macro, const Packe
   std::vector<Cmd> &power_off_seq = power_captured.first;
   std::vector<Cmd> &hibernate_seq = power_captured.second;
 
+  // plane_write_cmd_for_full_refresh - computed here, BEFORE the "// GENERATED"
+  // marker below, not alongside the printf()s that use it: every probe in this
+  // function runs its own fresh Peek<Driver> through an un-traced init()/
+  // writeScreenBuffer() first (see plane_burst_cmds), which prints raw
+  // pinMode()/digitalWrite()/etc lines straight to stdout outside the
+  // Trace::event_recording bracket - harmless for every OTHER probe above
+  // because capture()/run_program() in tools/capture.py slice captured stdout
+  // from the FIRST "// GENERATED" marker onward, dropping that noise. Calling
+  // this probe any later - after the marker's printed - would leak its raw
+  // trace lines into the middle of the emitted descriptor instead.
+  const uint8_t full_refresh_extra = pv.is_1bpp ? probe_full_refresh_extra_write_cmd<Driver>() : 0x00;
+
   // --- emit ---
   printf("// GENERATED by emit_descriptor from %s - candidate.\n", class_name);
   printf("// Command sequences, plane layout and plane_invert are observed here;\n");
@@ -781,6 +905,18 @@ void emit_descriptor_impl(const char *class_name, const char *macro, const Packe
   }
   printf("    .plane_count = %zu,\n", nplanes);
   printf("    .plane_write_cmd = {0x%02X, 0x%02X},\n", p0cmd, p1cmd);
+  // full_refresh_extra was computed above, before the "// GENERATED" marker -
+  // see that computation's comment for why. A packed (>1bpp) driver's
+  // writeImageForFullRefresh takes the same single-bitmap buffer shape, but
+  // its _writeImage expects a buffer already packed to its own bit depth -
+  // probing it with a 1bpp-sized buffer over/under-reads and crashes some
+  // drivers (e.g. GDEP073E01, 4bpp 7-colour), hence the pv.is_1bpp gate above;
+  // packed panels just keep the {0,0} default.
+  if (full_refresh_extra)
+    printf("    .plane_write_cmd_for_full_refresh = {0x%02X, 0x00},  // writeImageForFullRefresh also "
+           "re-writes this \"previous RAM\" bank before the 0x%02X write above - not read by this "
+           "full-refresh-only engine yet, captured for future partial-refresh use\n",
+           full_refresh_extra, p0cmd);
   // Fields below are emitted in struct-declaration order (plane_invert,
   // plane_width, line_order, bits_per_pixel, palette, palette_len,
   // blank_code) so the designated initializer stays well-formed.