2019-05-27 09:55:01 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2017-03-10 17:15:17 +03:00
|
|
|
/*
|
|
|
|
* Character LCD driver for Linux
|
|
|
|
*
|
|
|
|
* Copyright (C) 2000-2008, Willy Tarreau <w@1wt.eu>
|
|
|
|
* Copyright (C) 2016-2017 Glider bvba
|
|
|
|
*/
|
|
|
|
|
2019-08-06 10:14:45 +03:00
|
|
|
#ifndef _CHARLCD_H
|
|
|
|
#define _CHARLCD_H
|
|
|
|
|
2017-03-10 17:15:17 +03:00
|
|
|
struct charlcd {
|
|
|
|
const struct charlcd_ops *ops;
|
|
|
|
const unsigned char *char_conv; /* Optional */
|
|
|
|
|
2017-03-10 17:15:18 +03:00
|
|
|
int ifwidth; /* 4-bit or 8-bit (default) */
|
2017-03-10 17:15:17 +03:00
|
|
|
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 */
|
2017-03-10 17:15:18 +03:00
|
|
|
void (*write_cmd_raw4)(struct charlcd *lcd, int cmd); /* 4-bit only */
|
2017-03-10 17:15:17 +03:00
|
|
|
void (*clear_fast)(struct charlcd *lcd);
|
|
|
|
void (*backlight)(struct charlcd *lcd, int on);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct charlcd *charlcd_alloc(unsigned int drvdata_size);
|
2019-03-12 17:44:30 +03:00
|
|
|
void charlcd_free(struct charlcd *lcd);
|
2017-03-10 17:15:17 +03:00
|
|
|
|
|
|
|
int charlcd_register(struct charlcd *lcd);
|
|
|
|
int charlcd_unregister(struct charlcd *lcd);
|
|
|
|
|
|
|
|
void charlcd_poke(struct charlcd *lcd);
|
2019-08-06 10:14:45 +03:00
|
|
|
|
|
|
|
#endif /* CHARLCD_H */
|