Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
GxEPD2_270.cpp
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#include "GxEPD2_270.h"
14
15GxEPD2_270::GxEPD2_270(int16_t cs, int16_t dc, int16_t rst, int16_t busy) :
16 GxEPD2_EPD(cs, dc, rst, busy, LOW, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate)
17{
18}
19
20void GxEPD2_270::clearScreen(uint8_t value)
21{
22 writeScreenBuffer(value);
23 refresh(true);
25}
26
28{
29 _initial_write = false; // initial full screen buffer clean done
30 if (!_using_partial_mode) _Init_Part();
31 _writeCommand(0x13); // set current
32 for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++)
33 {
34 _writeData(value);
35 }
36 if (_initial_refresh) writeScreenBufferAgain(value); // init "old data"
37}
38
40{
41 if (!_using_partial_mode) _Init_Part();
42 _setPartialRamArea(0x14, 0, 0, WIDTH, HEIGHT);
43 for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++)
44 {
45 _writeData(value);
46 }
47}
48
49void GxEPD2_270::writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
50{
51 _writeImage(0x15, bitmap, x, y, w, h, invert, mirror_y, pgm);
52}
53
54void GxEPD2_270::writeImageAgain(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
55{
56 _writeImage(0x14, bitmap, x, y, w, h, invert, mirror_y, pgm);
57}
58
59void GxEPD2_270::_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)
60{
61 if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
62 delay(1); // yield() to avoid WDT on ESP8266 and ESP32
63 int16_t wb = (w + 7) / 8; // width bytes, bitmaps are padded
64 x -= x % 8; // byte boundary
65 w = wb * 8; // byte boundary
66 int16_t x1 = x < 0 ? 0 : x; // limit
67 int16_t y1 = y < 0 ? 0 : y; // limit
68 int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit
69 int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit
70 int16_t dx = x1 - x;
71 int16_t dy = y1 - y;
72 w1 -= dx;
73 h1 -= dy;
74 if ((w1 <= 0) || (h1 <= 0)) return;
75 if (!_using_partial_mode) _Init_Part();
76 _setPartialRamArea(command, x1, y1, w1, h1);
77 for (int16_t i = 0; i < h1; i++)
78 {
79 for (int16_t j = 0; j < w1 / 8; j++)
80 {
81 uint8_t data;
82 // use wb, h of bitmap for index!
83 int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb;
84 if (pgm)
85 {
86#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
87 data = pgm_read_byte(&bitmap[idx]);
88#else
89 data = bitmap[idx];
90#endif
91 }
92 else
93 {
94 data = bitmap[idx];
95 }
96 if (invert) data = ~data;
97 _writeData(data);
98 }
99 }
100 delay(1); // yield() to avoid WDT on ESP8266 and ESP32
101}
102
103void GxEPD2_270::writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
104 int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
105{
106 _writeImagePart(0x15, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
107}
108
109void GxEPD2_270::writeImagePartAgain(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
110 int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
111{
112 _writeImagePart(0x14, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
113}
114
115void GxEPD2_270::_writeImagePart(uint8_t command, const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
116 int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
117{
118 if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
119 delay(1); // yield() to avoid WDT on ESP8266 and ESP32
120 if ((w_bitmap < 0) || (h_bitmap < 0) || (w < 0) || (h < 0)) return;
121 if ((x_part < 0) || (x_part >= w_bitmap)) return;
122 if ((y_part < 0) || (y_part >= h_bitmap)) return;
123 int16_t wb_bitmap = (w_bitmap + 7) / 8; // width bytes, bitmaps are padded
124 x_part -= x_part % 8; // byte boundary
125 w = w_bitmap - x_part < w ? w_bitmap - x_part : w; // limit
126 h = h_bitmap - y_part < h ? h_bitmap - y_part : h; // limit
127 x -= x % 8; // byte boundary
128 w = 8 * ((w + 7) / 8); // byte boundary, bitmaps are padded
129 int16_t x1 = x < 0 ? 0 : x; // limit
130 int16_t y1 = y < 0 ? 0 : y; // limit
131 int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit
132 int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit
133 int16_t dx = x1 - x;
134 int16_t dy = y1 - y;
135 w1 -= dx;
136 h1 -= dy;
137 if ((w1 <= 0) || (h1 <= 0)) return;
138 if (!_using_partial_mode) _Init_Part();
139 _setPartialRamArea(command, x1, y1, w1, h1);
140 for (int16_t i = 0; i < h1; i++)
141 {
142 for (int16_t j = 0; j < w1 / 8; j++)
143 {
144 uint8_t data;
145 // use wb_bitmap, h_bitmap of bitmap for index!
146 int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap;
147 if (pgm)
148 {
149#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
150 data = pgm_read_byte(&bitmap[idx]);
151#else
152 data = bitmap[idx];
153#endif
154 }
155 else
156 {
157 data = bitmap[idx];
158 }
159 if (invert) data = ~data;
160 _writeData(data);
161 }
162 }
163 delay(1); // yield() to avoid WDT on ESP8266 and ESP32
164}
165
166void GxEPD2_270::writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
167{
168 if (black)
169 {
170 writeImage(black, x, y, w, h, invert, mirror_y, pgm);
171 }
172}
173
174void GxEPD2_270::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,
175 int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
176{
177 if (black)
178 {
179 writeImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
180 }
181}
182
183void GxEPD2_270::writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
184{
185 if (data1)
186 {
187 writeImage(data1, x, y, w, h, invert, mirror_y, pgm);
188 }
189}
190
191void GxEPD2_270::drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
192{
193 writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
194 refresh(x, y, w, h);
195 writeImageAgain(bitmap, x, y, w, h, invert, mirror_y, pgm);
196}
197
198void GxEPD2_270::drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
199 int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
200{
201 writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
202 refresh(x, y, w, h);
203 writeImagePartAgain(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
204}
205
206void GxEPD2_270::drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
207{
208 if (black)
209 {
210 drawImage(black, x, y, w, h, invert, mirror_y, pgm);
211 }
212}
213
214void GxEPD2_270::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,
215 int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
216{
217 if (black)
218 {
219 drawImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
220 }
221}
222
223void GxEPD2_270::drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
224{
225 if (data1)
226 {
227 drawImage(data1, x, y, w, h, invert, mirror_y, pgm);
228 }
229}
230
231void GxEPD2_270::refresh(bool partial_update_mode)
232{
233 if (partial_update_mode) refresh(0, 0, WIDTH, HEIGHT);
234 else
235 {
236 if (_using_partial_mode) _Init_Full();
237 _Update_Full();
238 _initial_refresh = false; // initial full update done
239 }
240}
241
242void GxEPD2_270::refresh(int16_t x, int16_t y, int16_t w, int16_t h)
243{
244 if (_initial_refresh) return refresh(false); // initial update needs be full update
245 // intersection with screen
246 int16_t w1 = x < 0 ? w + x : w; // reduce
247 int16_t h1 = y < 0 ? h + y : h; // reduce
248 int16_t x1 = x < 0 ? 0 : x; // limit
249 int16_t y1 = y < 0 ? 0 : y; // limit
250 w1 = x1 + w1 < int16_t(WIDTH) ? w1 : int16_t(WIDTH) - x1; // limit
251 h1 = y1 + h1 < int16_t(HEIGHT) ? h1 : int16_t(HEIGHT) - y1; // limit
252 if ((w1 <= 0) || (h1 <= 0)) return;
253 // make x1, w1 multiple of 8
254 w1 += x1 % 8;
255 if (w1 % 8 > 0) w1 += 8 - w1 % 8;
256 x1 -= x1 % 8;
257 _refreshWindow(x1, y1, w1, h1);
259}
260
262{
263 _PowerOff();
264}
265
267{
268 _PowerOff();
269 if (_rst >= 0)
270 {
271 _writeCommand(0x07); // deep sleep
272 _writeData(0xA5); // check code
273 _hibernating = true;
274 }
275}
276
277void GxEPD2_270::_setPartialRamArea(uint8_t command, uint16_t x, uint16_t y, uint16_t w, uint16_t h)
278{
279 w = (w + 7 + (x % 8)) & 0xfff8; // byte boundary exclusive (round up)
280 _writeCommand(command);
281 _writeData(x >> 8);
282 _writeData(x & 0xf8);
283 _writeData(y >> 8);
284 _writeData(y & 0xff);
285 _writeData(w >> 8);
286 _writeData(w & 0xf8);
287 _writeData(h >> 8);
288 _writeData(h & 0xff);
289}
290
291void GxEPD2_270::_refreshWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
292{
293 w = (w + 7 + (x % 8)) & 0xfff8; // byte boundary exclusive (round up)
294 h = gx_uint16_min(h, 256); // strange controller error
295 _writeCommand(0x16);
296 _writeData(x >> 8);
297 _writeData(x & 0xf8);
298 _writeData(y >> 8);
299 _writeData(y & 0xff);
300 _writeData(w >> 8);
301 _writeData(w & 0xf8);
302 _writeData(h >> 8);
303 _writeData(h & 0xff);
304}
305
306void GxEPD2_270::_PowerOn()
307{
308 if (!_power_is_on)
309 {
310 _writeCommand(0x04);
311 _waitWhileBusy("_PowerOn", power_on_time);
312 }
313 _power_is_on = true;
314}
315
316void GxEPD2_270::_PowerOff()
317{
318 _writeCommand(0x02); // power off
319 _waitWhileBusy("_PowerOff", power_off_time);
320 _power_is_on = false;
321 _using_partial_mode = false;
322}
323
324void GxEPD2_270::_InitDisplay()
325{
326 if (_hibernating) _reset();
327 _writeCommand(0x01); //POWER SETTING
328 _writeData (0x03);
329 _writeData (0x00);
330 _writeData (0x2b);
331 _writeData (0x2b);
332 _writeCommand(0x06); //boost
333 _writeData (0x07); //A
334 _writeData (0x07); //B
335 _writeData (0x17); //C
336 _writeCommand(0x16);
337 _writeData(0x00);
338 //_writeCommand(0x04);
339 //_waitWhileBusy("_wakeUp Power On");
340 _writeCommand(0x00); //panel setting
341 _writeData(0xbf); //KW-BF KWR-AF BWROTP 0f
342 _writeCommand(0x30); //PLL setting
343 _writeData (0x3a); //90 50HZ 3A 100HZ 29 150Hz 39 200HZ 31 171HZ
344 _writeCommand(0x61); //resolution setting
345 _writeData (0x00);
346 _writeData (0xb0); //176
347 _writeData (0x01);
348 _writeData (0x08); //264
349 _writeCommand(0x82); //vcom_DC setting
350 _writeData (0x08); //0x28:-2.0V,0x12:-0.9V
351}
352
353//full screen update LUT
354const uint8_t GxEPD2_270::lut_20_vcomDC[] PROGMEM =
355{
356 0x00, 0x00,
357 0x00, 0x08, 0x00, 0x00, 0x00, 0x02,
358 0x60, 0x28, 0x28, 0x00, 0x00, 0x01,
359 0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
360 0x00, 0x12, 0x12, 0x00, 0x00, 0x01,
361 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
362 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
363 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
364};
365
366const uint8_t GxEPD2_270::lut_21_ww[] PROGMEM =
367{
368 0x40, 0x08, 0x00, 0x00, 0x00, 0x02,
369 0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
370 0x40, 0x14, 0x00, 0x00, 0x00, 0x01,
371 0xA0, 0x12, 0x12, 0x00, 0x00, 0x01,
372 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
373 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
374 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
375};
376
377const uint8_t GxEPD2_270::lut_22_bw[] PROGMEM =
378{
379 0x40, 0x08, 0x00, 0x00, 0x00, 0x02,
380 0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
381 0x40, 0x14, 0x00, 0x00, 0x00, 0x01,
382 0xA0, 0x12, 0x12, 0x00, 0x00, 0x01,
383 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
384 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
385 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
386};
387
388const uint8_t GxEPD2_270::lut_23_wb[] PROGMEM =
389{
390 0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
391 0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
392 0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
393 0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
394 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
395 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
396 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
397};
398
399const uint8_t GxEPD2_270::lut_24_bb[] PROGMEM =
400{
401 0x80, 0x08, 0x00, 0x00, 0x00, 0x02,
402 0x90, 0x28, 0x28, 0x00, 0x00, 0x01,
403 0x80, 0x14, 0x00, 0x00, 0x00, 0x01,
404 0x50, 0x12, 0x12, 0x00, 0x00, 0x01,
405 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
406 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
407 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
408};
409
410//partial screen update LUT
411const uint8_t GxEPD2_270::lut_20_vcomDC_partial[] PROGMEM =
412{
413 0x00, 0x00,
414 0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
415 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
416 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
417 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
418 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
419 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
420 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
421};
422
423const uint8_t GxEPD2_270::lut_21_ww_partial[] PROGMEM =
424{
425 0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
426 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
427 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
428 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
429 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
430 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
431 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
432};
433
434const uint8_t GxEPD2_270::lut_22_bw_partial[] PROGMEM =
435{
436 0x80, 0x19, 0x01, 0x00, 0x00, 0x01,
437 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
438 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
439 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
440 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
441 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
442 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
443};
444
445const uint8_t GxEPD2_270::lut_23_wb_partial[] PROGMEM =
446{
447 0x40, 0x19, 0x01, 0x00, 0x00, 0x01,
448 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
449 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
450 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
451 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
452 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
453 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
454};
455
456const uint8_t GxEPD2_270::lut_24_bb_partial[] PROGMEM =
457{
458 0x00, 0x19, 0x01, 0x00, 0x00, 0x01,
459 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
460 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
461 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
462 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
463 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
464 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
465};
466
467void GxEPD2_270::_Init_Full()
468{
469 _InitDisplay();
470 _writeCommand(0x50); //VCOM AND DATA INTERVAL SETTING
471 _writeData(0x97); //WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7
472 _writeCommand(0x20);
473 _writeDataPGM_sCS(lut_20_vcomDC, sizeof(lut_20_vcomDC));
474 _writeCommand(0x21);
475 _writeDataPGM_sCS(lut_21_ww, sizeof(lut_21_ww));
476 _writeCommand(0x22);
477 _writeDataPGM_sCS(lut_22_bw, sizeof(lut_22_bw));
478 _writeCommand(0x23);
479 _writeDataPGM_sCS(lut_23_wb, sizeof(lut_23_wb));
480 _writeCommand(0x24);
481 _writeDataPGM_sCS(lut_24_bb, sizeof(lut_24_bb));
482 _PowerOn();
483 _using_partial_mode = false;
484}
485
486void GxEPD2_270::_Init_Part()
487{
488 _InitDisplay();
489 _writeCommand(0x50); //VCOM AND DATA INTERVAL SETTING
490 _writeData(0x17); //WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7
491 _writeCommand(0x20);
492 _writeDataPGM_sCS(lut_20_vcomDC_partial, sizeof(lut_20_vcomDC_partial));
493 _writeCommand(0x21);
494 _writeDataPGM_sCS(lut_21_ww_partial, sizeof(lut_21_ww_partial));
495 _writeCommand(0x22);
496 _writeDataPGM_sCS(lut_22_bw_partial, sizeof(lut_22_bw_partial));
497 _writeCommand(0x23);
498 _writeDataPGM_sCS(lut_23_wb_partial, sizeof(lut_23_wb_partial));
499 _writeCommand(0x24);
500 _writeDataPGM_sCS(lut_24_bb_partial, sizeof(lut_24_bb_partial));
501 _PowerOn();
502 _using_partial_mode = true;
503}
504
505void GxEPD2_270::_Update_Full()
506{
507 _writeCommand(0x12); //display refresh
508 _waitWhileBusy("_Update_Full", full_refresh_time);
509}
510
511void GxEPD2_270::_Update_Part()
512{
513 _writeCommand(0x12); //display refresh
514 _waitWhileBusy("_Update_Part", partial_refresh_time);
515}
const uint8_t GxEPD2_270::lut_20_vcomDC[] PROGMEM
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 power_on_time
Definition GxEPD2_270.h:28
void writeImagePartAgain(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 writeScreenBufferAgain(uint8_t value=0xFF)
static const uint16_t partial_refresh_time
Definition GxEPD2_270.h:31
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 writeImageAgain(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 hibernate()
GxEPD2_270(int16_t cs, int16_t dc, int16_t rst, int16_t busy)
static const uint16_t HEIGHT
Definition GxEPD2_270.h:23
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 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 refresh(bool partial_update_mode=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 WIDTH
Definition GxEPD2_270.h:22
static const uint16_t power_off_time
Definition GxEPD2_270.h:29
void powerOff()
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 uint16_t full_refresh_time
Definition GxEPD2_270.h:30
void clearScreen(uint8_t value=0xFF)
void _writeCommand(uint8_t c)
void _writeData(uint8_t d)
bool _using_partial_mode
Definition GxEPD2_EPD.h:118
void _waitWhileBusy(const char *comment=0, uint16_t busy_time=5000)
bool _power_is_on
Definition GxEPD2_EPD.h:118
bool _initial_refresh
Definition GxEPD2_EPD.h:117
void _reset()
void _writeDataPGM_sCS(const uint8_t *data, uint16_t n, int16_t fill_with_zeroes=0)
bool _initial_write
Definition GxEPD2_EPD.h:117
int16_t _rst
Definition GxEPD2_EPD.h:112
static uint16_t gx_uint16_min(uint16_t a, uint16_t b)
Definition GxEPD2_EPD.h:89
bool _hibernating
Definition GxEPD2_EPD.h:118