Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
GxEPD2_290_T94_V2.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: http://www.e-paper-display.com/download_detail/downloadsId=806.html
5// Panel: GDEM029T94 : https://www.good-display.com/product/360.html, Waveshare variant without partial wft in OTP
6// Controller : SSD1680 : https://www.good-display.com/companyfile/101.html
7// Display: Waveshare 2.9" b/w V2 : https://www.waveshare.com/product/displays/e-paper/2.9inch-e-paper-module.htm
8//
9// Author: Jean-Marc Zingg
10//
11// Version: see library.properties
12//
13// Library: https://github.com/ZinggJM/GxEPD2
14//
15// note: this is a driver class variant for the Waveshare V2 board with controller without partial update wft in OTP
16
17#ifndef _GxEPD2_290_T94_V2_H_
18#define _GxEPD2_290_T94_V2_H_
19
20#include "../GxEPD2_EPD.h"
21
23{
24 public:
25 // attributes
26 static const uint16_t WIDTH = 128;
27 static const uint16_t HEIGHT = 296;
29 static const bool hasColor = false;
30 static const bool hasPartialUpdate = true;
31 static const bool hasFastPartialUpdate = true;
32 static const uint16_t power_on_time = 100; // ms, e.g. 95868us
33 static const uint16_t power_off_time = 150; // ms, e.g. 140350us
34 static const uint16_t full_refresh_time = 4100; // ms, e.g. 4011934us
35 static const uint16_t partial_refresh_time = 750; // ms, e.g. 736721us
36 // constructor
37 GxEPD2_290_T94_V2(int16_t cs, int16_t dc, int16_t rst, int16_t busy);
38 // methods (virtual)
39 // Support for Bitmaps (Sprites) to Controller Buffer and to Screen
40 void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white)
41 void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white)
42 void writeScreenBufferAgain(uint8_t value = 0xFF); // init previous buffer controller memory (default white)
43 // write to controller memory, without screen refresh; x and w should be multiple of 8
44 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);
45 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);
46 void writeImagePart(const uint8_t bitmap[], 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 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);
49 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,
50 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
51 // for differential update: set current and previous buffers equal (for fast partial update to work correctly)
52 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);
53 void writeImagePartAgain(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
54 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
55 // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8
56 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);
57 // write to controller memory, with screen refresh; x and w should be multiple of 8
58 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);
59 void drawImagePart(const uint8_t bitmap[], 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 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);
62 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,
63 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
64 // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8
65 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);
66 void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen
67 void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen
68 void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
69 void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
70 private:
71 void _writeScreenBuffer(uint8_t command, uint8_t value);
72 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);
73 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,
74 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
75 void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
76 void _PowerOn();
77 void _PowerOff();
78 void _InitDisplay();
79 void _Init_Full();
80 void _Init_Part();
81 void _Update_Full();
82 void _Update_Part();
83 private:
84 static const unsigned char lut_partial[];
85};
86
87#endif
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 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 writeScreenBuffer(uint8_t value=0xFF)
static const GxEPD2::Panel panel
static const uint16_t WIDTH
static const uint16_t power_off_time
GxEPD2_290_T94_V2(int16_t cs, int16_t dc, int16_t rst, int16_t busy)
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)
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 HEIGHT
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)
static const bool hasFastPartialUpdate
void refresh(bool partial_update_mode=false)
static const bool hasPartialUpdate
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)
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)
static const uint16_t power_on_time
void writeScreenBufferAgain(uint8_t value=0xFF)
static const bool hasColor
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 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)
static const uint16_t full_refresh_time
static const uint16_t partial_refresh_time
Panel
Definition GxEPD2.h:37
@ GDEM029T94
Definition GxEPD2.h:61