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

#include <GxEPD2_290_BS.h>

Inheritance diagram for GxEPD2_290_BS:
GxEPD2_EPD

Public Member Functions

 GxEPD2_290_BS (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 writeScreenBufferAgain (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 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)
 
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)
 
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 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 = 128
 
static const uint16_t HEIGHT = 296
 
static const GxEPD2::Panel panel = GxEPD2::DEPG0290BS
 
static const bool hasColor = false
 
static const bool hasPartialUpdate = true
 
static const bool hasFastPartialUpdate = true
 
static const uint16_t power_on_time = 100
 
static const uint16_t power_off_time = 150
 
static const uint16_t full_refresh_time = 4000
 
static const uint16_t partial_refresh_time = 750
 

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 20 of file GxEPD2_290_BS.h.

Constructor & Destructor Documentation

◆ GxEPD2_290_BS()

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

Definition at line 19 of file GxEPD2_290_BS.cpp.

19 :
20 GxEPD2_EPD(cs, dc, rst, busy, HIGH, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate)
21{
22}
static const bool hasColor
static const bool hasFastPartialUpdate
static const GxEPD2::Panel panel
static const uint16_t HEIGHT
static const bool hasPartialUpdate
static const uint16_t WIDTH
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_290_BS::clearScreen ( uint8_t value = 0xFF)
virtual

Implements GxEPD2_EPD.

Definition at line 24 of file GxEPD2_290_BS.cpp.

25{
26 writeScreenBuffer(value);
27 refresh(true);
29}
void writeScreenBuffer(uint8_t value=0xFF)
void refresh(bool partial_update_mode=false)
void writeScreenBufferAgain(uint8_t value=0xFF)

◆ drawImage() [1/2]

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

224{
225 if (black)
226 {
227 drawImage(black, x, y, w, h, invert, mirror_y, pgm);
228 }
229}
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)

◆ drawImage() [2/2]

void GxEPD2_290_BS::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 208 of file GxEPD2_290_BS.cpp.

209{
210 writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
211 refresh(x, y, w, h);
212 writeImageAgain(bitmap, x, y, w, h, invert, mirror_y, pgm);
213}
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)
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)

◆ drawImagePart() [1/2]

void GxEPD2_290_BS::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 231 of file GxEPD2_290_BS.cpp.

233{
234 if (black)
235 {
236 drawImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
237 }
238}
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)

◆ drawImagePart() [2/2]

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

217{
218 writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
219 refresh(x, y, w, h);
220 writeImagePartAgain(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
221}
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)
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)

◆ drawNative()

void GxEPD2_290_BS::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 240 of file GxEPD2_290_BS.cpp.

241{
242 if (data1)
243 {
244 drawImage(data1, x, y, w, h, invert, mirror_y, pgm);
245 }
246}

◆ hibernate()

void GxEPD2_290_BS::hibernate ( )
virtual

Implements GxEPD2_EPD.

Definition at line 284 of file GxEPD2_290_BS.cpp.

285{
286 _PowerOff();
287 if (_rst >= 0)
288 {
289 _writeCommand(0x10); // deep sleep mode
290 _writeData(0x1); // enter deep sleep
291 _hibernating = true;
292 }
293}
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_290_BS::powerOff ( void )
virtual

Implements GxEPD2_EPD.

Definition at line 279 of file GxEPD2_290_BS.cpp.

280{
281 _PowerOff();
282}

◆ refresh() [1/2]

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

Implements GxEPD2_EPD.

Definition at line 248 of file GxEPD2_290_BS.cpp.

249{
250 if (partial_update_mode) refresh(0, 0, WIDTH, HEIGHT);
251 else
252 {
253 if (_using_partial_mode) _Init_Full();
254 _Update_Full();
255 _initial_refresh = false; // initial full update done
256 }
257}
bool _using_partial_mode
Definition GxEPD2_EPD.h:118
bool _initial_refresh
Definition GxEPD2_EPD.h:117

◆ refresh() [2/2]

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

Implements GxEPD2_EPD.

Definition at line 259 of file GxEPD2_290_BS.cpp.

260{
261 if (_initial_refresh) return refresh(false); // initial update needs be full update
262 // intersection with screen
263 int16_t w1 = x < 0 ? w + x : w; // reduce
264 int16_t h1 = y < 0 ? h + y : h; // reduce
265 int16_t x1 = x < 0 ? 0 : x; // limit
266 int16_t y1 = y < 0 ? 0 : y; // limit
267 w1 = x1 + w1 < int16_t(WIDTH) ? w1 : int16_t(WIDTH) - x1; // limit
268 h1 = y1 + h1 < int16_t(HEIGHT) ? h1 : int16_t(HEIGHT) - y1; // limit
269 if ((w1 <= 0) || (h1 <= 0)) return;
270 // make x1, w1 multiple of 8
271 w1 += x1 % 8;
272 if (w1 % 8 > 0) w1 += 8 - w1 % 8;
273 x1 -= x1 % 8;
274 if (!_using_partial_mode) _Init_Part();
275 _setPartialRamArea(x1, y1, w1, h1);
276 _Update_Part();
277}

