mirror of
https://github.com/esphome/esphome.git
synced 2025-10-16 00:33:54 +01:00
[waveshare_epaper] Add support for 13.3in-k (#6443)
This commit is contained in:
@@ -2963,5 +2963,88 @@ void WaveshareEPaper2P13InDKE::set_full_update_every(uint32_t full_update_every)
|
||||
this->full_update_every_ = full_update_every;
|
||||
}
|
||||
|
||||
// ========================================================
|
||||
// 13.3in (K version)
|
||||
// Datasheet/Specification/Reference:
|
||||
// - https://files.waveshare.com/wiki/13.3inch-e-Paper-HAT-(K)/13.3-inch-e-Paper-(K)-user-manual.pdf
|
||||
// - https://github.com/waveshareteam/e-Paper/tree/master/Arduino/epd13in3k
|
||||
// ========================================================
|
||||
|
||||
// using default wait_until_idle_() function
|
||||
void WaveshareEPaper13P3InK::initialize() {
|
||||
this->wait_until_idle_();
|
||||
this->command(0x12); // SWRESET
|
||||
this->wait_until_idle_();
|
||||
|
||||
this->command(0x0c); // set soft start
|
||||
this->data(0xae);
|
||||
this->data(0xc7);
|
||||
this->data(0xc3);
|
||||
this->data(0xc0);
|
||||
this->data(0x80);
|
||||
|
||||
this->command(0x01); // driver output control
|
||||
this->data((get_height_internal() - 1) % 256); // Y
|
||||
this->data((get_height_internal() - 1) / 256); // Y
|
||||
this->data(0x00);
|
||||
|
||||
this->command(0x11); // data entry mode
|
||||
this->data(0x03);
|
||||
|
||||
// SET WINDOWS
|
||||
// XRAM_START_AND_END_POSITION
|
||||
this->command(0x44);
|
||||
this->data(0 & 0xFF);
|
||||
this->data((0 >> 8) & 0x03);
|
||||
this->data((get_width_internal() - 1) & 0xFF);
|
||||
this->data(((get_width_internal() - 1) >> 8) & 0x03);
|
||||
// YRAM_START_AND_END_POSITION
|
||||
this->command(0x45);
|
||||
this->data(0 & 0xFF);
|
||||
this->data((0 >> 8) & 0x03);
|
||||
this->data((get_height_internal() - 1) & 0xFF);
|
||||
this->data(((get_height_internal() - 1) >> 8) & 0x03);
|
||||
|
||||
this->command(0x3C); // Border setting
|
||||
this->data(0x01);
|
||||
|
||||
this->command(0x18); // use the internal temperature sensor
|
||||
this->data(0x80);
|
||||
|
||||
// SET CURSOR
|
||||
// XRAM_ADDRESS
|
||||
this->command(0x4E);
|
||||
this->data(0 & 0xFF);
|
||||
this->data((0 >> 8) & 0x03);
|
||||
// YRAM_ADDRESS
|
||||
this->command(0x4F);
|
||||
this->data(0 & 0xFF);
|
||||
this->data((0 >> 8) & 0x03);
|
||||
}
|
||||
void HOT WaveshareEPaper13P3InK::display() {
|
||||
// do single full update
|
||||
this->command(0x24);
|
||||
this->start_data_();
|
||||
this->write_array(this->buffer_, this->get_buffer_length_());
|
||||
this->end_data_();
|
||||
|
||||
// COMMAND DISPLAY REFRESH
|
||||
this->command(0x22);
|
||||
this->data(0xF7);
|
||||
this->command(0x20);
|
||||
}
|
||||
|
||||
int WaveshareEPaper13P3InK::get_width_internal() { return 960; }
|
||||
int WaveshareEPaper13P3InK::get_height_internal() { return 680; }
|
||||
uint32_t WaveshareEPaper13P3InK::idle_timeout_() { return 10000; }
|
||||
void WaveshareEPaper13P3InK::dump_config() {
|
||||
LOG_DISPLAY("", "Waveshare E-Paper", this);
|
||||
ESP_LOGCONFIG(TAG, " Model: 13.3inK");
|
||||
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);
|
||||
}
|
||||
|
||||
} // namespace waveshare_epaper
|
||||
} // namespace esphome
|
||||
|
Reference in New Issue
Block a user