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