From: Przemyslaw Marczak Date: Wed, 2 Apr 2014 13:21:06 +0000 (+0200) Subject: common: lcd: extend lcd api by function lcd_get_position_cursor() X-Git-Tag: submit/tizen_common/20150115.132736~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01064e78afd01643a970c96d74b25157f3cb6e91;p=platform%2Fkernel%2Fu-boot.git common: lcd: extend lcd api by function lcd_get_position_cursor() This commit change the name of function lcd_position_cursor() to lcd_set_position_cursor() and adds its complementary function lcd_get_position_cursor(). This change is useful e.g. when user wants overwrite some lines, words or even just a letter on lcd console screen. Other changes: - update previous lcd_position_cursor() calls Change-Id: I4a102c236f2d2d5c238e9790382e4b9454e3c361 Signed-off-by: Przemyslaw Marczak Cc: Vadim Bendebury Cc: Simon Glass --- diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c index aa7fc20565..f97caf3c1d 100644 --- a/board/samsung/common/misc.c +++ b/board/samsung/common/misc.c @@ -202,7 +202,7 @@ static void display_board_info(void) #endif vidinfo_t *vid = &panel_info; - lcd_position_cursor(4, 4); + lcd_set_position_cursor(4, 4); lcd_printf("%s\n\t", U_BOOT_VERSION); lcd_puts("\n\t\tBoard Info:\n"); diff --git a/common/lcd.c b/common/lcd.c index 3ed504df50..cc7ffc6f22 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -1144,12 +1144,18 @@ static int on_splashimage(const char *name, const char *value, enum env_op op, U_BOOT_ENV_CALLBACK(splashimage, on_splashimage); #endif -void lcd_position_cursor(unsigned col, unsigned row) +void lcd_set_position_cursor(unsigned col, unsigned row) { console_col = min_t(short, col, CONSOLE_COLS - 1); console_row = min_t(short, row, CONSOLE_ROWS - 1); } +void lcd_get_position_cursor(unsigned *col, unsigned *row) +{ + *col = console_col; + *row = console_row; +} + int lcd_get_pixel_width(void) { return panel_info.vl_col; diff --git a/include/lcd.h b/include/lcd.h index 020d8800e9..407fe0131a 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -296,7 +296,15 @@ int lcd_get_screen_columns(void); * @param col Column to place cursor (0 = left side) * @param row Row to place cursor (0 = top line) */ -void lcd_position_cursor(unsigned col, unsigned row); +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); /* Allow boards to customize the information displayed */ void lcd_show_board_info(void);