Procházet zdrojové kódy

Version 1.5.6

- version for ongoing fixes and additions
- added support for GYE042A87  4.2" b/w 400x300
- added support for SE0420NQ04 4.2" b/w 400x300
- added support for GDEQ0583Z31 5.83" b/w/r 648x480
- added support for GDEM102T91 10.2" b/w 960x640, SSD1677
- added support for GDEY116Z91 11.6" b/w/r 960x640, SSD1677
- added support for GDEM133T91 13.3" b/w 960x680, SSD1677
- added support for GDEM133Z91 13.3" b/w/r 960x680, SSD1677
- improved differential refresh for SE0420NQ04
ZinggJM před 2 roky
rodič
revize
6bea4cfb45
2 změnil soubory, kde provedl 156 přidání a 36 odebrání
  1. 1 0
      README.md
  2. 155 36
      src/other/GxEPD2_420_SE0420NQ04.cpp

+ 1 - 0
README.md

@@ -160,6 +160,7 @@
 - added support for GDEY116Z91 11.6" b/w/r 960x640, SSD1677
 - added support for GDEM133T91 13.3" b/w 960x680, SSD1677
 - added support for GDEM133Z91 13.3" b/w/r 960x680, SSD1677
+- improved differential refresh for SE0420NQ04
 #### Version 1.5.5
 - updated 7-color driver classes (design cleanup fixed)
 - note: Waveshare PhotoPainter doesn't work with MBED Pico package

+ 155 - 36
src/other/GxEPD2_420_SE0420NQ04.cpp

@@ -304,7 +304,6 @@ void GxEPD2_420_SE0420NQ04::_PowerOff()
 
 void GxEPD2_420_SE0420NQ04::_InitDisplay()
 {
-#if 1
   if (_hibernating) _reset();
   _writeCommand(0x00);
   _writeData(0x3F); //bit 3:Gate scan direction  bit 2:Source shift direction;
@@ -332,36 +331,8 @@ void GxEPD2_420_SE0420NQ04::_InitDisplay()
   _writeData(0x90);
   _writeData(0x01);
   _writeData(0x2C);
-  _writeCommand (0X50); //
-  _writeData(0xb7);     // Border
-#else
-  if (_hibernating) _reset();
-  _writeCommand(0x01); // POWER SETTING
-  _writeData (0x03);   // VDS_EN, VDG_EN internal
-  _writeData (0x00);   // VCOM_HV, VGHL_LV=16V
-  _writeData (0x2b);   // VDH=11V
-  _writeData (0x2b);   // VDL=11V
-  _writeCommand(0x06); // boost soft start
-  _writeData (0x17);   // A
-  _writeData (0x17);   // B
-  _writeData (0x17);   // C
-  _writeCommand(0x00); // panel setting
-  _writeData(0x3f);    // 300x400 B/W mode, LUT set by register
-  _writeCommand(0x30); // PLL setting
-  _writeData (0x3a);   // 3a 100HZ   29 150Hz 39 200HZ 31 171HZ
-  _writeCommand(0x61); // resolution setting
-  _writeData (WIDTH / 256);
-  _writeData (WIDTH % 256);
-  _writeData (HEIGHT / 256);
-  _writeData (HEIGHT % 256);
-  _writeCommand(0x82); // vcom_DC setting
-  //_writeData (0x08);   // -0.1 + 8 * -0.05 = -0.5V from demo
-  _writeData (0x12);   // -0.1 + 18 * -0.05 = -1.0V from OTP, slightly better
-  //_writeData (0x1c);   // -0.1 + 28 * -0.05 = -1.5V test, worse
-  _writeCommand(0x50); // VCOM AND DATA INTERVAL SETTING
-  //_writeData(0x97);    // WBmode:VBDF 17|D7 VBDW 97 VBDB 57   WBRmode:VBDF F7 VBDW 77 VBDB 37  VBDR B7
-  _writeData(0xd7);    // border floating to avoid flashing
-#endif
+  _writeCommand (0x50); // Border
+  _writeData(0xb7);     // 
 }
 
 const unsigned char GxEPD2_420_SE0420NQ04::lut_20_vcom0_full[] PROGMEM =
