mirror of
https://github.com/esphome/esphome.git
synced 2025-03-15 15:18:16 +00:00
fix: (Component WaveshareEpaper) Correct display tx cmd
This commit is contained in:
parent
2ec2b505af
commit
ec5fccf9c8
@ -1960,17 +1960,19 @@ void WaveshareEPaper4P2InBV2::initialize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HOT WaveshareEPaper4P2InBV2::display() {
|
void HOT WaveshareEPaper4P2InBV2::display() {
|
||||||
|
const size_t buf_len = this->get_buffer_length_() / 2u;
|
||||||
|
|
||||||
// COMMAND DATA START TRANSMISSION 1 (B/W data)
|
// COMMAND DATA START TRANSMISSION 1 (B/W data)
|
||||||
this->command(0x10);
|
this->command(0x10);
|
||||||
this->start_data_();
|
this->start_data_();
|
||||||
this->write_array(this->buffer_, this->get_buffer_length_());
|
this->write_array(this->buffer_, buf_len);
|
||||||
this->end_data_();
|
this->end_data_();
|
||||||
|
delay(2);
|
||||||
|
|
||||||
// COMMAND DATA START TRANSMISSION 2 (RED data)
|
// COMMAND DATA START TRANSMISSION 2 (RED data)
|
||||||
this->command(0x13);
|
this->command(0x13);
|
||||||
this->start_data_();
|
this->start_data_();
|
||||||
for (size_t i = 0; i < this->get_buffer_length_(); i++)
|
this->write_array(this->buffer_ + buf_len, buf_len);
|
||||||
this->write_byte(0xFF);
|
|
||||||
this->end_data_();
|
this->end_data_();
|
||||||
delay(2);
|
delay(2);
|
||||||
|
|
||||||
|
@ -205,22 +205,3 @@ display:
|
|||||||
number: GPIO32
|
number: GPIO32
|
||||||
lambda: |-
|
lambda: |-
|
||||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
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);
|
|
||||||
|
@ -121,3 +121,23 @@ display:
|
|||||||
model: 7.50in-bv3-bwr
|
model: 7.50in-bv3-bwr
|
||||||
lambda: |-
|
lambda: |-
|
||||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
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);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user