blob: eac227f498d68df1bef0d5650aaabc3724a49e33 [file] [log] [blame]
Nikita Kiryanov904672e2014-12-08 17:14:45 +02001/*
2 * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7/* By default we scroll by a single line */
Nikita Kiryanov904672e2014-12-08 17:14:45 +02008
Hannes Petermaier604c7d42015-03-27 08:01:38 +01009struct console_t {
10 short curr_col, curr_row;
11 short cols, rows;
12 void *fbbase;
13 u32 lcdsizex, lcdsizey, lcdrot;
14 void (*fp_putc_xy)(struct console_t *pcons, ushort x, ushort y, char c);
15 void (*fp_console_moverow)(struct console_t *pcons,
16 u32 rowdst, u32 rowsrc);
17 void (*fp_console_setrow)(struct console_t *pcons, u32 row, int clr);
18};
19
20/**
21 * console_calc_rowcol() - calculate available rows / columns wihtin a given
22 * screen-size based on used VIDEO_FONT.
23 *
24 * @pcons: Pointer to struct console_t
25 * @sizex: size X of the screen in pixel
26 * @sizey: size Y of the screen in pixel
27 */
28void console_calc_rowcol(struct console_t *pcons, u32 sizex, u32 sizey);
Nikita Kiryanov904672e2014-12-08 17:14:45 +020029/**
30 * lcd_init_console() - Initialize lcd console parameters
31 *
32 * Setup the address of console base, and the number of rows and columns the
33 * console has.
34 *
35 * @address: Console base address
Hannes Petermaier604c7d42015-03-27 08:01:38 +010036 * @vl_rows: Number of rows in the console
37 * @vl_cols: Number of columns in the console
38 * @vl_rot: Rotation of display in degree (0 - 90 - 180 - 270) counterlockwise
Nikita Kiryanov904672e2014-12-08 17:14:45 +020039 */
Hannes Petermaier604c7d42015-03-27 08:01:38 +010040void lcd_init_console(void *address, int vl_cols, int vl_rows, int vl_rot);
Nikita Kiryanov904672e2014-12-08 17:14:45 +020041/**
42 * lcd_set_col() - Set the number of the current lcd console column
43 *
44 * Set the number of the console column where the cursor is.
45 *
46 * @col: Column number
47 */
48void lcd_set_col(short col);
49
50/**
51 * lcd_set_row() - Set the number of the current lcd console row
52 *
53 * Set the number of the console row where the cursor is.
54 *
55 * @row: Row number
56 */
57void lcd_set_row(short row);
58
59/**
60 * lcd_position_cursor() - Position the cursor on the screen
61 *
62 * Position the cursor at the given coordinates on the screen.
63 *
64 * @col: Column number
65 * @row: Row number
66 */
67void lcd_position_cursor(unsigned col, unsigned row);
68
69/**
70 * lcd_get_screen_rows() - Get the total number of screen rows
71 *
72 * @return: Number of screen rows
73 */
74int lcd_get_screen_rows(void);
75
76/**
77 * lcd_get_screen_columns() - Get the total number of screen columns
78 *
79 * @return: Number of screen columns
80 */
81int lcd_get_screen_columns(void);
82
83/**
84 * lcd_putc() - Print to screen a single character at the location of the cursor
85 *
86 * @c: The character to print
87 */
88void lcd_putc(const char c);
89
90/**
91 * lcd_puts() - Print to screen a string at the location of the cursor
92 *
93 * @s: The string to print
94 */
95void lcd_puts(const char *s);
96
97/**
98 * lcd_printf() - Print to screen a formatted string at location of the cursor
99 *
100 * @fmt: The formatted string to print
101 * @...: The arguments for the formatted string
102 */
103void lcd_printf(const char *fmt, ...);