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

#include <qwiic_ssd1680_184x88_rotated.h>

Inheritance diagram for SpiSsd1680_184x88_Rotated:

Public Member Functions

 SpiSsd1680_184x88_Rotated ()
 Construct the device - setup the viewport for this device. More...
 
 ~SpiSsd1680_184x88_Rotated ()
 Destroy the device - free the graphics buffer. More...
 
bool init (void)
 Set up the specific device settings: allocate the graphics buffer, then initialize the device. More...
 
void display (bool partial=false, bool dirtyOnly=true)
 Send the changes in the graphics buffer to the device and perform a full or partial update. More...
 
void erase (void)
 Erase the graphics buffer. The erase is not sent to the device until the next display(). More...
 
bool isInitialized (void)
 Check if init() has been called successfully. More...
 
bool reset (void)
 Wake and reset the device: clear the graphics and screen buffers and perform a full update. More...
 
void setCommBus (SparkFun_SSD168x::SSD168xDeviceBus &theBus, int resetPin, int busyPin)
 Set the communication bus this object should use, plus the RES# and BUSY pins. More...
 
void setColor (uint8_t color)
 
void setRasterOp (grEpRasterOp_t rop)
 Set the current raster operation (draw mode). More...
 
grEpRasterOp_t rasterOp (void)
 Get the current raster operation (draw mode). More...
 
void deepSleep (bool mode2)
 Put the SSD168x into deep sleep. Only a hardware reset can wake it again (display() does this). More...
 
bool isBusy (void)
 Read the state of the BUSY pin. More...
 
bool waitWhileBusy (unsigned long pollInterval_ms=10, unsigned long timeout_ms=kSsd168xBusyTimeout_ms)
 Wait until the SSD168x BUSY pin goes low. More...
 
void setViewport (uint8_t x0, uint8_t y0, uint8_t width, uint8_t height)
 
QwEpRect viewport (void)
 
uint16_t originX (void)
 
uint16_t originY (void)
 
uint16_t width (void)
 
uint16_t height (void)
 
void initFont (void)
 
void setFont (QwEpFont &font)
 
void setFont (const QwEpFont *font)
 
QwEpFont * font (void)
 
bool getStringSize (const char *text, uint16_t &width, uint16_t &height)
 
void line (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t clr=COLOR_ON)
 
void circle (uint8_t x0, uint8_t y0, uint8_t radius, uint8_t clr=COLOR_ON)
 
void circleFill (uint8_t x0, uint8_t y0, uint8_t radius, uint8_t clr=COLOR_ON)
 
void pixel (uint8_t x, uint8_t y, uint8_t clr=COLOR_ON)
 
void rectangle (uint8_t x0, uint8_t y0, uint8_t width, uint8_t height, uint8_t clr=COLOR_ON)
 
void rectangleFill (uint8_t x0, uint8_t y0, uint8_t width, uint8_t height, uint8_t clr=COLOR_ON)
 
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)
 
void bitmap (uint8_t x0, uint8_t y0, uint8_t *pBitmap, uint8_t bmp_width, uint8_t bmp_height)
 
void bitmap (uint8_t x0, uint8_t y0, QwEpBitmap &bitmap)
 
void text (uint8_t x0, uint8_t y0, const char *text, uint8_t clr=COLOR_ON)
 
void enableDebugging (sfe_print_t &debugPort, bool printLimitedDebug=false)
 Enable debug messages, sent to the given port. More...
 
void disableDebugging (void)
 Turn off debug message printing. More...
 
void debugPrint (const char *message, bool important=false)
 Print a debug message (no trailing newline), if debugging is enabled. More...
 
void debugPrint (uint32_t value, bool important=false)
 Print a debug value in decimal (no trailing newline), if debugging is enabled. More...
 
void debugPrint (uint32_t value, int printBase, bool important=false)
 Print a debug value in a given base (no trailing newline), if debugging is enabled. More...
 
void debugPrintln (const char *message, bool important=false)
 Print a debug message followed by a newline, if debugging is enabled. More...
 
