Просмотр исходного кода

Power on with select=Both, matching Waveshare's reference exactly

The engine's first dual-region attempt re-selected master before sending
0x04 (power on) - Waveshare's own epd5in79g.cpp sends it while select is
still Both (left that way from the shared BTST/TRES/CDI/E9/E0 registers),
so power-on applies to both chips at once. Re-selecting master first meant
only master's chip was ever actually powered on - a strong candidate for
why slave showed a persistent noise/garbage artifact regardless of what
data it was given, independent of content (a solid uniform fill showed it
too, which also ruled out row-order/interleaving as this artifact's
cause). Also switched BTST to Waveshare's {0x38,0x38,0x38,0x00} and
matched their exact register order (CDI, TRES, BTST) instead of GxEPD2's
(BTST, TRES, CDI).
ZiB 1 месяц назад
Родитель
Сommit
6a41d72b37
1 измененных файлов с 14 добавлено и 10 удалено
  1. 14 10
      components/gxepd2/panel_579c_gdey0579f51.h

+ 14 - 10
components/gxepd2/panel_579c_gdey0579f51.h

@@ -50,30 +50,34 @@ inline const uint8_t PANEL_579C_GDEY0579F51_SELECT_SLAVE[] = {0x02};
 inline const uint8_t PANEL_579C_GDEY0579F51_SELECT_BOTH[] = {0x00};
 inline const uint8_t PANEL_579C_GDEY0579F51_PSR_MASTER[] = {0x03, 0x29};
 inline const uint8_t PANEL_579C_GDEY0579F51_PSR_SLAVE[] = {0x07, 0x29};
-inline const uint8_t PANEL_579C_GDEY0579F51_BTST[] = {0x32, 0x32, 0x32, 0x32};
+inline const uint8_t PANEL_579C_GDEY0579F51_BTST[] = {0x38, 0x38, 0x38, 0x00};
 inline const uint8_t PANEL_579C_GDEY0579F51_TRES[] = {0x01, 0x8C, 0x01, 0x10};  // 396x272 - one region's resolution
 inline const uint8_t PANEL_579C_GDEY0579F51_CDI_INIT[] = {0x97};
 inline const uint8_t PANEL_579C_GDEY0579F51_E9[] = {0x01};
 inline const uint8_t PANEL_579C_GDEY0579F51_E0[] = {0x01};
 
-// _InitDisplay(): PSR written to each side individually (master and slave
-// scan in mirrored directions, hence different first PSR byte - 0x07 vs
-// 0x03), then BTST/TRES/CDI/E9/E0 written once under select=Both since
-// they're genuinely shared/global registers, then re-select master ready
-// for the first region's window-set.
+// Init(), following Waveshare's own epd5in79g.cpp exactly (command order
+// and select state matter here, not just which bytes get sent): PSR
+// written to each side individually, then CDI/TRES/BTST/E9/E0 written
+// once under select=Both since they're genuinely shared/global registers
+// - and, critically, POWER-ON (0x04) is sent while select is STILL Both,
+// not re-selecting master first. This engine's first attempt added an
+// extra "reselect master" step before 0x04 that Waveshare's reference
+// does not have, meaning only master's chip was ever actually powered on
+// - a very plausible explanation for slave showing a persistent noise/
+// garbage artifact regardless of what data it's given (2026-09-19).
 inline const EpdCommand PANEL_579C_GDEY0579F51_INIT[] = {
     {0xA2, PANEL_579C_GDEY0579F51_SELECT_MASTER, 1},
     {0x00, PANEL_579C_GDEY0579F51_PSR_MASTER, 2},
     {0xA2, PANEL_579C_GDEY0579F51_SELECT_SLAVE, 1},
     {0x00, PANEL_579C_GDEY0579F51_PSR_SLAVE, 2},
     {0xA2, PANEL_579C_GDEY0579F51_SELECT_BOTH, 1},
-    {0x06, PANEL_579C_GDEY0579F51_BTST, 4},
-    {0x61, PANEL_579C_GDEY0579F51_TRES, 4},
     {0x50, PANEL_579C_GDEY0579F51_CDI_INIT, 1},
+    {0x61, PANEL_579C_GDEY0579F51_TRES, 4},
+    {0x06, PANEL_579C_GDEY0579F51_BTST, 4},
     {0xE9, PANEL_579C_GDEY0579F51_E9, 1},
     {0xE0, PANEL_579C_GDEY0579F51_E0, 1},
-    {0xA2, PANEL_579C_GDEY0579F51_SELECT_MASTER, 1},
-    {0x04, nullptr, 0, /*delay_before_ms=*/0, /*delay_after_ms=*/0, /*wait_busy_after=*/true},  // power on
+    {0x04, nullptr, 0, /*delay_before_ms=*/0, /*delay_after_ms=*/0, /*wait_busy_after=*/true},  // power on, select=Both
 };
 
 // _setPartialRamAreaMaster/Slave(0, 0, 396, 272), default partial_mode=true