1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-14 15:53:48 +01:00

Add support for Waveshare 7.5in-bv2 (#3121)

This commit is contained in:
Matt Hamilton
2022-01-28 06:37:47 -05:00
committed by GitHub
parent 976f5d91ed
commit 0c3568fad5
3 changed files with 96 additions and 0 deletions

View File

@@ -937,6 +937,74 @@ void WaveshareEPaper5P8In::dump_config() {
LOG_PIN(" Busy Pin: ", this->busy_pin_);
LOG_UPDATE_INTERVAL(this);
}
void WaveshareEPaper7P5InBV2::initialize() {
// COMMAND POWER SETTING
this->command(0x01);
this->data(0x07);
this->data(0x07); // VGH=20V,VGL=-20V
this->data(0x3f); // VDH=15V
this->data(0x3f); // VDL=-15V
// COMMAND POWER ON
this->command(0x04);
delay(100); // NOLINT
this->wait_until_idle_();
// COMMAND PANEL SETTING
this->command(0x00);
this->data(0x0F); // KW3f, KWR-2F, BWROTP 0f, BWOTP 1f
this->command(0x61); // tres
this->data(0x03); // 800px
this->data(0x20);
this->data(0x01); // 400px
this->data(0xE0);
this->command(0x15);
this->data(0x00);
// COMMAND VCOM AND DATA INTERVAL SETTING
this->command(0x50);
this->data(0x11);
this->data(0x07);
// COMMAND TCON SETTING
this->command(0x60);
this->data(0x22);
// COMMAND RESOLUTION SETTING
this->command(0x65);
this->data(0x00);
this->data(0x00); // 800*480
this->data(0x00);
this->data(0x00);
}
void HOT WaveshareEPaper7P5InBV2::display() {
// COMMAND DATA START TRANSMISSION 1 (B/W data)
this->command(0x10);
delay(2);
this->start_data_();
this->write_array(this->buffer_, this->get_buffer_length_());
this->end_data_();
delay(2);
// COMMAND DATA START TRANSMISSION 2 (RED data)
this->command(0x13);
delay(2);
this->start_data_();
for (size_t i = 0; i < this->get_buffer_length_(); i++)
this->write_byte(0x00);
this->end_data_();
delay(2);
// COMMAND DISPLAY REFRESH
this->command(0x12);
delay(100); // NOLINT
this->wait_until_idle_();
}
int WaveshareEPaper7P5InBV2::get_width_internal() { return 800; }
int WaveshareEPaper7P5InBV2::get_height_internal() { return 480; }
void WaveshareEPaper7P5InBV2::dump_config() {
LOG_DISPLAY("", "Waveshare E-Paper", this);
ESP_LOGCONFIG(TAG, " Model: 7.5in-bv2");
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);