SSD1306 OLED display driver  1.3.3
This library is developed to control SSD1306 i2c/spi OLED display
tiny_ssd1306.cpp
1 /*
2  Copyright (C) 2017 Alexey Dynda
3 
4  This file is part of SSD1306 library.
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "tiny_ssd1306.h"
21 
22 size_t TinySSD1306::write(uint8_t ch)
23 {
24  const char str[2] = { static_cast<char>(ch), '\0' };
25  if ( (m_xpos > width() - 6) || (ch == '\n') )
26  {
27  m_xpos = 0;
28  m_ypos++;
29  }
30  ssd1306_charF6x8( m_xpos, m_ypos, str, STYLE_NORMAL );
31  m_xpos += 6;
32 }
uint8_t width()
Definition: tiny_ssd1306.h:119
uint8_t ssd1306_charF6x8(uint8_t x, uint8_t y, const char ch[], EFontStyle style)
Definition: ssd1306.cpp:89
virtual size_t write(uint8_t ch)