panel_213c_gdey0213f52.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. // GDEY0213F52, JD79676 controller, 128x250, 4-color (BWRY). The V2 revision of
  3. // the GDEY0213F51 (JD79661) on a different controller - this is the part the
  4. // bench F52 panels actually are (see the F51-vs-F52 control-diff memory).
  5. //
  6. // Emitter-derived (tools/gxepd2_harness/emit_descriptor.h) from the vendor
  7. // GxEPD2_213c_GDEY0213F52 driver pulled into vendor/ from the zGxEPD2 fork.
  8. // The striking thing the capture shows: this driver is *minimal* because the
  9. // JD79676 loads PSR/PWR/BTST/resolution and the full-refresh LUT from on-chip
  10. // OTP. So init is just 0xE9=0x01 then power-on (0x04), there is NO register
  11. // setup and NO window command at all (OTP resolution defaults to 128x250 =
  12. // WIDTH x HEIGHT, and with partial-update off the controller fills the whole
  13. // OTP-default frame), and refresh is a bare 0x12 trigger relying on the OTP
  14. // default CDI. Nothing to hand-transcribe - this is exactly what the emitter
  15. // produced, with only the packed-format fields added below.
  16. //
  17. // Packed 4-color: bits_per_pixel=2, GXEPD2_PALETTE_4C (the vendor's own
  18. // color4() black0/white1/yellow2/red3, validated by the diag Pattern-B pass -
  19. // see DESIGN.md §12; the F52 uses the same GxEPD2_4C wrapper). blank_code=0x01
  20. // matches the observed 0x55 white clear (code 01 x4). If colors come out wrong
  21. // on hardware the palette/codes are the thing to re-check for JD79676.
  22. //
  23. // NOT yet bench-confirmed at import time.
  24. #include "epd_command.h"
  25. namespace esphome::gxepd2 {
  26. inline const uint8_t PANEL_213C_GDEY0213F52_CMD_E9[] = {0x01};
  27. inline const EpdCommand PANEL_213C_GDEY0213F52_INIT[] = {
  28. {0xE9, PANEL_213C_GDEY0213F52_CMD_E9, 1},
  29. {0x04, nullptr, 0, /*delay_before_ms=*/0, /*delay_after_ms=*/0, /*wait_busy_after=*/true}, // power on
  30. };
  31. inline const uint8_t PANEL_213C_GDEY0213F52_REFRESH_TRIGGER[] = {0x00};
  32. inline const EpdCommand PANEL_213C_GDEY0213F52_REFRESH[] = {
  33. {0x12, PANEL_213C_GDEY0213F52_REFRESH_TRIGGER, 1, /*delay_before_ms=*/0, /*delay_after_ms=*/0,
  34. /*wait_busy_after=*/true},
  35. };
  36. inline const EpdPanelDescriptor PANEL_213C_GDEY0213F52 = {
  37. .width = 128,
  38. .height = 250,
  39. .busy_active_level = false, // GxEPD2_EPD(..., /*busy_level=*/LOW, ...) - confirmed: HIGH hangs
  40. .busy_timeout_ms = 30000, // vendor full_refresh_time ~16000ms; err long
  41. .init_sequence = PANEL_213C_GDEY0213F52_INIT,
  42. .init_sequence_len = sizeof(PANEL_213C_GDEY0213F52_INIT) / sizeof(PANEL_213C_GDEY0213F52_INIT[0]),
  43. .window_sequence = {nullptr, nullptr}, // OTP-default full frame; driver sets no window
  44. .window_sequence_len = {0, 0},
  45. .plane_count = 1,
  46. .plane_write_cmd = {0x10, 0x00},
  47. .plane_invert = {false, false}, // unused for packed panels
  48. .bits_per_pixel = 2,
  49. .palette = GXEPD2_PALETTE_4C,
  50. .palette_len = GXEPD2_PALETTE_4C_LEN,
  51. .blank_code = 0x01, // white; matches the observed 0x55 clear (code 01 x4)
  52. .refresh_sequence = PANEL_213C_GDEY0213F52_REFRESH,
  53. .refresh_sequence_len = sizeof(PANEL_213C_GDEY0213F52_REFRESH) / sizeof(PANEL_213C_GDEY0213F52_REFRESH[0]),
  54. };
  55. } // namespace esphome::gxepd2