mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 13:34:54 +01:00
Add support for Waveshare 7.5in-bv2 (#3121)
This commit is contained in:
parent
976f5d91ed
commit
0c3568fad5
3 changed files with 96 additions and 0 deletions
|
@ -44,6 +44,9 @@ WaveshareEPaper7P5In = waveshare_epaper_ns.class_(
|
|||
WaveshareEPaper7P5InBC = waveshare_epaper_ns.class_(
|
||||
"WaveshareEPaper7P5InBC", WaveshareEPaper
|
||||
)
|
||||
WaveshareEPaper7P5InBV2 = waveshare_epaper_ns.class_(
|
||||
"WaveshareEPaper7P5InBV2", WaveshareEPaper
|
||||
)
|
||||
WaveshareEPaper7P5InV2 = waveshare_epaper_ns.class_(
|
||||
"WaveshareEPaper7P5InV2", WaveshareEPaper
|
||||
)
|
||||
|
@ -70,6 +73,7 @@ MODELS = {
|
|||
"4.20in-bv2": ("b", WaveshareEPaper4P2InBV2),
|
||||
"5.83in": ("b", WaveshareEPaper5P8In),
|
||||
"7.50in": ("b", WaveshareEPaper7P5In),
|
||||
"7.50in-bv2": ("b", WaveshareEPaper7P5InBV2),
|
||||
"7.50in-bc": ("b", WaveshareEPaper7P5InBC),
|
||||
"7.50inv2": ("b", WaveshareEPaper7P5InV2),
|
||||
"2.13in-ttgo-dke": ("c", WaveshareEPaper2P13InDKE),
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -121,6 +121,7 @@ enum WaveshareEPaperTypeBModel {
|
|||
WAVESHARE_EPAPER_4_2_IN_B_V2,
|
||||
WAVESHARE_EPAPER_7_5_IN,
|
||||
WAVESHARE_EPAPER_7_5_INV2,
|
||||
WAVESHARE_EPAPER_7_5_IN_B_V2,
|
||||
};
|
||||
|
||||
class WaveshareEPaper2P7In : public WaveshareEPaper {
|
||||
|
@ -280,6 +281,29 @@ class WaveshareEPaper7P5In : public WaveshareEPaper {
|
|||
int get_height_internal() override;
|
||||
};
|
||||
|
||||
class WaveshareEPaper7P5InBV2 : public WaveshareEPaper {
|
||||
public:
|
||||
void initialize() override;
|
||||
|
||||
void display() override;
|
||||
|
||||
void dump_config() override;
|
||||
|
||||
void deep_sleep() override {
|
||||
// COMMAND POWER OFF
|
||||
this->command(0x02);
|
||||
this->wait_until_idle_();
|
||||
// COMMAND DEEP SLEEP
|
||||
this->command(0x07); // deep sleep
|
||||
this->data(0xA5); // check byte
|
||||
}
|
||||
|
||||
protected:
|
||||
int get_width_internal() override;
|
||||
|
||||
int get_height_internal() override;
|
||||
};
|
||||
|
||||
class WaveshareEPaper7P5InBC : public WaveshareEPaper {
|
||||
public:
|
||||
void initialize() override;
|
||||
|
|
Loading…
Reference in a new issue