Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
GxEPD2_420c_Z21.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: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html
5// Panel: GDEQ042Z21 : https://www.good-display.com/product/395.html
6// Controller: UC8276 : no link available currently, see https://www.good-display.com/companyfile/5/
7//
8// Author: Jean-Marc Zingg
9//
10// Version: see library.properties
11//
12// Library: https://github.com/ZinggJM/GxEPD2
13
14#ifndef _GxEPD2_420c_Z21_H_
15#define _GxEPD2_420c_Z21_H_
16
17#include "../GxEPD2_EPD.h"
18
20{
21 public:
22 // attributes
23 static const uint16_t WIDTH = 400;
24 static const uint16_t WIDTH_VISIBLE = WIDTH;
25 static const uint16_t HEIGHT = 300;
27 static const bool hasColor = true;
28 static const bool hasPartialUpdate = true;
29 static const bool usePartialUpdateWindow = true; // works fine on this panel
30 static const bool hasFastPartialUpdate = false;
31 static const uint16_t power_on_time = 50; // ms, e.g. 42190us
32 static const uint16_t power_off_time = 50; // ms, e.g. 39688us
33 static const uint16_t full_refresh_time = 16000; // ms, e.g. 15171828us
34 static const uint16_t partial_refresh_time = 16000; // ms, e.g. 15171828us
35 // constructor
36 GxEPD2_420c_Z21(int16_t cs, int16_t dc, int16_t rst, int16_t busy);
37 // methods (virtual)
38 // Support for Bitmaps (Sprites) to Controller Buffer and to Screen
39 void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white)
40 void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen
41 void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white)
42 void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory
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 writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
46 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
47 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);
48 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,
49 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
50 // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8
51 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);
52 // write to controller memory, with screen refresh; x and w should be multiple of 8
53 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);
54 void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
55 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
56 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);
57 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,
58 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
59 // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8
60 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);
61 void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen
62 void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen
63 void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
64 void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
65 private:
66 void _writeScreenBuffer(uint8_t value);
67 void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
68 void _PowerOn();
69 void _PowerOff();
70 void _InitDisplay();
71 void _Init_Full();
72 void _Init_Part();
73 void _Update_Full();
74 void _Update_Part();
75};
76
77#endif
static const bool hasPartialUpdate
static const uint16_t WIDTH
static const uint16_t power_off_time
static const uint16_t full_refresh_time
static const GxEPD2::Panel panel
static const bool hasFastPartialUpdate
void refresh(bool partial_update_mode=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)
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 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 bool hasColor
void clearScreen(uint8_t value=0xFF)
static const uint16_t power_on_time
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 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 usePartialUpdateWindow
static const uint16_t WIDTH_VISIBLE
static const uint16_t partial_refresh_time
static const uint16_t HEIGHT
GxEPD2_420c_Z21(int16_t cs, int16_t dc, int16_t rst, int16_t busy)
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)
Panel
Definition GxEPD2.h:37
@ GDEQ042Z21
Definition GxEPD2.h:91