Add support for TTGO epaper boards with B73 revision (#928)

* Add support for TTGO epaper boards with B73 revision
This commit is contained in:
Thomas Klingbeil 2020-03-12 01:19:01 +01:00 committed by GitHub
parent 11069085e3
commit 7f2a6e7403
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 0 deletions

View file

@ -23,6 +23,7 @@ MODELS = {
'1.54in': ('a', WaveshareEPaperTypeAModel.WAVESHARE_EPAPER_1_54_IN), '1.54in': ('a', WaveshareEPaperTypeAModel.WAVESHARE_EPAPER_1_54_IN),
'2.13in': ('a', WaveshareEPaperTypeAModel.WAVESHARE_EPAPER_2_13_IN), '2.13in': ('a', WaveshareEPaperTypeAModel.WAVESHARE_EPAPER_2_13_IN),
'2.13in-ttgo': ('a', WaveshareEPaperTypeAModel.TTGO_EPAPER_2_13_IN), '2.13in-ttgo': ('a', WaveshareEPaperTypeAModel.TTGO_EPAPER_2_13_IN),
'2.13in-ttgo-b73': ('a', WaveshareEPaperTypeAModel.TTGO_EPAPER_2_13_IN_B73),
'2.90in': ('a', WaveshareEPaperTypeAModel.WAVESHARE_EPAPER_2_9_IN), '2.90in': ('a', WaveshareEPaperTypeAModel.WAVESHARE_EPAPER_2_9_IN),
'2.70in': ('b', WaveshareEPaper2P7In), '2.70in': ('b', WaveshareEPaper2P7In),
'2.90in-b': ('b', WaveshareEPaper2P9InB), '2.90in-b': ('b', WaveshareEPaper2P9InB),

View file

@ -18,6 +18,8 @@ static const uint8_t PARTIAL_UPDATE_LUT[LUT_SIZE_WAVESHARE] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const uint8_t LUT_SIZE_TTGO = 70; static const uint8_t LUT_SIZE_TTGO = 70;
static const uint8_t LUT_SIZE_TTGO_B73 = 100;
static const uint8_t FULL_UPDATE_LUT_TTGO[LUT_SIZE_TTGO] = { static const uint8_t FULL_UPDATE_LUT_TTGO[LUT_SIZE_TTGO] = {
0x80, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, // LUT0: BB: VS 0 ~7 0x80, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, // LUT0: BB: VS 0 ~7
0x10, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00, // LUT1: BW: VS 0 ~7 0x10, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00, // LUT1: BW: VS 0 ~7
@ -33,6 +35,26 @@ static const uint8_t FULL_UPDATE_LUT_TTGO[LUT_SIZE_TTGO] = {
0x00, 0x00, 0x00, 0x00, 0x00, // TP6 A~D RP6 0x00, 0x00, 0x00, 0x00, 0x00, // TP6 A~D RP6
}; };
static const uint8_t FULL_UPDATE_LUT_TTGO_B73[LUT_SIZE_TTGO_B73] = {
0xA0, 0x90, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x90, 0xA0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xA0, 0x90, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x90, 0xA0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x03, 0x0F, 0x0F, 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,
};
static const uint8_t PARTIAL_UPDATE_LUT_TTGO_B73[LUT_SIZE_TTGO_B73] = {
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 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,
};
static const uint8_t PARTIAL_UPDATE_LUT_TTGO[LUT_SIZE_TTGO] = { static const uint8_t PARTIAL_UPDATE_LUT_TTGO[LUT_SIZE_TTGO] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // LUT0: BB: VS 0 ~7 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // LUT0: BB: VS 0 ~7
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // LUT1: BW: VS 0 ~7 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // LUT1: BW: VS 0 ~7
@ -169,6 +191,9 @@ void WaveshareEPaperTypeA::dump_config() {
case TTGO_EPAPER_2_13_IN: case TTGO_EPAPER_2_13_IN:
ESP_LOGCONFIG(TAG, " Model: 2.13in (TTGO)"); ESP_LOGCONFIG(TAG, " Model: 2.13in (TTGO)");
break; break;
case TTGO_EPAPER_2_13_IN_B73:
ESP_LOGCONFIG(TAG, " Model: 2.13in (TTGO B73)");
break;
case WAVESHARE_EPAPER_2_9_IN: case WAVESHARE_EPAPER_2_9_IN:
ESP_LOGCONFIG(TAG, " Model: 2.9in"); ESP_LOGCONFIG(TAG, " Model: 2.9in");
break; break;
@ -191,6 +216,8 @@ void HOT WaveshareEPaperTypeA::display() {
if (full_update != prev_full_update) { if (full_update != prev_full_update) {
if (this->model_ == TTGO_EPAPER_2_13_IN) { if (this->model_ == TTGO_EPAPER_2_13_IN) {
this->write_lut_(full_update ? FULL_UPDATE_LUT_TTGO : PARTIAL_UPDATE_LUT_TTGO, LUT_SIZE_TTGO); this->write_lut_(full_update ? FULL_UPDATE_LUT_TTGO : PARTIAL_UPDATE_LUT_TTGO, LUT_SIZE_TTGO);
} else if (this->model_ == TTGO_EPAPER_2_13_IN_B73) {
this->write_lut_(full_update ? FULL_UPDATE_LUT_TTGO_B73 : PARTIAL_UPDATE_LUT_TTGO_B73, LUT_SIZE_TTGO_B73);
} else { } else {
this->write_lut_(full_update ? FULL_UPDATE_LUT : PARTIAL_UPDATE_LUT, LUT_SIZE_WAVESHARE); this->write_lut_(full_update ? FULL_UPDATE_LUT : PARTIAL_UPDATE_LUT, LUT_SIZE_WAVESHARE);
} }
@ -247,6 +274,8 @@ int WaveshareEPaperTypeA::get_width_internal() {
return 128; return 128;
case TTGO_EPAPER_2_13_IN: case TTGO_EPAPER_2_13_IN:
return 128; return 128;
case TTGO_EPAPER_2_13_IN_B73:
return 128;
case WAVESHARE_EPAPER_2_9_IN: case WAVESHARE_EPAPER_2_9_IN:
return 128; return 128;
} }
@ -260,6 +289,8 @@ int WaveshareEPaperTypeA::get_height_internal() {
return 250; return 250;
case TTGO_EPAPER_2_13_IN: case TTGO_EPAPER_2_13_IN:
return 250; return 250;
case TTGO_EPAPER_2_13_IN_B73:
return 250;
case WAVESHARE_EPAPER_2_9_IN: case WAVESHARE_EPAPER_2_9_IN:
return 296; return 296;
} }

View file

@ -68,6 +68,7 @@ enum WaveshareEPaperTypeAModel {
WAVESHARE_EPAPER_2_13_IN, WAVESHARE_EPAPER_2_13_IN,
WAVESHARE_EPAPER_2_9_IN, WAVESHARE_EPAPER_2_9_IN,
TTGO_EPAPER_2_13_IN, TTGO_EPAPER_2_13_IN,
TTGO_EPAPER_2_13_IN_B73,
}; };
class WaveshareEPaperTypeA : public WaveshareEPaper { class WaveshareEPaperTypeA : public WaveshareEPaper {