Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
GxEPD2_260.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_detail/downloadsId=623.html
5// Panel: GDEW026T0 : http://www.e-paper-display.com/products_detail/productId=398.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_260_H_
15#define _GxEPD2_260_H_
16
17#include "../GxEPD2_EPD.h"
18
19class GxEPD2_260 : public GxEPD2_EPD
20{
21 public:
22 // attributes
23 static const uint16_t WIDTH = 152;
24 static const uint16_t HEIGHT = 296;
26 static const bool hasColor = false;
27 static const bool hasPartialUpdate = true;
28 static const bool usePartialUpdateWindow = false; // set false for better image
29 static const bool hasFastPartialUpdate = true;
30 static const uint16_t power_on_time = 60; // ms, e.g. 58296us
31 static const uint16_t power_off_time = 20; // ms, e.g. 19748us
32 static const uint16_t full_refresh_time = 1600; // ms, e.g. 1543246us
33 static const uint16_t partial_refresh_time = 1300; // ms, e.g. 1228991us
34 // constructor
35 GxEPD2_260(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 // write to controller memory, without screen refresh; x and w should be multiple of 8
41 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);
42 void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
43 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
44 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);
45 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,
46 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
47 // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8
48 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);
49 // write to controller memory, with screen refresh; x and w should be multiple of 8
50 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);
51 void drawImagePart(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 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);
54 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,
55 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
56 // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8
57 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);
58 void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen
59 void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen
60 void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
61 void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
62 private:
63 void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
64 void _PowerOn();
65 void _PowerOff();
66 void _InitDisplay();
67 void _Init_Full();
68 void _Init_Part();
69 void _Update_Full();
70 void _Update_Part();
71 private:
72 static const unsigned char lut_20_vcom0_full[];
73 static const unsigned char lut_21_ww_full[];
74 static const unsigned char lut_22_bw_full[];
75 static const unsigned char lut_23_wb_full[];
76 static const unsigned char lut_24_bb_full[];
77 static const unsigned char lut_20_vcom0_partial[];
78 static const unsigned char lut_21_ww_partial[];
79 static const unsigned char lut_22_bw_partial[];
80 static const unsigned char lut_23_wb_partial[];
81 static const unsigned char lut_24_bb_partial[];
82};
83
84#endif
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)
GxEPD2_260(int16_t cs, int16_t dc, int16_t rst, int16_t busy)
static const GxEPD2::Panel panel
Definition GxEPD2_260.h:25
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
Definition GxEPD2_260.h:28
static const bool hasPartialUpdate
Definition GxEPD2_260.h:27
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 power_off_time
Definition GxEPD2_260.h:31
static const bool hasFastPartialUpdate
Definition GxEPD2_260.h:29
void refresh(bool partial_update_mode=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 hibernate()
static const uint16_t power_on_time
Definition GxEPD2_260.h:30
void writeScreenBuffer(uint8_t value=0xFF)
static const uint16_t WIDTH
Definition GxEPD2_260.h:23
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 powerOff()
static const uint16_t HEIGHT
Definition GxEPD2_260.h:24
static const uint16_t full_refresh_time
Definition GxEPD2_260.h:32
void clearScreen(uint8_t value=0xFF)
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 bool hasColor
Definition GxEPD2_260.h:26
static const uint16_t partial_refresh_time
Definition GxEPD2_260.h:33
Panel
Definition GxEPD2.h:37
@ GDEW026T0
Definition GxEPD2.h:53