Files
lcdproc/server/drivers/lis.h
T

97 lines
2.6 KiB
C
Raw Normal View History

/*-
* Copyright (c) 2007, Daryl Fonseca-Holt <wyatt@prairieturtle.ca>
*
* Based on:
* ula200 driver, Copyright (C) 2006, Bernhard Walle
* IOWarrior driver, Copyright(C) 2004-2006 Peter Marschall <peter@adpm.de>
*
* This file is released under the GNU General Public License. Refer to the
* COPYING file distributed with this package.
*/
#ifndef LIS_H
#define LIS_H
/*----------------------------- Constants ---------------------------------*/
2007-05-26 19:43:13 +00:00
#define DISPLAY_VENDOR_ID 0x0403
#define DISPLAY_PRODUCT_ID 0x6001
#define CELLWIDTH 5
#define CELLHEIGHT 8
#define DEFAULT_BRIGHTNESS 1000
2007-06-17 12:07:37 +00:00
#define NUM_CCs 8
2007-05-26 19:43:13 +00:00
/*------------------------ Private data types -----------------------------*/
2007-06-17 12:07:37 +00:00
typedef struct cgram_cache {
unsigned char cache[CELLHEIGHT];
int clean;
} CGram;
2007-05-26 19:43:13 +00:00
/** private data for the \c lis driver */
typedef struct lis_private_data {
/* the handle for the USB FTDI library */
2007-05-26 19:43:13 +00:00
struct ftdi_context ftdic;
/* the width and the height (in number of characters) of the display */
2007-05-26 19:43:13 +00:00
int width, height;
/* pixel width and height of each character */
2007-06-17 12:07:37 +00:00
int cellwidth, cellheight;
2007-05-26 19:43:13 +00:00
/* The framebuffer and the framebuffer for the last contents (incr. update) */
2007-05-26 19:43:13 +00:00
unsigned char *framebuf;
/* dirty line flags */
2007-05-26 19:43:13 +00:00
unsigned int *line_flags;
/* child thread flag */
2007-05-26 19:43:13 +00:00
int child_flag;
/* parent thread flag */
2007-05-26 19:43:13 +00:00
int parent_flag;
/* display brightness 0-1000 */
2007-05-26 19:43:13 +00:00
int brightness;
/* custom characters */
2007-06-17 12:07:37 +00:00
CGram cc[NUM_CCs];
CGmode ccmode;
2007-05-26 19:43:13 +00:00
/* USB Vendor ID */
2007-05-26 19:43:13 +00:00
int VendorID;
/* USB Product ID */
2007-05-26 19:43:13 +00:00
int ProductID;
/*
* flag if the last row of each character can be set when defining
* custom characters.
*/
char lastline;
2007-05-26 19:43:13 +00:00
} PrivateData;
MODULE_EXPORT int lis_init(Driver *drvthis);
MODULE_EXPORT void lis_close(Driver *drvthis);
MODULE_EXPORT int lis_width(Driver *drvthis);
MODULE_EXPORT int lis_height(Driver *drvthis);
MODULE_EXPORT void lis_clear(Driver * drvthis);
MODULE_EXPORT void lis_string(Driver * drvthis, int x, int y, char string[]);
MODULE_EXPORT void lis_chr(Driver * drvthis, int x, int y, unsigned char c);
MODULE_EXPORT void lis_flush(Driver * drvthis);
MODULE_EXPORT void lis_vbar(Driver * drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT void lis_hbar(Driver * drvthis, int x, int y, int len, int promille, int options);
MODULE_EXPORT int lis_icon(Driver * drvthis, int x, int y, int icon);
MODULE_EXPORT int lis_cellheight(Driver *drvthis);
MODULE_EXPORT int lis_cellwidth(Driver *drvthis);
2007-06-17 12:07:37 +00:00
MODULE_EXPORT void lis_num(Driver *drvthis, int x, int num);
MODULE_EXPORT int lis_get_free_chars(Driver *drvthis);
MODULE_EXPORT void lis_set_char(Driver *drvthis, int n, unsigned char *dat);
#endif /* LIS_H */