blob: 23f61850f3639ae1686f9f83e0bac6e6a5015ba5 [file] [log] [blame]
Geert Uytterhoeven39f8ea42017-03-10 15:15:17 +01001/*
2 * Character LCD driver for Linux
3 *
4 * Copyright (C) 2000-2008, Willy Tarreau <w@1wt.eu>
5 * Copyright (C) 2016-2017 Glider bvba
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13struct charlcd {
14 const struct charlcd_ops *ops;
15 const unsigned char *char_conv; /* Optional */
16
Geert Uytterhoevenac201472017-03-10 15:15:18 +010017 int ifwidth; /* 4-bit or 8-bit (default) */
Geert Uytterhoeven39f8ea42017-03-10 15:15:17 +010018 int height;
19 int width;
20 int bwidth; /* Default set by charlcd_alloc() */
21 int hwidth; /* Default set by charlcd_alloc() */
22
23 void *drvdata; /* Set by charlcd_alloc() */
24};
25
26struct charlcd_ops {
27 /* Required */
28 void (*write_cmd)(struct charlcd *lcd, int cmd);
29 void (*write_data)(struct charlcd *lcd, int data);
30
31 /* Optional */
Geert Uytterhoevenac201472017-03-10 15:15:18 +010032 void (*write_cmd_raw4)(struct charlcd *lcd, int cmd); /* 4-bit only */
Geert Uytterhoeven39f8ea42017-03-10 15:15:17 +010033 void (*clear_fast)(struct charlcd *lcd);
34 void (*backlight)(struct charlcd *lcd, int on);
35};
36
37struct charlcd *charlcd_alloc(unsigned int drvdata_size);
38
39int charlcd_register(struct charlcd *lcd);
40int charlcd_unregister(struct charlcd *lcd);
41
42void charlcd_poke(struct charlcd *lcd);