Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
GxEPD2_it103_1872x1404 Class Reference

#include <GxEPD2_it103_1872x1404.h>

Inheritance diagram for GxEPD2_it103_1872x1404:
GxEPD2_EPD

Public Member Functions

 GxEPD2_it103_1872x1404 (int16_t cs, int16_t dc, int16_t rst, int16_t busy)
 
void init (uint32_t serial_diag_bitrate=0)
 
void init (uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration=20, bool pulldown_rst_mode=false)
 
void clearScreen (uint8_t value=0x33)
 
void writeScreenBuffer (uint8_t value=0x33)
 
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 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 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)
 
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=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 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 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 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)
 
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=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 refresh (bool partial_update_mode=false)
 
void refresh (int16_t x, int16_t y, int16_t w, int16_t h)
 
void powerOff ()
 
void hibernate ()
 
- Public Member Functions inherited from GxEPD2_EPD
 GxEPD2_EPD (int16_t cs, int16_t dc, int16_t rst, int16_t busy, int16_t busy_level, uint32_t busy_timeout, uint16_t w, uint16_t h, GxEPD2::Panel p, bool c, bool pu, bool fpu)
 
virtual void writeImageForFullRefresh (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)
 
virtual void writeScreenBufferAgain (uint8_t value=0xFF)
 
virtual 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)
 
virtual 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)
 
virtual void setPaged ()
 
void setBusyCallback (void(*busyCallback)(const void *), const void *busy_callback_parameter=0)
 
void selectSPI (SPIClass &spi, SPISettings spi_settings)
 

Static Public Attributes

static const uint16_t WIDTH = 1872
 
static const uint16_t HEIGHT = 1404
 
static const GxEPD2::Panel panel = GxEPD2::ES103TC1
 
static const bool hasColor = false
 
static const bool hasPartialUpdate = true
 
static const bool hasFastPartialUpdate = true
 
static const uint16_t reset_to_ready_time = 1800
 
static const uint16_t power_on_time = 10
 
static const uint16_t power_off_time = 250
 
static const uint16_t full_refresh_time = 850
 
static const uint16_t partial_refresh_time = 300
 
static const uint16_t refresh_cmd_time = 10
 
static const uint16_t refresh_par_time = 2
 
static const uint16_t default_wait_time = 1
 
static const uint16_t diag_min_time = 3
 
static const uint16_t set_vcom_time = 500
 

Additional Inherited Members

- Static Public Member Functions inherited from GxEPD2_EPD
static uint16_t gx_uint16_min (uint16_t a, uint16_t b)
 
static uint16_t gx_uint16_max (uint16_t a, uint16_t b)
 
- Public Attributes inherited from GxEPD2_EPD
const uint16_t WIDTH
 
const uint16_t HEIGHT
 
const GxEPD2::Panel panel
 
const bool hasColor
 
const bool hasPartialUpdate
 
const bool hasFastPartialUpdate
 
- Protected Member Functions inherited from GxEPD2_EPD
void _reset ()
 
void _waitWhileBusy (const char *comment=0, uint16_t busy_time=5000)
 
void _writeCommand (uint8_t c)
 
void _writeData (uint8_t d)
 
void _writeData (const uint8_t *data, uint16_t n)
 
void _writeDataPGM (const uint8_t *data, uint16_t n, int16_t fill_with_zeroes=0)
 
void _writeDataPGM_sCS (const uint8_t *data, uint16_t n, int16_t fill_with_zeroes=0)
 
void _writeCommandData (const uint8_t *pCommandData, uint8_t datalen)
 
void _writeCommandDataPGM (const uint8_t *pCommandData, uint8_t datalen)
 
void _startTransfer ()
 
void _transfer (uint8_t value)
 
void _endTransfer ()
 
- Protected Attributes inherited from GxEPD2_EPD
int16_t _cs
 
int16_t _dc
 
int16_t _rst
 
int16_t _busy
 
int16_t _busy_level
 
uint32_t _busy_timeout
 
bool _diag_enabled
 
bool _pulldown_rst_mode
 
SPIClass * _pSPIx
 
SPISettings _spi_settings
 
bool _initial_write
 
