35 #ifndef _SSD1306_ADAFRUIT_H_ 36 #define _SSD1306_ADAFRUIT_H_ 40 #if defined(CONFIG_ADAFRUIT_GFX_ENABLE) 46 #ifndef DOXYGEN_SHOULD_SKIP_THIS 51 #include "Adafruit_GFX.h" 54 #include "Adafruit_GFX.h" 57 #endif // DOXYGEN_SHOULD_SKIP_THIS 70 template <u
int8_t BPP>
103 void drawPixel(int16_t x, int16_t y, uint16_t color)
override;
110 void setOffset(lcdint_t ox, lcdint_t oy) { offset.
x = ox; offset.
y = oy; };
112 #ifndef DOXYGEN_SHOULD_SKIP_THIS 115 void fillScreen(uint16_t color)
override 117 fillRect(offset.
x, offset.
y, _width, _height, color);
127 inline void rotatePosition(int16_t &x, int16_t &y)
129 switch (getRotation()) {
150 template <u
int8_t BPP>
161 virtual void blt(lcdint_t x, lcdint_t y) = 0;
166 virtual void blt() = 0;
183 using AdafruitCanvasBase::AdafruitCanvasBase;
190 void blt(lcdint_t x, lcdint_t y)
override 204 #ifndef DOXYGEN_SHOULD_SKIP_THIS 210 if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))
214 rotatePosition(x, y);
218 case 1:
m_buffer[x+ (y/8)*WIDTH] |= (1 << (y&7));
break;
219 case 0:
m_buffer[x+ (y/8)*WIDTH] &= ~(1 << (y&7));
break;
220 case 2:
m_buffer[x+ (y/8)*WIDTH] ^= (1 << (y&7));
break;
223 #endif // DOXYGEN_SHOULD_SKIP_THIS 239 using AdafruitCanvasBase::AdafruitCanvasBase;
246 void blt(lcdint_t x, lcdint_t y)
override 260 #ifndef DOXYGEN_SHOULD_SKIP_THIS 266 if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))
270 rotatePosition(x, y);
274 #endif // DOXYGEN_SHOULD_SKIP_THIS 291 using AdafruitCanvasBase::AdafruitCanvasBase;
298 void blt(lcdint_t x, lcdint_t y)
override 312 #ifndef DOXYGEN_SHOULD_SKIP_THIS 318 if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))
322 rotatePosition(x, y);
324 m_buffer[(x+y*WIDTH) * 2 + 0] = color;
325 m_buffer[(x+y*WIDTH) * 2 + 1] = color >> 8;
327 #endif // DOXYGEN_SHOULD_SKIP_THIS 333 #endif // CONFIG_ADAFRUIT_GFX_ENABLE 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 ssd1306_drawBufferFast16(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *data)
static const uint8_t BITS_PER_PIXEL
void ssd1306_drawBufferFast8(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *data)
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)