Skip to content

Commit

Permalink
update for AVR support
Browse files Browse the repository at this point in the history
  • Loading branch information
ZinggJM committed Sep 15, 2017
1 parent 693740e commit 8a23ca7
Show file tree
Hide file tree
Showing 18 changed files with 1,106 additions and 8,660 deletions.
443 changes: 355 additions & 88 deletions GxGDE0213B1/GxGDE0213B1.cpp

Large diffs are not rendered by default.

26 changes: 23 additions & 3 deletions GxGDE0213B1/GxGDE0213B1.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
modified by :
Version : 2.1
Version : 2.2
Support: limited, provided as example, no claim to be fit for serious use
Expand Down Expand Up @@ -92,15 +92,28 @@ class GxGDE0213B1 : public GxEPD
}
void drawBitmap(const uint8_t *bitmap, uint32_t size, int16_t mode);
void eraseDisplay(bool using_partial_update = false);
// partial update
// partial update of rectangle from buffer to screen, does not power off
void updateWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h, bool using_rotation = true);
// partial update of rectangle at (xs,ys) from buffer to screen at (xd,yd), does not power off
void updateToWindow(uint16_t xs, uint16_t ys, uint16_t xd, uint16_t yd, uint16_t w, uint16_t h, bool using_rotation = true);
// terminate cleanly updateWindow or updateToWindow before removing power or long delays
void powerDown();
// paged drawing, for limited RAM, drawCallback() is called GxGDE0213B1_PAGES times
// each call of drawCallback() should draw the same
void drawPaged(void (*drawCallback)(void));
void drawPaged(void (*drawCallback)(uint32_t), uint32_t);
void drawPaged(void (*drawCallback)(const void*), const void*);
void drawPaged(void (*drawCallback)(const void*, const void*), const void*, const void*);
// paged drawing to screen rectangle at (x,y) using partial update
void drawPagedToWindow(void (*drawCallback)(void), uint16_t x, uint16_t y, uint16_t w, uint16_t h);
void drawPagedToWindow(void (*drawCallback)(uint32_t), uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint32_t);
void drawPagedToWindow(void (*drawCallback)(const void*), uint16_t x, uint16_t y, uint16_t w, uint16_t h, const void*);
void drawPagedToWindow(void (*drawCallback)(const void*, const void*), uint16_t x, uint16_t y, uint16_t w, uint16_t h, const void*, const void*);
void drawCornerTest(uint8_t em = 0x01);
// private methods kept available public
void drawBitmapEM(const uint8_t *bitmap, uint32_t size, uint8_t em); // ram data entry mode
void drawBitmapPU(const uint8_t *bitmap, uint32_t size, uint8_t em); // partial update mode
void drawPagedPU(void (*drawCallback)(void));
private:
void _writeData(uint8_t data);
void _writeCommand(uint8_t command);
Expand All @@ -116,20 +129,27 @@ class GxGDE0213B1 : public GxEPD
void _Init_Part(uint8_t em);
void _Update_Full(void);
void _Update_Part(void);
void _rotate(uint16_t& x, uint16_t& y, uint16_t& w, uint16_t& h);
void _drawCurrentPage();
protected:
#if defined(__AVR)
uint8_t _buffer[GxGDE0213B1_PAGE_SIZE];
#else
uint8_t _buffer[GxGDE0213B1_BUFFER_SIZE];
#endif

private:
GxIO& IO;
int16_t _current_page;
bool _using_partial_mode;
uint8_t _rst;
uint8_t _busy;
static const uint8_t LUTDefault_full[];
static const uint8_t LUTDefault_part[];
static const uint8_t GDOControl[];
static const uint8_t softstart[];
static const uint8_t VCOMVol[];
static const uint8_t DummyLine[];
static const uint8_t Gatetime[];
};

#endif
Expand Down
1,278 changes: 0 additions & 1,278 deletions GxGDE0213B1_RDEM/BitmapExamples.h

This file was deleted.

Loading

0 comments on commit 8a23ca7

Please sign in to comment.