From 12becc69182a37228ccf3e1c99583b250e696070 Mon Sep 17 00:00:00 2001 From: ZinggJM Date: Thu, 30 May 2024 07:26:41 +0200 Subject: [PATCH] keep this intermediate step // from A32-GDEM1085T51-P-20240314 --- src/gdem/GxEPD2_1085_GDEM1085T51.cpp | 247 ++++++++++++--------------- src/gdem/GxEPD2_1085_GDEM1085T51.h | 10 -- 2 files changed, 112 insertions(+), 145 deletions(-) diff --git a/src/gdem/GxEPD2_1085_GDEM1085T51.cpp b/src/gdem/GxEPD2_1085_GDEM1085T51.cpp index d8ce401..b164ff7 100644 --- a/src/gdem/GxEPD2_1085_GDEM1085T51.cpp +++ b/src/gdem/GxEPD2_1085_GDEM1085T51.cpp @@ -507,6 +507,54 @@ void GxEPD2_1085_GDEM1085T51::_InitDisplay() { if (_hibernating) _reset(); #if 1 + // from A32-GDEM1085T51-P-20240314 + _writeCommandToBoth(0x4D); + _writeDataToBoth(0x55); + _writeCommandToBoth(0xA6); + _writeDataToBoth(0x38); + _writeCommandToBoth(0xB4); + _writeDataToBoth(0x5D); + _writeCommandToBoth(0xB6); + _writeDataToBoth(0x80); + _writeCommandToBoth(0xB7); + _writeDataToBoth(0x00); + _writeCommandToBoth(0xF7); + _writeDataToBoth(0x02); + _writeCommandToSlave(0xAE); + _writeDataToSlave(0xA0); + _writeCommandToBoth(0xE0); + _writeDataToBoth(0x01); + _writeCommandToBoth(0x00); // Panel setting + _writeDataToBoth(0x9F); // otp + _writeDataToBoth(0x0D); // ?? + _writeCommandToBoth(0x06); // Booster Setting + _writeDataToBoth(0x57); // 20ms, str 3, period 8 + _writeDataToBoth(0x24); // 10ms, str 5, period 5 + _writeDataToBoth(0x28); // 10ms, str 6, period 1 + _writeDataToBoth(0x32); // ?? + _writeDataToBoth(0x08); // ?? + _writeDataToBoth(0x48); // ?? + _writeCommandToBoth(0x61); // Resolution setting + _writeDataToBoth(0X02); // 640 + _writeDataToBoth(0XA8); + _writeDataToBoth(0X01); // 480 + _writeDataToBoth(0XE0); + _writeCommandToBoth(0x62); // Source & gate start setting + _writeDataToBoth(0x00); + _writeDataToBoth(0x00); + _writeDataToBoth(0x00); + _writeDataToBoth(0x00); + _writeCommandToBoth(0x60); // TCON setting + _writeDataToBoth(0x31); // ?? + _writeCommandToBoth(0x50); // VCOM and DATA interval setting + _writeDataToBoth(0x97); // LUTBW, 10 hsync + _writeCommandToBoth(0xE8); + _writeDataToBoth(0x01); + _writeCommandToBoth(0x04); //power on + delay(200); + _waitWhileBusy("_PowerOn", power_on_time); + _power_is_on = true; +#elif 1 // from GDEM1085Z51 demo _writeCommandToBoth(0x4D); _writeDataToBoth(0x55); @@ -605,153 +653,82 @@ void GxEPD2_1085_GDEM1085T51::_InitDisplay() #endif } -const unsigned char GxEPD2_1085_GDEM1085T51::lut_20_vcomDC[] PROGMEM = -{ - 0x01, 0x05, 0x05, 0x05, 0x05, 0x01, 0x01, - 0x01, 0x05, 0x05, 0x05, 0x05, 0x01, 0x01, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const unsigned char GxEPD2_1085_GDEM1085T51::lut_21_ww[] PROGMEM = -{ - 0x01, 0x45, 0x45, 0x43, 0x44, 0x01, 0x01, - 0x01, 0x87, 0x83, 0x87, 0x06, 0x01, 0x01, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const unsigned char GxEPD2_1085_GDEM1085T51::lut_22_bw[] PROGMEM = -{ - 0x01, 0x05, 0x05, 0x45, 0x42, 0x01, 0x01, - 0x01, 0x87, 0x85, 0x85, 0x85, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const unsigned char GxEPD2_1085_GDEM1085T51::lut_23_wb[] PROGMEM = -{ - 0x01, 0x08, 0x08, 0x82, 0x42, 0x01, 0x01, - 0x01, 0x45, 0x45, 0x45, 0x45, 0x01, 0x01, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const unsigned char GxEPD2_1085_GDEM1085T51::lut_24_bb[] PROGMEM = -{ - 0x01, 0x85, 0x85, 0x85, 0x83, 0x01, 0x01, - 0x01, 0x45, 0x45, 0x04, 0x48, 0x01, 0x01, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const unsigned char GxEPD2_1085_GDEM1085T51::lut_20_vcomDC_partial[] PROGMEM = -{ - 0x01, 0x04, 0x04, 0x03, 0x01, 0x01, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const unsigned char GxEPD2_1085_GDEM1085T51::lut_21_ww_partial[] PROGMEM = -{ - 0x01, 0x04, 0x04, 0x03, 0x01, 0x01, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -const unsigned char GxEPD2_1085_GDEM1085T51::lut_22_bw_partial[] PROGMEM = -{ - 0x01, 0x84, 0x84, 0x83, 0x01, 0x01, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const unsigned char GxEPD2_1085_GDEM1085T51::lut_23_wb_partial[] PROGMEM = -{ - 0x01, 0x44, 0x44, 0x43, 0x01, 0x01, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -const unsigned char GxEPD2_1085_GDEM1085T51::lut_24_bb_partial[] PROGMEM = -{ - 0x01, 0x04, 0x04, 0x03, 0x01, 0x01, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - void GxEPD2_1085_GDEM1085T51::_Init_Full() { + Serial.println("_Init_Full"); _InitDisplay(); - // _writeCommand(0x20); - // _writeDataPGM(lut_20_vcomDC, sizeof(lut_20_vcomDC)); - // _writeCommand(0x21); - // _writeDataPGM(lut_21_ww, sizeof(lut_21_ww)); - // _writeCommand(0x22); - // _writeDataPGM(lut_22_bw, sizeof(lut_22_bw)); - // _writeCommand(0x23); - // _writeDataPGM(lut_23_wb, sizeof(lut_23_wb)); - // _writeCommand(0x24); - // _writeDataPGM(lut_24_bb, sizeof(lut_24_bb)); + //_writeCommandToBoth(0xE8); + //_writeDataToBoth(0x01); _PowerOn(); _using_partial_mode = false; } void GxEPD2_1085_GDEM1085T51::_Init_Part() { + Serial.println("_Init_Part"); +#if 1 _InitDisplay(); - // _writeCommand(0x20); - // _writeDataPGM(lut_20_vcomDC_partial, sizeof(lut_20_vcomDC_partial)); - // _writeCommand(0x21); - // _writeDataPGM(lut_21_ww_partial, sizeof(lut_21_ww_partial)); - // _writeCommand(0x22); - // _writeDataPGM(lut_22_bw_partial, sizeof(lut_22_bw_partial)); - // _writeCommand(0x23); - // _writeDataPGM(lut_23_wb_partial, sizeof(lut_23_wb_partial)); - // _writeCommand(0x24); - // _writeDataPGM(lut_24_bb_partial, sizeof(lut_24_bb_partial)); + //_writeCommandToBoth(0xE8); + //_writeDataToBoth(0x01); _PowerOn(); _using_partial_mode = true; +#else + if (_hibernating) _reset(); + _writeCommandToBoth(0x4D); + _writeDataToBoth(0x55); + _writeCommandToBoth(0xA6); + _writeDataToBoth(0x38); + _writeCommandToBoth(0xB4); + _writeDataToBoth(0x5D); + _writeCommandToBoth(0xB6); + _writeDataToBoth(0x80); + _writeCommandToBoth(0xB7); + _writeDataToBoth(0x00); + _writeCommandToBoth(0xF7); + _writeDataToBoth(0x02); + _writeCommandToSlave(0xAE); + _writeDataToSlave(0xA0); + _writeCommandToBoth(0xE0); + _writeDataToBoth(0x01); + _writeCommandToBoth(0x00); // Panel setting + _writeDataToBoth(0x9F); // otp + _writeDataToBoth(0x0D); // ?? + _writeCommandToBoth(0x06); // Booster Setting + _writeDataToBoth(0x57); // 20ms, str 3, period 8 + _writeDataToBoth(0x24); // 10ms, str 5, period 5 + _writeDataToBoth(0x28); // 10ms, str 6, period 1 + _writeDataToBoth(0x32); // ?? + _writeDataToBoth(0x08); // ?? + _writeDataToBoth(0x48); // ?? + _writeCommandToBoth(0x61); // Resolution setting + _writeDataToBoth(0X02); // 640 + _writeDataToBoth(0XA8); + _writeDataToBoth(0X01); // 480 + _writeDataToBoth(0XE0); + _writeCommandToBoth(0x62); // Source & gate start setting + _writeDataToBoth(0x00); + _writeDataToBoth(0x00); + _writeDataToBoth(0x00); + _writeDataToBoth(0x00); + _writeCommandToBoth(0x82); // VCOM DC Setting + _writeDataToBoth(0x12); // ?? + _writeCommandToBoth(0x60); // TCON setting + _writeDataToBoth(0x31); // ?? + _writeCommandToBoth(0x50); // VCOM and DATA interval setting + _writeDataToBoth(0x97); + //_writeCommandToBoth(0x50); // VCOM and DATA interval setting + //_writeDataToBoth(0x97); // LUTBW, 10 hsync + _writeCommandToBoth(0xE0); // ?? + _writeDataToBoth(0x03); // ?? + _writeCommandToBoth(0xE5); // Force Temperature + _writeDataToBoth(0x64); // 100, differential update + _writeCommandToBoth(0x04); //POWER ON + delay(100); + _waitWhileBusy("_PowerOn", power_on_time); + _power_is_on = true; + _PowerOn(); + _using_partial_mode = true; +#endif } void GxEPD2_1085_GDEM1085T51::_Update_Full() diff --git a/src/gdem/GxEPD2_1085_GDEM1085T51.h b/src/gdem/GxEPD2_1085_GDEM1085T51.h index c62b732..b9e309f 100644 --- a/src/gdem/GxEPD2_1085_GDEM1085T51.h +++ b/src/gdem/GxEPD2_1085_GDEM1085T51.h @@ -94,16 +94,6 @@ class GxEPD2_1085_GDEM1085T51 : public GxEPD2_EPD void _Update_Part(); private: int16_t _cs2; - static const unsigned char lut_20_vcomDC[]; - static const unsigned char lut_21_ww[]; - static const unsigned char lut_22_bw[]; - static const unsigned char lut_23_wb[]; - static const unsigned char lut_24_bb[]; - static const unsigned char lut_20_vcomDC_partial[]; - static const unsigned char lut_21_ww_partial[]; - static const unsigned char lut_22_bw_partial[]; - static const unsigned char lut_23_wb_partial[]; - static const unsigned char lut_24_bb_partial[]; }; #endif