new driver IOWarrior for Code Mercenaries IOWarrior devices

This commit is contained in:
marschap
2004-10-02 15:04:27 +00:00
parent 90f3da6cd4
commit a96ce76a20
7 changed files with 1338 additions and 4 deletions
+14
View File
@@ -42,6 +42,7 @@
Driver=curses
#Driver=hd44780
#Driver=IOWarrior
#Driver=MtxOrb
#Driver=CFontz633
#Driver=CwLnx
@@ -322,6 +323,19 @@ KeyMatrix_4_3=Down
KeyMatrix_4_4=Escape
# Code Mercenaries IO-Warrior drivr
[IOWarrior]
# display dimensions
Size=20x4
# serial number [exactly as listed by usbview]
# (if not given, the 1st IOWarrior found gets used)
#SerialNumber=00000674
[IrMan]
#IrMan driver
#if in trouble with IrMan, try Lirc emulator for IrMan
+13 -2
View File
@@ -8,13 +8,13 @@ AC_ARG_ENABLE(drivers,
[ mtxorb,cfontz,cfontz633,curses,cwlnx,text,lb216,]
[ hd44780,joy,irman,lirc,bayrad,glk,,mtc_s16209x]
[ stv5730,sed1330,sed1520,svga,lcdm001,t6963]
[ lcterm,icp_a106,ms6931]
[ lcterm,icp_a106,ms6931,iowarrior]
[ \"all\" compiles all drivers],
drivers="$enableval",
drivers=[lcdm001,mtxorb,cfontz,cfontz633,curses,cwlnx,text,lb216,bayrad,glk])
if test "$drivers" = "all"; then
drivers=[mtxorb,cfontz,cfontz633,curses,cwlnx,text,lb216,mtc_s16209x,hd44780,joy,irman,lirc,bayrad,glk,stv5730,sed1330,sed1520,svga,lcdm001,t6963,lcterm,icp_a106,ms6931]
drivers=[mtxorb,cfontz,cfontz633,curses,cwlnx,text,lb216,mtc_s16209x,hd44780,joy,irman,lirc,bayrad,glk,stv5730,sed1330,sed1520,svga,lcdm001,t6963,lcterm,icp_a106,ms6931,iowarrior]
fi
drivers=`echo $drivers | sed 's/,/ /g'`
@@ -148,6 +148,16 @@ dnl else
AC_MSG_WARN([The joy driver needs header file linux/joystick.h.])
])
;;
iowarrior)
AC_CHECK_LIB(usb, main,[
LIBUSB="-lusb"
DRIVERS="$DRIVERS IOWarrior${SO}"
actdrivers=["$actdrivers iowarrior"]
],[
dnl else
AC_MSG_WARN([The iowarrior driver needs the libusb library.])
])
;;
irman)
AC_CHECK_LIB(irman, main,[
LIBIRMAN="-lirman"
@@ -229,6 +239,7 @@ actdrivers=`echo $actdrivers | sed 's/ /,/g'`
AC_MSG_RESULT([Will compile drivers: $actdrivers])
AC_SUBST(LIBCURSES)
AC_SUBST(LIBUSB)
AC_SUBST(LIBIRMAN)
AC_SUBST(LIBLIRC_CLIENT)
AC_SUBST(LIBSVGA)
+3
View File
@@ -71,6 +71,9 @@ Standard video display using the ncurses library
.B HD44780
Hitachi HD44780 LCD displays
.TP
.B IOWarrior
Code Mercenaries IOWarrior
.TP
.B BayRAD
EMAC BayRad displays
.TP
+1 -1
View File
@@ -74,7 +74,7 @@ Available options are:
Currently available drivers:
lcdm001, LCDM001, MtxOrb, MatrixOrbital, CFontz, CrystalFontz, LB216, text,
curses, ncurses, BayRAD, glk, glc
curses, ncurses, BayRAD, glk, glc, IOWarrior
]]>
File diff suppressed because it is too large Load Diff
+130
View File
@@ -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 */
+3 -1
View File
@@ -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