SparkFun SSD168x Library  v1.0.2
Library for SSD1680 / SSD1681 e-paper displays on SPI
Loading...
Searching...
No Matches
SSD1680SPI184x88 Class Reference

A 184x88 SSD1680 e-Paper display (e.g. GoodDisplay GDEM0097T61) - portrait: 88 pixels wide, 184 pixels high. More...

#include <SparkFun_SSD168x_Library.h>

Inheritance diagram for SSD1680SPI184x88:

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

SpiSsd1680_184x88 m_device
 

Detailed Description

A 184x88 SSD1680 e-Paper display (e.g. GoodDisplay GDEM0097T61) - portrait: 88 pixels wide, 184 pixels high.

Member Typedef Documentation

◆ sfe_print_t

typedef SparkFun_SSD168x::sfe_print_t SSD168xSPIBaseClass< SpiSsd1680_184x88 >::sfe_print_t
inherited

The print type: Print on Arduino; SfeOutput on ESP-IDF.

◆ sfe_string_t

typedef SparkFun_SSD168x::sfe_string_t SSD168xSPIBaseClass< SpiSsd1680_184x88 >::sfe_string_t
inherited

The string type: String on Arduino; std::string on ESP-IDF.

Member Function Documentation

◆ bitmap() [1/3]

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::bitmap ( uint8_t  x0,
uint8_t  y0,
QwiicEpBitmap &  bitmap 
)
inlineinherited

Draw a bitmap object on the screen.

Parameters
x0The X coordinate to place the bitmap - upper left corner.
y0The Y coordinate to place the bitmap - upper left corner.
bitmapA bitmap object (e.g. QW_EP_BMP_SPARKFUN).

◆ bitmap() [2/3]

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::bitmap ( uint8_t  x0,
uint8_t  y0,
uint8_t *  pBitmap,
uint8_t  bmp_width,
uint8_t  bmp_height 
)
inlineinherited

Draw a bitmap on the screen.

Parameters
x0The X coordinate to place the bitmap - upper left corner.
y0The Y coordinate to place the bitmap - upper left corner.
pBitmapA pointer to the bitmap array.
bmp_widthThe width of the bitmap.
bmp_heightThe height of the bitmap.

◆ bitmap() [3/3]

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::bitmap ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
uint8_t *  pBitmap,
uint8_t  bmp_width,
uint8_t  bmp_height 
)
inlineinherited

Draw a bitmap on the screen.

Parameters
x0The X coordinate to place the bitmap - upper left corner.
y0The Y coordinate to place the bitmap - upper left corner.
x1The end X coordinate of the area to draw - lower right corner. Range will not exceed the bitmap width.
y1The end Y coordinate of the area to draw - lower right corner. Range will not exceed the bitmap height.
pBitmapA pointer to the bitmap array.
bmp_widthThe width of the bitmap.
bmp_heightThe height of the bitmap.

◆ circle()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::circle ( uint8_t  x0,
uint8_t  y0,
uint8_t  radius,
uint8_t  clr = COLOR_ON 
)
inlineinherited

Draw a circle on the screen.

Parameters
x0The X coordinate of the circle center.
y0The Y coordinate of the circle center.
radiusThe radius of the circle.
clroptional. The color value to draw the circle. Defaults to COLOR_ON (black).

◆ circleFill()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::circleFill ( uint8_t  x0,
uint8_t  y0,
uint8_t  radius,
uint8_t  clr = COLOR_ON 
)
inlineinherited

Draw a filled circle on the screen.

Parameters
x0The X coordinate of the circle center.
y0The Y coordinate of the circle center.
radiusThe radius of the circle.
clroptional. The color value to draw the filled circle. Defaults to COLOR_ON (black).

◆ deepSleep()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::deepSleep ( bool  mode2 = false)
inlineinherited

Put the SSD168x into deep sleep.

Only a hardware reset can wake it again. display() does this automatically.

Parameters
mode2false (default) : Deep Sleep Mode 1 (RAM retained), true : Deep Sleep Mode 2 (RAM not retained).

◆ disableDebugging()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::disableDebugging ( void  )
inlineinherited

