mirror of
https://github.com/usetrmnl/bb_epaper.git
synced 2026-04-29 13:43:26 -07:00
Merge pull request #12 from jonasschnelli/2025/05/isbusy
Add isBusy function
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user