diff options
author | Lars Poeschel <poeschel@lemonage.de> | 2020-11-03 12:58:18 +0300 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2020-11-04 13:04:04 +0300 |
commit | d2f2187e8f27cd884150acdce7ec96135260413b (patch) | |
tree | 1d9f26fc7efc246b9a83643f5be97a60bc6aa56c /drivers/auxdisplay/charlcd.h | |
parent | 01ec46dfa633a52ccfe38d4a194460d6adb2ba00 (diff) | |
download | linux-d2f2187e8f27cd884150acdce7ec96135260413b.tar.xz |
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 <w@1wt.eu>
Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'drivers/auxdisplay/charlcd.h')
-rw-r--r-- | drivers/auxdisplay/charlcd.h | 28 |
1 files changed, 28 insertions, 0 deletions
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); |