1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-14 06:38:17 +00:00

fix: (Component WaveshareEpaper) Correct display tx cmd

This commit is contained in:
rrachasak 2024-12-20 14:31:27 +07:00
parent 2ec2b505af
commit ec5fccf9c8
No known key found for this signature in database
3 changed files with 25 additions and 22 deletions

View File

@ -1960,17 +1960,19 @@ void WaveshareEPaper4P2InBV2::initialize() {
}
void HOT WaveshareEPaper4P2InBV2::display() {
const size_t buf_len = this->get_buffer_length_() / 2u;
// COMMAND DATA START TRANSMISSION 1 (B/W data)
this->command(0x10);
this->start_data_();
this->write_array(this->buffer_, this->get_buffer_length_());
this->write_array(this->buffer_, buf_len);
this->end_data_();
delay(2);
// COMMAND DATA START TRANSMISSION 2 (RED data)
this->command(0x13);
this->start_data_();
for (size_t i = 0; i < this->get_buffer_length_(); i++)
this->write_byte(0xFF);
this->write_array(this->buffer_ + buf_len, buf_len);
this->end_data_();
delay(2);

View File

@ -205,22 +205,3 @@ display:
number: GPIO32
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height());
- platform: waveshare_epaper
model: 4.20in-bv2-bwr
spi_id: spi_id_1
cs_pin:
allow_other_uses: true
number: GPIO25
dc_pin:
allow_other_uses: true
number: GPIO26
busy_pin:
allow_other_uses: true
number: GPIO27
reset_pin:
allow_other_uses: true
number: GPIO32
lambda: |-
auto const red = Color(255, 0, 0);
it.rectangle(0, 0, it.get_width() / 2, it.get_height() / 2);
it.rectangle(it.get_width() / 2, get_height() / 2, it.get_width(), it.get_height(), red);

View File

@ -121,3 +121,23 @@ display:
model: 7.50in-bv3-bwr
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height());
- platform: waveshare_epaper
model: 4.20in-bv2-bwr
spi_id: spi_id_1
cs_pin:
allow_other_uses: true
number: GPIO25
dc_pin:
allow_other_uses: true
number: GPIO26
busy_pin:
allow_other_uses: true
number: GPIO27
reset_pin:
allow_other_uses: true
number: GPIO32
lambda: |-
auto const red = Color(255, 0, 0);
it.rectangle(0, 0, it.get_width() / 2, it.get_height() / 2);
it.rectangle(it.get_width() / 2, it.get_height() / 2, it.get_width(), it.get_height(), red);