charlcd.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Character LCD driver for Linux
  4. *
  5. * Copyright (C) 2000-2008, Willy Tarreau <w@1wt.eu>
  6. * Copyright (C) 2016-2017 Glider bvba
  7. */
  8. #ifndef _CHARLCD_H
  9. #define _CHARLCD_H
  10. struct charlcd {
  11. const struct charlcd_ops *ops;
  12. const unsigned char *char_conv; /* Optional */
  13. int ifwidth; /* 4-bit or 8-bit (default) */
  14. int height;
  15. int width;
  16. int bwidth; /* Default set by charlcd_alloc() */
  17. int hwidth; /* Default set by charlcd_alloc() */
  18. void *drvdata; /* Set by charlcd_alloc() */
  19. };
  20. struct charlcd_ops {
  21. /* Required */
  22. void (*write_cmd)(struct charlcd *lcd, int cmd);
  23. void (*write_data)(struct charlcd *lcd, int data);
  24. /* Optional */
  25. void (*write_cmd_raw4)(struct charlcd *lcd, int cmd); /* 4-bit only */
  26. void (*clear_fast)(struct charlcd *lcd);
  27. void (*backlight)(struct charlcd *lcd, int on);
  28. };
  29. struct charlcd *charlcd_alloc(unsigned int drvdata_size);
  30. void charlcd_free(struct charlcd *lcd);
  31. int charlcd_register(struct charlcd *lcd);
  32. int charlcd_unregister(struct charlcd *lcd);
  33. void charlcd_poke(struct charlcd *lcd);
  34. #endif /* CHARLCD_H */