lcd_console.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. /* By default we scroll by a single line */
  7. #ifndef CONFIG_CONSOLE_SCROLL_LINES
  8. #define CONFIG_CONSOLE_SCROLL_LINES 1
  9. #endif
  10. /**
  11. * lcd_init_console() - Initialize lcd console parameters
  12. *
  13. * Setup the address of console base, and the number of rows and columns the
  14. * console has.
  15. *
  16. * @address: Console base address
  17. * @rows: Number of rows in the console
  18. * @cols: Number of columns in the console
  19. */
  20. void lcd_init_console(void *address, int rows, int cols);
  21. /**
  22. * lcd_set_col() - Set the number of the current lcd console column
  23. *
  24. * Set the number of the console column where the cursor is.
  25. *
  26. * @col: Column number
  27. */
  28. void lcd_set_col(short col);
  29. /**
  30. * lcd_set_row() - Set the number of the current lcd console row
  31. *
  32. * Set the number of the console row where the cursor is.
  33. *
  34. * @row: Row number
  35. */
  36. void lcd_set_row(short row);
  37. /**
  38. * lcd_position_cursor() - Position the cursor on the screen
  39. *
  40. * Position the cursor at the given coordinates on the screen.
  41. *
  42. * @col: Column number
  43. * @row: Row number
  44. */
  45. void lcd_position_cursor(unsigned col, unsigned row);
  46. /**
  47. * lcd_get_screen_rows() - Get the total number of screen rows
  48. *
  49. * @return: Number of screen rows
  50. */
  51. int lcd_get_screen_rows(void);
  52. /**
  53. * lcd_get_screen_columns() - Get the total number of screen columns
  54. *
  55. * @return: Number of screen columns
  56. */
  57. int lcd_get_screen_columns(void);
  58. /**
  59. * lcd_putc() - Print to screen a single character at the location of the cursor
  60. *
  61. * @c: The character to print
  62. */
  63. void lcd_putc(const char c);
  64. /**
  65. * lcd_puts() - Print to screen a string at the location of the cursor
  66. *
  67. * @s: The string to print
  68. */
  69. void lcd_puts(const char *s);
  70. /**
  71. * lcd_printf() - Print to screen a formatted string at location of the cursor
  72. *
  73. * @fmt: The formatted string to print
  74. * @...: The arguments for the formatted string
  75. */
  76. void lcd_printf(const char *fmt, ...);