35 #ifndef _SSD1306_ADAFRUIT_H_
36 #define _SSD1306_ADAFRUIT_H_
40 #if defined(CONFIG_ADAFRUIT_GFX_ENABLE)
47 #ifndef DOXYGEN_SHOULD_SKIP_THIS
52 #include "Adafruit_GFX.h"
55 #include "Adafruit_GFX.h"
58 #endif // DOXYGEN_SHOULD_SKIP_THIS
66 template <u
int8_t BPP>
99 void drawPixel(int16_t x, int16_t y, uint16_t color)
override;
106 void setOffset(lcdint_t ox, lcdint_t oy) { offset.
x = ox; offset.
y = oy; };
108 #ifndef DOXYGEN_SHOULD_SKIP_THIS
111 void fillScreen(uint16_t color)
override
113 fillRect(offset.
x, offset.
y, _width, _height, color);
123 inline void rotatePosition(int16_t &x, int16_t &y)
125 switch (getRotation()) {
146 template <u
int8_t BPP>
157 virtual void blt(lcdint_t x, lcdint_t y) = 0;
162 virtual void blt() = 0;
179 using AdafruitCanvasBase::AdafruitCanvasBase;
186 void blt(lcdint_t x, lcdint_t y)
override
200 #ifndef DOXYGEN_SHOULD_SKIP_THIS
206 if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))
210 rotatePosition(x, y);
214 case 1: m_buffer[x+ (y/8)*WIDTH] |= (1 << (y&7));
break;
215 case 0: m_buffer[x+ (y/8)*WIDTH] &= ~(1 << (y&7));
break;
216 case 2: m_buffer[x+ (y/8)*WIDTH] ^= (1 << (y&7));
break;
219 #endif // DOXYGEN_SHOULD_SKIP_THIS
235 using AdafruitCanvasBase::AdafruitCanvasBase;
242 void blt(lcdint_t x, lcdint_t y)
override
256 #ifndef DOXYGEN_SHOULD_SKIP_THIS
262 if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))
266 rotatePosition(x, y);
268 m_buffer[x+y*WIDTH] = color;
270 #endif // DOXYGEN_SHOULD_SKIP_THIS
287 using AdafruitCanvasBase::AdafruitCanvasBase;
294 void blt(lcdint_t x, lcdint_t y)
override
308 #ifndef DOXYGEN_SHOULD_SKIP_THIS
314 if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))
318 rotatePosition(x, y);
320 m_buffer[(x+y*WIDTH) * 2 + 0] = color;
321 m_buffer[(x+y*WIDTH) * 2 + 1] = color >> 8;
323 #endif // DOXYGEN_SHOULD_SKIP_THIS
325 #endif // CONFIG_ADAFRUIT_GFX_ENABLE
void ssd1331_drawBufferFast16(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *data)
AdafruitCanvasOps(lcduint_t w, lcduint_t h, uint8_t *buffer)
void blt(lcdint_t x, lcdint_t y) override
void setOffset(lcdint_t ox, lcdint_t oy)
void ssd1331_drawBufferFast8(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *data)
static const uint8_t BITS_PER_PIXEL
void blt(lcdint_t x, lcdint_t y) override
void blt(lcdint_t x, lcdint_t y) override
void ssd1306_drawBufferFast(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buf)
void drawPixel(int16_t x, int16_t y, uint16_t color) override
#define ssd1306_swap_data(a, b, type)