From 5d15ce188c6f9d0ad06f3a426f4a05ebaa0f7e92 Mon Sep 17 00:00:00 2001 From: Laurence Bank Date: Sun, 22 Sep 2024 20:15:43 +0100 Subject: [PATCH] changed class constructor for simpler operation --- src/bb_epaper.cpp | 12 ++++++++---- src/bb_epaper.h | 3 +-- 2 files changed, 9 insertions(+), 6 deletions(-) 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);