Lars Poeschel | 718e05e | 2020-11-03 10:58:05 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
Lars Poeschel | 2545c1c | 2020-11-03 10:58:06 +0100 | [diff] [blame] | 3 | #define DEFAULT_LCD_BWIDTH 40 |
| 4 | #define DEFAULT_LCD_HWIDTH 64 |
| 5 | |
Lars Poeschel | 718e05e | 2020-11-03 10:58:05 +0100 | [diff] [blame] | 6 | struct hd44780_common { |
Lars Poeschel | 3fc04dd | 2020-11-03 10:58:07 +0100 | [diff] [blame] | 7 | int ifwidth; /* 4-bit or 8-bit (default) */ |
Lars Poeschel | 2545c1c | 2020-11-03 10:58:06 +0100 | [diff] [blame] | 8 | int bwidth; /* Default set by hd44780_alloc() */ |
| 9 | int hwidth; /* Default set by hd44780_alloc() */ |
Lars Poeschel | 01ec46d | 2020-11-03 10:58:17 +0100 | [diff] [blame] | 10 | unsigned long hd44780_common_flags; |
Lars Poeschel | 71ff701 | 2020-11-03 10:58:08 +0100 | [diff] [blame] | 11 | void (*write_data)(struct hd44780_common *hdc, int data); |
Lars Poeschel | 2c6a82f | 2020-11-03 10:58:09 +0100 | [diff] [blame] | 12 | void (*write_cmd)(struct hd44780_common *hdc, int cmd); |
| 13 | /* write_cmd_raw4 is for 4-bit connected displays only */ |
| 14 | void (*write_cmd_raw4)(struct hd44780_common *hdc, int cmd); |
Lars Poeschel | 718e05e | 2020-11-03 10:58:05 +0100 | [diff] [blame] | 15 | void *hd44780; |
| 16 | }; |
| 17 | |
Lars Poeschel | b26deab | 2020-11-03 10:58:11 +0100 | [diff] [blame] | 18 | int hd44780_common_print(struct charlcd *lcd, int c); |
Lars Poeschel | 40c2b72 | 2020-11-03 10:58:25 +0100 | [diff] [blame] | 19 | int hd44780_common_gotoxy(struct charlcd *lcd, unsigned int x, unsigned int y); |
Lars Poeschel | 88645a8 | 2020-11-03 10:58:13 +0100 | [diff] [blame] | 20 | int hd44780_common_home(struct charlcd *lcd); |
Lars Poeschel | 45421ff | 2020-11-03 10:58:14 +0100 | [diff] [blame] | 21 | int hd44780_common_clear_display(struct charlcd *lcd); |
Lars Poeschel | 01ec46d | 2020-11-03 10:58:17 +0100 | [diff] [blame] | 22 | int hd44780_common_init_display(struct charlcd *lcd); |
Lars Poeschel | d2f2187 | 2020-11-03 10:58:18 +0100 | [diff] [blame] | 23 | int hd44780_common_shift_cursor(struct charlcd *lcd, |
| 24 | enum charlcd_shift_dir dir); |
| 25 | int hd44780_common_shift_display(struct charlcd *lcd, |
| 26 | enum charlcd_shift_dir dir); |
| 27 | int hd44780_common_display(struct charlcd *lcd, enum charlcd_onoff on); |
| 28 | int hd44780_common_cursor(struct charlcd *lcd, enum charlcd_onoff on); |
| 29 | int hd44780_common_blink(struct charlcd *lcd, enum charlcd_onoff on); |
| 30 | int hd44780_common_fontsize(struct charlcd *lcd, enum charlcd_fontsize size); |
| 31 | int hd44780_common_lines(struct charlcd *lcd, enum charlcd_lines lines); |
Lars Poeschel | 339acb0 | 2020-11-03 10:58:20 +0100 | [diff] [blame] | 32 | int hd44780_common_redefine_char(struct charlcd *lcd, char *esc); |
Lars Poeschel | 718e05e | 2020-11-03 10:58:05 +0100 | [diff] [blame] | 33 | struct hd44780_common *hd44780_common_alloc(void); |