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

#include <GxEPD2_102.h>

Inheritance diagram for GxEPD2_102:
GxEPD2_EPD

Public Member Functions

 GxEPD2_102 (int16_t cs, int16_t dc, int16_t rst, int16_t busy)
 
void clearScreen (uint8_t value=0xFF)
 
void writeScreenBuffer (uint8_t value=0xFF)
 
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 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)
 
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 init (uint32_t serial_diag_bitrate=0)
 
virtual void init (uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration=10, bool pulldown_rst_mode=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 = 80
 
static const uint16_t HEIGHT = 128
 
static const GxEPD2::Panel panel = GxEPD2::GDEW0102T4
 
static const bool hasColor = false
 
static const bool hasPartialUpdate = true
 
static const bool usePartialUpdateWindow = false
 
static const bool hasFastPartialUpdate = true
 
static const bool useOTPforFullRefresh = true
 
static const uint16_t power_on_time = 250
 
static const uint16_t power_off_time = 250
 
static const uint16_t full_refresh_time = 3600
 
static const uint16_t partial_refresh_time = 1200
 

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 19 of file GxEPD2_102.h.

Constructor & Destructor Documentation

◆ GxEPD2_102()

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

Definition at line 16 of file GxEPD2_102.cpp.

16 :
17 GxEPD2_EPD(cs, dc, rst, busy, LOW, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate)
18{
19}
static const bool hasPartialUpdate
Definition GxEPD2_102.h:27
static const bool hasFastPartialUpdate
Definition GxEPD2_102.h:29
static const uint16_t HEIGHT
Definition GxEPD2_102.h:24
static const bool hasColor
Definition GxEPD2_102.h:26
static const GxEPD2::Panel panel
Definition GxEPD2_102.h:25
static const uint16_t WIDTH
Definition GxEPD2_102.h:23
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)

Member Function Documentation

◆ clearScreen()

void GxEPD2_102::clearScreen ( uint8_t value = 0xFF)
virtual

Implements GxEPD2_EPD.

Definition at line 21 of file GxEPD2_102.cpp.

22{
23 writeScreenBuffer(value);
24 refresh(true);
25 writeScreenBuffer(value);
26}
void refresh(bool partial_update_mode=false)
void writeScreenBuffer(uint8_t value=0xFF)

◆ drawImage() [1/2]

void GxEPD2_102::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 215 of file GxEPD2_102.cpp.

216{
217 writeImage(black, color, x, y, w, h, invert, mirror_y, pgm);
218 refresh(x, y, w, h);
219 writeImage(black, color, x, y, w, h, invert, mirror_y, pgm);
220}
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_102::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 200 of file GxEPD2_102.cpp.

201{
202 writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
203 refresh(x, y, w, h);
204 writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
205}

◆ drawImagePart() [1/2]

void GxEPD2_102::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 222 of file GxEPD2_102.cpp.

224{
225 writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
226 refresh(x, y, w, h);
227 writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
228}
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_102::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 207 of file GxEPD2_102.cpp.

209{
210 writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
211 refresh(x, y, w, h);
212 writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
213}

◆ drawNative()

void GxEPD2_102::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 230 of file GxEPD2_102.cpp.

231{
232 writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm);
233 refresh(x, y, w, h);
234 writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm);
235}
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_102::hibernate ( )
virtual

Implements GxEPD2_EPD.

Definition at line 275 of file GxEPD2_102.cpp.

276{
277 _PowerOff();
278 if (_rst >= 0)
279 {
280 _writeCommand(0x07); // deep sleep
281 _writeData(0xA5); // check code
282 _hibernating = true;
283 }
284}
void _writeCommand(uint8_t c)
void _writeData(uint8_t d)
int16_t _rst
Definition GxEPD2_EPD.h:112
bool _hibernating
Definition GxEPD2_EPD.h:118

◆ powerOff()

void GxEPD2_102::powerOff ( void )
virtual

Implements GxEPD2_EPD.

Definition at line 270 of file GxEPD2_102.cpp.

271{
272 _PowerOff();
273}

◆ refresh() [1/2]

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

Implements GxEPD2_EPD.

Definition at line 237 of file GxEPD2_102.cpp.

238{
239 if (partial_update_mode) refresh(0, 0, WIDTH, HEIGHT);
240 else
241 {
242 if (_using_partial_mode) _Init_Full();
243 _Update_Full();
244 _initial_refresh = false; // initial full update done
245 }
246}
bool _using_partial_mode
Definition GxEPD2_EPD.h:118
bool _initial_refresh
Definition GxEPD2_EPD.h:117

◆ refresh() [2/2]

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

Implements GxEPD2_EPD.

Definition at line 248 of file GxEPD2_102.cpp.

