From d2f2187e8f27cd884150acdce7ec96135260413b Mon Sep 17 00:00:00 2001 From: Lars Poeschel Date: Tue, 3 Nov 2020 10:58:18 +0100 Subject: auxdisplay: implement various hd44780_common_ functions This implements various hd44780_common_ functions for hd44780 compatible display drivers to use. charlcd then calls these functions through its ops function pointer. The functions namely are: - hd44780_common_shift_cursor - hd44780_common_display_shift - hd44780_common_display - hd44780_common_cursor - hd44780_common_blink - hd44780_common_fontsize - hd44780_common_lines Reviewed-by: Willy Tarreau Signed-off-by: Lars Poeschel Signed-off-by: Miguel Ojeda --- drivers/auxdisplay/charlcd.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'drivers/auxdisplay/charlcd.h') diff --git a/drivers/auxdisplay/charlcd.h b/drivers/auxdisplay/charlcd.h index dd40fd814a57..5a89bdeb659a 100644 --- a/drivers/auxdisplay/charlcd.h +++ b/drivers/auxdisplay/charlcd.h @@ -21,6 +21,21 @@ enum charlcd_onoff { CHARLCD_ON, }; +enum charlcd_shift_dir { + CHARLCD_SHIFT_LEFT, + CHARLCD_SHIFT_RIGHT, +}; + +enum charlcd_fontsize { + CHARLCD_FONTSIZE_SMALL, + CHARLCD_FONTSIZE_LARGE, +}; + +enum charlcd_lines { + CHARLCD_LINES_1, + CHARLCD_LINES_2, +}; + struct charlcd { const struct charlcd_ops *ops; const unsigned char *char_conv; /* Optional */ @@ -54,6 +69,12 @@ struct charlcd { * values in addr.x and addr.y are set to 0, 0 by charlcd prior to calling this * function. * @init_display: Initialize the display. + * @shift_cursor: Shift cursor left or right one position. + * @shift_display: Shift whole display content left or right. + * @display: Turn display on or off. + * @cursor: Turn cursor on or off. + * @blink: Turn cursor blink on or off. + * @lines: One or two lines. */ struct charlcd_ops { void (*clear_fast)(struct charlcd *lcd); @@ -63,6 +84,13 @@ struct charlcd_ops { int (*home)(struct charlcd *lcd); int (*clear_display)(struct charlcd *lcd); int (*init_display)(struct charlcd *lcd); + int (*shift_cursor)(struct charlcd *lcd, enum charlcd_shift_dir dir); + int (*shift_display)(struct charlcd *lcd, enum charlcd_shift_dir dir); + int (*display)(struct charlcd *lcd, enum charlcd_onoff on); + int (*cursor)(struct charlcd *lcd, enum charlcd_onoff on); + int (*blink)(struct charlcd *lcd, enum charlcd_onoff on); + int (*fontsize)(struct charlcd *lcd, enum charlcd_fontsize size); + int (*lines)(struct charlcd *lcd, enum charlcd_lines lines); }; void charlcd_backlight(struct charlcd *lcd, enum charlcd_onoff on); -- cgit v1.2.3