Turn off debug messages.

◆ display()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::display ( bool  partial = false,
bool  dirtyOnly = true 
)
inlineinherited

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.

Parameters
partialfalse (default) : full update, true : partial update
dirtyOnlytrue (default) : send dirty pixels only, false : send all pixels

◆ erase()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::erase ( void  )
inlineinherited

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.

◆ getColor()

uint8_t SSD168xSPIBaseClass< SpiSsd1680_184x88 >::getColor ( void  )
inlineinherited

Get the current color of the system. This is used by the Arduino Print interface functionality.

Returns
The current color. COLOR_OFF (0) = white, COLOR_ON (1) = black.

◆ getDrawMode()

grEpRasterOp_t SSD168xSPIBaseClass< SpiSsd1680_184x88 >::getDrawMode ( void  )
inlineinherited

Get the current draw mode. The draw mode determines how pixels are set on the screen during drawing operations.

Returns
The current raster operation (ROP) of the graphics system.

◆ getFont()

QwiicEpFont * SSD168xSPIBaseClass< SpiSsd1680_184x88 >::getFont ( void  )
inlineinherited

Get the current font for the device.

Returns
A pointer to the current font. See setFont() for font object details.

◆ getFontName()

sfe_string_t SSD168xSPIBaseClass< SpiSsd1680_184x88 >::getFontName ( void  )
inlineinherited

Get the name of the current font for the device.

Returns
The font name (an Arduino String, or a std::string on ESP-IDF). Empty if no font is set.

◆ getHeight()

uint8_t SSD168xSPIBaseClass< SpiSsd1680_184x88 >::getHeight ( void  )
inlineinherited

Get the height, in pixels, of the connected e-Paper device.

Returns
The height in pixels.

◆ getStringHeight() [1/2]

unsigned int SSD168xSPIBaseClass< SpiSsd1680_184x88 >::getStringHeight ( const char *  text)
inlineinherited

Get the height of the provided string, using the current font.

Parameters
textThe null-terminated string used to determine the height.
Returns
The height of the provided string in pixels, as determined using the current font.

◆ getStringHeight() [2/2]

unsigned int SSD168xSPIBaseClass< SpiSsd1680_184x88 >::getStringHeight ( sfe_string_t &  text)
inlineinherited

Get the height of the provided string, using the current font.

Parameters
textThe string used to determine the height.
Returns
The height of the provided string in pixels, as determined using the current font.

◆ getStringWidth() [1/2]

unsigned int SSD168xSPIBaseClass< SpiSsd1680_184x88 >::getStringWidth ( const char *  text)
inlineinherited

Get the width of the provided string, using the current font.

Parameters
textThe null-terminated string used to determine the width.
Returns
The width of the provided string in pixels, as determined using the current font.

◆ getStringWidth() [2/2]

unsigned int SSD168xSPIBaseClass< SpiSsd1680_184x88 >::getStringWidth ( sfe_string_t &  text)
inlineinherited

Get the width of the provided string, using the current font.

Parameters
textThe string used to determine the width.
Returns
The width of the provided string in pixels, as determined using the current font.

◆ getWidth()

uint8_t SSD168xSPIBaseClass< SpiSsd1680_184x88 >::getWidth ( void  )
inlineinherited

Get the width, in pixels, of the connected e-Paper device.

Returns
The width in pixels.

◆ isBusy()

bool SSD168xSPIBaseClass< SpiSsd1680_184x88 >::isBusy ( void  )
inlineinherited

Read the SSD168x BUSY pin.

Returns
true if the SSD168x is busy (e.g. performing a display update).

◆ line()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::line ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
uint8_t  clr = COLOR_ON 
)
inlineinherited

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.

Parameters
x0The start X coordinate of the line.
y0The start Y coordinate of the line.
x1The end X coordinate of the line.
y1The end Y coordinate of the line.
clroptional. The color value to draw the line. Defaults to COLOR_ON (black).

◆ pixel()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::pixel ( uint8_t  x,
uint8_t  y,
uint8_t  clr = COLOR_ON 
)
inlineinherited

