mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 16:38:16 +01:00
Change buffer sending process for waveshare_epaper (2.70in) (#1031)
* Change buffer sending process for waveshare_epaper (2.70in) The current way ESPhome sending buffer to WaveshareEPaper2P7In does not show the expected content on the display, this commit is changing the data transferring process so the content is showing as expected. The process is adapted from the demo code provided by Waveshare, manufacturer of the E-paper display. * Fix linting eror
This commit is contained in:
parent
c9e224e999
commit
bab0ba9c0f
1 changed files with 8 additions and 6 deletions
|
@ -425,20 +425,22 @@ void WaveshareEPaper2P7In::initialize() {
|
|||
this->data(i);
|
||||
}
|
||||
void HOT WaveshareEPaper2P7In::display() {
|
||||
uint32_t buf_len = this->get_buffer_length_();
|
||||
|
||||
// COMMAND DATA START TRANSMISSION 1
|
||||
this->command(0x10);
|
||||
delay(2);
|
||||
this->start_data_();
|
||||
this->write_array(this->buffer_, this->get_buffer_length_());
|
||||
this->end_data_();
|
||||
for (uint32_t i = 0; i < buf_len; i++) {
|
||||
this->data(this->buffer_[i]);
|
||||
}
|
||||
delay(2);
|
||||
|
||||
// COMMAND DATA START TRANSMISSION 2
|
||||
this->command(0x13);
|
||||
delay(2);
|
||||
this->start_data_();
|
||||
this->write_array(this->buffer_, this->get_buffer_length_());
|
||||
this->end_data_();
|
||||
for (uint32_t i = 0; i < buf_len; i++) {
|
||||
this->data(this->buffer_[i]);
|
||||
}
|
||||
|
||||
// COMMAND DISPLAY REFRESH
|
||||
this->command(0x12);
|
||||
|
|
Loading…
Reference in a new issue