Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
GxEPD2_213_Z19c.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: these e-papers require 3.3V supply AND data lines!
3//
4// based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html
5// Controller: UC8151D : https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf
6//
7// Author: Jean-Marc Zingg
8//
9// Version: see library.properties
10//
11// Library: https://github.com/ZinggJM/GxEPD2
12
13#ifndef _GxEPD2_213_Z19c_H_
14#define _GxEPD2_213_Z19c_H_
15
16#include "../GxEPD2_EPD.h"
17
19{
20 public:
21 // attributes
22 static const uint16_t WIDTH = 104;
23 static const uint16_t WIDTH_VISIBLE = WIDTH;
24 static const uint16_t HEIGHT = 212;
26 static const bool hasColor = true;
27 static const bool hasPartialUpdate = true;
28 static const bool usePartialUpdateWindow = false; // needs be false, controller issue
29 static const bool hasFastPartialUpdate = false;
30 static const uint16_t power_on_time = 100; // ms, e.g. 79414us
31 static const uint16_t power_off_time = 50; // ms, e.g. 39140us
32 static const uint16_t full_refresh_time = 17000; // ms, e.g. 16788187us
33 static const uint16_t partial_refresh_time = 17000; // ms, e.g. 16788187us
34 // constructor
35 GxEPD2_213_Z19c(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 clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen
40 void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white)
41 void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory
42 // write to controller memory, without screen refresh; x and w should be multiple of 8
43 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);
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 writeImagePrevious(const uint8_t* black, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
48 void writeImageNew(const uint8_t* black, 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 void writeImagePartPrevious(const uint8_t* black, 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 void writeImagePartNew(const uint8_t* black, 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 refresh_bw(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen, bw differential
69 void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
70 void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
71 private:
72 void _writeScreenBuffer(uint8_t value);
73 void _writeImage(uint8_t command, const uint8_t* bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm);
74 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,
75 int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm);
76 void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
77 void _PowerOn();
78 void _PowerOff();
79 void _InitDisplay();
80 void _Init_Full();
81 void _Init_Part();
82 void _Update_Full();
83 void _Update_Part();
84 private:
85 static const unsigned char lut_20_vcomDC_partial[];
86 static const unsigned char lut_21_ww_partial[];
87 static const unsigned char lut_22_bw_partial[];
88 static const unsigned char lut_23_wb_partial[];
89 static const unsigned char lut_24_bb_partial[];
90};
91
92#endif
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 writeImageNew(const uint8_t *black, 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
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 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)
GxEPD2_213_Z19c(int16_t cs, int16_t dc, int16_t rst, int16_t busy)
static const uint16_t power_off_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)
void writeImagePartNew(const uint8_t *black, 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)
static const bool hasFastPartialUpdate
static const uint16_t partial_refresh_time
static const bool hasPartialUpdate
static const uint16_t WIDTH
void writeImagePrevious(const uint8_t *black, 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
void writeImagePartPrevious(const uint8_t *black, 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)
static const uint16_t power_on_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 refresh_bw(int16_t x, int16_t y, int16_t w, int16_t h)
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 HEIGHT
static const bool usePartialUpdateWindow
static const uint16_t WIDTH_VISIBLE
void refresh(bool partial_update_mode=false)
Panel
Definition GxEPD2.h:37
@ GDEW0213Z19
Definition GxEPD2.h:83