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

Match red-plane invert to the stock display-update-control register value

Rolling display-update-control back to GxEPD2's stock {0x00, 0x80} while
leaving plane_invert[1]=true (calibrated against epaper_spi's {0x80, 0x80})
cross-inverted the color plane: background and black text came out red,
and actually-drawn red text came out white. The register's first byte and
the color plane's wire polarity are coupled, not independent - each
register value has its own matching invert setting, confirmed by this
mismatch. invert=false pairs with {0x00, 0x80} per GxEPD2's own
writeImage() convention.
ZiB 1 месяц назад
Родитель
Сommit
1edb89e05b
1 измененных файлов с 10 добавлено и 1 удалено
  1. 10 1
      components/gxepd2/panel_213_z98c.h

+ 10 - 1
components/gxepd2/panel_213_z98c.h

@@ -67,7 +67,16 @@ inline const EpdPanelDescriptor PANEL_213_Z98C = {
     .init_sequence_len = sizeof(PANEL_213_Z98C_INIT) / sizeof(PANEL_213_Z98C_INIT[0]),
     .plane_count = 2,
     .plane_write_cmd = {0x24, 0x26},
-    .plane_invert = {false, true},  // color plane written as ~data - see writeImage()
+    // Stock GxEPD2 wire convention for the color plane, matched to
+    // DISPLAY_UPDATE_CONTROL={0x00, 0x80} above: vendor's writeImage()
+    // does _writeData(~data) where data's own "blank" default is 0xFF, so
+    // wire 0x00 = blank/not-red there - the opposite of epaper_spi's
+    // {0x80, 0x80} + inverted-buffer pairing. These two are coupled, not
+    // independent facts - confirmed by testing {0x00,0x80} register with
+    // invert=true still on: it cross-inverted (background/black text came
+    // out red, drawn-red text came out white). invert=false here matches
+    // this register value's actual polarity instead.
+    .plane_invert = {false, false},
     .refresh_sequence = PANEL_213_Z98C_REFRESH,
     .refresh_sequence_len = sizeof(PANEL_213_Z98C_REFRESH) / sizeof(PANEL_213_Z98C_REFRESH[0]),
 };