summaryrefslogtreecommitdiffstats
path: root/common/lcd_console.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/lcd_console.c')
-rw-r--r--common/lcd_console.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/common/lcd_console.c b/common/lcd_console.c
index 74c388a0ca..8bf83b90d5 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -209,3 +209,42 @@ void lcd_printf(const char *fmt, ...)
lcd_puts(buf);
}
+
+static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ unsigned int col, row;
+
+ if (argc != 3)
+ return CMD_RET_USAGE;
+
+ col = simple_strtoul(argv[1], NULL, 10);
+ row = simple_strtoul(argv[2], NULL, 10);
+ lcd_position_cursor(col, row);
+
+ return 0;
+}
+
+static int do_lcd_puts(cmd_tbl_t *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ if (argc != 2)
+ return CMD_RET_USAGE;
+
+ lcd_puts(argv[1]);
+
+ return 0;
+}
+
+U_BOOT_CMD(
+ setcurs, 3, 1, do_lcd_setcursor,
+ "set cursor position within screen",
+ " <col> <row> in character"
+);
+
+U_BOOT_CMD(
+ lcdputs, 2, 1, do_lcd_puts,
+ "print string on lcd-framebuffer",
+ " <string>"
+);
+
OpenPOWER on IntegriCloud