Skip to content

Commit

Permalink
Merge pull request #5 from todd-herbert/wireless-paper-v1.1
Browse files Browse the repository at this point in the history
Changes to Wireless Paper V1.0 and V1.1
  • Loading branch information
thebentern authored Mar 4, 2024
2 parents 4ddb4dc + cd0ba04 commit 378318c
Show file tree
Hide file tree
Showing 5 changed files with 267 additions and 384 deletions.
4 changes: 2 additions & 2 deletions src/GxEPD2.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class GxEPD2
GDEH0213B72, Waveshare_2_13_bw_B72 = GDEH0213B72,
GDEH0213B73, Waveshare_2_13_bw_B73 = GDEH0213B73,
GDEM0213B74, Waveshare_2_13_bw_B74 = GDEM0213B74,
DEPG0213BN, // Heltec Wireless Paper v1.0, backported from GxEPD v1.5.5
GDEM0213FC1,
DEPG0213BN, // Heltec Wireless Paper v1.0, backported from GxEPD v1.5.5
LCMEN2R13EFC1, // Heltec Wireless Paper v1.1, custom
GDEW0213I5F, Waveshare_2_13_flex = GDEW0213I5F,
GDEW0213M21,
GDEW0213T5D,
Expand Down
22 changes: 17 additions & 5 deletions src/epd/GxEPD2_213_BN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,9 @@ void GxEPD2_213_BN::_InitDisplay()
_writeData(0x00);
_writeCommand(0x11); //data entry mode
_writeData(0x03);
_writeCommand(0x3C); //BorderWavefrom
_writeData(0x05);
_writeCommand(0x21); // Display update control
_writeData(0x00);
_writeData(0x80);
_writeCommand(0x18); //Read built-in temperature sensor
_writeData(0x80);
_setPartialRamArea(0, 0, WIDTH, HEIGHT);
_using_partial_mode = false;
_init_display_done = true;
Expand Down Expand Up @@ -385,16 +381,32 @@ const unsigned char GxEPD2_213_BN::lut_partial[] PROGMEM =
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0,
};

void GxEPD2_213_BN::_Init_Full()
{
_InitDisplay();
_writeCommand(0x3C); // Border Waveform
_writeData(0x05);
_writeCommand(0x18); //Read built-in temperature sensor
_writeData(0x80);
_using_partial_mode = false;
}


void GxEPD2_213_BN::_Init_Part()
{
_InitDisplay();
_writeCommand(0x3C); // Border Waveform
_writeData(0xC0); // Floating (less noise-accumulation?)
_writeCommand(0x18); //Read built-in temperature sensor
_writeData(0x80);
_writeCommand(0x32);
_writeDataPGM(lut_partial, sizeof(lut_partial));
_using_partial_mode = true;
}

void GxEPD2_213_BN::_Update_Full()
{
_using_partial_mode = false;
if (_using_partial_mode) _Init_Full();
_PowerOn();
_writeCommand(0x22);
_writeData(0xf4);
Expand Down
2 changes: 1 addition & 1 deletion src/epd/GxEPD2_213_BN.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class GxEPD2_213_BN : public GxEPD2_EPD
static const bool hasFastPartialUpdate = true;
static const uint16_t power_on_time = 100; // ms, e.g. 95868us
static const uint16_t power_off_time = 250; // ms, e.g. 140350us
static const uint16_t full_refresh_time = 8100; // ms, e.g. 4011934us
static const uint16_t full_refresh_time = 4100; // ms, e.g. 4011934us
static const uint16_t partial_refresh_time = 750; // ms, e.g. 736721us
// constructor
GxEPD2_213_BN(int16_t cs, int16_t dc, int16_t rst, int16_t busy, SPIClass &spi);
Expand Down
Loading

0 comments on commit 378318c

Please sign in to comment.