2020-03-30 00:40:59 +02:00
|
|
|
#include <display.h>
|
2020-03-15 00:56:31 +01:00
|
|
|
|
|
|
|
int dopen(display_t *disp, const char *fontname)
|
|
|
|
{
|
|
|
|
extern struct font_s default5x3;
|
|
|
|
|
|
|
|
// TODO: handle font name
|
|
|
|
(void)fontname;
|
|
|
|
disp->font = &default5x3;
|
|
|
|
|
|
|
|
// Display size is hardcoded for now
|
2020-05-28 18:33:46 +02:00
|
|
|
// TODO: hardware check !!!!
|
2020-03-15 00:56:31 +01:00
|
|
|
disp->display.width = 128;
|
|
|
|
disp->display.height = 64;
|
|
|
|
|
|
|
|
// Pre-calculate internal value used to draw
|
|
|
|
disp->nb_char_width = disp->font->bitmap.width + disp->font->bitmap.cwidth - 1;
|
|
|
|
disp->nb_char_width = disp->nb_char_width / disp->font->bitmap.cwidth;
|
2020-05-28 18:33:46 +02:00
|
|
|
disp->ws_col = disp->display.width / (disp->font->font.width + 1);
|
|
|
|
disp->ws_row = disp->display.height / (disp->font->font.height + 1);
|
2020-03-15 00:56:31 +01:00
|
|
|
return (0);
|
|
|
|
}
|