27 extern uint8_t s_ssd1306_invertByte;
55 this->m_intf.startBlock(x, y, 0);
56 this->m_intf.send( (this->m_color & 0x0F) << (4*(x & 1)) );
57 this->m_intf.endBlock();
64 this->m_intf.startBlock(x1, y1, 0);
67 data |= (this->m_color & 0x0F) << (4*(x1 & 1));
70 this->m_intf.send( data );
77 this->m_intf.send( data );
79 this->m_intf.endBlock();
85 this->m_intf.startBlock(x1, y1, 1);
88 this->m_intf.send( (this->m_color & 0x0F) << (4*(x1 & 1)) );
91 this->m_intf.endBlock();
105 this->m_intf.startBlock(x1, y1, x2 - x1 + 1);
106 uint32_t count = (x2 - x1 + 1) * (y2 - y1 + 1);
109 this->m_intf.send( this->m_color );
112 this->m_intf.endBlock();
118 this->m_intf.startBlock(0, 0, 0);
119 uint32_t count = (uint32_t)this->m_w * (uint32_t)this->m_h / 2;
122 this->m_intf.send( color );
125 this->m_intf.endBlock();
144 uint8_t blackColor = s_ssd1306_invertByte ? (this->m_color | (this->m_color << 4)) : 0x00;
145 uint8_t color = s_ssd1306_invertByte ? 0x00 : (this->m_color | (this->m_color << 4));
146 this->m_intf.startBlock(xpos, ypos, w);
151 for (wx = xpos; wx < xpos + (
lcdint_t)w; wx++)
153 uint8_t data = pgm_read_byte( bitmap );
154 uint8_t mask = wx & 0x01 ? 0xF0 : 0x0F;
156 pixels |= color & mask;
158 pixels |= blackColor & mask;
162 this->m_intf.send( pixels );
168 this->m_intf.send( pixels );
180 this->m_intf.endBlock();
186 this->m_intf.startBlock(x, y, w);
187 for (
lcdint_t _y = y; _y < y + h; _y++)
190 for (
lcdint_t _x = x; _x < x + w; _x++)
192 uint8_t bmp = pgm_read_byte( bitmap );
193 if ( (_x - x) & 1 ) bmp >>=4;
else bmp &= 0x0F;
194 data |= bmp << (4 * (_x & 1));
201 this->m_intf.send( data );
207 this->m_intf.send( data );
210 this->m_intf.endBlock();
216 this->m_intf.startBlock(x, y, w);
217 uint32_t count = (w) * (h);
220 uint8_t data1 = pgm_read_byte( bitmap++ );
221 uint8_t data2 = pgm_read_byte( bitmap++ );
225 this->m_intf.endBlock();
238 uint8_t blackColor = s_ssd1306_invertByte ? (this->m_color | (this->m_color << 4)) : 0x00;
239 uint8_t color = s_ssd1306_invertByte ? 0x00 : (this->m_color | (this->m_color << 4));
240 this->m_intf.startBlock(xpos, ypos, w);
247 uint8_t data = *buffer;
248 uint8_t mask = wx & 0x01 ? 0xF0 : 0x0F;
250 pixels |= color & mask;
252 pixels |= blackColor & mask;
253 if ( ( wx & 0x01 ) == 0x00 )
255 this->m_intf.send( pixels );
270 this->m_intf.endBlock();
276 this->drawBuffer1( x, y, w, h, buf );
282 this->m_intf.startBlock(x, y, w);
283 for (
lcdint_t _y = y; _y < y + h; _y++)
286 for (
lcdint_t _x = x; _x < x + w; _x++)
288 uint8_t bmp = *buffer;
289 if ( (_x - x) & 1 ) bmp >>=4;
else bmp &= 0x0F;
290 data |= bmp << (4 * (_x & 1));
297 this->m_intf.send( data );
303 this->m_intf.send( data );
306 this->m_intf.endBlock();
312 this->m_intf.startBlock(x, y, w);
313 uint32_t count = (w) * (h);
316 uint8_t data1 = *buffer; buffer++;
317 uint8_t data2 = *buffer; buffer++;
321 this->m_intf.endBlock();
333 uint16_t unicode = this->m_font->unicode16FromUtf8(c);
336 this->m_font->getCharBitmap(unicode, &char_info);
337 uint8_t mode = this->m_textMode;
338 for (uint8_t i = 0; i<(this->m_fontStyle == STYLE_BOLD ? 2: 1); i++)
340 this->drawBitmap1(this->m_cursorX + i,
347 this->m_textMode = mode;
350 (this->m_cursorX > ((
lcdint_t)this->m_w - (
lcdint_t)this->m_font->getHeader().width) ) )
352 (this->m_cursorX > ((
lcdint_t)this->m_w - (
lcdint_t)this->m_font->getHeader().width)) ) )
354 this->m_cursorY += (
lcdint_t)this->m_font->getHeader().height;
356 if ( (this->m_textMode & CANVAS_TEXT_WRAP_LOCAL) &&
357 (this->m_cursorY > ((
lcdint_t)this->m_h - (
lcdint_t)this->m_font->getHeader().height)) )
370 this->m_cursorY += (
lcdint_t)this->m_font->getHeader().height;
379 return printChar( c );
389 this->m_cursorX = xpos;
void fill(uint16_t color)
void drawHLine(lcdint_t x1, lcdint_t y1, lcdint_t x2)
uint8_t height
char height in pixels
void drawXBitmap(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
void putPixel(lcdint_t x, lcdint_t y) __attribute__((noinline))
void drawVLine(lcdint_t x1, lcdint_t y1, lcdint_t y2)
void drawBuffer4(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
#define SSD1306_MORE_CHARS_REQUIRED
void printFixed(lcdint_t xpos, lcdint_t y, const char *ch, EFontStyle style=STYLE_NORMAL) __attribute__((noinline))
void drawBuffer8(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer)
void drawBitmap4(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap) __attribute__((noinline))
Draws 4-bit gray-color bitmap in color buffer. Draws 4-bit gray-color bitmap in color buffer...
void drawBitmap8(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
Draws 8-bit color bitmap in color buffer. Draws 8-bit color bitmap in color buffer.
uint8_t printChar(uint8_t c)
void drawBuffer16(lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
size_t write(uint8_t c) __attribute__((noinline))
void drawBitmap16(lcdint_t xpos, lcdint_t ypos, lcduint_t w, lcduint_t h, const uint8_t *bitmap)
uint8_t width
char width in pixels
#define RGB8_TO_GRAY4(rgb)
void drawBuffer1Fast(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer)
void fillRect(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2) __attribute__((noinline))
const uint8_t * glyph
char data, located in progmem.
void drawBitmap1(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *bitmap) __attribute__((noinline))
Draws monochrome bitmap in color buffer using color, specified via setColor() method Draws monochrome...
void drawBuffer1(lcdint_t x, lcdint_t y, lcduint_t w, lcduint_t h, const uint8_t *buffer) __attribute__((noinline))
uint8_t spacing
additional spaces after char in pixels
#define ssd1306_swap_data(a, b, type)