17 GxEPD2_EPD(cs, dc, rst, busy, LOW, 30000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate)
34 for (uint32_t i = 0; i < uint32_t(
WIDTH) * uint32_t(
HEIGHT) / 8; i++)
41 for (uint32_t i = 0; i < uint32_t(
WIDTH) * uint32_t(
HEIGHT) / 8; i++)
63 for (uint32_t i = 0; i < uint32_t(
WIDTH) * uint32_t(
HEIGHT) / 8; i++)
70 for (uint32_t i = 0; i < uint32_t(
WIDTH) * uint32_t(
HEIGHT) / 8; i++)
80 writeImage(bitmap, NULL, x, y, w, h, invert, mirror_y, pgm);
83void GxEPD2_583c_Z83::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)
87 uint16_t wb = (w + 7) / 8;
90 int16_t x1 = x < 0 ? 0 : x;
91 int16_t y1 = y < 0 ? 0 : y;
92 int16_t w1 = x + w < int16_t(
WIDTH) ? w : int16_t(
WIDTH) - x;
93 int16_t h1 = y + h < int16_t(
HEIGHT) ? h : int16_t(
HEIGHT) - y;
98 if ((w1 <= 0) || (h1 <= 0))
return;
101 _setPartialRamArea(x1, y1, w1, h1);
104 for (int16_t i = 0; i < h1; i++)
106 for (int16_t j = 0; j < w1 / 8; j++)
112 uint16_t idx = mirror_y ? j + dx / 8 + uint16_t((h - 1 - (i + dy))) * wb : j + dx / 8 + uint16_t(i + dy) * wb;
115#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
116 data = pgm_read_byte(&black[idx]);
125 if (invert) data = ~data;
133 for (int16_t i = 0; i < h1; i++)
135 for (int16_t j = 0; j < w1 / 8; j++)
141 uint16_t idx = mirror_y ? j + dx / 8 + uint16_t((h - 1 - (i + dy))) * wb : j + dx / 8 + uint16_t(i + dy) * wb;
144#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
145 data = pgm_read_byte(&color[idx]);
154 if (invert) data = ~data;
165 int16_t x, int16_t y, int16_t w, int16_t h,
bool invert,
bool mirror_y,
bool pgm)
167 writeImagePart(bitmap, NULL, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
171 int16_t x, int16_t y, int16_t w, int16_t h,
bool invert,
bool mirror_y,
bool pgm)
175 if ((w_bitmap < 0) || (h_bitmap < 0) || (w < 0) || (h < 0))
return;
176 if ((x_part < 0) || (x_part >= w_bitmap))
return;
177 if ((y_part < 0) || (y_part >= h_bitmap))
return;
178 uint16_t wb_bitmap = (w_bitmap + 7) / 8;
179 x_part -= x_part % 8;
180 w = w_bitmap - x_part < w ? w_bitmap - x_part : w;
181 h = h_bitmap - y_part < h ? h_bitmap - y_part : h;
183 w = 8 * ((w + 7) / 8);
184 int16_t x1 = x < 0 ? 0 : x;
185 int16_t y1 = y < 0 ? 0 : y;
186 int16_t w1 = x + w < int16_t(
WIDTH) ? w : int16_t(
WIDTH) - x;
187 int16_t h1 = y + h < int16_t(
HEIGHT) ? h : int16_t(
HEIGHT) - y;
192 if ((w1 <= 0) || (h1 <= 0))
return;
195 _setPartialRamArea(x1, y1, w1, h1);
198 for (int16_t i = 0; i < h1; i++)
200 for (int16_t j = 0; j < w1 / 8; j++)
204 uint16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + uint16_t((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + uint16_t(y_part + i + dy) * wb_bitmap;
207#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
208 data = pgm_read_byte(&black[idx]);
217 if (invert) data = ~data;
224 for (int16_t i = 0; i < h1; i++)
226 for (int16_t j = 0; j < w1 / 8; j++)
232 uint16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + uint16_t((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + uint16_t(y_part + i + dy) * wb_bitmap;
235#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
236 data = pgm_read_byte(&color[idx]);
245 if (invert) data = ~data;
255void GxEPD2_583c_Z83::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)
259 writeImage(data1, x, y, w, h, invert, mirror_y, pgm);
265 writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
270 int16_t x, int16_t y, int16_t w, int16_t h,
bool invert,
bool mirror_y,
bool pgm)
272 writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
276void GxEPD2_583c_Z83::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)
278 writeImage(black, color, x, y, w, h, invert, mirror_y, pgm);
283 int16_t x, int16_t y, int16_t w, int16_t h,
bool invert,
bool mirror_y,
bool pgm)
285 writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
289void GxEPD2_583c_Z83::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)
291 writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm);
304 int16_t w1 = x < 0 ? w + x : w;
305 int16_t h1 = y < 0 ? h + y : h;
306 int16_t x1 = x < 0 ? 0 : x;
307 int16_t y1 = y < 0 ? 0 : y;
308 w1 = x1 + w1 < int16_t(
WIDTH) ? w1 : int16_t(
WIDTH) - x1;
309 h1 = y1 + h1 < int16_t(
HEIGHT) ? h1 : int16_t(
HEIGHT) - y1;
310 if ((w1 <= 0) || (h1 <= 0))
return;
313 if (w1 % 8 > 0) w1 += 8 - w1 % 8;
317 _setPartialRamArea(x1, y1, w1, h1);
338void GxEPD2_583c_Z83::_setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
340 uint16_t xe = (x + w - 1) | 0x0007;
341 uint16_t ye = y + h - 1;
356void GxEPD2_583c_Z83::_PowerOn()
366void GxEPD2_583c_Z83::_PowerOff()
376void GxEPD2_583c_Z83::_InitDisplay()
400void GxEPD2_583c_Z83::_Init_Full()
406void GxEPD2_583c_Z83::_Init_Part()
412void GxEPD2_583c_Z83::_Update_Full()
418void GxEPD2_583c_Z83::_Update_Part()
void refresh(bool partial_update_mode=false)
static const uint16_t partial_refresh_time
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 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
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 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 clearScreen(uint8_t value=0xFF)
void writeScreenBuffer(uint8_t value=0xFF)
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
static const uint16_t full_refresh_time
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)
GxEPD2_583c_Z83(int16_t cs, int16_t dc, int16_t rst, int16_t busy)
static const uint16_t HEIGHT
static const bool usePartialUpdate
static const uint16_t WIDTH
void _writeCommand(uint8_t c)
void _writeData(uint8_t d)
void _waitWhileBusy(const char *comment=0, uint16_t busy_time=5000)
void _transfer(uint8_t value)