void debugPrintln (uint32_t value, bool important=false)
 Print a debug value in decimal followed by a newline, if debugging is enabled. More...
 
void debugPrintln (uint32_t value, int printBase, bool important=false)
 Print a debug value in a given base followed by a newline, if debugging is enabled. More...
 
void debugPrintln (void)
 Print a blank debug line, if debugging is enabled and not in limited-debug mode. More...
 
void copyDebugStateFrom (const SfeDebugPrint &other)
 Copy debug state (output stream and enabled flags) from another SfeDebugPrint. More...
 

Protected Member Functions

void setBuffer (uint8_t *pBuffer)
 
void drawPixel (uint8_t x, uint8_t y, uint8_t clr)
 
void drawLineHorz (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t clr)
 
void drawLineVert (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t clr)
 
void drawRectFilled (uint8_t x0, uint8_t y0, uint8_t width, uint8_t height, uint8_t clr)
 
void drawBitmap (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t *pBitmap, uint8_t bmp_width, uint8_t bmp_height)
 
virtual void drawLine (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t clr)
 
virtual void drawRect (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t clr)
 
virtual void drawCircle (uint8_t x0, uint8_t y0, uint8_t radius, uint8_t clr)
 
virtual void drawCircleFilled (uint8_t x0, uint8_t y0, uint8_t radius, uint8_t clr)
 
virtual void drawText (uint8_t x0, uint8_t y0, const char *text, uint8_t clr)
 
bool pageIsClean (pageStateEp_t &_page_)
 
void pageSetClean (pageStateEp_t &_page_)
 
void pageCheckBounds (pageStateEp_t &_page_, uint8_t _c_)
 
void pageCheckBoundsDesc (pageStateEp_t &_page_, pageStateEp_t &_page2_)
 
void pageCheckBoundsRange (pageStateEp_t &_page_, uint8_t _c0_, uint8_t _c1_)
 

Protected Attributes

QwEpRect m_viewport
 
_QwEpIDraw_vtable m_idraw
 
QwEpFont * m_currentFont
 
SfePrint _debugSerial
 
bool _printDebug = false
 
bool _printLimitedDebug = false
 

Constructor & Destructor Documentation

◆ SpiSsd1680_184x88_Rotated()

SpiSsd1680_184x88_Rotated::SpiSsd1680_184x88_Rotated ( )
inline

Construct the device - setup the viewport for this device.

◆ ~SpiSsd1680_184x88_Rotated()

SpiSsd1680_184x88_Rotated::~SpiSsd1680_184x88_Rotated ( )
inline

Destroy the device - free the graphics buffer.

Member Function Documentation

◆ bitmap() [1/3]

void QwEpGrBufferDevice::bitmap ( uint8_t  x0,
uint8_t  y0,
QwEpBitmap &  bitmap 
)
inherited

◆ bitmap() [2/3]

void QwEpGrBufferDevice::bitmap ( uint8_t  x0,
uint8_t  y0,
uint8_t *  pBitmap,
uint8_t  bmp_width,
uint8_t  bmp_height 
)
inherited

◆ bitmap() [3/3]

void QwEpGrBufferDevice::bitmap ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
uint8_t *  pBitmap,
uint8_t  bmp_width,
uint8_t  bmp_height 
)
inherited

◆ circle()

void QwEpGrBufferDevice::circle ( uint8_t  x0,
uint8_t  y0,
uint8_t  radius,
uint8_t  clr = COLOR_ON 
)
inherited

◆ circleFill()

void QwEpGrBufferDevice::circleFill ( uint8_t  x0,
uint8_t  y0,
uint8_t  radius,
uint8_t  clr = COLOR_ON 
)
inherited

◆ copyDebugStateFrom()

void SparkFun_SSD168x::SfeDebugPrint::copyDebugStateFrom ( const SfeDebugPrint &  other)
inlineinherited

Copy debug state (output stream and enabled flags) from another SfeDebugPrint.

Parameters
otherThe SfeDebugPrint object whose debug state to copy.

◆ debugPrint() [1/3]

void SfeDebugPrint::debugPrint ( const char *  message,
bool  important = false 
)
inherited

