update lis driver (Daryl F)

This commit is contained in:
marschap
2007-06-17 12:07:37 +00:00
parent 77209a6f3f
commit 2f9f70e87e
5 changed files with 353 additions and 188 deletions
+34 -4
View File
@@ -38,17 +38,36 @@
#define DEFAULT_BRIGHTNESS 1000
#define NUM_CCs 8
///////////////////////////////////////////////////////////////////////////////
// private data types
//
typedef enum {
standard, /* only char 0 is used for heartbeat */
vbar, /* vertical bars */
hbar, /* horizontal bars */
bignum, /* big numbers */
bigchar, /* big characters */
custom /* custom icons */
} CGmode;
typedef struct cgram_cache {
unsigned char cache[CELLHEIGHT];
int clean;
} CGram;
typedef struct {
// the handle for the USB FTDI library
struct ftdi_context ftdic;
// the width and the height (in number of characters) of the library
// the width and the height (in number of characters) of the display
int width, height;
// pixel width and height of each character
int cellwidth, cellheight;
// The framebuffer and the framebuffer for the last contents (incr. update)
unsigned char *framebuf;
@@ -65,8 +84,9 @@ typedef struct {
// display brightness 0-1000
int brightness;
// custom characters loaded?
int cc_flag;
// ustom characters
CGram cc[NUM_CCs];
CGmode ccmode;
// USB Vendor ID
int VendorID;
@@ -74,6 +94,11 @@ typedef struct {
// USB Product ID
int ProductID;
/* lastline controls the use of the last line, if pixel addressable (true, default) or */
/* underline effect (false). To avoid the underline effect in the latter case, the last */
/* line is always zeroed for whatever redefined character */
char lastline;
} PrivateData;
MODULE_EXPORT int lis_init(Driver *drvthis);
@@ -82,10 +107,15 @@ 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, char c);
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);
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 */