29 #define min(x,y) ((x)<(y)?(x):(y)) 33 #define max(x,y) ((x)>(y)?(x):(y)) 37 extern uint16_t ssd1306_color;
39 static uint8_t getMaxScreenItems(
void)
44 static uint8_t getMaxScreenItems8(
void)
58 static uint8_t calculateScrollPosition(
SAppMenu *menu, uint8_t selection)
60 if ( selection < menu->scrollPosition )
64 else if ( selection - menu->
scrollPosition > getMaxScreenItems() - 1)
66 return selection - getMaxScreenItems() + 1;
71 static uint8_t calculateScrollPosition8(
SAppMenu *menu, uint8_t selection)
73 if ( selection < menu->scrollPosition )
77 else if ( selection - menu->
scrollPosition > getMaxScreenItems8() - 1)
79 return selection - getMaxScreenItems8() + 1;
84 static void drawMenuItem(
SAppMenu *menu, uint8_t index)
98 static void drawMenuItem8(
SAppMenu *menu, uint8_t index)
112 static void drawMenuItem16(
SAppMenu *menu, uint8_t index)
132 drawMenuItem(menu, i);
143 drawMenuItem8(menu, i);
154 drawMenuItem16(menu, i);
163 uint8_t scrollPosition = calculateScrollPosition( menu, menu->
selection );
182 uint8_t scrollPosition = calculateScrollPosition8( menu, menu->
selection );
201 uint8_t scrollPosition = calculateScrollPosition8( menu, menu->
selection );
247 lcduint_t height = 8;
249 char str[5] =
"100%";
250 if ( progress < 100 )
253 str[1] = progress / 10 +
'0';
254 str[2] = progress % 10 +
'0';
263 uint16_t color = ssd1306_color;
264 ssd1306_color = 0x0000;
266 ssd1306_color = color;
274 lcduint_t height = 8;
276 char str[5] =
"100%";
277 if ( progress < 100 )
280 str[1] = progress / 10 +
'0';
281 str[2] = progress % 10 +
'0';
290 uint16_t color = ssd1306_color;
291 ssd1306_color = 0x0000;
293 ssd1306_color = color;
lcduint_t ssd1306_displayWidth(void)
void ssd1306_drawRect8(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
uint8_t ssd1306_printFixed8(lcdint_t x, lcdint_t y, const char *ch, EFontStyle style)
void ssd1306_createMenu(SAppMenu *menu, const char **items, uint8_t count)
void ssd1306_positiveMode()
const uint8_t * primary_table
font chars bits
uint8_t ssd1306_printFixed16(lcdint_t x, lcdint_t y, const char *ch, EFontStyle style)
uint8_t ssd1306_printFixed(uint8_t xpos, uint8_t y, const char *ch, EFontStyle style)
void ssd1306_updateMenu(SAppMenu *menu)
void ssd1306_drawRect(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2)
void ssd1306_drawRect16(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
void ssd1306_drawProgressBar8(int8_t progress)
void ssd1306_updateMenu16(SAppMenu *menu)
void ssd1306_drawProgressBar(int8_t progress)
void ssd1306_fillRect(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
SFixedFontInfo s_fixedFont
void ssd1306_clearScreen16(void)
SFontHeaderRecord h
record, containing information on font
lcduint_t ssd1306_getTextSize(const char *text, lcduint_t *height)
void ssd1306_menuDown(SAppMenu *menu)
void ssd1306_clearScreen8(void)
lcduint_t ssd1306_displayHeight(void)
void ssd1306_updateMenu8(SAppMenu *menu)
void ssd1306_showMenu8(SAppMenu *menu)
uint8_t ssd1306_menuSelection(SAppMenu *menu)
void ssd1306_clearScreen()
void ssd1306_fillRect8(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
void ssd1306_showMenu(SAppMenu *menu)
uint8_t pages
height in pages (each page height is 8-pixels)
void ssd1306_menuUp(SAppMenu *menu)
void ssd1306_negativeMode()
void ssd1306_showMenu16(SAppMenu *menu)