Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
GxEPD2_154_T8.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: GDEW0154T8 : http://www.e-paper-display.com/products_detail/productId=345.html
6// Controller: IL0373 : http://www.e-paper-display.com/download_detail/downloadsId=535.html
7//
8// Author: Jean-Marc Zingg
9//
10// Version: see library.properties
11//
12// Library: https://github.com/ZinggJM/GxEPD2
13
14#ifndef _GxEPD2_154_T8_H_
15#define _GxEPD2_154_T8_H_
16
17#include "../GxEPD2_EPD.h"
18
20{
21 public:
22 // attributes
23 static const uint16_t WIDTH = 152;
24 static const uint16_t HEIGHT = 152;
26 static const bool hasColor = false;
27 static const bool hasPartialUpdate = true;
28 static const bool hasFastPartialUpdate = true;
29 static const uint16_t power_on_time = 60; // ms, e.g. 54962us
30 static const uint16_t power_off_time = 20; // ms, e.g. 19339us
31 static const uint16_t full_refresh_time = 1600; // ms, e.g. 1525624us
32 static const uint16_t partial_refresh_time = 350; // ms, e.g. 349355us
33 // constructor
34 GxEPD2_154_T8(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 // write to controller memory, without screen refresh; x and w should be multiple of 8
40 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);
41 void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
42 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
43 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);
44 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,
45 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
46 // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8
47 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);
48 // write to controller memory, with screen refresh; x and w should be multiple of 8
49 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);
50 void drawImagePart(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 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);
53 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,
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, with screen refresh; x and w should be multiple of 8
56 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);
57 void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen
58 void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen
59 void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
60 void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
61 private:
62 void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
63 void _PowerOn();
64 void _PowerOff();
65 void _InitDisplay();
66 void _Init_Full();
67 void _Init_Part();
68 void _Update_Full();
69 void _Update_Part();
70 private:
71 static const unsigned char lut_20_vcomDC[];
72 static const unsigned char lut_21_ww[];
73 static const unsigned char lut_22_bw[];
74 static const unsigned char lut_23_wb[];
75 static const unsigned char lut_24_bb[];
76 static const unsigned char lut_20_vcomDC_partial[];
77 static const unsigned char lut_21_ww_partial[];
78 static const unsigned char lut_22_bw_partial[];
79 static const unsigned char lut_23_wb_partial[];
80 static const unsigned char lut_24_bb_partial[];
81};
82
83#endif
static const bool hasColor
GxEPD2_154_T8(int16_t cs, int16_t dc, int16_t rst, int16_t busy)
void writeScreenBuffer(uint8_t value=0xFF)
static const uint16_t HEIGHT
static const uint16_t full_refresh_time
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 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 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 partial_refresh_time
void clearScreen(uint8_t value=0xFF)
static const uint16_t power_on_time
static const GxEPD2::Panel panel
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 refresh(bool partial_update_mode=false)
static const uint16_t power_off_time
static const bool hasFastPartialUpdate
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 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 WIDTH
Panel
Definition GxEPD2.h:37
@ GDEW0154T8
Definition GxEPD2.h:42