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

#include <GxEPD2_1248c.h>

Inheritance diagram for GxEPD2_1248c:
GxEPD2_EPD

Public Member Functions

 GxEPD2_1248c (int16_t cs_m1, int16_t cs_s1, int16_t cs_m2, int16_t cs_s2, int16_t dc1, int16_t dc2, int16_t rst1, int16_t rst2, int16_t busy_m1, int16_t busy_s1, int16_t busy_m2, int16_t busy_s2)
 
 GxEPD2_1248c (int16_t cs_m1, int16_t cs_s1, int16_t cs_m2, int16_t cs_s2, 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=0xFF)
 
void writeScreenBuffer (uint8_t value=0xFF)
 
void writeScreenBuffer (uint8_t black_value, uint8_t color_value)
 
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 = 1304
 
static const uint16_t WIDTH_VISIBLE = WIDTH
 
static const uint16_t HEIGHT = 984
 
static const GxEPD2::Panel panel = GxEPD2::GDEY1248Z51
 
static const bool hasColor = true
 
static const bool hasPartialUpdate = true
 
static const bool hasFastPartialUpdate = false
 
static const uint16_t power_on_time = 200
 
static const uint16_t power_off_time = 50
 
static const uint16_t full_refresh_time = 18000
 
static const uint16_t partial_refresh_time = 18000
 

Friends

class GDEW1248T3_OTP
 

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_1248c.h.

Constructor & Destructor Documentation

◆ GxEPD2_1248c() [1/2]

GxEPD2_1248c::GxEPD2_1248c ( int16_t cs_m1,
int16_t cs_s1,
int16_t cs_m2,
int16_t cs_s2,
int16_t dc1,
int16_t dc2,
int16_t rst1,
int16_t rst2,
int16_t busy_m1,
int16_t busy_s1,
int16_t busy_m2,
int16_t busy_s2 )

Definition at line 39 of file GxEPD2_1248c.cpp.

41 :
42 GxEPD2_EPD(cs_m1, dc1, rst1, busy_m1, LOW, 20000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate),
43 _sck(SCK), _miso(MISO), _mosi(MOSI), _dc1(dc1), _dc2(dc2), _rst1(rst1), _rst2(rst2),
44 _cs_m1(cs_m1), _cs_s1(cs_s1), _cs_m2(cs_m2), _cs_s2(cs_s2),
45 _busy_m1(busy_m1), _busy_s1(busy_s1), _busy_m2(busy_m2), _busy_s2(busy_s2),
46 _temperature(20),
47 M1(648, 492, false, cs_m1, dc1),
48 S1(656, 492, false, cs_s1, dc1),
49 M2(656, 492, true, cs_m2, dc2),
50 S2(648, 492, true, cs_s2, dc2)
51{
52}
static const GxEPD2::Panel panel
static const bool hasFastPartialUpdate
static const uint16_t WIDTH
static const bool hasPartialUpdate
static const uint16_t HEIGHT
static const bool hasColor
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)

◆ GxEPD2_1248c() [2/2]

GxEPD2_1248c::GxEPD2_1248c ( int16_t cs_m1,
int16_t cs_s1,
int16_t cs_m2,
int16_t cs_s2,
int16_t dc,
int16_t rst,
int16_t busy )

Definition at line 55 of file GxEPD2_1248c.cpp.

55 :
56 GxEPD2_EPD(23, 25, 33, 32, LOW, 20000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate),
57 _sck(SCK), _miso(MISO), _mosi(MOSI), _dc1(dc), _dc2(dc), _rst1(rst), _rst2(rst),
58 _cs_m1(cs_m1), _cs_s1(cs_s1), _cs_m2(cs_m2), _cs_s2(cs_s2),
59 _busy_m1(busy), _busy_s1(busy), _busy_m2(busy), _busy_s2(busy),
60 _temperature(20),
61 M1(648, 492, false, cs_m1, dc),
62 S1(656, 492, false, cs_s1, dc),
63 M2(656, 492, true, cs_m2, dc),
64 S2(648, 492, true, cs_s2, dc)
65{
66}

Member Function Documentation

◆ clearScreen()

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

Implements GxEPD2_EPD.

Definition at line 106 of file GxEPD2_1248c.cpp.

107{
108 writeScreenBuffer(value);
109 refresh(true);
110}
void refresh(bool partial_update_mode=false)
void writeScreenBuffer(uint8_t value=0xFF)

