Skip to content

Commit

Permalink
Added fastRefresh mode for 2.9" display
Browse files Browse the repository at this point in the history
  • Loading branch information
squix78 committed Dec 16, 2017
1 parent 4e0852b commit c8a5683
Show file tree
Hide file tree
Showing 18 changed files with 639 additions and 23 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Mini Grafx",
"version": "0.0.15",
"version": "0.0.16",
"keywords": "embedded, graphics, tft, oled, e-paper",
"description": "A generic graphics library containing several drivers for TFT, OLED and e-paper displays",
"repository":
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Mini Grafx
version=0.0.15
version=0.0.16
author=Daniel Eichhorn
maintainer=Daniel Eichhorn <[email protected]>
sentence=Graphics Library for embedded devices with a framebuffer
Expand Down
2 changes: 2 additions & 0 deletions src/DisplayDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class DisplayDriver {
virtual void setRotation(uint8_t r);
virtual void init() = 0;
virtual void writeBuffer(uint8_t *buffer, uint8_t bitsPerPixel, uint16_t *palette) = 0;
virtual void setFastRefresh(boolean isEnabled) = 0;

int16_t height(void) const;
int16_t width(void) const;
Expand All @@ -60,6 +61,7 @@ class DisplayDriver {
WIDTH, HEIGHT; // This is the 'raw' display w/h - never changes
int16_t _width, _height;
uint8_t rotation;
boolean isFastRefreshEnabled = false;

};

Expand Down
6 changes: 5 additions & 1 deletion src/EPD_WaveShare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void EPD_WaveShare::writeBuffer(uint8_t *buffer, uint8_t bitsPerPixel, uint16_t
EPD_SetRamPointer(0x00,(yDot-1)%256,(yDot-1)/256); // set ram
//Serial.println(">>>>>>------start send display data!!---------<<<<<<<");
int i = 0,j = 0;
if(XSize%8 != 0){
if(XSize % 8 != 0){
XSize = XSize+(8-XSize%8);
}
XSize = XSize/8;
Expand Down Expand Up @@ -198,6 +198,10 @@ void EPD_WaveShare::writeBuffer(uint8_t *buffer, uint8_t bitsPerPixel, uint16_t

}

void EPD_WaveShare::setFastRefresh(boolean isFastRefreshEnabled) {
// Not enabled at the moment
}

uint8_t EPD_WaveShare::getPixel(uint8_t *buffer, uint16_t x, uint16_t y) {
uint8_t bitsPerPixel = 1;
uint8_t bitMask = (1 << bitsPerPixel) - 1;
Expand Down
1 change: 1 addition & 0 deletions src/EPD_WaveShare.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class EPD_WaveShare : public DisplayDriver {
void EPD_Dis_Full(unsigned char *DisBuffer,unsigned char Label);
void EPD_Dis_Part(unsigned char xStart,unsigned char xEnd,unsigned long yStart,unsigned long yEnd,unsigned char *DisBuffer,unsigned char Label);
void Dis_Char(char acsii,char size,char mode,char next,unsigned char *buffer);
void setFastRefresh(boolean isFastRefreshEnabled);

void driver_delay_xms(unsigned long xms);
void SPI_Write(unsigned char value);
Expand Down
Loading

0 comments on commit c8a5683

Please sign in to comment.