@@ -416,6 +387,8 @@ const unsigned char GxEPD2_420_SE0420NQ04::lut_24_bb_full[] PROGMEM =
 
 // partial update waveform
 
+#if 0
+
 const unsigned char GxEPD2_420_SE0420NQ04::lut_20_vcom0_partial[] PROGMEM =
 {
   0x01, 0x14, 0x02, 0x00, 0x00, 0x01, 0x00,
@@ -472,6 +445,150 @@ const unsigned char GxEPD2_420_SE0420NQ04::lut_24_bb_partial[] PROGMEM =
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
+#else
+
+// same waveform as by demo code from Good Display
+//#define T1  0 // color change charge balance pre-phase
+//#define T2  0 // color change or sustain charge balance pre-phase
+//#define T3  0 // color change or sustain phase
+//#define T4 25 // color change phase
+
+// new waveform created by Jean-Marc Zingg for the actual panel
+#define T1 25 // color change charge balance pre-phase
+#define T2  1 // color change or sustain charge balance pre-phase
+#define T3  4 // color change or sustain phase, was 2 before
+#define T4 25 // color change phase
+
+// for new waveform without sustain phase: uncomment next 2 lines, not good for fat fonts
+//#define T2  0 // color change or sustain charge balance pre-phase // 0 no sustain
+//#define T3  0 // color change or sustain phase // 0 no sustain
+
+// "balanced flash once" variant
+//#define T1  0 // color change charge balance pre-phase
+//#define T2 25 // color change or sustain charge balance pre-phase
+//#define T3 25 // color change or sustain phase
+//#define T4  0 // color change phase
+
+const unsigned char GxEPD2_420_SE0420NQ04::lut_20_vcom0_partial[] PROGMEM =
+{
+  // LUT format of UC8176
+  // 0x00, T1, T2, T3, T4, 1, // 00 00 00 00
+  // 0x00,  1,  0,  0,  0, 1, // gnd phase
+  //
+  // LUT format of UC8276
+  0x01, // Group Repeat Times
+  0x00 + T1,
+  0x00 + T2,
+  0x00 + T3,
+  0x00 + T4,
+  0x01, // State 1 repeat times
+  0x00, // State 2 repeat times
+  0x00 + 1, // gnd phase
+  0x00,
+  0x00,
+  0x00,
+  0x01,
+  0x00,
+};
+
+const unsigned char GxEPD2_420_SE0420NQ04::lut_21_ww_partial[] PROGMEM =
+{ 
+  // LUT format of UC8176
+  // 10 w
+  // 0x18, T1, T2, T3, T4, 1, // 00 01 10 00
+  // 0x00,  1,  0,  0,  0, 1, // gnd phase
+  //
+  // LUT format of UC8276
+  // 00b : 0V, 01b : VSH, 10b : VSL, 11b : VDHR
+  0x01, // Group Repeat Times
+  0x00 + T1,
+  0x80 + T2,
+  0x40 + T3,
+  0x00 + T4,
+  0x01, // State 1 repeat times
+  0x00, // State 2 repeat times
+  0x00 + 1, // gnd phase
+  0x00,
+  0x00,
+  0x00,
+  0x01,
+  0x00,
+};
+
+const unsigned char GxEPD2_420_SE0420NQ04::lut_22_bw_partial[] PROGMEM =
+{ 
+  // LUT format of UC8176
+  // 10 w
+  // 0x5A, T1, T2, T3, T4, 1, // 01 01 10 10
+  // 0x00,  1,  0,  0,  0, 1, // gnd phase
+  //
+  // LUT format of UC8276
+  // 00b : 0V, 01b : VSH, 10b : VSL, 11b : VDHR
+  0x01, // Group Repeat Times
+  0x80 + T1,
+  0x80 + T2,
+  0x40 + T3,
+  0x40 + T4,
+  0x01, // State 1 repeat times
+  0x00, // State 2 repeat times
+  0x00 + 1, // gnd phase
+  0x00,
+  0x00,
+  0x00,
+  0x01,
+  0x00,
+};
+
+const unsigned char GxEPD2_420_SE0420NQ04::lut_23_wb_partial[] PROGMEM =
+{ 
+  // LUT format of UC8176
+  // 01 b
+  // 0xA5, T1, T2, T3, T4, 1, // 10 10 01 01
+  // 0x00,  1,  0,  0,  0, 1, // gnd phase
+  //
+  // LUT format of UC8276
+  // 00b : 0V, 01b : VSH, 10b : VSL, 11b : VDHR
+  0x01, // Group Repeat Times
+  0x40 + T1,
+  0x40 + T2,
+  0x80 + T3,
+  0x80 + T4,
+  0x01, // State 1 repeat times
+  0x00, // State 2 repeat times
+  0x00 + 1, // gnd phase
+  0x00,
+  0x00,
+  0x00,
+  0x01,
+  0x00,
+};
+
+const unsigned char GxEPD2_420_SE0420NQ04::lut_24_bb_partial[] PROGMEM =
+{ 
+  // LUT format of UC8176
+  // 01 b
+  // 0x24, T1, T2, T3, T4, 1, // 00 10 01 00
+  // 0x00,  1,  0,  0,  0, 1, // gnd phase
+  //
+  // LUT format of UC8276
+  // 00b : 0V, 01b : VSH, 10b : VSL, 11b : VDHR
+  0x01, // Group Repeat Times
+  0x00 + T1,
+  0x40 + T2,
+  0x80 + T3,
+  0x00 + T4,
+  0x01, // State 1 repeat times
+  0x00, // State 2 repeat times
+  0x00 + 1, // gnd phase
+  0x00,
+  0x00,
+  0x00,
+  0x01,
+  0x00,
+};
+
+#endif
+
 void GxEPD2_420_SE0420NQ04::_Init_Full()
 {
   _InitDisplay();
@@ -493,15 +610,17 @@ void GxEPD2_420_SE0420NQ04::_Init_Part()
 {
   _InitDisplay();
   _writeCommand(0x20);
-  _writeDataPGM(lut_20_vcom0_partial, sizeof(lut_20_vcom0_partial), 44 - sizeof(lut_20_vcom0_partial));
+  _writeDataPGM(lut_20_vcom0_partial, sizeof(lut_20_vcom0_partial), 57 - sizeof(lut_20_vcom0_partial));
   _writeCommand(0x21);
-  _writeDataPGM(lut_21_ww_partial, sizeof(lut_21_ww_partial), 42 - sizeof(lut_21_ww_partial));
+  _writeDataPGM(lut_21_ww_partial, sizeof(lut_21_ww_partial), 43 - sizeof(lut_21_ww_partial));
   _writeCommand(0x22);
-  _writeDataPGM(lut_22_bw_partial, sizeof(lut_22_bw_partial), 42 - sizeof(lut_22_bw_partial));
+  _writeDataPGM(lut_22_bw_partial, sizeof(lut_22_bw_partial), 57 - sizeof(lut_22_bw_partial));
   _writeCommand(0x23);
-  _writeDataPGM(lut_23_wb_partial, sizeof(lut_23_wb_partial), 42 - sizeof(lut_23_wb_partial));
+  _writeDataPGM(lut_23_wb_partial, sizeof(lut_23_wb_partial), 57 - sizeof(lut_23_wb_partial));
   _writeCommand(0x24);
-  _writeDataPGM(lut_24_bb_partial, sizeof(lut_24_bb_partial), 42 - sizeof(lut_24_bb_partial));
+  _writeDataPGM(lut_24_bb_partial, sizeof(lut_24_bb_partial), 57 - sizeof(lut_24_bb_partial));
+  _writeCommand (0x50); // Border
+  _writeData(0xf7);     // 
   _PowerOn();
   _using_partial_mode = true;
 }