Skip to content

Commit 4a7d242

Browse files
committed
docs(srv/fb-console): Document service POC state
1 parent c99e023 commit 4a7d242

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

services/fb-console/fb-console.c

+28-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66
* All rights reserved.
77
*/
88

9+
/**
10+
* This is an extremely simple POC code of a LCD text console with part of the screen
11+
* scrolling as the text is added. It understands some basic ANSI escape sequences to
12+
* set bold and normal font and also some colors. Other than that, it most probably
13+
* won't work for anything useful. There is a bunch of things which need to be
14+
* addressed before considering this code at least alpha quality:
15+
*
16+
* - font rendering needs to be moved to a separate library, probably plumcore-grlib
17+
* - basic geometric shapes too (drawing frames, "windows", buttons, etc.)
18+
* - picture displaying too
19+
* - tool for converting pictures to C arrays needs to be made more generic
20+
* - making console header configurable and optional, it must be possible to
21+
* display custom text and logo
22+
* - scroll are configurable
23+
* - display size configurable (atm it only works with a 240x160 px display)
24+
* - Fb mode agnostic (now it works only in 2bpp G2 mode)
25+
*/
26+
927
#include <stdint.h>
1028
#include <stdlib.h>
1129
#include <string.h>
@@ -64,7 +82,6 @@ const struct imdata im_plum = {
6482
* Stream interface API
6583
***************************************************************************************************/
6684

67-
6885
static stream_ret_t stream_write(Stream *self, const void *buf, size_t size) {
6986
if (u_assert(self != NULL) ||
7087
u_assert(buf != NULL)) {
@@ -240,6 +257,11 @@ fb_console_ret_t fb_console_scroll(FbConsole *self, size_t r_start, size_t r_end
240257
}
241258

242259

260+
/**
261+
* @brief Render simple text on a framebuffer device
262+
*
263+
* @todo move to plumcore-grlib library
264+
*/
243265
fb_ret_t fb_text(Fb *self, const char *text, size_t posx, size_t posy, size_t *advance, uint8_t color, const struct small_char *font) {
244266
/** @todo handle the width properly */
245267

@@ -269,6 +291,11 @@ fb_ret_t fb_text(Fb *self, const char *text, size_t posx, size_t posy, size_t *a
269291
}
270292

271293

294+
/**
295+
* @brief Render simple uncompressed image on a framebuffer device
296+
*
297+
* @todo move to the plumcore-grlib library
298+
*/
272299
fb_ret_t fb_image(Fb *self, size_t posx, size_t posy, const struct imdata *data) {
273300
for (size_t y = 0; y < data->h; y++) {
274301
uint8_t d[60];

0 commit comments

Comments
 (0)