Control Surface master
MIDI Control Surface library for Arduino
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SSD1306_DisplayInterface Class Referenceabstract

#include <Display/DisplayInterfaces/DisplayInterfaceSSD1306.hpp>

Detailed Description

This class creates a mapping between the Adafruit_SSD1306 display driver and the general display interface used by the Control Surface library.

Examples
2.VU-Meter-OLED-USB-DAC.ino, MCU-OLED-SSD1306-x2.ino, MCU-OLED-SSD1306.ino, and VU-Meter-Bridge.ino.

Definition at line 13 of file DisplayInterfaceSSD1306.hpp.

+ Inheritance diagram for SSD1306_DisplayInterface:
+ Collaboration diagram for SSD1306_DisplayInterface:

Public Member Functions

void clear () override
 Clear the frame buffer or clear the display. More...
 
void drawBackground () override=0
 Draw a custom background. More...
 
void display () override
 Write the frame buffer to the display. More...
 
void drawPixel (int16_t x, int16_t y, uint16_t color) override
 Paint a single pixel with the given color. More...
 
void setTextColor (uint16_t color) override
 Set the text color. More...
 
void setTextSize (uint8_t size) override
 Set the text size. More...
 
void setCursor (int16_t x, int16_t y) override
 Set the cursor position. More...
 
size_t write (uint8_t c) override
 Write a character to the display. More...
 
void drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) override
 Draw a line between two points. More...
 
void drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color) override
 Draw a vertical line. More...
 
void drawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color) override
 Draw a horizontal line. More...
 
void drawXBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color) override
 Draw a bitmap to the display. More...
 
virtual void begin ()
 Initialize the display. More...
 
virtual void fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
 Draw a filled rectangle. More...
 
virtual void drawCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color)
 Draw a circle. More...
 
virtual void fillCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color)
 Draw a disk (filled circle). More...
 
void clearAndDrawBackground ()
 Clear the frame buffer, and draw the custom background. More...
 

Protected Member Functions

 SSD1306_DisplayInterface (Adafruit_SSD1306 &display)
 

Protected Attributes

Adafruit_SSD1306 & disp
 

Constructor & Destructor Documentation

◆ SSD1306_DisplayInterface()

SSD1306_DisplayInterface ( Adafruit_SSD1306 &  display)
inlineprotected

Definition at line 15 of file DisplayInterfaceSSD1306.hpp.

Member Function Documentation

◆ clear()

void clear ( )
inlineoverridevirtual

Clear the frame buffer or clear the display.

Implements DisplayInterface.

Definition at line 19 of file DisplayInterfaceSSD1306.hpp.

◆ drawBackground()

void drawBackground ( )
overridepure virtual

◆ display()

void display ( )
inlineoverridevirtual

Write the frame buffer to the display.

If your display library writes to the display directly, without a display buffer in RAM, you can leave this function empty.

Implements DisplayInterface.

Definition at line 25 of file DisplayInterfaceSSD1306.hpp.

◆ drawPixel()

void drawPixel ( int16_t  x,
int16_t  y,
uint16_t  color 
)
inlineoverridevirtual

Paint a single pixel with the given color.

Implements DisplayInterface.

Definition at line 28 of file DisplayInterfaceSSD1306.hpp.

◆ setTextColor()

void setTextColor ( uint16_t  color)
inlineoverridevirtual

Set the text color.

Implements DisplayInterface.

Definition at line 33 of file DisplayInterfaceSSD1306.hpp.

◆ setTextSize()

void setTextSize ( uint8_t  size)
inlineoverridevirtual

Set the text size.

Implements DisplayInterface.

Definition at line 35 of file DisplayInterfaceSSD1306.hpp.

◆ setCursor()

void setCursor ( int16_t  x,
int16_t  y 
)
inlineoverridevirtual

Set the cursor position.

Implements DisplayInterface.

Definition at line 37 of file DisplayInterfaceSSD1306.hpp.

◆ write()

size_t write ( uint8_t  c)
inlineoverridevirtual

Write a character to the display.

See also
setCursor
setTextSize
setTextColor

Implements DisplayInterface.

Definition at line 46 of file DisplayInterfaceSSD1306.hpp.

◆ drawLine()

void drawLine ( int16_t  x0,
int16_t  y0,
int16_t  x1,
int16_t  y1,
uint16_t  color 
)
inlineoverridevirtual

Draw a line between two points.

Implements DisplayInterface.

Definition at line 49 of file DisplayInterfaceSSD1306.hpp.

◆ drawFastVLine()

void drawFastVLine ( int16_t  x,
int16_t  y,
int16_t  h,
uint16_t  color 
)
inlineoverridevirtual

Draw a vertical line.

Implements DisplayInterface.

Definition at line 54 of file DisplayInterfaceSSD1306.hpp.

◆ drawFastHLine()

void drawFastHLine ( int16_t  x,
int16_t  y,
int16_t  w,
uint16_t  color 
)
inlineoverridevirtual

Draw a horizontal line.

Implements DisplayInterface.

Definition at line 59 of file DisplayInterfaceSSD1306.hpp.

◆ drawXBitmap()

void drawXBitmap ( int16_t  x,
int16_t  y,
const uint8_t  bitmap[],
int16_t  w,
int16_t  h,
uint16_t  color 
)
inlineoverridevirtual

Draw a bitmap to the display.

Implements DisplayInterface.

Definition at line 65 of file DisplayInterfaceSSD1306.hpp.

◆ begin()

void begin ( )
virtualinherited

Initialize the display.

Examples
2.VU-Meter-OLED-USB-DAC.ino, MCU-OLED-SSD1306-x2.ino, MCU-OLED-SSD1306.ino, and VU-Meter-Bridge.ino.

Definition at line 5 of file DisplayInterface.cpp.

◆ fillRect()

void fillRect ( int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
uint16_t  color 
)
virtualinherited

Draw a filled rectangle.

Definition at line 11 of file DisplayInterface.cpp.

◆ drawCircle()

void drawCircle ( int16_t  x0,
int16_t  y0,
int16_t  r,
uint16_t  color 
)
virtualinherited

Draw a circle.

Definition at line 17 of file DisplayInterface.cpp.

◆ fillCircle()

void fillCircle ( int16_t  x0,
int16_t  y0,
int16_t  r,
uint16_t  color 
)
virtualinherited

Draw a disk (filled circle).

Definition at line 40 of file DisplayInterface.cpp.

◆ clearAndDrawBackground()

void clearAndDrawBackground ( )
inlineinherited

Clear the frame buffer, and draw the custom background.

See also
clear
drawBackground

Definition at line 81 of file DisplayInterface.hpp.

Member Data Documentation

◆ disp

Adafruit_SSD1306& disp
protected

Definition at line 71 of file DisplayInterfaceSSD1306.hpp.


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