mirror of
https://github.com/usetrmnl/bb_epaper.git
synced 2026-04-29 13:43:26 -07:00
Added virtual (pure memory) display support
This commit is contained in:
@@ -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
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user