From 3f9869980fafeb9113e7cde539d8b9e6f11fcbc2 Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Mon, 16 Feb 2015 17:40:25 +0100 Subject: [PATCH] common: lcd: extend lcd api by function lcd_get_position_cursor() Changes for v2015.04-rc1: - Moving lcd console related code to lcd_console.c Signed-off-by: Lukasz Majewski --- common/lcd_console.c | 11 +++++++++++ include/lcd_console.h | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/common/lcd_console.c b/common/lcd_console.c index 9c0ff4480e..3260941303 100644 --- a/common/lcd_console.c +++ b/common/lcd_console.c @@ -18,6 +18,17 @@ static struct console_t cons; +void lcd_set_position_cursor(unsigned col, unsigned row) +{ + lcd_position_cursor(col, row); +} + +void lcd_get_position_cursor(unsigned *col, unsigned *row) +{ + *col = cons.curr_col; + *row = cons.curr_row; +} + void lcd_set_col(short col) { cons.curr_col = col; diff --git a/include/lcd_console.h b/include/lcd_console.h index 061a6a41bb..e3767183fd 100644 --- a/include/lcd_console.h +++ b/include/lcd_console.h @@ -100,3 +100,19 @@ void lcd_puts(const char *s); * @...: The arguments for the formatted string */ void lcd_printf(const char *fmt, ...); + +/** + * Set the position of the text cursor + * + * @param col Column to place cursor (0 = left side) + * @param row Row to place cursor (0 = top line) + */ +void lcd_set_position_cursor(unsigned col, unsigned row); + +/** + * Get the position of the text cursor + * + * @param *col Pointer to store cursor placement column (0 = left side) + * @param *row Pointer to store cursor placement row (0 = top line) + */ +void lcd_get_position_cursor(unsigned *col, unsigned *row); -- 2.34.1