mirror of
https://github.com/usetrmnl/bb_epaper.git
synced 2026-04-29 13:43:26 -07:00
Fix wake sequence for Spectra6
This commit is contained in:
@@ -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
@@ -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__
|
||||
|
||||
@@ -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() */
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user