bool _initial_refresh
 
bool _power_is_on
 
bool _using_partial_mode
 
bool _hibernating
 
uint16_t _reset_duration
 
void(* _busy_callback )(const void *)
 
const void * _busy_callback_parameter
 

Detailed Description

Definition at line 22 of file GxEPD2_it103_1872x1404.h.

Constructor & Destructor Documentation

◆ GxEPD2_it103_1872x1404()

GxEPD2_it103_1872x1404::GxEPD2_it103_1872x1404 ( int16_t cs,
int16_t dc,
int16_t rst,
int16_t busy )

Definition at line 59 of file GxEPD2_it103_1872x1404.cpp.

59 :
60 GxEPD2_EPD(cs, dc, rst, busy, LOW, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate),
61 _spi_settings(24000000, MSBFIRST, SPI_MODE0),
62 _spi_settings_for_read(1000000, MSBFIRST, SPI_MODE0)
63{
64}
GxEPD2_EPD(int16_t cs, int16_t dc, int16_t rst, int16_t busy, int16_t busy_level, uint32_t busy_timeout, uint16_t w, uint16_t h, GxEPD2::Panel p, bool c, bool pu, bool fpu)
static const bool hasFastPartialUpdate
static const GxEPD2::Panel panel
static const uint16_t WIDTH
static const bool hasPartialUpdate
static const uint16_t HEIGHT

Member Function Documentation

◆ clearScreen()

void GxEPD2_it103_1872x1404::clearScreen ( uint8_t value = 0x33)
virtual

Implements GxEPD2_EPD.

Definition at line 109 of file GxEPD2_it103_1872x1404.cpp.

110{
111 _initial_write = false; // initial full screen buffer clean done
112 if (_initial_refresh) _Init_Full();
113 else _Init_Part();
114 _initial_refresh = false;
115 _setPartialRamArea(0, 0, WIDTH, HEIGHT);
116 SPI.beginTransaction(_spi_settings);
117 if (_cs >= 0) digitalWrite(_cs, LOW);
118 _transfer16(0x0000); // preamble for write data
119 _waitWhileBusy2("clearScreen preamble", default_wait_time);
120 for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT); i++)
121 {
122 SPI.transfer(value);
123#if defined(ESP8266) || defined(ESP32)
124 if (0 == i % 10000) yield();
125#endif
126 }
127 if (_cs >= 0) digitalWrite(_cs, HIGH);
128 SPI.endTransaction();
129 _writeCommand16(IT8951_TCON_LD_IMG_END);
130 _waitWhileBusy2("clearScreen load end", default_wait_time);
131 _refresh(0, 0, WIDTH, HEIGHT, false);
132}
#define IT8951_TCON_LD_IMG_END
bool _initial_refresh
Definition GxEPD2_EPD.h:117
bool _initial_write
Definition GxEPD2_EPD.h:117
int16_t _cs
Definition GxEPD2_EPD.h:112
static const uint16_t default_wait_time

◆ drawImage() [1/2]

void GxEPD2_it103_1872x1404::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 )

Definition at line 361 of file GxEPD2_it103_1872x1404.cpp.

362{
363 writeImage(black, color, x, y, w, h, invert, mirror_y, pgm);
364 _refresh(x, y, w, h, true);
365}
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)

◆ drawImage() [2/2]

void GxEPD2_it103_1872x1404::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 at line 348 of file GxEPD2_it103_1872x1404.cpp.

349{
350 writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
351 _refresh(x, y, w, h, true);
352}

◆ drawImagePart() [1/2]

void GxEPD2_it103_1872x1404::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 = false,
bool mirror_y = false,
bool pgm = false )

Definition at line 367 of file GxEPD2_it103_1872x1404.cpp.

369{
370 writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
371 _refresh(x, y, w, h, true);
372}
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)

◆ drawImagePart() [2/2]

void GxEPD2_it103_1872x1404::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 at line 354 of file GxEPD2_it103_1872x1404.cpp.

356{
357 writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
358 _refresh(x, y, w, h, true);
359}

◆ drawNative()

void GxEPD2_it103_1872x1404::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 )

Definition at line 374 of file GxEPD2_it103_1872x1404.cpp.

