|
|
@@ -4,15 +4,21 @@
|
|
|
// JD79667-family packing as GDEY029F51, see panel_290c_gdey029f51.h).
|
|
|
//
|
|
|
// Captured from the STOCK vendored driver
|
|
|
-// (third_party/GxEPD2/src/epd4c/GxEPD2_579c_GDEY0579F51.{h,cpp}), with no
|
|
|
-// local corrections. An earlier revision of this descriptor carried
|
|
|
-// hand-"fixes" derived from Waveshare's epd5in79g.cpp (swapped master/slave
|
|
|
-// PSR, power-on under select=Both, a changed BTST) to chase mirrored text /
|
|
|
-// split geometry / a non-converging slave. Those symptoms were later traced
|
|
|
-// to DRIVE-CURRENT STARVATION on the bench MCU, not a driver bug - the same
|
|
|
-// panel + firmware renders on an adequately-powered driver board - so the
|
|
|
-// corrections were unjustified and have been dropped. This descriptor now
|
|
|
-// reproduces the stock GxEPD2 driver's own on-wire behaviour byte-for-byte.
|
|
|
+// (third_party/GxEPD2/src/epd4c/GxEPD2_579c_GDEY0579F51.{h,cpp}) and kept
|
|
|
+// byte-for-byte stock EXCEPT the PSR source-scan bytes (see PSR_MASTER/
|
|
|
+// PSR_SLAVE below) - those are swapped to Waveshare's orientation because
|
|
|
+// the stock values render this panel left-right mirrored on hardware.
|
|
|
+//
|
|
|
+// History worth not repeating: an earlier revision carried a pile of
|
|
|
+// hand-"fixes" from Waveshare's epd5in79g.cpp - swapped PSR, power-on under
|
|
|
+// select=Both, a changed BTST - all introduced together to chase mirrored
|
|
|
+// text AND a slave region that never converged. The bench (2026-10-18)
|
|
|
+// separated the two: the non-convergence was DRIVE-CURRENT STARVATION on
|
|
|
+// the bench MCU (not a driver bug - the same panel + firmware renders on an
|
|
|
+// adequately-powered board), so power-on-select and BTST were red herrings
|
|
|
+// and are back to stock here; only the PSR scan-direction swap was doing
|
|
|
+// real work (fixing the mirror) and is kept. Window + refresh are the fresh
|
|
|
+// capture, unchanged.
|
|
|
//
|
|
|
// Dual-region layer assembled by hand from the driver source, per
|
|
|
// CONTRIBUTING.md "Limits - True dual-region command structure": the
|
|
|
@@ -36,8 +42,16 @@ namespace esphome::gxepd2 {
|
|
|
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};
|
|
|
-inline const uint8_t PANEL_579C_GDEY0579F51_PSR_MASTER[] = {0x07, 0x29};
|
|
|
-inline const uint8_t PANEL_579C_GDEY0579F51_PSR_SLAVE[] = {0x03, 0x29};
|
|
|
+// PSR source-scan (SHL) bytes are the ONE deviation from the stock driver:
|
|
|
+// stock is master {0x07,0x29} / slave {0x03,0x29}, which renders this panel
|
|
|
+// left-right MIRRORED (text backwards) on hardware. The two values differ
|
|
|
+// only in the source-scan-direction bit; swapping which half gets it (the
|
|
|
+// value Waveshare's epd5in79g.cpp uses) un-mirrors it - confirmed on the
|
|
|
+// bench 2026-10-18. This is a real per-panel orientation fix and is
|
|
|
+// unrelated to the drive-current issue that explained the old "slave won't
|
|
|
+// converge" symptom; everything else here stays stock.
|
|
|
+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_TRES[] = {0x01, 0x8C, 0x01, 0x10}; // 396x272 - one region
|
|
|
inline const uint8_t PANEL_579C_GDEY0579F51_CDI_INIT[] = {0x97}; // border white
|