Print a debug message (no trailing newline), if debugging is enabled.

A no-op unless _printDebug is true; further suppressed if _printLimitedDebug is true and 'important' is false - see enableDebugging().

Parameters
messageNull-terminated string to print.
importantIf true, print even when limited debugging is active. Defaults to false.

◆ debugPrint() [2/3]

void SfeDebugPrint::debugPrint ( uint32_t  value,
bool  important = false 
)
inherited

Print a debug value in decimal (no trailing newline), if debugging is enabled.

Parameters
valueThe value to print.
importantIf true, print even when limited debugging is active. Defaults to false.

◆ debugPrint() [3/3]

void SfeDebugPrint::debugPrint ( uint32_t  value,
int  printBase,
bool  important = false 
)
inherited

Print a debug value in a given base (no trailing newline), if debugging is enabled.

Parameters
valueThe value to print.
printBaseNumber base to print in (e.g. HEX, DEC).
importantIf true, print even when limited debugging is active. Defaults to false.

◆ debugPrintln() [1/4]

void SfeDebugPrint::debugPrintln ( const char *  message,
bool  important = false 
)
inherited

Print a debug message followed by a newline, if debugging is enabled.

Parameters
messageNull-terminated string to print.
importantIf true, print even when limited debugging is active. Defaults to false.

◆ debugPrintln() [2/4]

void SfeDebugPrint::debugPrintln ( uint32_t  value,
bool  important = false 
)
inherited

Print a debug value in decimal followed by a newline, if debugging is enabled.

Parameters
valueThe value to print.
importantIf true, print even when limited debugging is active. Defaults to false.

◆ debugPrintln() [3/4]

void SfeDebugPrint::debugPrintln ( uint32_t  value,
int  printBase,
bool  important = false 
)
inherited

Print a debug value in a given base followed by a newline, if debugging is enabled.

Parameters
valueThe value to print.
printBaseNumber base to print in (e.g. HEX, DEC).
importantIf true, print even when limited debugging is active. Defaults to false.

◆ debugPrintln() [4/4]

void SfeDebugPrint::debugPrintln ( void  )
inherited

Print a blank debug line, if debugging is enabled and not in limited-debug mode.

◆ deepSleep()

void SpiSsd1680Rotated::deepSleep ( bool  mode2)
inherited

Put the SSD168x into deep sleep. Only a hardware reset can wake it again (display() does this).

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

◆ disableDebugging()

void SparkFun_SSD168x::SfeDebugPrint::disableDebugging ( void  )
inlineinherited

Turn off debug message printing.

◆ display()

void SpiSsd1680Rotated::display ( bool  partial = false,
bool  dirtyOnly = true 
)
virtualinherited

Send the changes in the graphics buffer to the device and perform a full or partial update.

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

Implements QwEpGrBufferDevice.

◆ drawBitmap()

void SpiSsd1680Rotated::drawBitmap ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
uint8_t *  pBitmap,
uint8_t  bmp_width,
uint8_t  bmp_height 
)
protectedvirtualinherited

Reimplemented from _QwEpIDraw.

◆ drawCircle()

void QwEpGrBufferDevice::drawCircle ( uint8_t  x0,
uint8_t  y0,
uint8_t  radius,
uint8_t  clr 
)
protectedvirtualinherited

Reimplemented from _QwEpIDraw.

◆ drawCircleFilled()

void QwEpGrBufferDevice::drawCircleFilled ( uint8_t  x0,
uint8_t  y0,
uint8_t  radius,
uint8_t  clr 
)
protectedvirtualinherited

Reimplemented from _QwEpIDraw.

◆ drawLine()

void QwEpGrBufferDevice::drawLine ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
uint8_t  clr 
)
protectedvirtualinherited

Reimplemented from _QwEpIDraw.

◆ drawLineHorz()

void SpiSsd1680Rotated::drawLineHorz ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
uint8_t  clr 
)
protectedvirtualinherited

Reimplemented from _QwEpIDraw.

◆ drawLineVert()

void SpiSsd1680Rotated::drawLineVert ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
uint8_t  clr 
)
protectedvirtualinherited