375{
376 writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm);
377 _refresh(x, y, w, h, false);
378}
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)

◆ hibernate()

void GxEPD2_it103_1872x1404::hibernate ( )
virtual

Implements GxEPD2_EPD.

Definition at line 421 of file GxEPD2_it103_1872x1404.cpp.

422{
423 if (_power_is_on) _PowerOff();
424 if (_rst >= 0)
425 {
426 // this does not work, does not reduce power, uses more than in stand by mode
427 //delay(1000);
428 //_IT8951Sleep();
429 //delay(1000);
430 //_hibernating = true;
431 }
432}
bool _power_is_on
Definition GxEPD2_EPD.h:118
int16_t _rst
Definition GxEPD2_EPD.h:112

◆ init() [1/2]

void GxEPD2_it103_1872x1404::init ( uint32_t serial_diag_bitrate,
bool initial,
uint16_t reset_duration = 20,
bool pulldown_rst_mode = false )
virtual

Reimplemented from GxEPD2_EPD.

Definition at line 71 of file GxEPD2_it103_1872x1404.cpp.

72{
73 GxEPD2_EPD::init(serial_diag_bitrate, initial, reset_duration, pulldown_rst_mode);
74
75 // we need a long reset pulse
76 if (_rst >= 0)
77 {
78 digitalWrite(_rst, LOW);
79 delay(200);
80 digitalWrite(_rst, HIGH);
81 delay(200);
82 _waitWhileBusy("init reset_to_ready", reset_to_ready_time);
83 }
84
85 _writeCommand16(USDEF_I80_CMD_GET_DEV_INFO);
86 _waitWhileBusy("GetIT8951SystemInfo", power_on_time);
87 _readData16((uint16_t*)&IT8951DevInfo, sizeof(IT8951DevInfo) / 2);
88 if (_diag_enabled)
89 {
90 //Show Device information of IT8951
91 printf("Panel(W,H) = (%d,%d)\r\n",
92 IT8951DevInfo.usPanelW, IT8951DevInfo.usPanelH );
93 printf("Image Buffer Address = %lX\r\n",
94 uint32_t(IT8951DevInfo.usImgBufAddrL) | (uint32_t(IT8951DevInfo.usImgBufAddrH) << 16));
95 //Show Firmware and LUT Version
96 printf("FW Version = %s\r\n", (uint8_t*)IT8951DevInfo.usFWVersion);
97 printf("LUT Version = %s\r\n", (uint8_t*)IT8951DevInfo.usLUTVersion);
98 }
99 //Set to Enable I80 Packed mode
100 _IT8951WriteReg(I80CPCR, 0x0001);
101 if (VCOM != _IT8951GetVCOM())
102 {
103 _IT8951SetVCOM(VCOM);
104 printf("VCOM = -%.02fV\n", (double)_IT8951GetVCOM() / 1000);
105 }
106 printf("VCOM = -%.02fV\n", (double)_IT8951GetVCOM() / 1000);
107}
#define I80CPCR
#define VCOM
#define USDEF_I80_CMD_GET_DEV_INFO
bool _diag_enabled
Definition GxEPD2_EPD.h:114
virtual void init(uint32_t serial_diag_bitrate=0)
void _waitWhileBusy(const char *comment=0, uint16_t busy_time=5000)
static const uint16_t reset_to_ready_time
static const uint16_t power_on_time

◆ init() [2/2]

void GxEPD2_it103_1872x1404::init ( uint32_t serial_diag_bitrate = 0)
virtual

Reimplemented from GxEPD2_EPD.

Definition at line 66 of file GxEPD2_it103_1872x1404.cpp.

67{
68 init(serial_diag_bitrate, true, 20, false);
69}
void init(uint32_t serial_diag_bitrate=0)

◆ powerOff()

void GxEPD2_it103_1872x1404::powerOff ( void )
virtual

Implements GxEPD2_EPD.

Definition at line 416 of file GxEPD2_it103_1872x1404.cpp.

417{
418 _PowerOff();
419}

◆ refresh() [1/2]

void GxEPD2_it103_1872x1404::refresh ( bool partial_update_mode = false)
virtual

