From bf8b16d036e60eec56a42cbfcf012390c143e699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C5=ABnas=20Ma=C5=BEeikis?= Date: Mon, 27 May 2019 23:12:42 +0300 Subject: Screen: implementation of drawing and trivial docs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ramūnas Mažeikis --- src/device/screen.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) mode change 100755 => 100644 src/device/screen.h (limited to 'src/device/screen.h') diff --git a/src/device/screen.h b/src/device/screen.h old mode 100755 new mode 100644 index 7763bd2..54734e5 --- a/src/device/screen.h +++ b/src/device/screen.h @@ -1,9 +1,17 @@ +/** + * Simple API for scrolling lines. Keeps things simple by not even assuming + * which screen is being drawn on. + */ + #ifndef DEVICE_SCREEN_H #define DEVICE_SCREEN_H #include +#include +#include -#define SCREEN_WIDTH (64) +#define SCREEN_WIDTH (128) +#define SCREEN_HEIGHT (32) #define FONT_WIDTH (8) #define SCREEN_MAX_CHARS (SCREEN_WIDTH / FONT_WIDTH) @@ -11,6 +19,7 @@ * Struct that keeps track of the lines on the screen. */ struct display_status { + SSD1306Brzo *screen; /* Screen to draw on. */ time_t delta; /* Seconds/Line */ time_t last_scroll_time; /* Last second the line was scrolled */ char *message; /* Entire message to be shown */ @@ -25,6 +34,16 @@ struct display_status { */ void display_update_scroll(struct display_status *status); -void display_status_init(struct display_status *status, char *msg); +/** + * Initialises display_status structure so it can be used for + * display_update_scroll. + * + * screen - screen to draw on + * + * status - structure to Initialise + * + * msg - message to scroll on the screen + */ +void display_status_init(SSD1306Brzo *screen, struct display_status *status, char *msg); #endif /* DEVICE_SCREEN_H */ \ No newline at end of file -- cgit v1.2.3