Blame view

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