Reimplemented from _QwEpIDraw.

◆ drawPixel()

void SpiSsd1680Rotated::drawPixel ( uint8_t  x,
uint8_t  y,
uint8_t  clr 
)
protectedvirtualinherited

Implements QwEpGrBufferDevice.

◆ drawRect()

void QwEpGrBufferDevice::drawRect ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
uint8_t  clr 
)
protectedvirtualinherited

Reimplemented from _QwEpIDraw.

◆ drawRectFilled()

void SpiSsd1680Rotated::drawRectFilled ( uint8_t  x0,
uint8_t  y0,
uint8_t  width,
uint8_t  height,
uint8_t  clr 
)
protectedvirtualinherited

Reimplemented from QwEpGrBufferDevice.

◆ drawText()

void QwEpGrBufferDevice::drawText ( uint8_t  x0,
uint8_t  y0,
const char *  text,
uint8_t  clr 
)
protectedvirtualinherited

Reimplemented from _QwEpIDraw.

◆ enableDebugging()

void SparkFun_SSD168x::SfeDebugPrint::enableDebugging ( sfe_print_t &  debugPort,
bool  printLimitedDebug = false 
)
inlineinherited

Enable debug messages, sent to the given port.

Parameters
debugPortThe port to print debug messages to (Arduino: a Print, e.g. Serial. ESP-IDF: an SfeOutput, e.g. SparkFun_SSD168x::sfeStdout).
printLimitedDebugIf true, only print messages flagged as "important". Defaults to false (print everything).

◆ erase()

void SpiSsd1680Rotated::erase ( void  )
virtualinherited

Erase the graphics buffer. The erase is not sent to the device until the next display().

Implements QwEpGrBufferDevice.

◆ font()

QwEpFont * QwEpGrBufferDevice::font ( void  )
inherited

◆ getStringSize()

bool QwEpGrBufferDevice::getStringSize ( const char *  text,
uint16_t &  width,
uint16_t &  height 
)
inherited

◆ height()

uint16_t QwEpGrBufferDevice::height ( void  )
inlineinherited

◆ init()

bool SpiSsd1680_184x88_Rotated::init ( void  )
inlinevirtual

Set up the specific device settings: allocate the graphics buffer, then initialize the device.

Returns
true on success, false on failure.

Reimplemented from SpiSsd1680Rotated.

◆ initFont()

void QwEpGrBufferDevice::initFont ( void  )
inherited

◆ isBusy()

bool SpiSsd1680Rotated::isBusy ( void  )
inherited

Read the state of the BUSY pin.

Returns
true if the SSD168x is busy (BUSY is high). Always false if not initialized.

◆ isInitialized()

bool SpiSsd1680Rotated::isInitialized ( void  )
inlineinherited

Check if init() has been called successfully.

Returns
true if initialized.

◆ line()

void QwEpGrBufferDevice::line ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
uint8_t  clr = COLOR_ON 
)
inherited

◆ originX()

uint16_t QwEpGrBufferDevice::originX ( void  )
inlineinherited

◆ originY()

uint16_t QwEpGrBufferDevice::originY ( void  )
inlineinherited

◆ pageCheckBounds()

void QwEpGrBufferDevice::pageCheckBounds ( pageStateEp_t &  _page_,
uint8_t  _c_ 
)
protectedinherited

◆ pageCheckBoundsDesc()

void QwEpGrBufferDevice::pageCheckBoundsDesc ( pageStateEp_t &  _page_,
pageStateEp_t &  _page2_ 
)
protectedinherited

◆ pageCheckBoundsRange()

void QwEpGrBufferDevice::pageCheckBoundsRange ( pageStateEp_t &  _page_,
uint8_t  _c0_,
uint8_t  _c1_ 
)
protectedinherited

◆ pageIsClean()

bool QwEpGrBufferDevice::pageIsClean ( pageStateEp_t &  _page_)
protectedinherited

◆ pageSetClean()

void QwEpGrBufferDevice::pageSetClean ( pageStateEp_t &  _page_)
protectedinherited

◆ pixel()

