|
|
@@ -26,7 +26,19 @@ class SPIClass : public esphome::spi::SPIDevice<esphome::spi::BIT_ORDER_MSB_FIRS
|
|
|
void end() {}
|
|
|
void beginTransaction(SPISettings settings) { this->enable(); }
|
|
|
void endTransaction() { this->disable(); }
|
|
|
- uint8_t transfer(uint8_t data) { return this->transfer_byte(data); }
|
|
|
+ // GxEPD2 panels (all but the IT8951-based ones, which aren't supported -
|
|
|
+ // see display.py) never read anything back over MISO; e-paper wiring
|
|
|
+ // normally leaves it unconnected, and esphome's spi: bus then registers
|
|
|
+ // this device as write-only. transfer_byte()/delegate transfer() ask for
|
|
|
+ // a real bidirectional exchange regardless, which a write-only device
|
|
|
+ // refuses outright - it doesn't just skip the read, it drops the write
|
|
|
+ // too (see SPIDelegateHw::transfer in spi_esp_idf.cpp), silently bricking
|
|
|
+ // every panel command. write_byte() only ever asks to write, so it works
|
|
|
+ // whether or not MISO is wired.
|
|
|
+ uint8_t transfer(uint8_t data) {
|
|
|
+ this->write_byte(data);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
// Unused: every gxepd2 instance overrides this via selectSPI() with its own
|