Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
GxEPD2_1160_T91.h
Go to the documentation of this file.
1// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare.
2// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines!
3//
4// based on Demo Example from Good Display, available here: https://www.good-display.com/comp/xcompanyFile/downloadNew.do?appId=24&fid=553&id=374
5// Panel: GDEH116T91 : https://www.good-display.com/product/246.html
6// Controller : SSD1677 : https://v4.cecdn.yun300.cn/100001_1909185148/SSD1677.pdf
7//
8// Author: Jean-Marc Zingg
9//
10// Version: see library.properties
11//
12// Library: https://github.com/ZinggJM/GxEPD2
13
14#ifndef _GxEPD2_1160_T91_H_
15#define _GxEPD2_1160_T91_H_
16
17#include "../GxEPD2_EPD.h"
18
20{
21 public:
22 // attributes
23 static const uint16_t WIDTH = 960;
24 static const uint16_t HEIGHT = 640;
26 static const bool hasColor = false;
27 static const bool hasPartialUpdate = true;
28 static const bool hasFastPartialUpdate = true; // set false to disable differential refresh
29 static const uint16_t power_on_time = 100; // ms, e.g. 86001us
30 static const uint16_t power_off_time = 150; // ms, e.g. 140001us
31 static const uint16_t full_refresh_time = 6200; // ms, e.g. 6180001us
32 static const uint16_t partial_refresh_time = 700; // ms, e.g. 643732us, for hasFastPartialUpdate = true
33 // constructor
34 GxEPD2_1160_T91(int16_t cs, int16_t dc, int16_t rst, int16_t busy);
35 // methods (virtual)
36 // Support for Bitmaps (Sprites) to Controller Buffer and to Screen
37 void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white)
38 void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white)
39 void writeScreenBufferAgain(uint8_t value = 0xFF); // init previous buffer controller memory (default white)
40 // write to controller memory, without screen refresh; x and w should be multiple of 8
41 void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
42 void writeImageForFullRefresh(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
43 void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
44 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
45 void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
46 void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
47 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
48 // for differential update: set current and previous buffers equal (for fast partial update to work correctly)
49 void writeImageAgain(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
50 void writeImagePartAgain(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
51 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
52 // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8
53 void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
54 // write to controller memory, with screen refresh; x and w should be multiple of 8
55 void drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
56 void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
57 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
58 void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
59 void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
60 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
61 // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8
62 void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
63 void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen
64 void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen
65 void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
66 void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
67 private:
68 void _writeScreenBuffer(uint8_t command, uint8_t value);
69 void _writeImage(uint8_t command, const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
70 void _writeImagePart(uint8_t command, const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
71 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
72 void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
73 void _PowerOn();
74 void _PowerOff();
75 void _InitDisplay();
76 void _Init_Full();
77 void _Init_Part();
78 void _Update_Full();
79 void _Update_Part();
80 private:
81 static const uint8_t lut_partial[];
82};
83
84#endif
void writeImageAgain(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
static const GxEPD2::Panel panel
static const bool hasFastPartialUpdate
void drawNative(const uint8_t *data1, const uint8_t *data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
GxEPD2_1160_T91(int16_t cs, int16_t dc, int16_t rst, int16_t busy)
static const uint16_t power_on_time
static const uint16_t HEIGHT
static const bool hasColor
void writeScreenBufferAgain(uint8_t value=0xFF)
static const uint16_t power_off_time
static const uint16_t WIDTH
static const uint16_t partial_refresh_time
void drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
void clearScreen(uint8_t value=0xFF)
void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
void writeImageForFullRefresh(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
static const uint16_t full_refresh_time
void writeImagePartAgain(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
static const bool hasPartialUpdate
void writeNative(const uint8_t *data1, const uint8_t *data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
void writeScreenBuffer(uint8_t value=0xFF)
void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
void refresh(bool partial_update_mode=false)
Panel
Definition GxEPD2.h:37
@ GDEH116T91
Definition GxEPD2.h:73