void QwEpGrBufferDevice::pixel ( uint8_t  x,
uint8_t  y,
uint8_t  clr = COLOR_ON 
)
inherited

◆ rasterOp()

grEpRasterOp_t SpiSsd1680Rotated::rasterOp ( void  )
inlineinherited

Get the current raster operation (draw mode).

Returns
The current raster operation.

◆ rectangle()

void QwEpGrBufferDevice::rectangle ( uint8_t  x0,
uint8_t  y0,
uint8_t  width,
uint8_t  height,
uint8_t  clr = COLOR_ON 
)
inherited

◆ rectangleFill()

void QwEpGrBufferDevice::rectangleFill ( uint8_t  x0,
uint8_t  y0,
uint8_t  width,
uint8_t  height,
uint8_t  clr = COLOR_ON 
)
inherited

◆ reset()

bool SpiSsd1680Rotated::reset ( void  )
inherited

Wake and reset the device: clear the graphics and screen buffers and perform a full update.

Returns
true on success, false on failure.

◆ setBuffer()

void SpiSsd1680Rotated::setBuffer ( uint8_t *  pBuffer)
protectedinherited

◆ setColor()

void SpiSsd1680Rotated::setColor ( uint8_t  color)
inherited

◆ setCommBus()

void SpiSsd1680Rotated::setCommBus ( SparkFun_SSD168x::SSD168xDeviceBus &  theBus,
int  resetPin,
int  busyPin 
)
inherited

Set the communication bus this object should use, plus the RES# and BUSY pins.

Parameters
theBusThe SPI bus object (SparkFun_SSD168x::SfeSPI), already initialized with the CS# and D/C# pins.
resetPinThe RES# (reset) pin. Can be -1 if not connected: a software reset is used instead.
busyPinThe BUSY pin (required).

◆ setFont() [1/2]

void QwEpGrBufferDevice::setFont ( const QwEpFont *  font)
inherited

◆ setFont() [2/2]

void QwEpGrBufferDevice::setFont ( QwEpFont &  font)
inherited

◆ setRasterOp()

void SpiSsd1680Rotated::setRasterOp ( grEpRasterOp_t  rop)
inlineinherited

Set the current raster operation (draw mode).

Parameters
ropThe raster operation.

◆ setViewport()

void QwEpGrBufferDevice::setViewport ( uint8_t  x0,
uint8_t  y0,
uint8_t  width,
uint8_t  height 
)
inlineinherited

◆ text()

void QwEpGrBufferDevice::text ( uint8_t  x0,
uint8_t  y0,
const char *  text,
uint8_t  clr = COLOR_ON 
)
inherited

◆ viewport()

QwEpRect QwEpGrBufferDevice::viewport ( void  )
inlineinherited

◆ waitWhileBusy()

bool SpiSsd1680Rotated::waitWhileBusy ( unsigned long  pollInterval_ms = 10,
unsigned long  timeout_ms = kSsd168xBusyTimeout_ms 
)
inherited

Wait until the SSD168x BUSY pin goes low.

Parameters
pollInterval_msHow often to check the BUSY pin (ms). Defaults to 10ms.
timeout_msThe maximum time to wait (ms). Defaults to kSsd168xBusyTimeout_ms.
Returns
true when BUSY is low, false on timeout.

◆ width()

uint16_t QwEpGrBufferDevice::width ( void  )
inlineinherited

Member Data Documentation

◆ _debugSerial

SfePrint SparkFun_SSD168x::SfeDebugPrint::_debugSerial
protectedinherited

◆ _printDebug

bool SparkFun_SSD168x::SfeDebugPrint::_printDebug = false
protectedinherited

◆ _printLimitedDebug

bool SparkFun_SSD168x::SfeDebugPrint::_printLimitedDebug = false
protectedinherited

◆ m_currentFont

QwEpFont* QwEpGrBufferDevice::m_currentFont
protectedinherited

◆ m_idraw

_QwEpIDraw_vtable QwEpGrBufferDevice::m_idraw
protectedinherited

◆ m_viewport

QwEpRect QwEpGrBufferDevice::m_viewport
protectedinherited

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