Control Surface
main
MIDI Control Surface library for Arduino
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Display
DisplayInterfaces
DisplayInterfaceSSD1306.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <Adafruit_SSD1306.h>
4
#include <
Display/DisplayInterface.hpp
>
5
6
BEGIN_CS_NAMESPACE
7
14
class
SSD1306_DisplayInterface
:
public
DisplayInterface
{
15
protected
:
16
SSD1306_DisplayInterface
(Adafruit_SSD1306 &
display
) :
disp
(
display
) {}
17
18
public
:
20
void
clear
()
override
{
disp
.clearDisplay(); }
22
void
drawBackground
()
override
= 0;
26
void
display
()
override
{
disp
.display(); }
27
29
void
drawPixel
(int16_t x, int16_t y, uint16_t color)
override
{
30
disp
.drawPixel(x, y, color);
31
}
32
34
void
setTextColor
(uint16_t color)
override
{
disp
.setTextColor(color); }
36
void
setTextSize
(uint8_t size)
override
{
disp
.setTextSize(size); }
38
void
setCursor
(int16_t x, int16_t y)
override
{
disp
.setCursor(x, y); }
39
47
size_t
write
(uint8_t c)
override
{
return
disp
.write(c); }
48
50
void
drawLine
(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
51
uint16_t color)
override
{
52
disp
.drawLine(x0, y0, x1, y1, color);
53
}
54
55
void
drawFastVLine
(int16_t x, int16_t y, int16_t h,
56
uint16_t color)
override
{
57
disp
.drawFastVLine(x, y, h, color);
58
}
59
60
void
drawFastHLine
(int16_t x, int16_t y, int16_t w,
61
uint16_t color)
override
{
62
disp
.drawFastHLine(x, y, w, color);
63
}
64
66
void
drawXBitmap
(int16_t x, int16_t y,
const
uint8_t bitmap[], int16_t w,
67
int16_t h, uint16_t color)
override
{
68
disp
.drawXBitmap(x, y, bitmap, w, h, color);
69
}
70
71
protected
:
72
Adafruit_SSD1306 &
disp
;
73
};
74
75
END_CS_NAMESPACE
DisplayInterface.hpp
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:14
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:11
DisplayInterface::DisplayInterface
DisplayInterface()=default
SSD1306_DisplayInterface::write
size_t write(uint8_t c) override
Write a character to the display.
Definition
DisplayInterfaceSSD1306.hpp:47
SSD1306_DisplayInterface::display
void display() override
Write the frame buffer to the display.
Definition
DisplayInterfaceSSD1306.hpp:26
SSD1306_DisplayInterface::drawBackground
void drawBackground() override=0
Draw a custom background.
SSD1306_DisplayInterface::setTextSize
void setTextSize(uint8_t size) override
Set the text size.
Definition
DisplayInterfaceSSD1306.hpp:36
SSD1306_DisplayInterface::setCursor
void setCursor(int16_t x, int16_t y) override
Set the cursor position.
Definition
DisplayInterfaceSSD1306.hpp:38
SSD1306_DisplayInterface::setTextColor
void setTextColor(uint16_t color) override
Set the text color.
Definition
DisplayInterfaceSSD1306.hpp:34
SSD1306_DisplayInterface::drawFastVLine
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) override
Draw a vertical line.
Definition
DisplayInterfaceSSD1306.hpp:55
SSD1306_DisplayInterface::drawLine
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) override
Draw a line between two points.
Definition
DisplayInterfaceSSD1306.hpp:50
SSD1306_DisplayInterface::drawFastHLine
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) override
Draw a horizontal line.
Definition
DisplayInterfaceSSD1306.hpp:60
SSD1306_DisplayInterface::disp
Adafruit_SSD1306 & disp
Definition
DisplayInterfaceSSD1306.hpp:72
SSD1306_DisplayInterface::drawPixel
void drawPixel(int16_t x, int16_t y, uint16_t color) override
Paint a single pixel with the given color.
Definition
DisplayInterfaceSSD1306.hpp:29
SSD1306_DisplayInterface::drawXBitmap
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.
Definition
DisplayInterfaceSSD1306.hpp:66
SSD1306_DisplayInterface::SSD1306_DisplayInterface
SSD1306_DisplayInterface(Adafruit_SSD1306 &display)
Definition
DisplayInterfaceSSD1306.hpp:16
SSD1306_DisplayInterface::clear
void clear() override
Clear the frame buffer or clear the display.
Definition
DisplayInterfaceSSD1306.hpp:20
Generated by
1.17.0