◆ drawImage() [1/2]

void GxEPD2_1248c::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 210 of file GxEPD2_1248c.cpp.

211{
212 writeImage(black, color, x, y, w, h, invert, mirror_y, pgm);
213 refresh(x, y, w, h);
214}
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_1248c::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 197 of file GxEPD2_1248c.cpp.

198{
199 writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
200 refresh(x, y, w, h);
201}

◆ drawImagePart() [1/2]

void GxEPD2_1248c::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 216 of file GxEPD2_1248c.cpp.

218{
219 writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
220 refresh(x, y, w, h);
221}
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_1248c::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 203 of file GxEPD2_1248c.cpp.

205{
206 writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
207 refresh(x, y, w, h);
208}

◆ drawNative()

void GxEPD2_1248c::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 223 of file GxEPD2_1248c.cpp.

224{
225 writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm);
226 refresh(x, y, w, h);
227}
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_1248c::hibernate ( )
virtual

Implements GxEPD2_EPD.

Definition at line 252 of file GxEPD2_1248c.cpp.

253{
254 _PowerOff();
255 if (_rst >= 0)
256 {
257 _writeCommandAll(0x07); // deep sleep
258 _writeDataAll(0xA5); // check code
259 _hibernating = true;
260 }
261}
int16_t _rst
Definition GxEPD2_EPD.h:112
bool _hibernating
Definition GxEPD2_EPD.h:118

◆ init() [1/2]

void GxEPD2_1248c::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 73 of file GxEPD2_1248c.cpp.

74{
75 _initial_write = initial;
76 _initial_refresh = initial;
77 _using_partial_mode = false;
78 if (serial_diag_bitrate > 0)
79 {
80 Serial.begin(serial_diag_bitrate);
81 _diag_enabled = true;
82 Serial.println(); Serial.println("GxEPD2_1248c::init()");
83 }
84 pinMode(_cs_m1, OUTPUT);
85 pinMode(_cs_s1, OUTPUT);
86 pinMode(_cs_m2, OUTPUT);
87 pinMode(_cs_s2, OUTPUT);
88 pinMode(_dc1, OUTPUT);
89 pinMode(_dc2, OUTPUT);
90 pinMode(_rst1, OUTPUT);
91 pinMode(_rst2, OUTPUT);
92 pinMode(_busy_m1, INPUT);
93 pinMode(_busy_s1, INPUT);
94 pinMode(_busy_m2, INPUT);
95 pinMode(_busy_s2, INPUT);
96 digitalWrite(_cs_m1, HIGH);
97 digitalWrite(_cs_s1, HIGH);
98 digitalWrite(_cs_m2, HIGH);
99 digitalWrite(_cs_s2, HIGH);
100 _initSPI();
101 _reset();
102 // only relevant for full refresh, comment out if 20 is ok
103 _getMasterTemperature();
104}
bool _diag_enabled
Definition GxEPD2_EPD.h:114
bool _using_partial_mode
Definition GxEPD2_EPD.h:118
bool _initial_refresh
Definition GxEPD2_EPD.h:117
bool _initial_write
Definition GxEPD2_EPD.h:117

◆ init() [2/2]

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

Reimplemented from GxEPD2_EPD.

Definition at line 68 of file GxEPD2_1248c.cpp.

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

◆ powerOff()

void GxEPD2_1248c::powerOff ( void )
virtual

Implements GxEPD2_EPD.

Definition at line 247 of file GxEPD2_1248c.cpp.

248{
249 _PowerOff();
250}

◆ refresh() [1/2]

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

Implements GxEPD2_EPD.

Definition at line 229 of file GxEPD2_1248c.cpp.

230{
231 if (partial_update_mode) refresh(0, 0, WIDTH, HEIGHT);
232 else
233 {
234 if (_using_partial_mode) _Init_Full();
235 _Update_Full();
236 _initial_refresh = false; // initial full update done
237 }
238}

◆ refresh() [2/2]

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

Implements GxEPD2_EPD.

Definition at line 240 of file GxEPD2_1248c.cpp.

241{
242 if (_initial_refresh) return refresh(false); // initial update needs be full update
243 if (!_using_partial_mode) _Init_Part();
244 _Update_Part();
245}

◆ writeImage() [1/2]

void GxEPD2_1248c::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_1248c.cpp.

