[epaper_spi] spectra e6 13in#16946
Conversation
|
To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file: external_components:
- source: github://pr#16946
components: [epaper_spi]
refresh: 1h(Added by the PR bot) |
|
👋 Hi there! This PR modifies 6 file(s) with codeowners. @esphome/core - As codeowner(s) of the affected files, your review would be appreciated! 🙏 Note: Automatic review request may have failed, but you're still welcome to review. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for a 13.3" Spectra E6 dual-chip-select (master+slave CS) ePaper panel in epaper_spi, including a new model definition and a new C++ driver that can operate without a D/C line.
Changes:
- Introduces a new
13.3in-Spectra-E6model with dual-CS support and inverted BUSY default. - Adds a new dual-CS C++ implementation (
EPaperSpectraE6DualCS) and updates the base epaper SPI code to support optional D/C and a power-enable pin. - Extends YAML test configuration to compile the new panel model.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/components/epaper_spi/test.esp32-s3-idf.yaml | Adds a compile-time YAML config for the new dual-CS 13.3" Spectra E6 panel. |
| esphome/components/epaper_spi/models/spectra_e6_13in.py | Defines the new 13.3" Spectra E6 dual-CS model and its config behaviors (optional D/C, inverted BUSY). |
| esphome/components/epaper_spi/models/init.py | Adds a model hook to customize BUSY pin schema per model. |
| esphome/components/epaper_spi/epaper_spi_spectra_e6_dual_cs.h | Declares the new dual-CS driver class. |
| esphome/components/epaper_spi/epaper_spi_spectra_e6_dual_cs.cpp | Implements init, dual-CS command/data helpers, and split-buffer transfer logic. |
| esphome/components/epaper_spi/epaper_spi_spectra_e6.h | Removes final so the new dual-CS driver can inherit from EPaperSpectraE6. |
| esphome/components/epaper_spi/epaper_spi.h | Adds enable-pin support and makes D/C operations safe no-ops when no D/C pin exists. |
| esphome/components/epaper_spi/epaper_spi.cpp | Powers the panel via enable-pin early in setup and routes D/C toggles through null-safe helpers. |
| esphome/components/epaper_spi/display.py | Adds cs_slave_pin, makes D/C optional in codegen, and adds codegen for enable pin + slave CS. |
| if enable_pins := config.get(CONF_ENABLE_PIN): | ||
| # Power-enable pin(s) (manufacturer "LOAD_SW"/"PWR"): driven high at setup so the | ||
| # panel's source-driver power comes on before reset. | ||
| for enable_pin in enable_pins: | ||
| enable = await cg.gpio_pin_expression(enable_pin) | ||
| cg.add(var.set_enable_pin(enable)) |
| if (this->current_data_index_ == 0) { | ||
| ESP_LOGI(TAG, "DTM transfer to master IC (left half, %u bytes)", HALF_FRAME_BYTES); | ||
| this->dc_command_(); | ||
| this->enable(); // assert master CS — held for entire transfer | ||
| this->write_byte(CMD_DTM); | ||
| this->dc_data_(); | ||
| } | ||
| size_t buf_idx = 0; | ||
| while (this->current_data_index_ != HALF_FRAME_BYTES) { | ||
| uint32_t idx = this->current_data_index_++; | ||
| bytes_to_send[buf_idx++] = this->buffer_[idx / COLS_PER_IC * (COLS_PER_IC * 2) + idx % COLS_PER_IC]; | ||
|
|
||
| if (buf_idx == sizeof bytes_to_send) { | ||
| this->write_array(bytes_to_send, buf_idx); // master CS remains low | ||
| buf_idx = 0; | ||
| if (millis() - start_time > MAX_TRANSFER_TIME) { | ||
| return false; // yield; CS stays asserted across loop iterations | ||
| } | ||
| } | ||
| } |
| // Switch on panel power first (matches the manufacturer driving LOAD_SW/PWR high before | ||
| // anything else). Must happen before reset so the controller can power up. | ||
| if (this->enable_pin_ != nullptr) { | ||
| this->enable_pin_->setup(); // OUTPUT | ||
| this->enable_pin_->digital_write(true); | ||
| } |
| void EPaperSpectraE6DualCS::setup() { | ||
| EPaperBase::setup(); | ||
| if (this->cs_slave_ != nullptr) { | ||
| this->cs_slave_->setup(); | ||
| this->cs_slave_->digital_write(true); | ||
| } | ||
| } | ||
|
|
||
| void EPaperSpectraE6DualCS::dump_config() { | ||
| EPaperBase::dump_config(); | ||
| LOG_PIN(" Slave CS Pin: ", this->cs_slave_); | ||
| } |
| dc_pin: | ||
| allow_other_uses: true | ||
| number: GPIO17 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #16946 +/- ##
=======================================
Coverage 79.29% 79.29%
=======================================
Files 72 72
Lines 15079 15079
Branches 2209 2209
=======================================
Hits 11957 11957
Misses 2671 2671
Partials 451 451 🚀 New features to boost your workflow:
|
Memory Impact AnalysisComponents:
📊 Component Memory Breakdown
🔍 Symbol-Level Changes (click to expand)Changed Symbols
New Symbols (top 15)
This analysis runs automatically when components change. Memory usage is measured from a representative test configuration. |
What does this implement/fix?
Add support for Spectra E6 13in GDEP133C02
Types of changes
Related issue or feature (if applicable):
Pull request in esphome.io with documentation (if applicable):
Test Environment
Example entry for
config.yaml:Checklist:
tests/folder).If user exposed functionality or configuration variables are added/changed: