38 uint16_t ssd1306_color = 0xFFFF;
39 lcduint_t ssd1306_cursorX = 0;
40 lcduint_t ssd1306_cursorY = 0;
42 #ifdef CONFIG_SSD1306_UNICODE_ENABLE 43 uint8_t g_ssd1306_unicode = 1;
64 s_fixedFont.
h.
type = pgm_read_byte(&progmemFont[0]);
65 s_fixedFont.
h.
width = pgm_read_byte(&progmemFont[1]);
66 s_fixedFont.
h.
height = pgm_read_byte(&progmemFont[2]);
71 #ifdef CONFIG_SSD1306_UNICODE_ENABLE 91 info->
data = ssd1306_getCharGlyph( ch );
95 const uint8_t *ssd1306_getCharGlyph(
char ch)
102 #ifdef CONFIG_SSD1306_UNICODE_ENABLE 105 r->
start_code = pgm_read_byte(&p[0]) | (pgm_read_byte(&p[1]) << 8);
106 r->
count = pgm_read_byte(&p[2]) | (pgm_read_byte(&p[3]) << 8);
110 static const uint8_t *ssd1306_searchCharGlyph(
const uint8_t * unicode_table, uint16_t unicode)
113 const uint8_t *data = unicode_table;
117 ssd1306_readUnicodeRecord( &r, data );
137 const uint8_t *ssd1306_getU16CharGlyph(uint16_t unicode)
139 #ifdef CONFIG_SSD1306_UNICODE_ENABLE 140 const uint8_t * glyph = NULL;
141 if ((unicode < 128) && (s_fixedFont.
h.
type == 0x00) && (s_fixedFont.
primary_table != NULL))
143 return ssd1306_getCharGlyph(unicode);
147 glyph = ssd1306_searchCharGlyph( s_fixedFont.
primary_table, unicode );
151 glyph = ssd1306_searchCharGlyph( s_fixedFont.
secondary_table, unicode );
159 return ssd1306_getCharGlyph(unicode);
163 uint16_t ssd1306_unicode16FromUtf8(uint8_t ch)
165 static uint16_t unicode = 0;
176 uint16_t code = ((unicode & 0x1f) << 6) | (ch & 0x3f);
183 #ifdef CONFIG_SSD1306_UNICODE_ENABLE 184 g_ssd1306_unicode = 1;
190 #ifdef CONFIG_SSD1306_UNICODE_ENABLE 191 g_ssd1306_unicode = 0;
void ssd1306_setCursor(lcdint_t x, lcdint_t y)
Sets cursor position for text mode print functions.
const uint8_t * data
char data, located in progmem.
uint8_t height
char height in pixels
const uint8_t * primary_table
font chars bits
void ssd1306_enableUtf8Mode()
uint16_t start_code
unicode start code
uint8_t ssd1306_displayWidth()
ssd1306_lcd_t ssd1306_lcd
void ssd1306_setFixedFont(const uint8_t *progmemFont)
uint8_t count
count of unicode chars in block
uint8_t width
char width in pixels
const uint8_t * secondary_table
font chars bits
SFixedFontInfo s_fixedFont
SFontHeaderRecord h
record, containing information on font
void ssd1306_setSecondaryFont(const uint8_t *progmemUnicode)
void ssd1306_getCharBitmap(char ch, SCharInfo *info)
returns char data for currently set (active) font.
#define SSD1306_MORE_CHARS_REQUIRED
uint8_t ssd1306_displayHeight()
uint8_t glyph_size
glyph size in bytes
uint8_t pages
height in pages (each page height is 8-pixels)
void ssd1306_enableAsciiMode()