![]() |
SparkFun SSD168x Library
v1.0.2
Library for SSD1680 / SSD1681 e-paper displays on SPI
|
The templated base class for all SSD168x SPI e-Paper displays. More...
#include <SparkFun_SSD168x_Library.h>
Public Types | |
| typedef SparkFun_SSD168x::sfe_print_t | sfe_print_t |
| The print type: Print on Arduino; SfeOutput on ESP-IDF. More... | |
| typedef SparkFun_SSD168x::sfe_string_t | sfe_string_t |
| The string type: String on Arduino; std::string on ESP-IDF. More... | |
Public Member Functions | |
| void | disableDebugging (void) |
| Turn off debug messages. More... | |
| uint8_t | getWidth (void) |
| Get the width, in pixels, of the connected e-Paper device. More... | |
| uint8_t | getHeight (void) |
| Get the height, in pixels, of the connected e-Paper device. More... | |
| bool | reset (void) |
| Reset the system and the SSD168x back to an initial state. More... | |
| void | display (bool partial=false, bool dirtyOnly=true) |
| Send any pending display updates to the connected SSD168x device and update the display. More... | |
| void | erase (void) |
| Erase all graphics on the device, placing the display in a blank state. More... | |
| void | deepSleep (bool mode2=false) |
| Put the SSD168x into deep sleep. More... | |
| bool | isBusy (void) |
| Read the SSD168x BUSY pin. More... | |
| void | setFont (QwiicEpFont &theFont) |
| Set the current font. The current font is used when calling the text() method on this device. More... | |
| void | setFont (const QwiicEpFont *theFont) |
| Set the current font. The current font is used when calling the text() method on this device. More... | |
| QwiicEpFont * | getFont (void) |
| Get the current font for the device. More... | |
| sfe_string_t | getFontName (void) |
| Get the name of the current font for the device. More... | |
| unsigned int | getStringWidth (sfe_string_t &text) |
| Get the width of the provided string, using the current font. More... | |
| unsigned int | getStringWidth (const char *text) |
| Get the width of the provided string, using the current font. More... | |
| unsigned int | getStringHeight (sfe_string_t &text) |
| Get the height of the provided string, using the current font. More... | |
| unsigned int | getStringHeight (const char *text) |
| Get the height of the provided string, using the current font. More... | |
| void | setDrawMode (grEpRasterOp_t rop) |
| Set the current draw mode. The draw mode determines how pixels are set on the screen during drawing operations. More... | |
| grEpRasterOp_t | getDrawMode (void) |
| Get the current draw mode. The draw mode determines how pixels are set on the screen during drawing operations. More... | |
| void | pixel (uint8_t x, uint8_t y, uint8_t clr=COLOR_ON) |
| Set the value of a pixel on the screen. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| void | circle (uint8_t x0, uint8_t y0, uint8_t radius, uint8_t clr=COLOR_ON) |
| Draw a circle on the screen. More... | |
| void | circleFill (uint8_t x0, uint8_t y0, uint8_t radius, uint8_t clr=COLOR_ON) |
| Draw a filled circle on the screen. More... | |
| 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. More... | |
| 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. More... | |
| void | bitmap (uint8_t x0, uint8_t y0, QwiicEpBitmap &bitmap) |
| Draw a bitmap object on the screen. More... | |
| 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. More... | |
| 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. More... | |
| void | setCursor (uint8_t x, uint8_t y) |
| Set the "cursor" position in the device. More... | |
| void | setColor (uint8_t clr) |
| Set the current color of the system. This is used by the Arduino Print interface functionality. More... | |
| uint8_t | getColor (void) |
| Get the current color of the system. This is used by the Arduino Print interface functionality. More... | |
| virtual size_t | write (uint8_t theChar) |
| Write one character at the cursor position, using the current font and color. For the Arduino Print interface. More... | |
Protected Attributes | |
| DeviceType | m_device |
The templated base class for all SSD168x SPI e-Paper displays.
Implements the Arduino Print interface (or SSD168xPrint on ESP-IDF), so print(), println() (and printf()) can be used to write text at the cursor position.
| DeviceType | The device driver class (e.g. SpiSsd1680_184x88). |
| typedef SparkFun_SSD168x::sfe_print_t SSD168xSPIBaseClass< DeviceType >::sfe_print_t |
The print type: Print on Arduino; SfeOutput on ESP-IDF.
| typedef SparkFun_SSD168x::sfe_string_t SSD168xSPIBaseClass< DeviceType >::sfe_string_t |
The string type: String on Arduino; std::string on ESP-IDF.
|
inline |
Draw a bitmap object on the screen.
| x0 | The X coordinate to place the bitmap - upper left corner. |
| y0 | The Y coordinate to place the bitmap - upper left corner. |
| bitmap | A bitmap object (e.g. QW_EP_BMP_SPARKFUN). |
|
inline |
Draw a bitmap on the screen.
| x0 | The X coordinate to place the bitmap - upper left corner. |
| y0 | The Y coordinate to place the bitmap - upper left corner. |
| pBitmap | A pointer to the bitmap array. |
| bmp_width | The width of the bitmap. |
| bmp_height | The height of the bitmap. |
|
inline |
Draw a bitmap on the screen.
| x0 | The X coordinate to place the bitmap - upper left corner. |
| y0 | The Y coordinate to place the bitmap - upper left corner. |
| x1 | The end X coordinate of the area to draw - lower right corner. Range will not exceed the bitmap width. |
| y1 | The end Y coordinate of the area to draw - lower right corner. Range will not exceed the bitmap height. |
| pBitmap | A pointer to the bitmap array. |
| bmp_width | The width of the bitmap. |
| bmp_height | The height of the bitmap. |
|
inline |
Draw a circle on the screen.
| x0 | The X coordinate of the circle center. |
| y0 | The Y coordinate of the circle center. |
| radius | The radius of the circle. |
| clr | optional. The color value to draw the circle. Defaults to COLOR_ON (black). |
|
inline |
Draw a filled circle on the screen.
| x0 | The X coordinate of the circle center. |
| y0 | The Y coordinate of the circle center. |
| radius | The radius of the circle. |
| clr | optional. The color value to draw the filled circle. Defaults to COLOR_ON (black). |
|
inline |
Put the SSD168x into deep sleep.
Only a hardware reset can wake it again. display() does this automatically.
| mode2 | false (default) : Deep Sleep Mode 1 (RAM retained), true : Deep Sleep Mode 2 (RAM not retained). |
|
inline |
Turn off debug messages.
|
inline |
Send any pending display updates to the connected SSD168x device and update the display.
This includes drawn graphics and erase commands. To display any graphics, this method must be called.
display() will always reset (wake) the SSD168x, even if there is nothing new to display. This avoids it staying in deep sleep and holding BUSY high.
The update takes some time. Check isBusy() to see when it is complete.
| partial | false (default) : full update, true : partial update |
| dirtyOnly | true (default) : send dirty pixels only, false : send all pixels |
|
inline |
Erase all graphics on the device, placing the display in a blank state.
The erase update isn't sent to the device until the next display() call on the device.
|
inline |
Get the current color of the system. This is used by the Arduino Print interface functionality.
|
inline |
Get the current draw mode. The draw mode determines how pixels are set on the screen during drawing operations.
|
inline |
Get the current font for the device.
|
inline |
Get the name of the current font for the device.
|
inline |
Get the height, in pixels, of the connected e-Paper device.
|
inline |
Get the height of the provided string, using the current font.
| text | The null-terminated string used to determine the height. |
|
inline |
Get the height of the provided string, using the current font.
| text | The string used to determine the height. |
|
inline |
Get the width of the provided string, using the current font.
| text | The null-terminated string used to determine the width. |
|
inline |
Get the width of the provided string, using the current font.
| text | The string used to determine the width. |
|
inline |
Get the width, in pixels, of the connected e-Paper device.
|
inline |
Read the SSD168x BUSY pin.
|
inline |
Draw a line on the screen.
If a line is horizontal (y0 = y1) or vertical (x0 = x1), optimized draw algorithms are used by the library.
| x0 | The start X coordinate of the line. |
| y0 | The start Y coordinate of the line. |
| x1 | The end X coordinate of the line. |
| y1 | The end Y coordinate of the line. |
| clr | optional. The color value to draw the line. Defaults to COLOR_ON (black). |
|
inline |
Set the value of a pixel on the screen.
| x | The X coordinate of the pixel to set. |
| y | The Y coordinate of the pixel to set. |
| clr | optional. The color value to set the pixel. Defaults to COLOR_ON (black). |
|
inline |
Draw a rectangle on the screen.
| x0 | The start X coordinate of the rectangle - upper left corner. |
| y0 | The start Y coordinate of the rectangle - upper left corner. |
| width | The width of the rectangle. |
| height | The height of the rectangle. |
| clr | optional. The color value to draw the rectangle. Defaults to COLOR_ON (black). |
|
inline |
Draw a filled rectangle on the screen.
| x0 | The start X coordinate of the rectangle - upper left corner. |
| y0 | The start Y coordinate of the rectangle - upper left corner. |
| width | The width of the rectangle. |
| height | The height of the rectangle. |
| clr | optional. The color value to draw the filled rectangle. Defaults to COLOR_ON (black). |
|
inline |
Reset the system and the SSD168x back to an initial state.
Clears the graphics buffer and the display RAM, and performs a full update. The user must check isBusy() afterwards.
|
inline |
Set the current color of the system. This is used by the Arduino Print interface functionality.
| clr | The color to set. COLOR_ON ('ON') is e-paper BLACK (due to inversion); COLOR_OFF ('OFF') is e-paper WHITE. |
|
inline |
Set the "cursor" position in the device.
The library supports the Arduino Print interface, enabling the use of the print() and println() methods. The cursor position defines where to start text output for this functionality.
| x | The X coordinate of the cursor. |
| y | The Y coordinate of the cursor. |
|
inline |
Set the current draw mode. The draw mode determines how pixels are set on the screen during drawing operations.
| rop | The raster operation (ROP) to set the graphics system to. See the comments above for the available codes. |
|
inline |
Set the current font. The current font is used when calling the text() method on this device.
| theFont | A pointer to the font to set as current in the device. |
|
inline |
Set the current font. The current font is used when calling the text() method on this device.
The default font for the device is 5x7. See the comments above for the list of fonts.
| theFont | The font to set as current in the device. |
|
inline |
Draw a string on the screen using the current font.
| x0 | The X coordinate to start drawing the text. |
| y0 | The Y coordinate to start drawing the text. |
| text | The null-terminated string to draw on the screen. |
| clr | optional. The color value to draw the text. Defaults to COLOR_ON (black). |
|
inline |
Draw a string on the screen using the current font.
| x0 | The X coordinate to start drawing the text. |
| y0 | The Y coordinate to start drawing the text. |
| text | The string (an Arduino String, or a std::string on ESP-IDF) to draw on the screen. |
| clr | optional. The color value to draw the text. Defaults to COLOR_ON (black). |
|
inlinevirtual |
Write one character at the cursor position, using the current font and color. For the Arduino Print interface.
'\n' moves the cursor to the start of the next line. '\r' is ignored.
| theChar | The character to write. |
|
protected |