Implements GxEPD2_EPD.

Definition at line 380 of file GxEPD2_it103_1872x1404.cpp.

381{
382 _refresh(0, 0, WIDTH, HEIGHT, partial_update_mode);
383}

◆ refresh() [2/2]

void GxEPD2_it103_1872x1404::refresh ( int16_t x,
int16_t y,
int16_t w,
int16_t h )
virtual

Implements GxEPD2_EPD.

Definition at line 385 of file GxEPD2_it103_1872x1404.cpp.

386{
387 _refresh(x, y, w, h, true);
388}

◆ writeImage() [1/2]

void GxEPD2_it103_1872x1404::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 )

Definition at line 276 of file GxEPD2_it103_1872x1404.cpp.

277{
278 if (black)
279 {
280 writeImage(black, x, y, w, h, invert, mirror_y, pgm);
281 }
282}

◆ writeImage() [2/2]

void GxEPD2_it103_1872x1404::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 )
virtual

Implements GxEPD2_EPD.

Definition at line 162 of file GxEPD2_it103_1872x1404.cpp.

163{
164 if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
165 delay(1); // yield() to avoid WDT on ESP8266 and ESP32
166 int16_t wb = (w + 7) / 8; // width bytes, bitmaps are padded
167 x -= x % 8; // byte boundary
168 w = wb * 8; // byte boundary
169 int16_t x1 = x < 0 ? 0 : x; // limit
170 int16_t y1 = y < 0 ? 0 : y; // limit
171 int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit
172 int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit
173 int16_t dx = x1 - x;
174 int16_t dy = y1 - y;
175 w1 -= dx;
176 h1 -= dy;
177 if ((w1 <= 0) || (h1 <= 0)) return;
178 if (!_using_partial_mode) _Init_Part();
179 _setPartialRamArea(x1, y1, w1, h1);
180 SPI.beginTransaction(_spi_settings);
181 if (_cs >= 0) digitalWrite(_cs, LOW);
182 _transfer16(0x0000); // preamble for write data
183 _waitWhileBusy2("writeImage preamble", default_wait_time);
184 for (int16_t i = 0; i < h1; i++)
185 {
186 for (int16_t j = 0; j < w1 / 8; j++)
187 {
188 uint8_t data;
189 // use wb, h of bitmap for index!
190 uint32_t idx = mirror_y ? uint32_t(j + dx / 8) + uint32_t((h - 1 - (i + dy))) * uint32_t(wb) : uint32_t(j + dx / 8) + uint32_t(i + dy) * uint32_t(wb);
191 if (pgm)
192 {
193#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
194 data = pgm_read_byte(&bitmap[idx]);
195#else
196 data = bitmap[idx];
197#endif
198 }
199 else
200 {
201 data = bitmap[idx];
202 }
203 if (invert) data = ~data;
204 _send8pixel(~data);
205 }
206#if defined(ESP8266) || defined(ESP32)
207 yield();
208#endif
209 }
210 if (_cs >= 0) digitalWrite(_cs, HIGH);
211 SPI.endTransaction();
212 _writeCommand16(IT8951_TCON_LD_IMG_END);
213 _waitWhileBusy2("writeImage load end", default_wait_time);
214 delay(1); // yield() to avoid WDT on ESP8266 and ESP32
215}
bool _using_partial_mode
Definition GxEPD2_EPD.h:118
void writeScreenBuffer(uint8_t value=0x33)

◆ writeImagePart() [1/2]

void GxEPD2_it103_1872x1404::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 = false,
bool mirror_y = false,
bool pgm = false )

Definition at line 284 of file GxEPD2_it103_1872x1404.cpp.

286{
287 if (black)
288 {
289 writeImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
290 }
291}

◆ writeImagePart() [2/2]

void GxEPD2_it103_1872x1404::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 )
virtual

Implements GxEPD2_EPD.

Definition at line 217 of file GxEPD2_it103_1872x1404.cpp.

