Skip to content

Commit 1a6b012

Browse files
committed
Merge branch 'inkplate-library-restructure' of https://github.com/SolderedElectronics/Inkplate-Arduino-library into inkplate-library-restructure
2 parents ebcbc7b + a8f8a77 commit 1a6b012

File tree

14 files changed

+2199
-1971
lines changed

14 files changed

+2199
-1971
lines changed

src/Inkplate.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
//--------------------------USER FUNCTIONS--------------------------------------------
2323
Inkplate::Inkplate(uint8_t mode) : Adafruit_GFX(E_INK_WIDTH, E_INK_HEIGHT), Graphics(E_INK_WIDTH, E_INK_HEIGHT)
2424
{
25-
_mode=mode;
25+
_mode = mode;
2626
}
2727

2828
void Inkplate::begin()
@@ -39,15 +39,14 @@ void Inkplate::begin()
3939
// Init low level driver for EPD.
4040
initDriver(this);
4141

42-
//Forward the display mode to the EPD driver
42+
// Forward the display mode to the EPD driver
4343
selectDisplayMode(_mode);
4444

4545
// Clean frame buffers.
4646
clearDisplay();
4747

4848
// Block multiple inits.
4949
_beginDone = 1;
50-
5150
}
5251
void Inkplate::writePixel(int16_t x, int16_t y, uint16_t color)
5352
{
@@ -92,6 +91,8 @@ void Inkplate::writePixel(int16_t x, int16_t y, uint16_t color)
9291

9392
void Inkplate::drawPixel(int16_t x, int16_t y, uint16_t color)
9493
{
95-
writePixel(x,y,color);
94+
writePixel(x, y, color);
9695
}
97-
void Inkplate::setRotation(uint8_t r){}
96+
void Inkplate::setRotation(uint8_t r)
97+
{
98+
}

src/Inkplate.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,22 @@
2121
#define __INKPLATE_H__
2222

2323
#include "Arduino.h"
24-
#include "Wire.h"
2524
#include "SPI.h"
25+
#include "Wire.h"
2626
#include "graphics/Graphics.h"
2727
#include "system/NetworkController/NetworkController.h"
2828
#include "system/defines.h"
2929
#include "system/InkplateBoards.h"
3030
#include "boardSelect.h"
3131

32-
3332
class Inkplate : public Graphics, public InkplateBoardClass, public NetworkController
3433
{
3534
public:
3635
Inkplate(uint8_t mode);
3736
void begin();
3837
void drawPixel(int16_t x, int16_t y, uint16_t color);
3938
void setRotation(uint8_t r);
40-
39+
4140

4241
protected:
4342
private:

src/boards/Inkplate10/Inkplate10Driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int EPDDriver::initDriver(Inkplate *_inkplatePtr)
5858
pinLUT[i] = ((i & B00000011) << 4) | (((i & B00001100) >> 2) << 18) | (((i & B00010000) >> 4) << 23) |
5959
(((i & B11100000) >> 5) << 25);
6060

61-
for(int i = 0; i < 15; i++)
61+
for (int i = 0; i < 15; i++)
6262
{
6363
externalIO.pinMode( i, OUTPUT);
6464
externalIO.digitalWrite( i, LOW);
@@ -536,7 +536,7 @@ int EPDDriver::einkOn()
536536
OE_CLEAR;
537537
PWRUP_SET;
538538
setPanelState(1);
539-
539+
540540
unsigned long timer = millis();
541541
do
542542
{
@@ -615,7 +615,7 @@ uint8_t EPDDriver::getPanelState()
615615
}
616616
void EPDDriver::setPanelState(uint8_t state)
617617
{
618-
_panelState=state;
618+
_panelState = state;
619619
}
620620

621621
/**

src/boards/Inkplate10/Inkplate10Driver.h

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ class Inkplate;
3535

3636
class EPDDriver:public RTC
3737
{
38-
public:
39-
int initDriver(Inkplate *_inkplatePtr);
40-
void display(bool _leaveOn = 0);
41-
void selectDisplayMode(uint8_t displayMode);
42-
void clearDisplay();
43-
uint32_t partialUpdate(bool _forced = false, bool leaveOn = false);
44-
void setFullUpdateThreshold(uint16_t _numberOfPartialUpdates);
45-
uint8_t getDisplayMode();
38+
public:
39+
int initDriver(Inkplate *_inkplatePtr);
40+
void display(bool _leaveOn = 0);
41+
void selectDisplayMode(uint8_t displayMode);
42+
void clearDisplay();
43+
uint32_t partialUpdate(bool _forced = false, bool leaveOn = false);
44+
void setFullUpdateThreshold(uint16_t _numberOfPartialUpdates);
45+
uint8_t getDisplayMode();
4646

4747

4848
void setSdCardOk(int16_t s);
@@ -60,8 +60,8 @@ class EPDDriver:public RTC
6060
IOExpander internalIO;
6161
IOExpander externalIO;
6262

63-
uint8_t _beginDone = 0;
64-
uint8_t _displayMode;
63+
uint8_t _beginDone = 0;
64+
uint8_t _displayMode;
6565

6666

6767
uint32_t pinLUT[256];
@@ -78,23 +78,22 @@ class EPDDriver:public RTC
7878
int16_t _sdCardOk = 0;
7979

8080

81-
82-
private:
83-
void calculateLUTs();
84-
uint8_t readPowerGood();
85-
void pinsAsOutputs();
86-
int einkOn();
87-
void einkOff();
88-
void display1b(bool _leaveOn);
89-
void display3b(bool _leaveOn);
90-
void pinsZstate();
91-
uint8_t getPanelState();
92-
void setPanelState(uint8_t state);
93-
void clean(uint8_t c, uint8_t rep);
94-
void vscan_start();
95-
void hscan_start(uint32_t _d);
96-
void vscan_end();
97-
uint8_t _panelState = 0;
81+
private:
82+
void calculateLUTs();
83+
uint8_t readPowerGood();
84+
void pinsAsOutputs();
85+
int einkOn();
86+
void einkOff();
87+
void display1b(bool _leaveOn);
88+
void display3b(bool _leaveOn);
89+
void pinsZstate();
90+
uint8_t getPanelState();
91+
void setPanelState(uint8_t state);
92+
void clean(uint8_t c, uint8_t rep);
93+
void vscan_start();
94+
void hscan_start(uint32_t _d);
95+
void vscan_end();
96+
uint8_t _panelState = 0;
9897
};
9998

10099
#endif

0 commit comments

Comments
 (0)