176{
177 if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
178 if (!_using_partial_mode) _Init_Part();
179 _writeImage(0x10, black, x, y, w, h, invert, mirror_y, pgm);
180 _writeImage(0x13, color, x, y, w, h, !invert, mirror_y, pgm);
181}

◆ writeImage() [2/2]

void GxEPD2_1248c::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 147 of file GxEPD2_1248c.cpp.

148{
149 if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
150 if (!_using_partial_mode) _Init_Part();
151 _writeImage(0x10, bitmap, x, y, w, h, invert, mirror_y, pgm); // black
152 _writeScreenBuffer(0x13, 0x0); // color (white)
153}

◆ writeImagePart() [1/2]

void GxEPD2_1248c::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_1248c.cpp.

185{
186 if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
187 if (!_using_partial_mode) _Init_Part();
188 _writeImagePart(0x10, black, x_part, y_part, w, h, x, y, w, h, invert, mirror_y, pgm);
189 _writeImagePart(0x13, color, x_part, y_part, w, h, x, y, w, h, !invert, mirror_y, pgm);
190}

◆ writeImagePart() [2/2]

void GxEPD2_1248c::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 167 of file GxEPD2_1248c.cpp.

169{
170 if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean
171 if (!_using_partial_mode) _Init_Part();
172 _writeImagePart(0x10, bitmap, x_part, y_part, w, h, x, y, w, h, invert, mirror_y, pgm); // black
173}

◆ writeNative()

void GxEPD2_1248c::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_1248c.cpp.

193{
194 writeImage(data1, data2, x, y, w, h, invert, mirror_y, pgm);
195}

◆ writeScreenBuffer() [1/2]

void GxEPD2_1248c::writeScreenBuffer ( uint8_t black_value,
uint8_t color_value )

Definition at line 128 of file GxEPD2_1248c.cpp.

129{
130 if (!_using_partial_mode) _Init_Part();
131 _writeScreenBuffer(0x10, black_value); // black
132 _writeScreenBuffer(0x13, color_value); // color
133 _initial_write = false; // initial full screen buffer clean done
134}

◆ writeScreenBuffer() [2/2]

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

Implements GxEPD2_EPD.

Definition at line 120 of file GxEPD2_1248c.cpp.

121{
122 if (!_using_partial_mode) _Init_Part();
123 _writeScreenBuffer(0x10, value); // black
124 _writeScreenBuffer(0x13, ~value); // color
125 _initial_write = false; // initial full screen buffer clean done
126}

Friends And Related Symbol Documentation

◆ GDEW1248T3_OTP

friend class GDEW1248T3_OTP
friend

Definition at line 102 of file GxEPD2_1248c.h.

Member Data Documentation

◆ full_refresh_time

const uint16_t GxEPD2_1248c::full_refresh_time = 18000
static

Definition at line 35 of file GxEPD2_1248c.h.

◆ hasColor

const bool GxEPD2_1248c::hasColor = true
static

Definition at line 30 of file GxEPD2_1248c.h.

◆ hasFastPartialUpdate

const bool GxEPD2_1248c::hasFastPartialUpdate = false
static

Definition at line 32 of file GxEPD2_1248c.h.

◆ hasPartialUpdate

const bool GxEPD2_1248c::hasPartialUpdate = true
static

Definition at line 31 of file GxEPD2_1248c.h.

◆ HEIGHT

const uint16_t GxEPD2_1248c::HEIGHT = 984
static

Definition at line 28 of file GxEPD2_1248c.h.

◆ panel

const GxEPD2::Panel GxEPD2_1248c::panel = GxEPD2::GDEY1248Z51
static

Definition at line 29 of file GxEPD2_1248c.h.

◆ partial_refresh_time

const uint16_t GxEPD2_1248c::partial_refresh_time = 18000
static

Definition at line 36 of file GxEPD2_1248c.h.

◆ power_off_time

const uint16_t GxEPD2_1248c::power_off_time = 50
static

Definition at line 34 of file GxEPD2_1248c.h.

◆ power_on_time

const uint16_t GxEPD2_1248c::power_on_time = 200
static

Definition at line 33 of file GxEPD2_1248c.h.

◆ WIDTH

const uint16_t GxEPD2_1248c::WIDTH = 1304
static

Definition at line 26 of file GxEPD2_1248c.h.

◆ WIDTH_VISIBLE

const uint16_t GxEPD2_1248c::WIDTH_VISIBLE = WIDTH
static

Definition at line 27 of file GxEPD2_1248c.h.


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