249{
250 if (_initial_refresh) return refresh(false); // initial update needs be full update
251 // intersection with screen
252 int16_t w1 = x < 0 ? w + x : w; // reduce
253 int16_t h1 = y < 0 ? h + y : h; // reduce
254 int16_t x1 = x < 0 ? 0 : x; // limit
255 int16_t y1 = y < 0 ? 0 : y; // limit
256 w1 = x1 + w1 < int16_t(WIDTH) ? w1 : int16_t(WIDTH) - x1; // limit
257 h1 = y1 + h1 < int16_t(HEIGHT) ? h1 : int16_t(HEIGHT) - y1; // limit
258 if ((w1 <= 0) || (h1 <= 0)) return;
259 // make x1, w1 multiple of 8
260 w1 += x1 % 8;
261 if (w1 % 8 > 0) w1 += 8 - w1 % 8;
262 x1 -= x1 % 8;
263 if (!_using_partial_mode) _Init_Part();
264 if (usePartialUpdateWindow) _writeCommand(0x91); // partial in
265 _setPartialRamArea(x1, y1, w1, h1);
266 _Update_Part();
267 if (usePartialUpdateWindow) _writeCommand(0x92); // partial out
268}
static const bool usePartialUpdateWindow
Definition GxEPD2_102.h:28

◆ writeImage() [1/2]

void GxEPD2_102::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 175 of file GxEPD2_102.cpp.

176{
177 if (black)
178 {
179 writeImage(black, x, y, w, h, invert, mirror_y, pgm);
180 }
181}

◆ writeImage() [2/2]

void GxEPD2_102::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 51 of file GxEPD2_102.cpp.

52{
53 _writeImage(0x13, bitmap, x, y, w, h, invert, mirror_y, pgm);
54}

◆ writeImageForFullRefresh()

void GxEPD2_102::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

Reimplemented from GxEPD2_EPD.

Definition at line 56 of file GxEPD2_102.cpp.

57{
58 _writeImage(0x10, bitmap, x, y, w, h, invert, mirror_y, pgm);
59 _writeImage(0x13, bitmap, x, y, w, h, invert, mirror_y, pgm);
60}

◆ writeImagePart() [1/2]

void GxEPD2_102::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 183 of file GxEPD2_102.cpp.

185{
186 if (black)
187 {
188 writeImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
189 }
190}

◆ writeImagePart() [2/2]

void GxEPD2_102::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 113 of file GxEPD2_102.cpp.

115{
116 _writeImagePart(0x13, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
117}

◆ writeNative()

void GxEPD2_102::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 192 of file GxEPD2_102.cpp.

193{
194 if (data1)
195 {
196 writeImage(data1, x, y, w, h, invert, mirror_y, pgm);
197 }
198}

◆ writeScreenBuffer()

void GxEPD2_102::writeScreenBuffer ( uint8_t value = 0xFF)
virtual

Implements GxEPD2_EPD.

Definition at line 28 of file GxEPD2_102.cpp.

29{
30 _initial_write = false; // initial full screen buffer clean done
31 if (!_using_partial_mode) _Init_Part();
33 {
34 _writeCommand(0x10); // init old data
36 for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++)
37 {
38 _transfer(value);
39 }
41 }
42 _writeCommand(0x13);
44 for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++)
45 {
46 _transfer(value);
47 }
49}
void _endTransfer()
void _startTransfer()
void _transfer(uint8_t value)
bool _initial_write
Definition GxEPD2_EPD.h:117

Member Data Documentation

◆ full_refresh_time

const uint16_t GxEPD2_102::full_refresh_time = 3600
static

Definition at line 33 of file GxEPD2_102.h.

◆ hasColor

const bool GxEPD2_102::hasColor = false
static

Definition at line 26 of file GxEPD2_102.h.

◆ hasFastPartialUpdate

const bool GxEPD2_102::hasFastPartialUpdate = true
static

Definition at line 29 of file GxEPD2_102.h.

◆ hasPartialUpdate

const bool GxEPD2_102::hasPartialUpdate = true
static

Definition at line 27 of file GxEPD2_102.h.

◆ HEIGHT

const uint16_t GxEPD2_102::HEIGHT = 128
static

Definition at line 24 of file GxEPD2_102.h.

◆ panel

const GxEPD2::Panel GxEPD2_102::panel = GxEPD2::GDEW0102T4
static

Definition at line 25 of file GxEPD2_102.h.

◆ partial_refresh_time

const uint16_t GxEPD2_102::partial_refresh_time = 1200
static

Definition at line 34 of file GxEPD2_102.h.

◆ power_off_time

const uint16_t GxEPD2_102::power_off_time = 250
static

Definition at line 32 of file GxEPD2_102.h.

◆ power_on_time

const uint16_t GxEPD2_102::power_on_time = 250
static

Definition at line 31 of file GxEPD2_102.h.

◆ useOTPforFullRefresh

const bool GxEPD2_102::useOTPforFullRefresh = true
static

Definition at line 30 of file GxEPD2_102.h.

◆ usePartialUpdateWindow

const bool GxEPD2_102::usePartialUpdateWindow = false
static

Definition at line 28 of file GxEPD2_102.h.

◆ WIDTH

const uint16_t GxEPD2_102::WIDTH = 80
static

Definition at line 23 of file GxEPD2_102.h.


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