Merge pull request #12 from jonasschnelli/2025/05/isbusy

Add isBusy function
This commit is contained in:
Larry Bank
2025-05-29 23:20:48 +01:00
committed by GitHub
3 changed files with 17 additions and 0 deletions
+12
View File
@@ -1617,6 +1617,18 @@ void bbepWaitBusy(BBEPDISP *pBBEP)
}
} /* bbepWaitBusy() */
//
// Return if panel is busy
//
bool bbepIsBusy(BBEPDISP *pBBEP)
{
if (!pBBEP) return false;
if (pBBEP->iBUSYPin == 0xff) return false;
delay(10); // give time for the busy status to be valid
uint8_t busy_idle = (pBBEP->chip_type == BBEP_CHIP_UC81xx) ? HIGH : LOW;
delay(1); // some panels need a short delay before testing the BUSY line
return (digitalRead(pBBEP->iBUSYPin) != busy_idle);
} /* bbepWaitBusy() */
//
// Toggle the reset line to wake up the eink from deep sleep
//
void bbepWakeUp(BBEPDISP *pBBEP)
+4
View File
@@ -517,6 +517,10 @@ void BBEPAPER::wait(bool bQuick)
{
bbepWaitBusy(&_bbep);
}
bool BBEPAPER::isBusy(void)
{
return bbepIsBusy(&_bbep);
}
void BBEPAPER::drawString(const char *pText, int x, int y)
{
if (_bbep.pFont) {
+1
View File
@@ -474,6 +474,7 @@ class BBEPAPER
void stretchAndSmooth(uint8_t *pSrc, uint8_t *pDest, int w, int h, int iSmoothType);
void sleep(int bDeep);
void wait(bool bQuick = false);
bool isBusy(void);
void drawString(const char *pText, int x, int y);
void setPlane(int iPlane);
int getPlane(void);