blob: ac404a44889b3654902095e8beaf034086db2353 [file] [log] [blame]
Lars Poeschel718e05e2020-11-03 10:58:05 +01001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
Lars Poeschel2545c1c2020-11-03 10:58:06 +01003#define DEFAULT_LCD_BWIDTH 40
4#define DEFAULT_LCD_HWIDTH 64
5
Lars Poeschel718e05e2020-11-03 10:58:05 +01006struct hd44780_common {
Lars Poeschel3fc04dd2020-11-03 10:58:07 +01007 int ifwidth; /* 4-bit or 8-bit (default) */
Lars Poeschel2545c1c2020-11-03 10:58:06 +01008 int bwidth; /* Default set by hd44780_alloc() */
9 int hwidth; /* Default set by hd44780_alloc() */
Lars Poeschel71ff7012020-11-03 10:58:08 +010010 void (*write_data)(struct hd44780_common *hdc, int data);
Lars Poeschel2c6a82f2020-11-03 10:58:09 +010011 void (*write_cmd)(struct hd44780_common *hdc, int cmd);
12 /* write_cmd_raw4 is for 4-bit connected displays only */
13 void (*write_cmd_raw4)(struct hd44780_common *hdc, int cmd);
Lars Poeschel718e05e2020-11-03 10:58:05 +010014 void *hd44780;
15};
16
Lars Poeschelb26deab2020-11-03 10:58:11 +010017int hd44780_common_print(struct charlcd *lcd, int c);
Lars Poeschel718e05e2020-11-03 10:58:05 +010018struct hd44780_common *hd44780_common_alloc(void);