Added virtual (pure memory) display support

This commit is contained in:
Laurence Bank
2024-10-27 19:30:34 +00:00
parent 924854be26
commit f5e2a5aeda
3 changed files with 23 additions and 1 deletions
+14
View File
@@ -1081,6 +1081,20 @@ int bbepSetPanelType(BBEPDISP *pBBEP, int iPanel)
return BBEP_SUCCESS;
} /* bbepSetPanelType() */
int bbepCreateVirtual(BBEPDISP *pBBEP, int iWidth, int iHeight, int iFlags)
{
if (pBBEP) {
memset(pBBEP, 0, sizeof(BBEPDISP));
pBBEP->native_width = pBBEP->width = iWidth;
pBBEP->native_height = pBBEP->height = iHeight;
pBBEP->iFlags = iFlags;
pBBEP->chip_type = BBEP_CHIP_NONE;
return BBEP_SUCCESS;
} else {
return BBEP_ERROR_BAD_PARAMETER;
}
}
//
// Toggle the reset line to wake up the eink from deep sleep
//
+7 -1
View File
@@ -105,7 +105,13 @@ int BBEPAPER::refresh(int iMode, bool bWait)
//{
// _bbep.iFlags = iFlags;
//}
//
// Create a RAM-only virtual display
//
int BBEPAPER::createVirtual(int iWidth, int iHeight, int iFlags)
{
return bbepCreateVirtual(&_bbep, iWidth, iHeight, iFlags);
}
void BBEPAPER::setBuffer(uint8_t *pBuffer)
{
_bbep.ucScreen = pBuffer;
+2
View File
@@ -58,6 +58,7 @@ enum {
BBEP_CHIP_NOT_DEFINED = 0,
BBEP_CHIP_SSD16xx,
BBEP_CHIP_UC81xx,
BBEP_CHIP_NONE, // for virtual display
BBEP_CHIP_COUNT
};
@@ -285,6 +286,7 @@ class BBEPAPER
{
public:
BBEPAPER(int iPanel);
int createVirtual(int iWidth, int iHeight, int iFlags);
void setAddrWindow(int x, int y, int w, int h);
#ifdef ARDUINO
void initIO(int iDC, int iReset, int iBusy, int iCS = SS, int iMOSI = MOSI, int iSCLK = SCK, uint32_t u32Speed = 8000000);