219{
220 if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
221 delay(1); // yield() to avoid WDT on ESP8266 and ESP32
222 if ((w_bitmap < 0) || (h_bitmap < 0) || (w < 0) || (h < 0)) return;
223 if ((x_part < 0) || (x_part >= w_bitmap)) return;
224 if ((y_part < 0) || (y_part >= h_bitmap)) return;
225 int16_t wb_bitmap = (w_bitmap + 7) / 8; // width bytes, bitmaps are padded
226 x_part -= x_part % 8; // byte boundary
227 w = w_bitmap - x_part < w ? w_bitmap - x_part : w; // limit
228 h = h_bitmap - y_part < h ? h_bitmap - y_part : h; // limit
229 x -= x % 8; // byte boundary
230 w = 8 * ((w + 7) / 8); // byte boundary, bitmaps are padded
231 int16_t x1 = x < 0 ? 0 : x; // limit
232 int16_t y1 = y < 0 ? 0 : y; // limit
233 int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit
234 int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit
235 int16_t dx = x1 - x;
236 int16_t dy = y1 - y;
237 w1 -= dx;
238 h1 -= dy;
239 if ((w1 <= 0) || (h1 <= 0)) return;
240 if (!_using_partial_mode) _Init_Part();
241 _setPartialRamArea(x1, y1, w1, h1);
242 SPI.beginTransaction(_spi_settings);
243 if (_cs >= 0) digitalWrite(_cs, LOW);
244 _transfer16(0x0000); // preamble for write data
245 _waitWhileBusy2("writeImage preamble", default_wait_time);
246 for (int16_t i = 0; i < h1; i++)
247 {
248 for (int16_t j = 0; j < w1 / 8; j++)
249 {
250 uint8_t data;
251 // use wb_bitmap, h_bitmap of bitmap for index!
252 uint32_t idx = mirror_y ? x_part / 8 + (j + dx / 8) + uint32_t((h_bitmap - 1 - (y_part + i + dy))) * uint32_t(wb_bitmap) : x_part / 8 + j + dx / 8 + uint32_t(y_part + i + dy) * uint32_t(wb_bitmap);
253 if (pgm)
254 {
255#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
256 data = pgm_read_byte(&bitmap[idx]);
257#else
258 data = bitmap[idx];
259#endif
260 }
261 else
262 {
263 data = bitmap[idx];
264 }
265 if (invert) data = ~data;
266 _send8pixel(~data);
267 }
268 }
269 if (_cs >= 0) digitalWrite(_cs, HIGH);
270 SPI.endTransaction();
271 _writeCommand16(IT8951_TCON_LD_IMG_END);
272 _waitWhileBusy2("writeImage load end", default_wait_time);
273 delay(1); // yield() to avoid WDT on ESP8266 and ESP32
274}

◆ writeNative()

void GxEPD2_it103_1872x1404::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 )

Definition at line 293 of file GxEPD2_it103_1872x1404.cpp.

294{
295 if (data1)
296 {
297 if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
298 delay(1); // yield() to avoid WDT on ESP8266 and ESP32
299 int16_t x1 = x < 0 ? 0 : x; // limit
300 int16_t y1 = y < 0 ? 0 : y; // limit
301 int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit
302 int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit
303 int16_t dx = x1 - x;
304 int16_t dy = y1 - y;
305 w1 -= dx;
306 h1 -= dy;
307 if ((w1 <= 0) || (h1 <= 0)) return;
308 if (!_using_partial_mode) _Init_Part();
309 _setPartialRamArea(x1, y1, w1, h1);
310 SPI.beginTransaction(_spi_settings);
311 if (_cs >= 0) digitalWrite(_cs, LOW);
312 _transfer16(0x0000); // preamble for write data
313 _waitWhileBusy2("writeNative preamble", default_wait_time);
314 for (int16_t i = 0; i < h1; i++)
315 {
316 for (int16_t j = 0; j < w1; j++)
317 {
318 uint8_t data;
319 // use w, h of bitmap for index!
320 uint32_t idx = mirror_y ? uint32_t(j + dx) + uint32_t((h - 1 - (i + dy))) * uint32_t(w) : uint32_t(j + dx) + uint32_t(i + dy) * uint32_t(w);
321 if (pgm)
322 {
323#if defined(__AVR) || defined(ESP8266) || defined(ESP32)
324 data = pgm_read_byte(&data1[idx]);
325#else
326 data = data1[idx];
327#endif
328 }
329 else
330 {
331 data = data1[idx];
332 }
333 if (invert) data = ~data;
334 SPI.transfer(data);
335 }
336#if defined(ESP8266) || defined(ESP32)
337 yield();
338#endif
339 }
340 if (_cs >= 0) digitalWrite(_cs, HIGH);
341 SPI.endTransaction();
342 _writeCommand16(IT8951_TCON_LD_IMG_END);
343 _waitWhileBusy2("writeNative load end", default_wait_time);
344 delay(1); // yield() to avoid WDT on ESP8266 and ESP32
345 }
346}

