3#include <Adafruit_SSD1306.h>
29 void drawPixel(int16_t x, int16_t y, uint16_t color)
override {
30 disp.drawPixel(x, y, color);
47 size_t write(uint8_t c)
override {
return disp.write(c); }
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);
56 uint16_t color)
override {
57 disp.drawFastVLine(x, y, h, color);
61 uint16_t color)
override {
62 disp.drawFastHLine(x, y, w, color);
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);
#define BEGIN_CS_NAMESPACE
An interface for displays.
This class creates a mapping between the Adafruit_SSD1306 display driver and the general display inte...
size_t write(uint8_t c) override
Write a character to the display.
void display() override
Write the frame buffer to the display.
void drawBackground() override=0
Draw a custom background.
void setTextSize(uint8_t size) override
Set the text size.
void setCursor(int16_t x, int16_t y) override
Set the cursor position.
void setTextColor(uint16_t color) override
Set the text color.
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) override
Draw a vertical line.
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) override
Draw a line between two points.
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) override
Draw a horizontal line.
void drawPixel(int16_t x, int16_t y, uint16_t color) override
Paint a single pixel with the given color.
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.
SSD1306_DisplayInterface(Adafruit_SSD1306 &display)
void clear() override
Clear the frame buffer or clear the display.