Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
GxEPD2_270c.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: IL91874 : http://www.e-paper-display.com/download_detail/downloadsId=539.html
6//
7// Author: Jean-Marc Zingg
8//
9// Version: see library.properties
10//
11// Library: https://github.com/ZinggJM/GxEPD2
12
13#ifndef _GxEPD2_270c_H_
14#define _GxEPD2_270c_H_
15
16#include "../GxEPD2_EPD.h"
17
18class GxEPD2_270c : public GxEPD2_EPD
19{
20 public:
21 // attributes
22 static const uint16_t WIDTH = 176;
23 static const uint16_t WIDTH_VISIBLE = WIDTH;
24 static const uint16_t HEIGHT = 264;
26 static const bool hasColor = true;
27 static const bool hasPartialUpdate = true;
28 static const bool hasFastPartialUpdate = false;
29 static const uint16_t power_on_time = 20; // ms, e.g. 101361us
30 static const uint16_t power_off_time = 40; // ms, e.g. 29419us
31 static const uint16_t full_refresh_time = 16000; // ms, e.g. 15524093us
32 static const uint16_t partial_refresh_time = 16000; // ms, e.g. 15524093us
33 // constructor
34 GxEPD2_270c(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 clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen
39 void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white)
40 void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory
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 writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
44 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
45 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);
46 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,
47 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
48 // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8
49 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);
50 // write to controller memory, with screen refresh; x and w should be multiple of 8
51 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);
52 void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
53 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
54 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);
55 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,
56 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
57 // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8
58 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);
59 void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen
60 void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen
61 void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
62 void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
63 private:
64 void _writeScreenBuffer(uint8_t value);
65 void _setPartialRamArea_270c(uint8_t cmd, uint16_t x, uint16_t y, uint16_t w, uint16_t h);
66 void _PowerOn();
67 void _PowerOff();
68 void _InitDisplay();
69 void _Init_Full();
70 void _Init_Part();
71 void _Update_Full();
72 void _Update_Part();
73 private:
74 static const uint8_t lut_20_vcomDC[];
75 static const uint8_t lut_21[];
76 static const uint8_t lut_22_red[];
77 static const uint8_t lut_23_white[];
78 static const uint8_t lut_24_black[];
79};
80
81#endif
static const bool hasFastPartialUpdate
Definition GxEPD2_270c.h:28
void writeScreenBuffer(uint8_t value=0xFF)
static const uint16_t HEIGHT
Definition GxEPD2_270c.h:24
static const uint16_t power_off_time
Definition GxEPD2_270c.h:30
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 GxEPD2::Panel panel
Definition GxEPD2_270c.h:25
static const uint16_t power_on_time
Definition GxEPD2_270c.h:29
static const uint16_t full_refresh_time
Definition GxEPD2_270c.h:31
void refresh(bool partial_update_mode=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 hasPartialUpdate
Definition GxEPD2_270c.h:27
static const uint16_t WIDTH_VISIBLE
Definition GxEPD2_270c.h:23
GxEPD2_270c(int16_t cs, int16_t dc, int16_t rst, int16_t busy)
static const uint16_t WIDTH
Definition GxEPD2_270c.h:22
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)
static const bool hasColor
Definition GxEPD2_270c.h:26
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 uint16_t partial_refresh_time
Definition GxEPD2_270c.h:32
void clearScreen(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)
Panel
Definition GxEPD2.h:37
@ GDEW027C44
Definition GxEPD2.h:89