diff --git a/src/bb_epaper.cpp b/src/bb_epaper.cpp index 6c6aa08..e8f817a 100644 --- a/src/bb_epaper.cpp +++ b/src/bb_epaper.cpp @@ -47,14 +47,18 @@ void delay(int); // return _bbep.iTimeout; //} +BBEPAPER::BBEPAPER(int iPanel) +{ + memset(&_bbep, 0, sizeof(_bbep)); + _bbep.iFG = BBEP_BLACK; + bbepSetPanelType(&_bbep, iPanel); +} + void BBEPAPER::setAddrWindow(int x, int y, int w, int h) { bbepSetAddrWindow(&_bbep, x, y, w, h); } -int BBEPAPER::setPanelType(int iPanel) -{ - return bbepSetPanelType(&_bbep, iPanel); -} + void BBEPAPER::initIO(int iDC, int iReset, int iBusy, int iCS, int iMOSI, int iSCLK, uint32_t u32Speed) { _bbep.iCSPin = iCS; diff --git a/src/bb_epaper.h b/src/bb_epaper.h index 5aa69ed..369deff 100644 --- a/src/bb_epaper.h +++ b/src/bb_epaper.h @@ -278,9 +278,8 @@ class BBEPAPER #endif // _LINUX_ { public: - BBEPAPER() { memset(&_bbep, 0, sizeof(_bbep)); _bbep.iFG = BBEP_BLACK; _bbep.type = EPD_PANEL_UNDEFINED;} + BBEPAPER(int iPanel); void setAddrWindow(int x, int y, int w, int h); - int setPanelType(int iPanel); void initIO(int iDC, int iReset, int iBusy, int iCS = SS, int iMOSI = MOSI, int iSCLK = SCK, uint32_t u32Speed = 8000000); int writePlane(int iPlane = PLANE_DUPLICATE); void startWrite(int iPlane);