hd44780_common.h 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. #define DEFAULT_LCD_BWIDTH 40
  3. #define DEFAULT_LCD_HWIDTH 64
  4. struct hd44780_common {
  5. int ifwidth; /* 4-bit or 8-bit (default) */
  6. int bwidth; /* Default set by hd44780_alloc() */
  7. int hwidth; /* Default set by hd44780_alloc() */
  8. unsigned long hd44780_common_flags;
  9. void (*write_data)(struct hd44780_common *hdc, int data);
  10. void (*write_cmd)(struct hd44780_common *hdc, int cmd);
  11. /* write_cmd_raw4 is for 4-bit connected displays only */
  12. void (*write_cmd_raw4)(struct hd44780_common *hdc, int cmd);
  13. void *hd44780;
  14. };
  15. int hd44780_common_print(struct charlcd *lcd, int c);
  16. int hd44780_common_gotoxy(struct charlcd *lcd, unsigned int x, unsigned int y);
  17. int hd44780_common_home(struct charlcd *lcd);
  18. int hd44780_common_clear_display(struct charlcd *lcd);
  19. int hd44780_common_init_display(struct charlcd *lcd);
  20. int hd44780_common_shift_cursor(struct charlcd *lcd,
  21. enum charlcd_shift_dir dir);
  22. int hd44780_common_shift_display(struct charlcd *lcd,
  23. enum charlcd_shift_dir dir);
  24. int hd44780_common_display(struct charlcd *lcd, enum charlcd_onoff on);
  25. int hd44780_common_cursor(struct charlcd *lcd, enum charlcd_onoff on);
  26. int hd44780_common_blink(struct charlcd *lcd, enum charlcd_onoff on);
  27. int hd44780_common_fontsize(struct charlcd *lcd, enum charlcd_fontsize size);
  28. int hd44780_common_lines(struct charlcd *lcd, enum charlcd_lines lines);
  29. int hd44780_common_redefine_char(struct charlcd *lcd, char *esc);
  30. struct hd44780_common *hd44780_common_alloc(void);