SparkFun SSD168x Library  v1.0.2
Library for SSD1680 / SSD1681 e-paper displays on SPI
Loading...
Searching...
No Matches
SparkFun_SSD168x_Library.h
Go to the documentation of this file.
1
38#pragma once
39
40#include "sfe_platform.h"
41#include "sfe_bus.h"
42#include "sfe_debug.h"
43
44// include the underlying SDK implementation headers for the SSD168x devices
50
51#if defined(SFE_SSD168X_ESP_IDF)
52#include <stdarg.h>
53#endif
54
55// Friendly typenames
58
59// COLOR_ON and COLOR_OFF are defined in qwiic_grbuffer.cpp:
60// COLOR_ON = 1 indicates the pixel is 'on': black on e-paper (inverted)
61// COLOR_OFF = 0 indicates the pixel is 'off': white on e-paper (inverted)
62
63#if defined(SFE_SSD168X_ESP_IDF)
64
70class SSD168xPrint
71{
72 public:
73 virtual ~SSD168xPrint() {}
74
81 virtual size_t write(uint8_t theChar) = 0;
82
84 size_t print(const char *str)
85 {
86 size_t n = 0;
87 if (str)
88 while (*str)
89 n += write((uint8_t)*str++);
90 return n;
91 }
93 size_t print(const std::string &str)
94 {
95 return print(str.c_str());
96 }
98 size_t print(char c)
99 {
100 return write((uint8_t)c);
101 }
103 size_t print(long value)
104 {
105 char buf[24];
106 snprintf(buf, sizeof(buf), "%ld", value);
107 return print(buf);
108 }
110 size_t print(int value)
111 {
112 return print((long)value);
113 }
115 size_t print(unsigned long value, int base = DEC)
116 {
117 char buf[24];
118 snprintf(buf, sizeof(buf), (base == HEX) ? "%lX" : "%lu", value);
119 return print(buf);
120 }
122 size_t print(unsigned int value, int base = DEC)
123 {
124 return print((unsigned long)value, base);
125 }
127 size_t print(double value, int decimalPlaces = 2)
128 {
129 char buf[40];
130 snprintf(buf, sizeof(buf), "%.*f", decimalPlaces, value);
131 return print(buf);
132 }
134 size_t println(void)
135 {
136 return write((uint8_t)'\n');
137 }
139 size_t println(const char *str)
140 {
141 return print(str) + println();
142 }
144 size_t println(const std::string &str)
145 {
146 return print(str) + println();
147 }
149 size_t println(long value)
150 {
151 return print(value) + println();
152 }
154 size_t println(int value)
155 {
156 return print(value) + println();
157 }
159 size_t println(unsigned long value, int base = DEC)
160 {
161 return print(value, base) + println();
162 }
164 size_t println(unsigned int value, int base = DEC)
165 {
166 return print(value, base) + println();
167 }
169 size_t println(double value, int decimalPlaces = 2)
170 {
171 return print(value, decimalPlaces) + println();
172 }
179 size_t printf(const char *format, ...) __attribute__((format(printf, 2, 3)))
180 {
181 char buf[129];
182 va_list args;
183 va_start(args, format);
184 vsnprintf(buf, sizeof(buf), format, args);
185 va_end(args);
186 return print(buf);
187 }
188};
189
190typedef SSD168xPrint SSD168xPrintBase; // The base class for the text output: SSD168xPrint on ESP-IDF
191
192#else
193
194typedef Print SSD168xPrintBase; // The base class for the text output: Arduino Print
195
196#endif
197
198// The Plan:
199//
200// For each supported device the following is needed
201//
202// - A common Arduino / ESP-IDF interface/implementation. One impl, one area to maintain
203// - Classes that are specialized for each device
204// - No abstract methods that a subclass must implement
205//
206// The solution
207// A templated base class that device specific sub-classes derive from.
208//
209
210// Define the template and fill in the interface methods in-line.
211
220template <typename DeviceType> class SSD168xSPIBaseClass : public SSD168xPrintBase
221{
222 public:
223 // The platform types, from namespace SparkFun_SSD168x (see sfe_platform.h and sfe_bus.h)
224 typedef SparkFun_SSD168x::sfe_print_t sfe_print_t;
225 typedef SparkFun_SSD168x::sfe_string_t sfe_string_t;
226
227 protected:
228 // our device driver
229 DeviceType m_device;
230
231 private:
232 SparkFun_SSD168x::SfeSPI m_spiBus; // our SPI bus object
233
234 // for the Arduino print functionality
235 uint8_t m_cursorX;
236 uint8_t m_cursorY;
237
238 uint8_t m_color;
239
241 // initDevice()
242 //
243 // Common code for all begin() methods - once the SPI bus object has been initialized
244
245 bool initDevice(int resetPin, int busyPin)
246 {
247 // defaults for Arduino Print
248 setCursor(0, 0);
250
251 m_device.setCommBus(m_spiBus, resetPin, busyPin);
252
253 // call init on the device
254 bool bStatus = m_device.init();
255
256 // Want to start cursor at Y height of the current font, if we have a font.
257 //
258 // Get our font height ... a default font is set during init ...
259 if (bStatus)
260 {
261 QwiicEpFont *pFont = m_device.font();
262 if (pFont)
263 m_cursorY = pFont->height;
264 }
265
266 return bStatus;
267 }
268
269 public:
270#if defined(SFE_SSD168X_ARDUINO)
271
273 // begin()
274 //
275 // This method is called to initialize the SSD168x library and the connection to
276 // the e-Paper display. This method must be called before calling any graphics methods.
277 //
278 // This method follows the standard startup pattern in SparkFun Arduino
279 // libraries.
280 //
281 // The SPI port must have been started (SPI.begin()) before calling begin().
282
298 bool begin(int csPin, int dcPin, int resetPin, int busyPin, SPIClass &spiPort = SPI,
299 uint32_t spiClockHz = SparkFun_SSD168x::kDefaultSpiClockHz)
300 {
301 if (!m_spiBus.init(spiPort, spiClockHz, csPin, dcPin))
302 {
303 m_device.debugPrintln("begin: invalid CS or D/C pin", true);
304 return false;
305 }
306
307 return initDevice(resetPin, busyPin);
308 }
309
316 void enableDebugging(Print &debugPort = Serial, bool printLimitedDebug = false)
317 {
318 m_device.enableDebugging(debugPort, printLimitedDebug);
319 }
320
321#elif defined(SFE_SSD168X_ESP_IDF)
322
338 bool begin(spi_host_device_t host, gpio_num_t csPin, gpio_num_t dcPin, gpio_num_t resetPin, gpio_num_t busyPin,
339 uint32_t spiClockHz = SparkFun_SSD168x::kDefaultSpiClockHz)
340 {
341 if (!m_spiBus.init(host, csPin, dcPin, spiClockHz))
342 {
343 m_device.debugPrintln("begin: SPI init failed", true);
344 return false;
345 }
346
347 return initDevice((int)resetPin, (int)busyPin);
348 }
349
362 bool begin(spi_device_handle_t device, gpio_num_t csPin, gpio_num_t dcPin, gpio_num_t resetPin, gpio_num_t busyPin)
363 {
364 if (!m_spiBus.init(device, csPin, dcPin))
365 {
366 m_device.debugPrintln("begin: SPI init failed", true);
367 return false;
368 }
369
370 return initDevice((int)resetPin, (int)busyPin);
371 }
372
379 void enableDebugging(sfe_print_t &debugPort = SparkFun_SSD168x::sfeStdout, bool printLimitedDebug = false)
380 {
381 m_device.enableDebugging(debugPort, printLimitedDebug);
382 }
383
384#endif
385
390 {
391 m_device.disableDebugging();
392 }
393
395 // getWidth()
396
402 uint8_t getWidth(void)
403 {
404 return m_device.width();
405 }
406
408 // getHeight()
409
415 uint8_t getHeight(void)
416 {
417 return m_device.height();
418 }
419
421 // reset()
422
431 bool reset(void)
432 {
433 return m_device.reset();
434 }
435
437 // display()
438
452 void display(bool partial = false, bool dirtyOnly = true)
453 {
454 m_device.display(partial, dirtyOnly);
455 }
456
458 // erase()
459
465 void erase(void)
466 {
467 m_device.erase();
468 }
469
471 // deepSleep()
472
480 void deepSleep(bool mode2 = false)
481 {
482 m_device.deepSleep(mode2);
483 }
484
486 // isBusy()
487
493 bool isBusy(void)
494 {
495 return m_device.isBusy();
496 }
497
499 // setFont()
500 //
501 // For the library, fonts are added to your program by including them via include files which
502 // are part of this library.
503 //
504 // The following fonts are included:
505 //
506 // Font Include File Font Variable Description
507 // ----------- --------------------- ---------------- ---------------------
508 // 5x7 <res/qw_ep_fnt_5x7.h> QW_EP_FONT_5X7 5 x 7 font, all 255 characters
509 // 8x16 <res/qw_ep_fnt_8x16.h> QW_EP_FONT_8X16 8 x 16 font, 96 characters from space to ~
510 // 10x20 <res/qw_ep_fnt_10x20.h> QW_EP_FONT_10X20 10 x 20 font, 96 characters from space to ~
511 // 31x48 <res/qw_ep_fnt_31x48.h> QW_EP_FONT_31X48 31 x 48 font, 58 characters from A to z
512 // Seven Segment <res/qw_ep_fnt_7segment.h> QW_EP_FONT_7SEGMENT 13 characters: ./0123456789:
513 // Large Numbers <res/qw_ep_fnt_largenum.h> QW_EP_FONT_LARGENUM 11 characters: 0123456789:
514 //
515 // For each font, the font variables are objects with the following attributes:
516 //
517 // Attribute Value
518 // ---------- -------------------------------------
519 // width The font width in pixels
520 // height The font height in pixels
521 // start The font start character offset
522 // n_chars The number of characters
523 // map_width The width of the font map
524 //
525 // Example use of a font object attribute:
526 //
527 // #include <res/qw_ep_fnt_31x48.h>
528 //
529 // int myFontWidth = QW_EP_FONT_31X48.width;
530 //
531
539 void setFont(QwiicEpFont &theFont)
540 {
541 m_device.setFont(theFont);
542 }
548 void setFont(const QwiicEpFont *theFont)
549 {
550 m_device.setFont(theFont);
551 }
552
554 // getFont()
555
562 {
563 return m_device.font();
564 }
565
567 // getFontName()
568
575 {
576 QwiicEpFont *pFont = m_device.font();
577
578 if (!pFont)
579 return sfe_string_t("");
580
581 return sfe_string_t(pFont->name);
582 }
583
585 // getStringWidth()
586
594 {
595 return getStringWidth(text.c_str());
596 }
597
604 unsigned int getStringWidth(const char *text)
605 {
606 uint16_t height, width;
607
608 return (m_device.getStringSize(text, width, height) ? width : 0);
609 }
610
612 // getStringHeight()
613
621 {
622 return getStringHeight(text.c_str());
623 }
624
631 unsigned int getStringHeight(const char *text)
632 {
633 uint16_t height, width;
634
635 return (m_device.getStringSize(text, width, height) ? height : 0);
636 }
637
639 // setDrawMode()
640 //
641 // Raster operations define how source (pixels to draw) are represented on the
642 // destination device. The available Raster Operation (ROP) codes are:
643 //
644 // ROP Code Description
645 // --------- -------------------------------------
646 // grEpROPCopy default Drawn pixel values are copied to the device screen
647 // grEpROPNotCopy A not operation is applied to the source value before copying to screen
648 // grEpROPNot A not operation is applied to the destination (screen) value
649 // grEpROPXOR A XOR operation is performed between the source and destination values
650 // grEpROPOff A value of 0, or 'OFF' is drawn to the destination
651 // grEpROPOn A value of 1, or 'ON' is drawn to the destination
652
659 {
660 m_device.setRasterOp(rop);
661 }
662
664 // getDrawMode()
665
672 {
673 return m_device.rasterOp();
674 }
675
677 // Drawing methods
679 //
680 // pixel()
681
689 void pixel(uint8_t x, uint8_t y, uint8_t clr = COLOR_ON)
690 {
691 m_device.pixel(x, y, clr);
692 }
693
695 // line()
696
708 void line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t clr = COLOR_ON)
709 {
710 m_device.line(x0, y0, x1, y1, clr);
711 }
712
714 // rectangle()
715
725 void rectangle(uint8_t x0, uint8_t y0, uint8_t width, uint8_t height, uint8_t clr = COLOR_ON)
726 {
727 m_device.rectangle(x0, y0, width, height, clr);
728 }
729
731 // rectangleFill()
732
742 void rectangleFill(uint8_t x0, uint8_t y0, uint8_t width, uint8_t height, uint8_t clr = COLOR_ON)
743 {
744 m_device.rectangleFill(x0, y0, width, height, clr);
745 }
746
748 // circle()
749
758 void circle(uint8_t x0, uint8_t y0, uint8_t radius, uint8_t clr = COLOR_ON)
759 {
760 m_device.circle(x0, y0, radius, clr);
761 }
762
764 // circleFill()
765
774 void circleFill(uint8_t x0, uint8_t y0, uint8_t radius, uint8_t clr = COLOR_ON)
775 {
776 m_device.circleFill(x0, y0, radius, clr);
777 }
778
780 // bitmap()
781
793 void bitmap(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t *pBitmap, uint8_t bmp_width, uint8_t bmp_height)
794 {
795 m_device.bitmap(x0, y0, x1, y1, pBitmap, bmp_width, bmp_height);
796 }
797
807 void bitmap(uint8_t x0, uint8_t y0, uint8_t *pBitmap, uint8_t bmp_width, uint8_t bmp_height)
808 {
809 m_device.bitmap(x0, y0, pBitmap, bmp_width, bmp_height);
810 }
811
819 void bitmap(uint8_t x0, uint8_t y0, QwiicEpBitmap &bitmap)
820 {
821 m_device.bitmap(x0, y0, bitmap);
822 }
823
825 // text()
826
835 void text(uint8_t x0, uint8_t y0, const char *text, uint8_t clr = COLOR_ON)
836 {
837 m_device.text(x0, y0, text, clr);
838 }
839
848 void text(uint8_t x0, uint8_t y0, sfe_string_t &text, uint8_t clr = COLOR_ON)
849 {
850 m_device.text(x0, y0, text.c_str(), clr);
851 }
852
854 // Methods to support Arduino Print capability
856 //
857 // setCursor()
858
868 void setCursor(uint8_t x, uint8_t y)
869 {
870 // Note: x < 0 and y < 0 are also illegal but are not possible with uint8_t arguments
871 if (x >= m_device.width() || y >= m_device.height())
872 return;
873
874 m_cursorX = x;
875 m_cursorY = y;
876 }
877
879 // setColor()
880
886 void setColor(uint8_t clr)
887 {
888 m_color = (clr == COLOR_OFF ? COLOR_OFF : COLOR_ON);
889 }
890
892 // getColor()
893
899 uint8_t getColor(void)
900 {
901 return m_color;
902 }
903
905 // write()
906
915 virtual size_t write(uint8_t theChar)
916 {
917 QwiicEpFont *pFont = m_device.font();
918
919 if (!pFont) // no Font?! No dice
920 return 0;
921
922 switch (theChar)
923 {
924 case '\n': // Line feed - move to the start of the next line
925 m_cursorX = 0;
926 m_cursorY += pFont->height;
927 break;
928 case '\r': // Carriage return - do nothing
929 break;
930 default:
931
932 char buffer[2] = {(char)theChar, '\0'}; // text() needs a c string
933 m_device.text(m_cursorX, m_cursorY, buffer, m_color);
934
935 m_cursorX += pFont->width + 1;
936
937 if (m_cursorX > m_device.width() - pFont->width)
938 { // overflow
939 m_cursorX = 0;
940 m_cursorY += pFont->height;
941 }
942 break;
943 }
944 if (m_cursorY >= m_device.height()) // check for overflow
945 m_cursorY = 0;
946
947 return 1;
948 }
949
950#if defined(SFE_SSD168X_ARDUINO)
951 using Print::write; // Also allow write(const uint8_t *buffer, size_t size) etc.
952#endif
953};
954
956// For our actual implementations - just subclass from the above template
957
961class SSD1680SPI184x88 : public SSD168xSPIBaseClass<SpiSsd1680_184x88>
962{
963 // nothing here - see above
964};
965
969class SSD1681SPI200x200 : public SSD168xSPIBaseClass<SpiSsd1681_200x200>
970{
971 // nothing here - see above
972};
973
977class SSD1680SPICustom : public SSD168xSPIBaseClass<SpiSsd1680_Custom>
978{
979 public:
981 void setXOffset(uint8_t xOffset)
982 {
983 m_device.setXOffset(xOffset);
984 }
986 void setYOffset(uint8_t yOffset)
987 {
988 m_device.setYOffset(yOffset);
989 }
991 void setDisplayWidth(uint8_t displayWidth)
992 {
993 m_device.setDisplayWidth(displayWidth);
994 }
996 void setDisplayHeight(uint8_t displayHeight)
997 {
998 m_device.setDisplayHeight(displayHeight);
999 }
1000};
1001
1005class SSD1681SPICustom : public SSD168xSPIBaseClass<SpiSsd1681_Custom>
1006{
1007 public:
1009 void setXOffset(uint8_t xOffset)
1010 {
1011 m_device.setXOffset(xOffset);
1012 }
1014 void setYOffset(uint8_t yOffset)
1015 {
1016 m_device.setYOffset(yOffset);
1017 }
1019 void setDisplayWidth(uint8_t displayWidth)
1020 {
1021 m_device.setDisplayWidth(displayWidth);
1022 }
1024 void setDisplayHeight(uint8_t displayHeight)
1025 {
1026 m_device.setDisplayHeight(displayHeight);
1027 }
1028};
1029
1033class SSD1680SPI184x88Rotated : public SSD168xSPIBaseClass<SpiSsd1680_184x88_Rotated>
1034{
1035 // nothing here - see above
1036};
Print SSD168xPrintBase
Definition: SparkFun_SSD168x_Library.h:194
QwEpFont QwiicEpFont
Definition: SparkFun_SSD168x_Library.h:56
QwEpBitmap QwiicEpBitmap
Definition: SparkFun_SSD168x_Library.h:57
Definition: qwiic_resdef.h:102
Definition: qwiic_resdef.h:138
const char * name
Definition: qwiic_resdef.h:146
uint8_t width
Definition: qwiic_resdef.h:141
uint8_t height
Definition: qwiic_resdef.h:142
A 184x88 SSD1680 e-Paper display (e.g. GoodDisplay GDEM0097T61) - portrait: 88 pixels wide,...
Definition: SparkFun_SSD168x_Library.h:962
A 184x88 SSD1680 e-Paper display (e.g. GoodDisplay GDEM0097T61) - rotated to landscape: 184 pixels wi...
Definition: SparkFun_SSD168x_Library.h:1034
A custom-sized SSD1680 e-Paper display. Call the set methods before begin().
Definition: SparkFun_SSD168x_Library.h:978
void setYOffset(uint8_t yOffset)
Set the Y offset. Call before begin().
Definition: SparkFun_SSD168x_Library.h:986
void setXOffset(uint8_t xOffset)
Set the X offset. Call before begin().
Definition: SparkFun_SSD168x_Library.h:981
void setDisplayHeight(uint8_t displayHeight)
Set the display height. Call before begin().
Definition: SparkFun_SSD168x_Library.h:996
void setDisplayWidth(uint8_t displayWidth)
Set the display width. Call before begin().
Definition: SparkFun_SSD168x_Library.h:991
A 200x200 SSD1681 e-Paper display (e.g. GoodDisplay GDEY0154D67).
Definition: SparkFun_SSD168x_Library.h:970
A custom-sized SSD1681 e-Paper display. Call the set methods before begin().
Definition: SparkFun_SSD168x_Library.h:1006
void setXOffset(uint8_t xOffset)
Set the X offset. Call before begin().
Definition: SparkFun_SSD168x_Library.h:1009
void setDisplayWidth(uint8_t displayWidth)
Set the display width. Call before begin().
Definition: SparkFun_SSD168x_Library.h:1019
void setYOffset(uint8_t yOffset)
Set the Y offset. Call before begin().
Definition: SparkFun_SSD168x_Library.h:1014
void setDisplayHeight(uint8_t displayHeight)
Set the display height. Call before begin().
Definition: SparkFun_SSD168x_Library.h:1024
The templated base class for all SSD168x SPI e-Paper displays.
Definition: SparkFun_SSD168x_Library.h:221
virtual size_t write(uint8_t theChar)
Write one character at the cursor position, using the current font and color. For the Arduino Print i...
Definition: SparkFun_SSD168x_Library.h:915
void bitmap(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t *pBitmap, uint8_t bmp_width, uint8_t bmp_height)
Draw a bitmap on the screen.
Definition: SparkFun_SSD168x_Library.h:793
void setCursor(uint8_t x, uint8_t y)
Set the "cursor" position in the device.
Definition: SparkFun_SSD168x_Library.h:868
SparkFun_SSD168x::sfe_string_t sfe_string_t
The string type: String on Arduino; std::string on ESP-IDF.
Definition: SparkFun_SSD168x_Library.h:225
void setFont(QwiicEpFont &theFont)
Set the current font. The current font is used when calling the text() method on this device.
Definition: SparkFun_SSD168x_Library.h:539
void display(bool partial=false, bool dirtyOnly=true)
Send any pending display updates to the connected SSD168x device and update the display.
Definition: SparkFun_SSD168x_Library.h:452
void text(uint8_t x0, uint8_t y0, const char *text, uint8_t clr=COLOR_ON)
Draw a string on the screen using the current font.
Definition: SparkFun_SSD168x_Library.h:835
void rectangleFill(uint8_t x0, uint8_t y0, uint8_t width, uint8_t height, uint8_t clr=COLOR_ON)
Draw a filled rectangle on the screen.
Definition: SparkFun_SSD168x_Library.h:742
void disableDebugging(void)
Turn off debug messages.
Definition: SparkFun_SSD168x_Library.h:389
void rectangle(uint8_t x0, uint8_t y0, uint8_t width, uint8_t height, uint8_t clr=COLOR_ON)
Draw a rectangle on the screen.
Definition: SparkFun_SSD168x_Library.h:725
void setColor(uint8_t clr)
Set the current color of the system. This is used by the Arduino Print interface functionality.
Definition: SparkFun_SSD168x_Library.h:886
void circleFill(uint8_t x0, uint8_t y0, uint8_t radius, uint8_t clr=COLOR_ON)
Draw a filled circle on the screen.
Definition: SparkFun_SSD168x_Library.h:774
sfe_string_t getFontName(void)
Get the name of the current font for the device.
Definition: SparkFun_SSD168x_Library.h:574
void bitmap(uint8_t x0, uint8_t y0, QwiicEpBitmap &bitmap)
Draw a bitmap object on the screen.
Definition: SparkFun_SSD168x_Library.h:819
bool reset(void)
Reset the system and the SSD168x back to an initial state.
Definition: SparkFun_SSD168x_Library.h:431
uint8_t getColor(void)
Get the current color of the system. This is used by the Arduino Print interface functionality.
Definition: SparkFun_SSD168x_Library.h:899
DeviceType m_device
Definition: SparkFun_SSD168x_Library.h:229
void deepSleep(bool mode2=false)
Put the SSD168x into deep sleep.
Definition: SparkFun_SSD168x_Library.h:480
unsigned int getStringHeight(sfe_string_t &text)
Get the height of the provided string, using the current font.
Definition: SparkFun_SSD168x_Library.h:620
SparkFun_SSD168x::sfe_print_t sfe_print_t
The print type: Print on Arduino; SfeOutput on ESP-IDF.
Definition: SparkFun_SSD168x_Library.h:224
void setDrawMode(grEpRasterOp_t rop)
Set the current draw mode. The draw mode determines how pixels are set on the screen during drawing o...
Definition: SparkFun_SSD168x_Library.h:658
void text(uint8_t x0, uint8_t y0, sfe_string_t &text, uint8_t clr=COLOR_ON)
Draw a string on the screen using the current font.
Definition: SparkFun_SSD168x_Library.h:848
QwiicEpFont * getFont(void)
Get the current font for the device.
Definition: SparkFun_SSD168x_Library.h:561
void circle(uint8_t x0, uint8_t y0, uint8_t radius, uint8_t clr=COLOR_ON)
Draw a circle on the screen.
Definition: SparkFun_SSD168x_Library.h:758
void bitmap(uint8_t x0, uint8_t y0, uint8_t *pBitmap, uint8_t bmp_width, uint8_t bmp_height)
Draw a bitmap on the screen.
Definition: SparkFun_SSD168x_Library.h:807
unsigned int getStringHeight(const char *text)
Get the height of the provided string, using the current font.
Definition: SparkFun_SSD168x_Library.h:631
unsigned int getStringWidth(const char *text)
Get the width of the provided string, using the current font.
Definition: SparkFun_SSD168x_Library.h:604
void pixel(uint8_t x, uint8_t y, uint8_t clr=COLOR_ON)
Set the value of a pixel on the screen.
Definition: SparkFun_SSD168x_Library.h:689
void setFont(const QwiicEpFont *theFont)
Set the current font. The current font is used when calling the text() method on this device.
Definition: SparkFun_SSD168x_Library.h:548
bool isBusy(void)
Read the SSD168x BUSY pin.
Definition: SparkFun_SSD168x_Library.h:493
unsigned int getStringWidth(sfe_string_t &text)
Get the width of the provided string, using the current font.
Definition: SparkFun_SSD168x_Library.h:593
void line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t clr=COLOR_ON)
Draw a line on the screen.
Definition: SparkFun_SSD168x_Library.h:708
grEpRasterOp_t getDrawMode(void)
Get the current draw mode. The draw mode determines how pixels are set on the screen during drawing o...
Definition: SparkFun_SSD168x_Library.h:671
uint8_t getHeight(void)
Get the height, in pixels, of the connected e-Paper device.
Definition: SparkFun_SSD168x_Library.h:415
uint8_t getWidth(void)
Get the width, in pixels, of the connected e-Paper device.
Definition: SparkFun_SSD168x_Library.h:402
void erase(void)
Erase all graphics on the device, placing the display in a blank state.
Definition: SparkFun_SSD168x_Library.h:465
void setXOffset(uint8_t xOffset)
Set the X offset. Call before init().
Definition: qwiic_ssd1680_custom.h:77
void setDisplayHeight(uint8_t displayHeight)
Set the display height. Call before init().
Definition: qwiic_ssd1680_custom.h:83
void setDisplayWidth(uint8_t displayWidth)
Set the display width. Call before init().
Definition: qwiic_ssd1680_custom.h:81
void setYOffset(uint8_t yOffset)
Set the Y offset. Call before init().
Definition: qwiic_ssd1680_custom.h:79
void setDisplayWidth(uint8_t displayWidth)
Set the display width. Call before init().
Definition: qwiic_ssd1681_custom.h:81
void setDisplayHeight(uint8_t displayHeight)
Set the display height. Call before init().
Definition: qwiic_ssd1681_custom.h:83
void setYOffset(uint8_t yOffset)
Set the Y offset. Call before init().
Definition: qwiic_ssd1681_custom.h:79
void setXOffset(uint8_t xOffset)
Set the X offset. Call before init().
Definition: qwiic_ssd1681_custom.h:77
const uint8_t COLOR_ON
Definition: qwiic_grbuffer.cpp:51
const uint8_t COLOR_OFF
Definition: qwiic_grbuffer.cpp:52
enum gr_ep_op_funcs_ grEpRasterOp_t