◆ writeScreenBuffer()

void GxEPD2_it103_1872x1404::writeScreenBuffer ( uint8_t value = 0x33)
virtual

Implements GxEPD2_EPD.

Definition at line 134 of file GxEPD2_it103_1872x1404.cpp.

135{
136 if (_initial_refresh) clearScreen(value);
137 else _writeScreenBuffer(value);
138}
void clearScreen(uint8_t value=0x33)

Member Data Documentation

◆ default_wait_time

const uint16_t GxEPD2_it103_1872x1404::default_wait_time = 1
static

Definition at line 39 of file GxEPD2_it103_1872x1404.h.

◆ diag_min_time

const uint16_t GxEPD2_it103_1872x1404::diag_min_time = 3
static

Definition at line 40 of file GxEPD2_it103_1872x1404.h.

◆ full_refresh_time

const uint16_t GxEPD2_it103_1872x1404::full_refresh_time = 850
static

Definition at line 35 of file GxEPD2_it103_1872x1404.h.

◆ hasColor

const bool GxEPD2_it103_1872x1404::hasColor = false
static

Definition at line 29 of file GxEPD2_it103_1872x1404.h.

◆ hasFastPartialUpdate

const bool GxEPD2_it103_1872x1404::hasFastPartialUpdate = true
static

Definition at line 31 of file GxEPD2_it103_1872x1404.h.

◆ hasPartialUpdate

const bool GxEPD2_it103_1872x1404::hasPartialUpdate = true
static

Definition at line 30 of file GxEPD2_it103_1872x1404.h.

◆ HEIGHT

const uint16_t GxEPD2_it103_1872x1404::HEIGHT = 1404
static

Definition at line 27 of file GxEPD2_it103_1872x1404.h.

◆ panel

const GxEPD2::Panel GxEPD2_it103_1872x1404::panel = GxEPD2::ES103TC1
static

Definition at line 28 of file GxEPD2_it103_1872x1404.h.

◆ partial_refresh_time

const uint16_t GxEPD2_it103_1872x1404::partial_refresh_time = 300
static

Definition at line 36 of file GxEPD2_it103_1872x1404.h.

◆ power_off_time

const uint16_t GxEPD2_it103_1872x1404::power_off_time = 250
static

Definition at line 34 of file GxEPD2_it103_1872x1404.h.

◆ power_on_time

const uint16_t GxEPD2_it103_1872x1404::power_on_time = 10
static

Definition at line 33 of file GxEPD2_it103_1872x1404.h.

◆ refresh_cmd_time

const uint16_t GxEPD2_it103_1872x1404::refresh_cmd_time = 10
static

Definition at line 37 of file GxEPD2_it103_1872x1404.h.

◆ refresh_par_time

const uint16_t GxEPD2_it103_1872x1404::refresh_par_time = 2
static

Definition at line 38 of file GxEPD2_it103_1872x1404.h.

◆ reset_to_ready_time

const uint16_t GxEPD2_it103_1872x1404::reset_to_ready_time = 1800
static

Definition at line 32 of file GxEPD2_it103_1872x1404.h.

◆ set_vcom_time

const uint16_t GxEPD2_it103_1872x1404::set_vcom_time = 500
static

Definition at line 41 of file GxEPD2_it103_1872x1404.h.

◆ WIDTH

const uint16_t GxEPD2_it103_1872x1404::WIDTH = 1872
static

Definition at line 26 of file GxEPD2_it103_1872x1404.h.


The documentation for this class was generated from the following files: