53 if ( m_lastRow != y || newColumn != m_lastColumn )
56 m_lastColumn = newColumn;
57 m_lastByte = this->m_bgColor | (this->m_bgColor << 4);
60 m_lastByte &= 0xF0 >> (4 * (x & 1));
62 m_lastByte |= (this->m_color & 0x0F) << (4 * (x & 1));
63 this->m_intf.startBlock(x, y, 0);
64 this->m_intf.send(m_lastByte);
65 this->m_intf.endBlock();
71 this->m_intf.startBlock(x1, y1, 0);
74 data |= (this->m_color & 0x0F) << (4 * (x1 & 1));
77 this->m_intf.send(data);
84 this->m_intf.send(data);
86 this->m_intf.endBlock();
91 this->m_intf.startBlock(x1, y1, 1);
94 this->m_intf.send((this->m_color & 0x0F) << (4 * (x1 & 1)));
97 this->m_intf.endBlock();
110 this->m_intf.startBlock(x1, y1, x2 - x1 + 1);
111 uint32_t count = (x2 - x1 + 1) * (y2 - y1 + 1);
114 this->m_intf.send(this->m_color);
117 this->m_intf.endBlock();
122 this->m_intf.startBlock(0, 0, 0);
123 uint32_t count = (uint32_t)this->m_w * (uint32_t)this->m_h / 2;
126 this->m_intf.send(color);
129 this->m_intf.endBlock();
147 uint8_t blackColor = this->m_bgColor | (this->m_bgColor << 4);
148 uint8_t color = this->m_color | (this->m_color << 4);
149 this->m_intf.startBlock(xpos, ypos, w);
154 for ( wx = xpos; wx < xpos + (
lcdint_t)w; wx++ )
156 uint8_t data = pgm_read_byte(bitmap);
157 uint8_t mask = (wx & 0x01) ? 0xF0 : 0x0F;
159 pixels |= color & mask;
161 pixels |= blackColor & mask;
165 this->m_intf.send(pixels);
171 this->m_intf.send(pixels);
183 this->m_intf.endBlock();
189 this->m_intf.startBlock(x, y, w);
190 for (
lcdint_t _y = y; _y < y + h; _y++ )
193 for (
lcdint_t _x = x; _x < x + w; _x++ )
195 uint8_t bmp = pgm_read_byte(bitmap);
200 data |= bmp << (4 * (_x & 1));
207 this->m_intf.send(data);
213 this->m_intf.send(data);
216 this->m_intf.endBlock();
222 this->m_intf.startBlock(x, y, w);
223 uint32_t count = (w) * (h);
226 uint8_t data1 = pgm_read_byte(bitmap++);
227 uint8_t data2 = pgm_read_byte(bitmap++);
231 this->m_intf.endBlock();
244 uint8_t blackColor = this->m_bgColor | (this->m_bgColor << 4);
245 uint8_t color = this->m_color | (this->m_color << 4);
246 this->m_intf.startBlock(xpos, ypos, w);
253 uint8_t data = *buffer;
254 uint8_t mask = (wx & 0x01) ? 0xF0 : 0x0F;
256 pixels |= color & mask;
258 pixels |= blackColor & mask;
259 if ( (wx & 0x01) == 0x00 )
261 this->m_intf.send(pixels);
276 this->m_intf.endBlock();
282 this->drawBuffer1(x, y, w, h, buf);
288 this->m_intf.startBlock(x, y, w);
289 for (
lcdint_t _y = y; _y < y + h; _y++ )
292 for (
lcdint_t _x = x; _x < x + w; _x++ )
294 uint8_t bmp = *buffer;
299 data |= bmp << (4 * (_x & 1));
306 this->m_intf.send(data);
312 this->m_intf.send(data);
315 this->m_intf.endBlock();
321 this->m_intf.startBlock(x, y, w);
322 uint32_t count = (w) * (h);
325 uint8_t data1 = *buffer;
327 uint8_t data2 = *buffer;
332 this->m_intf.endBlock();
343 uint16_t unicode = this->m_font->unicode16FromUtf8(c);
347 this->m_font->getCharBitmap(unicode, &char_info);
348 uint8_t mode = this->m_textMode;
349 for ( uint8_t i = 0; i < (this->m_fontStyle == STYLE_BOLD ? 2 : 1); i++ )
351 this->drawBitmap1(this->m_cursorX + i, this->m_cursorY, char_info.
width, char_info.
height, char_info.
glyph);
354 this->m_textMode = mode;
357 (this->m_cursorX > ((
lcdint_t)this->m_w - (
lcdint_t)this->m_font->getHeader().width))) ||
359 (this->m_cursorX > ((
lcdint_t)this->m_w - (
lcdint_t)this->m_font->getHeader().width))) )
361 this->m_cursorY += (
lcdint_t)this->m_font->getHeader().height;
363 if ( (this->m_textMode & CANVAS_TEXT_WRAP_LOCAL) &&
364 (this->m_cursorY > ((
lcdint_t)this->m_h - (
lcdint_t)this->m_font->getHeader().height)) )
376 this->m_cursorY += (
lcdint_t)this->m_font->getHeader().height;
379 else if ( c ==
'\r' )
394 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)