Set the value of a pixel on the screen.

Parameters
xThe X coordinate of the pixel to set.
yThe Y coordinate of the pixel to set.
clroptional. The color value to set the pixel. Defaults to COLOR_ON (black).

◆ rectangle()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::rectangle ( uint8_t  x0,
uint8_t  y0,
uint8_t  width,
uint8_t  height,
uint8_t  clr = COLOR_ON 
)
inlineinherited

Draw a rectangle on the screen.

Parameters
x0The start X coordinate of the rectangle - upper left corner.
y0The start Y coordinate of the rectangle - upper left corner.
widthThe width of the rectangle.
heightThe height of the rectangle.
clroptional. The color value to draw the rectangle. Defaults to COLOR_ON (black).

◆ rectangleFill()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::rectangleFill ( uint8_t  x0,
uint8_t  y0,
uint8_t  width,
uint8_t  height,
uint8_t  clr = COLOR_ON 
)
inlineinherited

Draw a filled rectangle on the screen.

Parameters
x0The start X coordinate of the rectangle - upper left corner.
y0The start Y coordinate of the rectangle - upper left corner.
widthThe width of the rectangle.
heightThe height of the rectangle.
clroptional. The color value to draw the filled rectangle. Defaults to COLOR_ON (black).

◆ reset()

bool SSD168xSPIBaseClass< SpiSsd1680_184x88 >::reset ( void  )
inlineinherited

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.

Returns
true on success, false on failure.

◆ setColor()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::setColor ( uint8_t  clr)
inlineinherited

Set the current color of the system. This is used by the Arduino Print interface functionality.

Parameters
clrThe color to set. COLOR_ON ('ON') is e-paper BLACK (due to inversion); COLOR_OFF ('OFF') is e-paper WHITE.

◆ setCursor()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::setCursor ( uint8_t  x,
uint8_t  y 
)
inlineinherited

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.

Parameters
xThe X coordinate of the cursor.
yThe Y coordinate of the cursor.

◆ setDrawMode()

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::setDrawMode ( grEpRasterOp_t  rop)
inlineinherited

Set the current draw mode. The draw mode determines how pixels are set on the screen during drawing operations.

Parameters
ropThe raster operation (ROP) to set the graphics system to. See the comments above for the available codes.

◆ setFont() [1/2]

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::setFont ( const QwiicEpFont *  theFont)
inlineinherited

Set the current font. The current font is used when calling the text() method on this device.

Parameters
theFontA pointer to the font to set as current in the device.

◆ setFont() [2/2]

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::setFont ( QwiicEpFont &  theFont)
inlineinherited

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.

Parameters
theFontThe font to set as current in the device.

◆ text() [1/2]

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::text ( uint8_t  x0,
uint8_t  y0,
const char *  text,
uint8_t  clr = COLOR_ON 
)
inlineinherited

Draw a string on the screen using the current font.

Parameters
x0The X coordinate to start drawing the text.
y0The Y coordinate to start drawing the text.
textThe null-terminated string to draw on the screen.
clroptional. The color value to draw the text. Defaults to COLOR_ON (black).

◆ text() [2/2]

void SSD168xSPIBaseClass< SpiSsd1680_184x88 >::text ( uint8_t  x0,
uint8_t  y0,
sfe_string_t &  text,
uint8_t  clr = COLOR_ON 
)
inlineinherited

Draw a string on the screen using the current font.

Parameters
x0The X coordinate to start drawing the text.
y0The Y coordinate to start drawing the text.
textThe string (an Arduino String, or a std::string on ESP-IDF) to draw on the screen.
clroptional. The color value to draw the text. Defaults to COLOR_ON (black).

◆ write()

virtual size_t SSD168xSPIBaseClass< SpiSsd1680_184x88 >::write ( uint8_t  theChar)
inlinevirtualinherited

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.

Parameters
theCharThe character to write.
Returns
1 on success, 0 if there is no font.

Member Data Documentation

◆ m_device

SpiSsd1680_184x88 SSD168xSPIBaseClass< SpiSsd1680_184x88 >::m_device
protectedinherited

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