key support for hd44780/lcd2usb (M. Dolze)

This commit is contained in:
marschap
2007-09-20 09:18:21 +00:00
parent c7358581de
commit 6c18a1751a
4 changed files with 21 additions and 10 deletions
+1
View File
@@ -24,6 +24,7 @@ v.0.5dev (ongoing development)
* enable building lcdproc client on FreeBSD AMD64 platform (M. Dolze) * enable building lcdproc client on FreeBSD AMD64 platform (M. Dolze)
* Autoconf fixes for Net/FreeBSD (M. Dolze) * Autoconf fixes for Net/FreeBSD (M. Dolze)
* fixes for the lcpdroc client iface screen on *BSD (M.Dolze) * fixes for the lcpdroc client iface screen on *BSD (M.Dolze)
* key support for hd44780/lcd2usb (M. Dolze)
v.0.5.2 v.0.5.2
* fix switching on/off the Load screen in lcdproc client using the menu * fix switching on/off the Load screen in lcdproc client using the menu
+4 -1
View File
@@ -436,9 +436,12 @@ Speed=0
# You may also need to configure the keypad layout further on in this file. # You may also need to configure the keypad layout further on in this file.
Keypad=no Keypad=no
# set the initial contrast (for bwctusb only) [default: 0; legal: 0 - 1000] # Set the initial contrast (bwctusb and lcd2usb) [default: 0; legal: 0 - 1000]
Contrast=0 Contrast=0
# Set brightness of the backlight (lcd2usb only) [default: 0; legal 0 - 1000]
#Brightness=1000
# If you have a switchable backlight. # If you have a switchable backlight.
Backlight=no Backlight=no
+4 -9
View File
@@ -1647,6 +1647,10 @@ This means that you can take these schematics and use it as a basis for your own
e.g. for a graphic LCD e.g. for a graphic LCD
</para> </para>
<para>
The LCD2USB interface supports up to two keys. They can be configured as direct keys 1 and 2.
</para>
<sect4 id="hd44780-lcd2usb-config"> <sect4 id="hd44780-lcd2usb-config">
<title>Special config options</title> <title>Special config options</title>
@@ -1657,15 +1661,6 @@ Besides the standard configuration options for <code>hd44780</code> displays, th
<command>Brightness=</command> to set the display's brightness. <command>Brightness=</command> to set the display's brightness.
Both options expect a number in the range from <literal>0</literal> to <literal>1000</literal>. Both options expect a number in the range from <literal>0</literal> to <literal>1000</literal>.
</para> </para>
</sect4>
<sect4 id="hd44780-lcd2usb-status">
<title>Status</title>
<para>
Although the LCD2USB sports two keys, they are currently not supported by
<package>LCDproc</package>. Patches to fix the situation are very welcome.
</para>
<tip> <tip>
<para> <para>
+12
View File
@@ -147,6 +147,18 @@ lcd2usb_HD44780_backlight(PrivateData *p, unsigned char state)
unsigned char unsigned char
lcd2usb_HD44780_scankeypad(PrivateData *p) lcd2usb_HD44780_scankeypad(PrivateData *p)
{ {
unsigned char buffer[2];
int nBytes;
/* send control request and accept return value */
nBytes = usb_control_msg(lcd2usb,
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN,
LCD2USB_GET_KEYS, 0, 0, (char *) buffer, sizeof(buffer), 1000);
if (nBytes != -1) {
return buffer[0];
}
return 0; return 0;
} }