update lis driver Daryl F
This commit is contained in:
@@ -622,12 +622,18 @@ Size=16x2
|
|||||||
## LIS MCE 2005 driver ##
|
## LIS MCE 2005 driver ##
|
||||||
[lis]
|
[lis]
|
||||||
|
|
||||||
# USB device to use [default: /dev/ttyUSB0]
|
|
||||||
Device=/dev/ttyUSB0
|
|
||||||
|
|
||||||
# Set the initial brightness [default: 1000; legal: 0 - 1000]
|
# Set the initial brightness [default: 1000; legal: 0 - 1000]
|
||||||
Brightness=1000
|
# 0-250 = 25%, 251-500 = 50%, 501-750 = 75%, 751-1000 = 100%
|
||||||
|
#Brightness=1000
|
||||||
|
|
||||||
|
# Columns by lines (default 20x2)
|
||||||
|
#Size=20x2
|
||||||
|
|
||||||
|
# USB Vendor ID (default 0x0403)
|
||||||
|
VendorID=0x0403
|
||||||
|
|
||||||
|
# USB Product ID (default 0x6001
|
||||||
|
ProductID=0x6001
|
||||||
|
|
||||||
|
|
||||||
##The driver for the VFD of the Medion MD8800 PC ##
|
##The driver for the VFD of the Medion MD8800 PC ##
|
||||||
|
|||||||
@@ -3,13 +3,47 @@
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
This section talks about using LCDproc with the VLSystem L.I.S
|
This section talks about using LCDproc with the VLSystem L.I.S
|
||||||
MCE 2005 Vacuum Flourescent Display based on the FTDI USB-to-serial
|
MCE 2005 Vacuum Flourescent Display (VFD) based on the FTDI USB-to-serial
|
||||||
converter, the Microchip PIC-16F716 microcontroller, and
|
converter, the Microchip PIC-16F716 microcontroller, and
|
||||||
the NEC UPD16314 display driver that can be obtained at
|
the NEC UPD16314 display driver manufactured by
|
||||||
<ulink url="http://www.vlsys.co.kr">VLSys</ulink>.
|
<ulink url="http://www.vlsys.co.kr">VLSystem</ulink>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<!-- ## VLSys lis driver ## -->
|
<!-- ## VLSys lis driver ## -->
|
||||||
|
<sect2 id="lis-features">
|
||||||
|
<title>Features</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
This device uses a vacuum flourescent display of 20 characters by 2 lines. Each each
|
||||||
|
character is 5 pixels wide by 8 pixels high. The device is connected by USB. The FTDI chip
|
||||||
|
translates the USB protocol to serial expected by the VFD driver chip, an NEC UPD16314. A
|
||||||
|
programmable interrupt controller (PIC), the PIC16F716 by Microchip, provides the glue
|
||||||
|
between the FTDI and the NEC chips.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
<sect2 id="lis-requirements">
|
||||||
|
<title>Requirements</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The driver depends on libftdi, version 0.8 or higher, from
|
||||||
|
<ulink url="http://www.intra2net.com/opensource/ftdi/">
|
||||||
|
http://www.intra2net.com/opensource/ftdi/</ulink>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
<sect2 id="lis-compiling">
|
||||||
|
<title>Compiling</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Make sure that the L.I.S files are built when you run configure. This
|
||||||
|
can be done by specifying "--enable-drivers=all" or by
|
||||||
|
"--enable-drivers=lis".
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
<sect2 id="lis-config">
|
<sect2 id="lis-config">
|
||||||
<title>Configuration in LCDd.conf</title>
|
<title>Configuration in LCDd.conf</title>
|
||||||
|
|
||||||
@@ -17,30 +51,62 @@
|
|||||||
<title>[lis]</title>
|
<title>[lis]</title>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<command>Size=</command>
|
||||||
|
<arg choice="plain">
|
||||||
|
<replaceable>WIDTH</replaceable>
|
||||||
|
<literal>x</literal>
|
||||||
|
<replaceable>HEIGHT</replaceable>
|
||||||
|
</arg>
|
||||||
|
</term>
|
||||||
|
<listitem><para>
|
||||||
|
Set the display size. The default <literal>20x2</literal> should be safe
|
||||||
|
for most if not all users, since the device seeems to be made only with
|
||||||
|
this one size.
|
||||||
|
But who knowns …
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<command>VendorID=</command>
|
||||||
|
<arg choice="plain">
|
||||||
|
<replaceable>VENDORID</replaceable>
|
||||||
|
</arg>
|
||||||
|
</term>
|
||||||
|
<listitem><para>
|
||||||
|
USB Vendor ID
|
||||||
|
[default: <literal>0x0403</literal>].
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<command>ProductID=</command>
|
||||||
|
<arg choice="plain">
|
||||||
|
<replaceable>PRODUCTID</replaceable>
|
||||||
|
</arg>
|
||||||
|
</term>
|
||||||
|
<listitem><para>
|
||||||
|
USB Product ID
|
||||||
|
[default: <literal>0x6001</literal>].
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<command>Brightness=</command>
|
<command>Brightness=</command>
|
||||||
<arg choice="plain"><replaceable>BRIGHTNESS</replaceable></arg>
|
<arg choice="plain"><replaceable>BRIGHTNESS</replaceable></arg>
|
||||||
</term>
|
</term>
|
||||||
<listitem><para>
|
<listitem>
|
||||||
Set the initial brightness [default: <literal>1000</literal>; legal: <literal>0</literal> - <literal>1000</literal>]
|
<para>
|
||||||
</para></listitem>
|
Set the initial brightness [default: <literal>1000</literal>;
|
||||||
</term>
|
legal: <literal>0</literal> - <literal>1000</literal>. Values
|
||||||
<listitem><para>
|
between 0 and 250 give 25% brightness, 251 to 500 give 50% brightness,
|
||||||
Select the LCD size [default: <literal>20x4</literal>]
|
501 and 750, give 75% brightness, and values higher than 751 give 100%
|
||||||
</para></listitem>
|
brightness.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<command>Device=</command>
|
|
||||||
<arg choice="plain"><replaceable>DEVICE</replaceable></arg>
|
|
||||||
</term>
|
|
||||||
<listitem><para>
|
|
||||||
USB device to use. Usual values are <filename>/dev/ttyUSB0</filename>, <filename>/dev/ttyUSB1</filename>, etc.
|
|
||||||
[default: <filename>/dev/ttyUSB0</filename>].
|
|
||||||
</para></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|||||||
+26
-49
@@ -7,8 +7,7 @@
|
|||||||
* This driver uses the libftdi library to interface to the FTDI chip. Make
|
* This driver uses the libftdi library to interface to the FTDI chip. Make
|
||||||
* sure kernel module ftdi_sio doesn't claim the device.
|
* sure kernel module ftdi_sio doesn't claim the device.
|
||||||
*
|
*
|
||||||
* Based on the ula200 driver Copyright (C) 2006, Bernhard Walle
|
* Based on: ula200 driver Copyright (C) 2006, Bernhard Walle
|
||||||
* and the CrystalFontz 633 driver Copyright (C) 2002 David GLAUDE
|
|
||||||
*
|
*
|
||||||
* Copyright (c) 2007, Daryl Fonseca-Holt <wyatt@prairieturtle.ca>
|
* Copyright (c) 2007, Daryl Fonseca-Holt <wyatt@prairieturtle.ca>
|
||||||
*
|
*
|
||||||
@@ -33,6 +32,16 @@
|
|||||||
* was which line would be written at column 1.
|
* was which line would be written at column 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* CHANGES:
|
||||||
|
*
|
||||||
|
* 2007/05/22 Removed useless Device= config option.
|
||||||
|
* Added VendorID= and ProductID= config
|
||||||
|
* option parsting. Moved constants to
|
||||||
|
* lis.h where they belong. Added
|
||||||
|
* lis_cellheight() and lis_cellwidth().
|
||||||
|
* Completely commented out lis_test() to
|
||||||
|
* save memory.
|
||||||
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -57,7 +66,7 @@
|
|||||||
#include "lcd_lib.h"
|
#include "lcd_lib.h"
|
||||||
#include "timing.h"
|
#include "timing.h"
|
||||||
|
|
||||||
void lis_test(Driver *drvthis);
|
// void lis_test(Driver *drvthis);
|
||||||
|
|
||||||
/* Vars for the server core */
|
/* Vars for the server core */
|
||||||
MODULE_EXPORT char *api_version = API_VERSION;
|
MODULE_EXPORT char *api_version = API_VERSION;
|
||||||
@@ -66,17 +75,6 @@ MODULE_EXPORT int supports_multiple = 1;
|
|||||||
MODULE_EXPORT char *symbol_prefix = "lis_";
|
MODULE_EXPORT char *symbol_prefix = "lis_";
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// constants
|
|
||||||
//
|
|
||||||
#define DISPLAY_VENDOR_ID 0x0403
|
|
||||||
#define DISPLAY_PRODUCT_ID 0x6001
|
|
||||||
|
|
||||||
#define CELLWIDTH 5
|
|
||||||
#define CELLHEIGHT 8
|
|
||||||
|
|
||||||
#define DEFAULT_BRIGHTNESS 750
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Charactar mapping for UPD16314 device by Daryl Fonseca-Holt
|
* Charactar mapping for UPD16314 device by Daryl Fonseca-Holt
|
||||||
* <wyatt@prairieturtle.ca> taken from Mark Haemmerling's HD44780 table.
|
* <wyatt@prairieturtle.ca> taken from Mark Haemmerling's HD44780 table.
|
||||||
@@ -139,38 +137,6 @@ const unsigned char UPD16314_charmap[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
// private data types
|
|
||||||
//
|
|
||||||
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
|
|
||||||
int width, height;
|
|
||||||
|
|
||||||
// The framebuffer and the framebuffer for the last contents (incr. update)
|
|
||||||
unsigned char *framebuf;
|
|
||||||
|
|
||||||
// dirty line flags
|
|
||||||
unsigned int *line_flags;
|
|
||||||
|
|
||||||
// child thread flag
|
|
||||||
int child_flag;
|
|
||||||
|
|
||||||
// parent thread flag
|
|
||||||
int parent_flag;
|
|
||||||
|
|
||||||
// display brightness 0-1000
|
|
||||||
int brightness;
|
|
||||||
|
|
||||||
// custom characters loaded
|
|
||||||
int cc_flag;
|
|
||||||
|
|
||||||
} PrivateData;
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Write a command to the display.
|
// Write a command to the display.
|
||||||
//
|
//
|
||||||
@@ -352,7 +318,7 @@ lis_load_custom_chars(Driver *drvthis)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
// Seperate thread to keep a read up on the USB device at all times
|
// Separate thread to keep a read up on the USB device at all times
|
||||||
int
|
int
|
||||||
lis_read_thread(void *arg)
|
lis_read_thread(void *arg)
|
||||||
{
|
{
|
||||||
@@ -471,6 +437,9 @@ lis_init(Driver *drvthis)
|
|||||||
}
|
}
|
||||||
p->brightness = count;
|
p->brightness = count;
|
||||||
|
|
||||||
|
p->VendorID = drvthis->config_get_int(drvthis->name, "VendorID", 0, DISPLAY_VENDOR_ID);
|
||||||
|
p->ProductID = drvthis->config_get_int(drvthis->name, "ProductID", 0, DISPLAY_PRODUCT_ID);
|
||||||
|
|
||||||
/* End of config file parsing */
|
/* End of config file parsing */
|
||||||
|
|
||||||
|
|
||||||
@@ -492,9 +461,12 @@ lis_init(Driver *drvthis)
|
|||||||
// (&p->ftdic)->usb_read_timeout = 20;
|
// (&p->ftdic)->usb_read_timeout = 20;
|
||||||
|
|
||||||
// open the device
|
// open the device
|
||||||
err = ftdi_usb_open(&p->ftdic, DISPLAY_VENDOR_ID, DISPLAY_PRODUCT_ID);
|
err = ftdi_usb_open(&p->ftdic, p->VendorID, p->ProductID);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
report(RPT_ERR, "%s: cannot open USB device", drvthis->name);
|
report(RPT_ERR, "%s: cannot open USB device %x:%x",
|
||||||
|
drvthis->name
|
||||||
|
p->VendorID,
|
||||||
|
p->ProductID);
|
||||||
goto err_framebuf;
|
goto err_framebuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1277,6 +1249,7 @@ lis_clear (Driver *drvthis)
|
|||||||
memset(p->framebuf + (line * p->width), ' ', p->width);
|
memset(p->framebuf + (line * p->width), ' ', p->width);
|
||||||
p->line_flags[line] = 1;
|
p->line_flags[line] = 1;
|
||||||
}
|
}
|
||||||
|
p->ccmode = standard;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -1448,6 +1421,9 @@ lis_hbar(Driver *drvthis, int x, int y, int len, int promille, int options)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
void
|
void
|
||||||
lis_test(Driver *drvthis)
|
lis_test(Driver *drvthis)
|
||||||
{
|
{
|
||||||
@@ -1463,3 +1439,4 @@ lis_test(Driver *drvthis)
|
|||||||
lis_flush(drvthis);
|
lis_flush(drvthis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
+49
-2
@@ -27,6 +27,55 @@
|
|||||||
# define false 0
|
# define false 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// constants
|
||||||
|
//
|
||||||
|
#define DISPLAY_VENDOR_ID 0x0403
|
||||||
|
#define DISPLAY_PRODUCT_ID 0x6001
|
||||||
|
|
||||||
|
#define CELLWIDTH 5
|
||||||
|
#define CELLHEIGHT 8
|
||||||
|
|
||||||
|
#define DEFAULT_BRIGHTNESS 1000
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// private data types
|
||||||
|
//
|
||||||
|
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
|
||||||
|
int width, height;
|
||||||
|
|
||||||
|
// The framebuffer and the framebuffer for the last contents (incr. update)
|
||||||
|
unsigned char *framebuf;
|
||||||
|
|
||||||
|
// dirty line flags
|
||||||
|
unsigned int *line_flags;
|
||||||
|
|
||||||
|
// child thread flag
|
||||||
|
int child_flag;
|
||||||
|
|
||||||
|
// parent thread flag
|
||||||
|
int parent_flag;
|
||||||
|
|
||||||
|
// display brightness 0-1000
|
||||||
|
int brightness;
|
||||||
|
|
||||||
|
// custom characters loaded?
|
||||||
|
int cc_flag;
|
||||||
|
|
||||||
|
// USB Vendor ID
|
||||||
|
int VendorID;
|
||||||
|
|
||||||
|
// USB Product ID
|
||||||
|
int ProductID;
|
||||||
|
|
||||||
|
} PrivateData;
|
||||||
|
|
||||||
MODULE_EXPORT int lis_init(Driver *drvthis);
|
MODULE_EXPORT int lis_init(Driver *drvthis);
|
||||||
MODULE_EXPORT void lis_close (Driver *drvthis);
|
MODULE_EXPORT void lis_close (Driver *drvthis);
|
||||||
MODULE_EXPORT int lis_width (Driver *drvthis);
|
MODULE_EXPORT int lis_width (Driver *drvthis);
|
||||||
@@ -34,11 +83,9 @@ MODULE_EXPORT int lis_height (Driver *drvthis);
|
|||||||
MODULE_EXPORT void lis_clear (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_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, char c);
|
||||||
MODULE_EXPORT void lis_set_char (Driver * drvthis, int n, char *dat);
|
|
||||||
MODULE_EXPORT void lis_flush (Driver * drvthis);
|
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_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 void lis_hbar (Driver * drvthis, int x, int y, int len, int promille, int options);
|
||||||
MODULE_EXPORT void lis_num (Driver * drvthis, int x, int num);
|
|
||||||
MODULE_EXPORT int lis_icon(Driver * drvthis, int x, int y, int icon);
|
MODULE_EXPORT int lis_icon(Driver * drvthis, int x, int y, int icon);
|
||||||
|
|
||||||
#endif /* LIS_H */
|
#endif /* LIS_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user