Fix wake sequence for Spectra6

This commit is contained in:
Larry Bank
2025-05-30 00:17:44 +01:00
parent 53a6a16b12
commit 9c00aea6e4
4 changed files with 38 additions and 1 deletions
+10
View File
@@ -37,6 +37,16 @@ extern "C" void app_main(void)
bbep.writePlane();
bbep.refresh(REFRESH_FULL);
bbep.sleep(1); // deep sleep
vTaskDelay(200); // wait 2 seconds
// try different content
bbep.fillScreen(BBEP_YELLOW);
bbep.setTextColor(BBEP_GREEN);
bbep.setCursor(200, 300);
bbep.print("Second time is broken?");
bbep.writePlane();
bbep.refresh(REFRESH_FULL);
bbep.sleep(1);
while (1) {
vTaskDelay(1);
}
+16 -1
View File
@@ -200,6 +200,14 @@ void bbepWriteCmd(BBEPDISP *pBBEP, uint8_t cmd)
// if it's asleep, it can't receive commands
bbepWakeUp(pBBEP);
pBBEP->is_awake = 1;
if (pBBEP->iFlags & BBEP_7COLOR) { // need to send before you can send it data
bbepSendCMDSequence(pBBEP, pBBEP->pInitFull);
if (pBBEP->iFlags & BBEP_SPLIT_BUFFER) { // dual cable EPD
pBBEP->iCSPin = pBBEP->iCS2Pin;
bbepSendCMDSequence(pBBEP, pBBEP->pInitFull); // second controller
pBBEP->iCSPin = pBBEP->iCS1Pin;
}
}
}
digitalWrite(pBBEP->iDCPin, LOW);
delay(1);
@@ -281,8 +289,15 @@ void bbepInitIO(BBEPDISP *pBBEP, uint8_t u8DC, uint8_t u8RST, uint8_t u8BUSY, ui
assert(ret==ESP_OK);
if (pBBEP->iFlags & BBEP_7COLOR) { // need to send before you can send it data
pBBEP->is_awake = 1;
bbepSendCMDSequence(pBBEP, pBBEP->pInitFull);
if (pBBEP->iFlags & BBEP_SPLIT_BUFFER) {
// Send the same sequence to the second controller
pBBEP->iCSPin = pBBEP->iCS2Pin;
bbepSendCMDSequence(pBBEP, pBBEP->pInitFull);
pBBEP->iCSPin = pBBEP->iCS1Pin;
}
}
} /* spi_init() */
} /* bbepInitIO() */
#endif // __ESP_IDF_IO__
+7
View File
@@ -66,7 +66,14 @@ void bbepInitIO(BBEPDISP *pBBEP, uint8_t u8DC, uint8_t u8RST, uint8_t u8BUSY, ui
SPI.beginTransaction(SPISettings(u32Speed, MSBFIRST, SPI_MODE0));
SPI.endTransaction(); // N.B. - if you call beginTransaction() again without a matching endTransaction(), it will hang on ESP32
if (pBBEP->iFlags & BBEP_7COLOR) { // need to send before you can send it data
pBBEP->is_awake = 1;
bbepSendCMDSequence(pBBEP, pBBEP->pInitFull);
if (pBBEP->iFlags & BBEP_SPLIT_BUFFER) {
// Send the same sequence to the second controller
pBBEP->iCSPin = pBBEP->iCS2Pin;
bbepSendCMDSequence(pBBEP, pBBEP->pInitFull);
pBBEP->iCSPin = pBBEP->iCS1Pin;
}
}
} /* bbepInitIO() */
+5
View File
@@ -1725,6 +1725,11 @@ void bbepSleep(BBEPDISP *pBBEP, int bDeep)
if (pBBEP->chip_type == BBEP_CHIP_UC81xx) {
if (pBBEP->iFlags & BBEP_7COLOR) {
bbepCMD2(pBBEP, UC8151_POFF, 0x00); // power off
if (pBBEP->iFlags & BBEP_SPLIT_BUFFER) { // dual cable EPD
pBBEP->iCSPin = pBBEP->iCS2Pin;
bbepCMD2(pBBEP, UC8151_POFF, 0x00); // second controller
pBBEP->iCSPin = pBBEP->iCS1Pin;
}
} else {
bbepCMD2(pBBEP, UC8151_CDI, 0x17); // border floating
bbepWriteCmd(pBBEP, UC8151_POFF); // power off