2020-11-03 04:58:05 -05:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
|
2020-11-03 04:58:06 -05:00
|
|
|
#define DEFAULT_LCD_BWIDTH 40
|
|
|
|
#define DEFAULT_LCD_HWIDTH 64
|
|
|
|
|
2020-11-03 04:58:05 -05:00
|
|
|
struct hd44780_common {
|
2020-11-03 04:58:07 -05:00
|
|
|
int ifwidth; /* 4-bit or 8-bit (default) */
|
2020-11-03 04:58:06 -05:00
|
|
|
int bwidth; /* Default set by hd44780_alloc() */
|
|
|
|
int hwidth; /* Default set by hd44780_alloc() */
|
2020-11-03 04:58:17 -05:00
|
|
|
unsigned long hd44780_common_flags;
|
2020-11-03 04:58:08 -05:00
|
|
|
void (*write_data)(struct hd44780_common *hdc, int data);
|
2020-11-03 04:58:09 -05:00
|
|
|
void (*write_cmd)(struct hd44780_common *hdc, int cmd);
|
|
|
|
/* write_cmd_raw4 is for 4-bit connected displays only */
|
|
|
|
void (*write_cmd_raw4)(struct hd44780_common *hdc, int cmd);
|
2020-11-03 04:58:05 -05:00
|
|
|
void *hd44780;
|
|
|
|
};
|
|
|
|
|
2020-11-03 04:58:11 -05:00
|
|
|
int hd44780_common_print(struct charlcd *lcd, int c);
|
2020-11-03 04:58:25 -05:00
|
|
|
int hd44780_common_gotoxy(struct charlcd *lcd, unsigned int x, unsigned int y);
|
2020-11-03 04:58:13 -05:00
|
|
|
int hd44780_common_home(struct charlcd *lcd);
|
2020-11-03 04:58:14 -05:00
|
|
|
int hd44780_common_clear_display(struct charlcd *lcd);
|
2020-11-03 04:58:17 -05:00
|
|
|
int hd44780_common_init_display(struct charlcd *lcd);
|
2020-11-03 04:58:18 -05:00
|
|
|
int hd44780_common_shift_cursor(struct charlcd *lcd,
|
|
|
|
enum charlcd_shift_dir dir);
|
|
|
|
int hd44780_common_shift_display(struct charlcd *lcd,
|
|
|
|
enum charlcd_shift_dir dir);
|
|
|
|
int hd44780_common_display(struct charlcd *lcd, enum charlcd_onoff on);
|
|
|
|
int hd44780_common_cursor(struct charlcd *lcd, enum charlcd_onoff on);
|
|
|
|
int hd44780_common_blink(struct charlcd *lcd, enum charlcd_onoff on);
|
|
|
|
int hd44780_common_fontsize(struct charlcd *lcd, enum charlcd_fontsize size);
|
|
|
|
int hd44780_common_lines(struct charlcd *lcd, enum charlcd_lines lines);
|
2020-11-03 04:58:20 -05:00
|
|
|
int hd44780_common_redefine_char(struct charlcd *lcd, char *esc);
|
2020-11-03 04:58:05 -05:00
|
|
|
struct hd44780_common *hd44780_common_alloc(void);
|