◆ writeImage() [1/2]

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

184{
185 if (black)
186 {
187 writeImage(black, x, y, w, h, invert, mirror_y, pgm);
188 }
189}

◆ writeImage() [2/2]

void GxEPD2_290_BS::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 55 of file GxEPD2_290_BS.cpp.

56{
57 _writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
58}

◆ writeImageAgain()

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

Reimplemented from GxEPD2_EPD.

Definition at line 67 of file GxEPD2_290_BS.cpp.

68{
69 _writeImage(0x26, bitmap, x, y, w, h, invert, mirror_y, pgm); // set previous
70 _writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm); // set current
71}

◆ writeImageForFullRefresh()

void GxEPD2_290_BS::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 60 of file GxEPD2_290_BS.cpp.

61{
62 _writeImage(0x26, bitmap, x, y, w, h, invert, mirror_y, pgm); // set previous
63 _writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
64}

◆ writeImagePart() [1/2]

void GxEPD2_290_BS::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 191 of file GxEPD2_290_BS.cpp.

193{
194 if (black)
195 {
196 writeImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
197 }
198}

◆ writeImagePart() [2/2]

void GxEPD2_290_BS::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 118 of file GxEPD2_290_BS.cpp.

120{
121 _writeImagePart(0x24, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
122}

◆ writeImagePartAgain()

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

Reimplemented from GxEPD2_EPD.

Definition at line 124 of file GxEPD2_290_BS.cpp.

126{
127 _writeImagePart(0x26, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); // set previous
128 _writeImagePart(0x24, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); // set current
129}

◆ writeNative()

void GxEPD2_290_BS::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 200 of file GxEPD2_290_BS.cpp.

201{
202 if (data1)
203 {
204 writeImage(data1, x, y, w, h, invert, mirror_y, pgm);
205 }
206}

◆ writeScreenBuffer()

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

Implements GxEPD2_EPD.

Definition at line 31 of file GxEPD2_290_BS.cpp.

32{
33 if (!_using_partial_mode) _Init_Part();
34 if (_initial_write) _writeScreenBuffer(0x26, value); // set previous
35 _writeScreenBuffer(0x24, value); // set current
36 _initial_write = false; // initial full screen buffer clean done
37}
bool _initial_write
Definition GxEPD2_EPD.h:117

◆ writeScreenBufferAgain()

void GxEPD2_290_BS::writeScreenBufferAgain ( uint8_t value = 0xFF)
virtual

Reimplemented from GxEPD2_EPD.

Definition at line 39 of file GxEPD2_290_BS.cpp.

40{
41 if (!_using_partial_mode) _Init_Part();
42 _writeScreenBuffer(0x26, value); // set previous
43 _writeScreenBuffer(0x24, value); // set current
44}

Member Data Documentation

◆ full_refresh_time

const uint16_t GxEPD2_290_BS::full_refresh_time = 4000
static

Definition at line 32 of file GxEPD2_290_BS.h.

◆ hasColor

const bool GxEPD2_290_BS::hasColor = false
static

Definition at line 27 of file GxEPD2_290_BS.h.

◆ hasFastPartialUpdate

const bool GxEPD2_290_BS::hasFastPartialUpdate = true
static

Definition at line 29 of file GxEPD2_290_BS.h.

◆ hasPartialUpdate

const bool GxEPD2_290_BS::hasPartialUpdate = true
static

Definition at line 28 of file GxEPD2_290_BS.h.

◆ HEIGHT

const uint16_t GxEPD2_290_BS::HEIGHT = 296
static

Definition at line 25 of file GxEPD2_290_BS.h.

◆ panel

const GxEPD2::Panel GxEPD2_290_BS::panel = GxEPD2::DEPG0290BS
static

Definition at line 26 of file GxEPD2_290_BS.h.

◆ partial_refresh_time

const uint16_t GxEPD2_290_BS::partial_refresh_time = 750
static

Definition at line 33 of file GxEPD2_290_BS.h.

◆ power_off_time

const uint16_t GxEPD2_290_BS::power_off_time = 150
static

Definition at line 31 of file GxEPD2_290_BS.h.

◆ power_on_time

const uint16_t GxEPD2_290_BS::power_on_time = 100
static

Definition at line 30 of file GxEPD2_290_BS.h.

◆ WIDTH

const uint16_t GxEPD2_290_BS::WIDTH = 128
static

Definition at line 24 of file GxEPD2_290_BS.h.


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