xref: /linux/drivers/auxdisplay/hd44780_common.h (revision 40c2b72e4b11f0a80dff19b539fccf36472dc417)
1718e05edSLars Poeschel /* SPDX-License-Identifier: GPL-2.0-or-later */
2718e05edSLars Poeschel 
32545c1c9SLars Poeschel #define DEFAULT_LCD_BWIDTH      40
42545c1c9SLars Poeschel #define DEFAULT_LCD_HWIDTH      64
52545c1c9SLars Poeschel 
6718e05edSLars Poeschel struct hd44780_common {
73fc04dd7SLars Poeschel 	int ifwidth;			/* 4-bit or 8-bit (default) */
82545c1c9SLars Poeschel 	int bwidth;			/* Default set by hd44780_alloc() */
92545c1c9SLars Poeschel 	int hwidth;			/* Default set by hd44780_alloc() */
1001ec46dfSLars Poeschel 	unsigned long hd44780_common_flags;
1171ff701bSLars Poeschel 	void (*write_data)(struct hd44780_common *hdc, int data);
122c6a82f2SLars Poeschel 	void (*write_cmd)(struct hd44780_common *hdc, int cmd);
132c6a82f2SLars Poeschel 	/* write_cmd_raw4 is for 4-bit connected displays only */
142c6a82f2SLars Poeschel 	void (*write_cmd_raw4)(struct hd44780_common *hdc, int cmd);
15718e05edSLars Poeschel 	void *hd44780;
16718e05edSLars Poeschel };
17718e05edSLars Poeschel 
18b26deabbSLars Poeschel int hd44780_common_print(struct charlcd *lcd, int c);
19*40c2b72eSLars Poeschel int hd44780_common_gotoxy(struct charlcd *lcd, unsigned int x, unsigned int y);
2088645a86SLars Poeschel int hd44780_common_home(struct charlcd *lcd);
2145421ffeSLars Poeschel int hd44780_common_clear_display(struct charlcd *lcd);
2201ec46dfSLars Poeschel int hd44780_common_init_display(struct charlcd *lcd);
23d2f2187eSLars Poeschel int hd44780_common_shift_cursor(struct charlcd *lcd,
24d2f2187eSLars Poeschel 		enum charlcd_shift_dir dir);
25d2f2187eSLars Poeschel int hd44780_common_shift_display(struct charlcd *lcd,
26d2f2187eSLars Poeschel 		enum charlcd_shift_dir dir);
27d2f2187eSLars Poeschel int hd44780_common_display(struct charlcd *lcd, enum charlcd_onoff on);
28d2f2187eSLars Poeschel int hd44780_common_cursor(struct charlcd *lcd, enum charlcd_onoff on);
29d2f2187eSLars Poeschel int hd44780_common_blink(struct charlcd *lcd, enum charlcd_onoff on);
30d2f2187eSLars Poeschel int hd44780_common_fontsize(struct charlcd *lcd, enum charlcd_fontsize size);
31d2f2187eSLars Poeschel int hd44780_common_lines(struct charlcd *lcd, enum charlcd_lines lines);
32339acb08SLars Poeschel int hd44780_common_redefine_char(struct charlcd *lcd, char *esc);
33718e05edSLars Poeschel struct hd44780_common *hd44780_common_alloc(void);
34