Extending Support to 5.83in Waveshare eink B/W displays (#1009)

* Extending Support to 5.83in Waveshare eink B/W displays

* Fixed lint issues
This commit is contained in:
sredfern
2020-05-01 21:30:52 -03:00
committed by GitHub
parent 4f2e2fa297
commit 7fa5cab8e3
3 changed files with 120 additions and 0 deletions
@@ -657,6 +657,101 @@ void WaveshareEPaper4P2In::dump_config() {
LOG_UPDATE_INTERVAL(this);
}
void WaveshareEPaper5P8In::initialize() {
// COMMAND POWER SETTING
this->command(0x01);
this->data(0x37);
this->data(0x00);
// COMMAND PANEL SETTING
this->command(0x00);
this->data(0xCF);
this->data(0x0B);
// COMMAND BOOSTER SOFT START
this->command(0x06);
this->data(0xC7);
this->data(0xCC);
this->data(0x28);
// COMMAND POWER ON
this->command(0x04);
this->wait_until_idle_();
delay(10);
// COMMAND PLL CONTROL
this->command(0x30);
this->data(0x3C);
// COMMAND TEMPERATURE SENSOR CALIBRATION
this->command(0x41);
this->data(0x00);
// COMMAND VCOM AND DATA INTERVAL SETTING
this->command(0x50);
this->data(0x77);
// COMMAND TCON SETTING
this->command(0x60);
this->data(0x22);
// COMMAND RESOLUTION SETTING
this->command(0x61);
this->data(0x02);
this->data(0x58);
this->data(0x01);
this->data(0xC0);
// COMMAND VCM DC SETTING REGISTER
this->command(0x82);
this->data(0x1E);
this->command(0xE5);
this->data(0x03);
}
void HOT WaveshareEPaper5P8In::display() {
// COMMAND DATA START TRANSMISSION 1
this->command(0x10);
this->start_data_();
for (size_t i = 0; i < this->get_buffer_length_(); i++) {
uint8_t temp1 = this->buffer_[i];
for (uint8_t j = 0; j < 8; j++) {
uint8_t temp2;
if (temp1 & 0x80)
temp2 = 0x03;
else
temp2 = 0x00;
temp2 <<= 4;
temp1 <<= 1;
j++;
if (temp1 & 0x80)
temp2 |= 0x03;
else
temp2 |= 0x00;
temp1 <<= 1;
this->write_byte(temp2);
}
App.feed_wdt();
}
this->end_data_();
// COMMAND DISPLAY REFRESH
this->command(0x12);
}
int WaveshareEPaper5P8In::get_width_internal() { return 600; }
int WaveshareEPaper5P8In::get_height_internal() { return 448; }
void WaveshareEPaper5P8In::dump_config() {
LOG_DISPLAY("", "Waveshare E-Paper", this);
ESP_LOGCONFIG(TAG, " Model: 5.83in");
LOG_PIN(" Reset Pin: ", this->reset_pin_);
LOG_PIN(" DC Pin: ", this->dc_pin_);
LOG_PIN(" Busy Pin: ", this->busy_pin_);
LOG_UPDATE_INTERVAL(this);
}
void WaveshareEPaper7P5In::initialize() {
// COMMAND POWER SETTING
this->command(0x01);