new driver IOWarrior for Code Mercenaries IOWarrior devices
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,130 @@
|
||||
/* This is the LCDproc driver for IO-Warrior devices (http://www.codemercs.de)
|
||||
|
||||
Copyright (C) 2004, Peter Marschall <peter@adpm.de>
|
||||
|
||||
based on GPL'ed code:
|
||||
|
||||
* IOWarrior LCD routines
|
||||
Copyright (c) 2004 Christian Vogelgsang <chris@lallafa.de>
|
||||
|
||||
* misc. files from LCDproc source tree
|
||||
|
||||
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
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */
|
||||
|
||||
|
||||
#ifndef IOWARRIOR_H
|
||||
#define IOWARRIOR_H
|
||||
|
||||
#include <usb.h>
|
||||
#include "lcd.h"
|
||||
|
||||
#define DEFAULT_SERIALNO ""
|
||||
#define DEFAULT_SIZE "20x4"
|
||||
#define DEFAULT_BACKLIGHT 1
|
||||
#define DEFAULT_BRIGHTNESS 200
|
||||
|
||||
/* define some IOW constants */
|
||||
#define iowVendor 0x07c0 /* CodeMercs */
|
||||
#define iowProd40 0x1500 /* IOW40 */
|
||||
#define iowProd24 0x1501 /* IOW24 */
|
||||
#define iowTimeout 1000
|
||||
|
||||
#define USB_REQ_SET_REPORT 0x09
|
||||
#define USB_REQ_GET_REPORT 0x01
|
||||
|
||||
#define IOW_OK 0
|
||||
#define IOW_ERROR -1
|
||||
|
||||
#define IOWLCD_BUSY 0x80
|
||||
#define IOWLCD_ADDR_MASK 0x7F
|
||||
|
||||
/* IOWarriors drive HD44780 cmpatible displays that have these cells: */
|
||||
#define CELLWIDTH LCD_DEFAULT_CELLWIDTH
|
||||
#define CELLHEIGHT LCD_DEFAULT_CELLHEIGHT
|
||||
|
||||
|
||||
/* Constants for userdefchar_mode */
|
||||
#define NUM_CCs 8 /* max. number of custom characters */
|
||||
|
||||
typedef enum {
|
||||
standard, /* only char 0 is used for heartbeat */
|
||||
vbar, /* vertical bars */
|
||||
hbar, /* horizontaln bars */
|
||||
bignum, /* big numbers */
|
||||
bigchar /* big characters */
|
||||
} CGmode;
|
||||
|
||||
|
||||
typedef struct cgram_cache {
|
||||
char cache[LCD_DEFAULT_CELLHEIGHT];
|
||||
int clean;
|
||||
} CGram;
|
||||
|
||||
|
||||
typedef struct driver_private_data {
|
||||
char manufacturer[LCD_MAX_WIDTH+1];
|
||||
char product[LCD_MAX_WIDTH+1];
|
||||
char serial[LCD_MAX_WIDTH+1];
|
||||
int productID;
|
||||
|
||||
usb_dev_handle *udh;
|
||||
|
||||
int width, height;
|
||||
int cellwidth, cellheight;
|
||||
|
||||
/* The framebuffer */
|
||||
char *framebuf;
|
||||
|
||||
/* last LCD contents (for incremental updates) */
|
||||
char *backingstore;
|
||||
|
||||
/* defineable characters */
|
||||
CGram cc[NUM_CCs];
|
||||
CGmode ccmode;
|
||||
|
||||
/* output LED(s) state */
|
||||
unsigned int output_mask;
|
||||
int output_state;
|
||||
|
||||
int brightness;
|
||||
int backlight;
|
||||
} PrivateData;
|
||||
|
||||
|
||||
/* API: variables for the server core */
|
||||
MODULE_EXPORT char *api_version = API_VERSION;
|
||||
MODULE_EXPORT int stay_in_foreground = 0; /* For testing only */
|
||||
MODULE_EXPORT int supports_multiple = 1;
|
||||
MODULE_EXPORT char *symbol_prefix = "IOWarrior_";
|
||||
|
||||
/* API: functions for the server core */
|
||||
MODULE_EXPORT int IOWarrior_init(Driver *drvthis, char *device);
|
||||
MODULE_EXPORT void IOWarrior_close(Driver *drvthis);
|
||||
MODULE_EXPORT int IOWarrior_width(Driver *drvthis);
|
||||
MODULE_EXPORT int IOWarrior_height(Driver *drvthis);
|
||||
MODULE_EXPORT void IOWarrior_clear(Driver *drvthis);
|
||||
MODULE_EXPORT void IOWarrior_chr(Driver *drvthis, int x, int y, char c);
|
||||
MODULE_EXPORT void IOWarrior_string(Driver *drvthis, int x, int y, char string[]);
|
||||
MODULE_EXPORT void IOWarrior_flush(Driver *drvthis);
|
||||
MODULE_EXPORT void IOWarrior_backlight(Driver *drvthis, int on);
|
||||
MODULE_EXPORT void IOWarrior_vbar(Driver *drvthis, int x, int y, int len, int promille, int options);
|
||||
MODULE_EXPORT void IOWarrior_hbar(Driver *drvthis, int x, int y, int len, int promille, int options);
|
||||
MODULE_EXPORT void IOWarrior_num(Driver *drvthis, int x, int num);
|
||||
MODULE_EXPORT void IOWarrior_set_char(Driver *drvthis, int n, char *dat);
|
||||
MODULE_EXPORT int IOWarrior_icon(Driver *drvthis, int x, int y, int icon);
|
||||
MODULE_EXPORT void IOWarrior_output(Driver *drvthis, int on);
|
||||
|
||||
#endif /* IOWARRIOR_H */
|
||||
|
||||
@@ -18,7 +18,7 @@ LDFLAGS += @LDSHARED@
|
||||
LIBS =
|
||||
|
||||
pkglib_PROGRAMS = @DRIVERS@
|
||||
EXTRA_PROGRAMS = bayrad CFontz CFontz633 curses CwLnx glk hd44780 irman icp_a106 joy lb216 mtc_s16209x lcdm001 lcterm lirc MtxOrb sed1330 sed1520 stv5730 svga t6963 text wirz_sli ms6931
|
||||
EXTRA_PROGRAMS = bayrad CFontz CFontz633 curses CwLnx glk hd44780 irman icp_a106 joy lb216 mtc_s16209x lcdm001 lcterm lirc MtxOrb sed1330 sed1520 stv5730 svga t6963 text wirz_sli ms6931 IOWarrior
|
||||
noinst_LIBRARIES = libLCD.a
|
||||
|
||||
CFontz_LDADD = libLCD.a
|
||||
@@ -29,6 +29,7 @@ CwLnx_SOURCES = lcd.h CwLnx.c CwLnx.h report.h
|
||||
hd44780_LDADD = libLCD.a @HD44780_DRIVERS@
|
||||
hd44780_DEPENDENCIES = @HD44780_DRIVERS@
|
||||
icp_a106_LDADD = libLCD.a
|
||||
IOWarrior_LDADD = @LIBUSB@ libLCD.a
|
||||
irman_LDADD = @LIBIRMAN@
|
||||
lirc_LDADD = @LIBLIRC_CLIENT@
|
||||
lcterm_LDADD = libLCD.a
|
||||
@@ -46,6 +47,7 @@ hd44780_SOURCES = lcd.h hd44780.h hd44780.c hd44780-drivers.h hd44780-low.h h
|
||||
EXTRA_hd44780_SOURCES = hd44780-4bit.c hd44780-4bit.h hd44780-ext8bit.c hd44780-ext8bit.h lcd_sem.c lcd_sem.h hd44780-serialLpt.c hd44780-serialLpt.h hd44780-winamp.c hd44780-winamp.h hd44780-picanlcd.c hd44780-picanlcd.h port.h lpt-port.h timing.h
|
||||
|
||||
icp_a106_SOURCES = lcd.h icp_a106.c icp_a106.h report.h
|
||||
IOWarrior_SOURCES = lcd.h lcd_lib.h hd44780-charmap.h IOWarrior.c IOWarrior.h report.h
|
||||
irman_SOURCES = lcd.h irmanin.c irmanin.h report.h
|
||||
joy_SOURCES = lcd.h joy.c joy.h port.h report.h
|
||||
lb216_SOURCES = lcd.h lb216.c lb216.h report.h
|
||||
|
||||
Reference in New Issue
Block a user