Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
GxEPD2_7C.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//
6// Author: Jean-Marc Zingg
7//
8// Version: see library.properties
9//
10// Library: https://github.com/ZinggJM/GxEPD2
11
12#ifndef _GxEPD2_7C_H_
13#define _GxEPD2_7C_H_
14// uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX
15//#include <GFX.h>
16
17#ifndef ENABLE_GxEPD2_GFX
18// default is off
19#define ENABLE_GxEPD2_GFX 0
20#endif
21
22#if ENABLE_GxEPD2_GFX
23#include "GxEPD2_GFX.h"
24#define GxEPD2_GFX_BASE_CLASS GxEPD2_GFX
25#elif defined(_GFX_H_)
26#define GxEPD2_GFX_BASE_CLASS GFX
27#else
28#include <Adafruit_GFX.h>
29#define GxEPD2_GFX_BASE_CLASS Adafruit_GFX
30#endif
31
32#include "GxEPD2_EPD.h"
33#include "epd3c/GxEPD2_565c.h"
34
35template<typename GxEPD2_Type, const uint16_t page_height>
36class GxEPD2_7C : public GxEPD2_GFX_BASE_CLASS
37{
38 public:
39 GxEPD2_Type epd2;
40#if ENABLE_GxEPD2_GFX
41 GxEPD2_7C(GxEPD2_Type epd2_instance) : GxEPD2_GFX_BASE_CLASS(epd2, GxEPD2_Type::WIDTH, GxEPD2_Type::HEIGHT), epd2(epd2_instance)
42#else
43 GxEPD2_7C(GxEPD2_Type epd2_instance) : GxEPD2_GFX_BASE_CLASS(GxEPD2_Type::WIDTH, GxEPD2_Type::HEIGHT), epd2(epd2_instance)
44#endif
45 {
46 _page_height = page_height;
47 _pages = (HEIGHT / _page_height) + ((HEIGHT % _page_height) > 0);
48 _mirror = false;
49 _using_partial_mode = false;
50 _current_page = 0;
52 }
53
54 uint16_t pages()
55 {
56 return _pages;
57 }
58
59 uint16_t pageHeight()
60 {
61 return _page_height;
62 }
63
64 bool mirror(bool m)
65 {
66 _swap_ (_mirror, m);
67 return m;
68 }
69
70 void drawPixel(int16_t x, int16_t y, uint16_t color)
71 {
72 if ((x < 0) || (x >= width()) || (y < 0) || (y >= height())) return;
73 if (_mirror) x = width() - x - 1;
74 // check rotation, move pixel around if necessary
75 switch (getRotation())
76 {
77 case 1:
78 _swap_(x, y);
79 x = WIDTH - x - 1;
80 break;
81 case 2:
82 x = WIDTH - x - 1;
83 y = HEIGHT - y - 1;
84 break;
85 case 3:
86 _swap_(x, y);
87 y = HEIGHT - y - 1;
88 break;
89 }
90 // transpose partial window to 0,0
91 x -= _pw_x;
92 y -= _pw_y;
93 // clip to (partial) window
94 if ((x < 0) || (x >= int16_t(_pw_w)) || (y < 0) || (y >= int16_t(_pw_h))) return;
95 // adjust for current page
96 y -= _current_page * _page_height;
97 // check if in current page
98 if ((y < 0) || (y >= int16_t(_page_height))) return;
99 uint32_t i = x / 2 + uint32_t(y) * (_pw_w / 2);
100 uint8_t pv = color7(color);
101 if (x & 1) _pixel_buffer[i] = (_pixel_buffer[i] & 0xF0) | pv;
102 else _pixel_buffer[i] = (_pixel_buffer[i] & 0x0F) | (pv << 4);
103 }
104
105 void init(uint32_t serial_diag_bitrate = 0) // = 0 : disabled
106 {
107 epd2.init(serial_diag_bitrate);
108 _using_partial_mode = false;
109 _current_page = 0;
111 }
112
113 // init method with additional parameters:
114 // initial false for re-init after processor deep sleep wake up, if display power supply was kept
115 // only relevant for b/w displays with fast partial update
116 // reset_duration = 20 is default; a value of 2 may help with "clever" reset circuit of newer boards from Waveshare
117 // pulldown_rst_mode true for alternate RST handling to avoid feeding 5V through RST pin
118 void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration = 20, bool pulldown_rst_mode = false)
119 {
120 epd2.init(serial_diag_bitrate, initial, reset_duration, pulldown_rst_mode);
121 _using_partial_mode = false;
122 _current_page = 0;
124 }
125
126 // init method with additional parameters:
127 // SPIClass& spi: either SPI or alternate HW SPI channel
128 // SPISettings spi_settings: e.g. for higher SPI speed selection
129 void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration, bool pulldown_rst_mode, SPIClass& spi, SPISettings spi_settings)
130 {
131 epd2.selectSPI(spi, spi_settings);
132 epd2.init(serial_diag_bitrate, initial, reset_duration, pulldown_rst_mode);
133 _using_partial_mode = false;
134 _current_page = 0;
136 }
137
138 void fillScreen(uint16_t color)
139 {
140 uint8_t pv = color7(color);
141 uint8_t pv2 = pv | pv << 4;
142 for (uint32_t x = 0; x < sizeof(_pixel_buffer); x++)
143 {
144 _pixel_buffer[x] = pv2;
145 }
146 }
147
148 // display buffer content to screen, useful for full screen buffer
149 void display(bool partial_update_mode = false)
150 {
151 epd2.writeNative(_pixel_buffer, 0, 0, 0, WIDTH, _page_height);
152 epd2.refresh(partial_update_mode);
153 if (!partial_update_mode) epd2.powerOff();
154 }
155
156 // display part of buffer content to screen, useful for full screen buffer
157 // displayWindow, use parameters according to actual rotation.
158 // x and w should be multiple of 8, for rotation 0 or 2,
159 // y and h should be multiple of 8, for rotation 1 or 3,
160 // else window is increased as needed,
161 // this is an addressing limitation of the e-paper controllers
162 void displayWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
163 {
164 x = gx_uint16_min(x, width());
165 y = gx_uint16_min(y, height());
166 w = gx_uint16_min(w, width() - x);
167 h = gx_uint16_min(h, height() - y);
168 _rotate(x, y, w, h);
169 epd2.writeNativePart(_pixel_buffer, 0, x, y, WIDTH, _page_height, x, y, w, h);
170 epd2.refresh(x, y, w, h);
171 }
172
174 {
175 _using_partial_mode = false;
176 _pw_x = 0;
177 _pw_y = 0;
178 _pw_w = WIDTH;
179 _pw_h = HEIGHT;
180 }
181
182 // setPartialWindow, use parameters according to actual rotation.
183 // x and w should be multiple of 8, for rotation 0 or 2,
184 // y and h should be multiple of 8, for rotation 1 or 3,
185 // else window is increased as needed,
186 // this is an addressing limitation of the e-paper controllers
187 void setPartialWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
188 {
189 if (!epd2.hasPartialUpdate) return;
190 _pw_x = gx_uint16_min(x, width());
191 _pw_y = gx_uint16_min(y, height());
192 _pw_w = gx_uint16_min(w, width() - _pw_x);
193 _pw_h = gx_uint16_min(h, height() - _pw_y);
194 _rotate(_pw_x, _pw_y, _pw_w, _pw_h);
195 _using_partial_mode = true;
196 // make _pw_x, _pw_w multiple of 2
197 _pw_w += _pw_x % 2;
198 if (_pw_w % 2 > 0) _pw_w += 2 - _pw_w % 2;
199 _pw_x -= _pw_x % 2;
200 }
201
203 {
205 _current_page = 0;
206 _second_phase = false;
207 epd2.setPaged(); // for GxEPD2_565c paged workaround
208 }
209
210 bool nextPage()
211 {
212 uint16_t page_ys = _current_page * _page_height;
213 if (_using_partial_mode)
214 {
215 //Serial.print(" nextPage("); Serial.print(_pw_x); Serial.print(", "); Serial.print(_pw_y); Serial.print(", ");
216 //Serial.print(_pw_w); Serial.print(", "); Serial.print(_pw_h); Serial.print(") P"); Serial.println(_current_page);
217 uint16_t page_ye = _current_page < int16_t(_pages - 1) ? page_ys + _page_height : HEIGHT;
218 uint16_t dest_ys = _pw_y + page_ys; // transposed
219 uint16_t dest_ye = gx_uint16_min(_pw_y + _pw_h, _pw_y + page_ye);
220 if (dest_ye > dest_ys)
221 {
222 //Serial.print("writeImage("); Serial.print(_pw_x); Serial.print(", "); Serial.print(dest_ys); Serial.print(", ");
223 //Serial.print(_pw_w); Serial.print(", "); Serial.print(dest_ye - dest_ys); Serial.println(")");
224 epd2.writeNative(_pixel_buffer, 0, _pw_x, dest_ys, _pw_w, dest_ye - dest_ys);
225 }
226 else
227 {
228 //Serial.print("writeImage("); Serial.print(_pw_x); Serial.print(", "); Serial.print(dest_ys); Serial.print(", ");
229 //Serial.print(_pw_w); Serial.print(", "); Serial.print(dest_ye - dest_ys); Serial.print(") skipped ");
230 //Serial.print(dest_ys); Serial.print(".."); Serial.println(dest_ye);
231 }
232 _current_page++;
233 if (_current_page == int16_t(_pages))
234 {
235 _current_page = 0;
236 if (!_second_phase)
237 {
238 epd2.refresh(_pw_x, _pw_y, _pw_w, _pw_h);
239 if (epd2.hasFastPartialUpdate)
240 {
241 _second_phase = true;
242 return true;
243 }
244 }
245 return false;
246 }
248 return true;
249 }
250 else // full update
251 {
252 epd2.writeNative(_pixel_buffer, 0, 0, page_ys, WIDTH, gx_uint16_min(_page_height, HEIGHT - page_ys));
253 _current_page++;
254 if (_current_page == int16_t(_pages))
255 {
256 _current_page = 0;
257 if ((epd2.panel == GxEPD2::GDEW0154Z04) && (_pages > 1))
258 {
259 if (!_second_phase)
260 {
261 epd2.refresh(false); // full update after first phase
262 _second_phase = true;
264 return true;
265 }
266 else epd2.refresh(true); // partial update after second phase
267 } else epd2.refresh(false); // full update after only phase
268 epd2.powerOff();
269 return false;
270 }
272 return true;
273 }
274 }
275
276 // GxEPD style paged drawing; drawCallback() is called as many times as needed
277 void drawPaged(void (*drawCallback)(const void*), const void* pv)
278 {
279 if (_using_partial_mode)
280 {
281 for (_current_page = 0; _current_page < _pages; _current_page++)
282 {
283 uint16_t page_ys = _current_page * _page_height;
284 uint16_t page_ye = _current_page < (_pages - 1) ? page_ys + _page_height : HEIGHT;
285 uint16_t dest_ys = _pw_y + page_ys; // transposed
286 uint16_t dest_ye = gx_uint16_min(_pw_y + _pw_h, _pw_y + page_ye);
287 if (dest_ye > dest_ys)
288 {
290 drawCallback(pv);
291 epd2.writeNative(_pixel_buffer, 0, _pw_x, dest_ys, _pw_w, dest_ye - dest_ys);
292 }
293 }
294 epd2.refresh(_pw_x, _pw_y, _pw_w, _pw_h);
295 }
296 else // full update
297 {
298 epd2.setPaged(); // for GxEPD2_154c paged workaround
299 for (_current_page = 0; _current_page < _pages; _current_page++)
300 {
301 uint16_t page_ys = _current_page * _page_height;
303 drawCallback(pv);
304 epd2.writeNative(_pixel_buffer, 0, 0, page_ys, WIDTH, gx_uint16_min(_page_height, HEIGHT - page_ys));
305 }
306 epd2.refresh(false); // full update
307 epd2.powerOff();
308 }
309 _current_page = 0;
310 }
311
312 void drawInvertedBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)
313 {
314 // taken from Adafruit_GFX.cpp, modified
315 int16_t byteWidth = (w + 7) / 8; // Bitmap scanline pad = whole byte
316 uint8_t byte = 0;
317 for (int16_t j = 0; j < h; j++)
318 {
319 for (int16_t i = 0; i < w; i++ )
320 {
321 if (i & 7) byte <<= 1;
322 else
323 {
324#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
325 byte = pgm_read_byte(&bitmap[j * byteWidth + i / 8]);
326#else
327 byte = bitmap[j * byteWidth + i / 8];
328#endif
329 }
330 if (!(byte & 0x80))
331 {
332 drawPixel(x + i, y + j, color);
333 }
334 }
335 }
336 }
337
338 // Support for Bitmaps (Sprites) to Controller Buffer and to Screen
339 void clearScreen(uint8_t value = 0xFF) // init controller memory and screen (default white)
340 {
341 epd2.clearScreen(value);
342 }
343 void writeScreenBuffer(uint8_t value = 0xFF) // init controller memory (default white)
344 {
345 epd2.writeScreenBuffer(value);
346 }
347 // write to controller memory, without screen refresh; x and w should be multiple of 8
348 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)
349 {
350 epd2.writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
351 }
352 void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
353 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false)
354 {
355 epd2.writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
356 }
357 void 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)
358 {
359 epd2.writeImage(black, color, x, y, w, h, invert, mirror_y, pgm);
360 }
361 void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h)
362 {
363 epd2.writeImage(black, color, x, y, w, h, false, false, false);
364 }
365 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,
366 int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
367 {
368 epd2.writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
369 }
370 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,
371 int16_t x, int16_t y, int16_t w, int16_t h)
372 {
373 epd2.writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, false, false, false);
374 }
375 // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8
376 void 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)
377 {
378 epd2.writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm);
379 }
380 // write to controller memory, with screen refresh; x and w should be multiple of 8
381 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)
382 {
383 epd2.drawImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
384 }
385 void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
386 int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false)
387 {
388 epd2.drawImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
389 }
390 void 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)
391 {
392 epd2.drawImage(black, color, x, y, w, h, invert, mirror_y, pgm);
393 }
394 void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h)
395 {
396 epd2.drawImage(black, color, x, y, w, h, false, false, false);
397 }
398 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,
399 int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
400 {
401 epd2.drawImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
402 }
403 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,
404 int16_t x, int16_t y, int16_t w, int16_t h)
405 {
406 epd2.drawImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, false, false, false);
407 }
408 // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8
409 void 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)
410 {
411 epd2.drawNative(data1, data2, x, y, w, h, invert, mirror_y, pgm);
412 }
413 void refresh(bool partial_update_mode = false) // screen refresh from controller memory to full screen
414 {
415 epd2.refresh(partial_update_mode);
416 if (!partial_update_mode) epd2.powerOff();
417 }
418 void refresh(int16_t x, int16_t y, int16_t w, int16_t h) // screen refresh from controller memory, partial screen
419 {
420 epd2.refresh(x, y, w, h);
421 }
422 // turns off generation of panel driving voltages, avoids screen fading over time
423 void powerOff()
424 {
425 epd2.powerOff();
426 }
427 // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
429 {
430 epd2.hibernate();
431 }
432 private:
433 template <typename T> static inline void
434 _swap_(T & a, T & b)
435 {
436 T t = a;
437 a = b;
438 b = t;
439 };
440 static inline uint16_t gx_uint16_min(uint16_t a, uint16_t b)
441 {
442 return (a < b ? a : b);
443 };
444 static inline uint16_t gx_uint16_max(uint16_t a, uint16_t b)
445 {
446 return (a > b ? a : b);
447 };
448 void _rotate(uint16_t& x, uint16_t& y, uint16_t& w, uint16_t& h)
449 {
450 switch (getRotation())
451 {
452 case 1:
453 _swap_(x, y);
454 _swap_(w, h);
455 x = WIDTH - x - w;
456 break;
457 case 2:
458 x = WIDTH - x - w;
459 y = HEIGHT - y - h;
460 break;
461 case 3:
462 _swap_(x, y);
463 _swap_(w, h);
464 y = HEIGHT - y - h;
465 break;
466 }
467 }
468 uint8_t color7(uint16_t color)
469 {
470 static uint16_t _prev_color = GxEPD_BLACK;
471 static uint8_t _prev_color7 = 0x00; // black
472 if (color == _prev_color) return _prev_color7;
473 uint8_t cv7 = 0x00;
474 switch (color)
475 {
476 case GxEPD_BLACK: cv7 = 0x00; break;
477 case GxEPD_WHITE: cv7 = 0x01; break;
478 case GxEPD_GREEN: cv7 = 0x02; break;
479 case GxEPD_BLUE: cv7 = 0x03; break;
480 case GxEPD_RED: cv7 = 0x04; break;
481 case GxEPD_YELLOW: cv7 = 0x05; break;
482 case GxEPD_ORANGE: cv7 = 0x06; break;
483 default:
484 {
485 uint16_t red = color & 0xF800;
486 uint16_t green = (color & 0x07E0) << 5;
487 uint16_t blue = (color & 0x001F) << 11;
488 if ((red < 0x8000) && (green < 0x8000) && (blue < 0x8000)) cv7 = 0x00; // black
489 else if ((red >= 0x8000) && (green >= 0x8000) && (blue >= 0x8000)) cv7 = 0x01; // white
490 else if ((red >= 0x8000) && (blue >= 0x8000)) cv7 = red > blue ? 0x04 : 0x03; // red, blue
491 else if ((green >= 0x8000) && (blue >= 0x8000)) cv7 = green > blue ? 0x02 : 0x03; // green, blue
492 else if ((red >= 0x8000) && (green >= 0x8000))
493 {
494 static const uint16_t y2o_lim = ((GxEPD_YELLOW - GxEPD_ORANGE) / 2 + (GxEPD_ORANGE & 0x07E0)) << 5;
495 cv7 = green > y2o_lim ? 0x05 : 0x06; // yellow, orange
496 }
497 else if (red >= 0x8000) cv7 = 0x04; // red
498 else if (green >= 0x8000) cv7 = 0x02; // green
499 else cv7 = 0x03; // blue
500 }
501 }
502 _prev_color = color;
503 _prev_color7 = cv7;
504 return cv7;
505 }
506 private:
507 uint8_t _pixel_buffer[(GxEPD2_Type::WIDTH / 2) * page_height];
508 bool _using_partial_mode, _second_phase, _mirror;
509 uint16_t _width_bytes, _pixel_bytes;
510 int16_t _current_page;
511 uint16_t _pages, _page_height;
512 uint16_t _pw_x, _pw_y, _pw_w, _pw_h;
513};
514
515#endif
#define GxEPD_RED
Definition GxEPD2.h:25
#define GxEPD_BLACK
Definition GxEPD2.h:19
#define GxEPD_ORANGE
Definition GxEPD2.h:31
#define GxEPD_GREEN
Definition GxEPD2.h:30
#define GxEPD_YELLOW
Definition GxEPD2.h:26
#define GxEPD_WHITE
Definition GxEPD2.h:20
#define GxEPD_BLUE
Definition GxEPD2.h:29
void 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)
Definition GxEPD2_7C.h:376
void setPartialWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition GxEPD2_7C.h:187
void writeImage(const uint8_t *black, const uint8_t *color, int16_t x, int16_t y, int16_t w, int16_t h)
Definition GxEPD2_7C.h:361
void hibernate()
Definition GxEPD2_7C.h:428
void 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)
Definition GxEPD2_7C.h:409
void powerOff()
Definition GxEPD2_7C.h:423
void display(bool partial_update_mode=false)
Definition GxEPD2_7C.h:149
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)
Definition GxEPD2_7C.h:352
void firstPage()
Definition GxEPD2_7C.h:202
void 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)
Definition GxEPD2_7C.h:390
uint16_t pageHeight()
Definition GxEPD2_7C.h:59
bool nextPage()
Definition GxEPD2_7C.h:210
void refresh(int16_t x, int16_t y, int16_t w, int16_t h)
Definition GxEPD2_7C.h:418
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)
Definition GxEPD2_7C.h:385
void fillScreen(uint16_t color)
Definition GxEPD2_7C.h:138
void drawImage(const uint8_t *black, const uint8_t *color, int16_t x, int16_t y, int16_t w, int16_t h)
Definition GxEPD2_7C.h:394
void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration=20, bool pulldown_rst_mode=false)
Definition GxEPD2_7C.h:118
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, int16_t x, int16_t y, int16_t w, int16_t h)
Definition GxEPD2_7C.h:370
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)
Definition GxEPD2_7C.h:348
bool mirror(bool m)
Definition GxEPD2_7C.h:64
void setFullWindow()
Definition GxEPD2_7C.h:173
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, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
Definition GxEPD2_7C.h:398
GxEPD2_Type epd2
Definition GxEPD2_7C.h:39
void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration, bool pulldown_rst_mode, SPIClass &spi, SPISettings spi_settings)
Definition GxEPD2_7C.h:129
void drawPixel(int16_t x, int16_t y, uint16_t color)
Definition GxEPD2_7C.h:70
void refresh(bool partial_update_mode=false)
Definition GxEPD2_7C.h:413
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)
Definition GxEPD2_7C.h:381
GxEPD2_7C(GxEPD2_Type epd2_instance)
Definition GxEPD2_7C.h:43
void drawPaged(void(*drawCallback)(const void *), const void *pv)
Definition GxEPD2_7C.h:277
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, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
Definition GxEPD2_7C.h:365
void writeScreenBuffer(uint8_t value=0xFF)
Definition GxEPD2_7C.h:343
void 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)
Definition GxEPD2_7C.h:357
uint16_t pages()
Definition GxEPD2_7C.h:54
void displayWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition GxEPD2_7C.h:162
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, int16_t x, int16_t y, int16_t w, int16_t h)
Definition GxEPD2_7C.h:403
void init(uint32_t serial_diag_bitrate=0)
Definition GxEPD2_7C.h:105
void clearScreen(uint8_t value=0xFF)
Definition GxEPD2_7C.h:339
void drawInvertedBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)
Definition GxEPD2_7C.h:312
@ GDEW0154Z04
Definition GxEPD2.h:80