HID LCD display trouble
Oliver Fromme
olli at lurza.secnetix.de
Wed Mar 31 17:06:25 UTC 2010
Hi,
I've recently bought a small USB color LCD module that has
132 x 64 pixels and supports 16 bit colors.
When I connect it to a stable/8 machine, three interfaces
are detected: The first two of them are keyboard and mouse
interfaces. That's because the display also has an IR port
with which you can use certain IR keyboards and mice and IR
remote controls. The mouse interface attaches to ums(4),
the keyboard interface attaches to uhid(4) because I don't
have ukbd in the kernel for certain reasons. Anyway, I'm
not interested in these, so I don't care, I only want to
control the LCD display itself.
The third interface represents the display itself. It is
a HID interface, so it attaches to a uhid(4) instance.
So this is what I get in dmesg:
ugen0.3: <Linux4Media GmbH> at usbus0
uhid1: <Keyboard> on usbus0
ums1: <Mouse> on usbus0
ums1: 3 buttons and [XY] coordinates ID=1
uhid2: <LCD> on usbus0
And these are the devices:
/dev:
lrwxr-xr-x 1 root wheel 9 Mar 30 10:36 ugen0.3 -> usb/0.3.0
crw-r--r-- 1 root operator 0, 110 Mar 30 10:36 uhid1
crw-r--r-- 1 root operator 0, 112 Mar 30 10:36 uhid2
crw-r--r-- 1 root operator 0, 111 Mar 30 10:36 ums1
/dev/usb:
crw------- 1 root operator 0, 104 Mar 30 10:36 0.3.0
crw------- 1 root operator 0, 106 Mar 30 10:36 0.3.1
crw------- 1 root operator 0, 107 Mar 30 10:36 0.3.2
crw------- 1 root operator 0, 108 Mar 30 10:36 0.3.3
crw------- 1 root operator 0, 109 Mar 30 10:36 0.3.4
usbconfig reveals these details:
# usbconfig -u 0 -a 3 show_ifdrv
ugen0.3: <IR/ RF Control Linux4Media GmbH> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen0.3.0: uhid1: <Keyboard>
ugen0.3.1: ums1: <Mouse>
ugen0.3.2: uhid2: <LCD>
# jot 6 0 | xargs -n 1 usbconfig -u 0 -a 3 dump_string
STRING_0x00 = <>
STRING_0x01 = <Linux4Media GmbH>
STRING_0x02 = <Keyboard>
STRING_0x03 = <Mouse>
STRING_0x04 = <LCD>
STRING_0x05 = <IR/ RF Control>
# usbconfig -u 0 -a 3 dump_device_desc
ugen0.3: <IR/ RF Control Linux4Media GmbH> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x0000
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0008
idVendor = 0x4243
idProduct = 0xee08
bcdDevice = 0x0101
iManufacturer = 0x0001 <Linux4Media GmbH>
iProduct = 0x0005 <IR/ RF Control>
iSerialNumber = 0x0000 <no string>
bNumConfigurations = 0x0001
# usbconfig -u 0 -a 3 dump_all_config_desc
ugen0.3: <IR/ RF Control Linux4Media GmbH> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
Configuration index 0
bLength = 0x0009
bDescriptorType = 0x0002
wTotalLength = 0x005b
bNumInterfaces = 0x0003
bConfigurationValue = 0x0001
iConfiguration = 0x0001 <Linux4Media GmbH>
bmAttributes = 0x00a0
bMaxPower = 0x0032
Interface 0
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0000
bAlternateSetting = 0x0000
bNumEndpoints = 0x0001
bInterfaceClass = 0x0003
bInterfaceSubClass = 0x0001
bInterfaceProtocol = 0x0001
iInterface = 0x0002 <Keyboard>
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x21
bDescriptorSubType = 0x11
RAW dump:
0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x3f,
0x08 | 0x00
Endpoint 0
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0081 <IN>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x0008
bInterval = 0x000a
bRefresh = 0x0000
bSynchAddress = 0x0000
Interface 1
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0001
bAlternateSetting = 0x0000
bNumEndpoints = 0x0001
bInterfaceClass = 0x0003
bInterfaceSubClass = 0x0001
bInterfaceProtocol = 0x0002
iInterface = 0x0003 <Mouse>
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x21
bDescriptorSubType = 0x11
RAW dump:
0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x6a,
0x08 | 0x00
Endpoint 0
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0082 <IN>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x0009
bInterval = 0x000a
bRefresh = 0x0000
bSynchAddress = 0x0000
Interface 2
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0002
bAlternateSetting = 0x0000
bNumEndpoints = 0x0002
bInterfaceClass = 0x0003
bInterfaceSubClass = 0x0000
bInterfaceProtocol = 0x0000
iInterface = 0x0004 <LCD>
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x21
bDescriptorSubType = 0x11
RAW dump:
0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x24,
0x08 | 0x00
Endpoint 0
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0083 <IN>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x0040
bInterval = 0x0001
bRefresh = 0x0000
bSynchAddress = 0x0000
Endpoint 1
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0004 <OUT>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x0040
bInterval = 0x0001
bRefresh = 0x0000
bSynchAddress = 0x0000
Finally, usbhidctl shows this:
# usbhidctl -f /dev/uhid2 -v -r
Report descriptor:
Collection page=Microsoft usage=0x0001
Input size=8 count=1 page=Microsoft usage=0x0001, logical range 0..1
Input size=8 count=1 page=Microsoft usage=0x0002, logical range 0..1
Input size=8 count=1 page=Microsoft usage=0x0003, logical range 0..1
Input size=8 count=1 page=Microsoft usage=0x0004, logical range 0..1
Input size=8 count=1 page=Microsoft usage=0x0005, logical range 0..1
Input size=8 count=1 page=Microsoft usage=0x0006, logical range 0..1
Input size=8 count=1 page=Microsoft usage=0x0007, logical range 0..1
Input size=8 count=1 page=Microsoft usage=0x0008, logical range 0..1
Input size=8 count=1 page=Microsoft usage=0x0008, logical range 0..1
Input size=8 count=1 page=Microsoft usage=0x0008, logical range 0..1
[50 more lines that are identical to the last one]
Output size=8 count=1 page=Microsoft usage=0x0001, logical range 0..1
Output size=8 count=1 page=Microsoft usage=0x0002, logical range 0..1
Output size=8 count=1 page=Microsoft usage=0x0003, logical range 0..1
Output size=8 count=1 page=Microsoft usage=0x0004, logical range 0..1
Output size=8 count=1 page=Microsoft usage=0x0005, logical range 0..1
Output size=8 count=1 page=Microsoft usage=0x0006, logical range 0..1
Output size=8 count=1 page=Microsoft usage=0x0007, logical range 0..1
Output size=8 count=1 page=Microsoft usage=0x0008, logical range 0..1
Output size=8 count=1 page=Microsoft usage=0x0008, logical range 0..1
Output size=8 count=1 page=Microsoft usage=0x0008, logical range 0..1
[50 more lines that are identical to the last one]
End collection
Total input size 60 bytes
Total output size 60 bytes
Total feature size 0 bytes
The USB HID commands to control the display are documented
in this PDF document:
http://www.digitaldevices.de/lcdfarbe/USB_Color_commands.pdf
My first Idea (probably very naive) was to simply open one
of the devices (/dev/uhid2 or /dev/usb/0.3.*) and write the
commands listed in the PDF to the file descriptor, e.g.
one byte 0x02 to clear the screen. This did not work.
Next I looked at some Linux sources. The serdisplib does
support this particular device. It also claims to support
FreeBSD, but only for displays connected via RS232 and
parallel ports:
http://serdisplib.sourceforge.net/ser/usb_l4m132c.html
It can be compiled with either libusb or Linux HID ioctl
support. The latter looks vastly different from what
FreeBSD does, so I tried compiling it with libusb support
(using FreeBSD's libusb20, of course). It didn't work
either, it just hangs forever. Close inspection of the
serdisplib docs indicate that libusb support doesn't even
work correctly on Linux, so I gave up on this software.
Next I installed ports/devel/libhid and modified the
test programm (included with the source tarball) to send
simple commands (i.e. 0x02 to clear the screen) to the
output path 0xff00:0x0001/0xff00:0x0001 (also tried the
other usages listed by usbhidctl, see above). Nothing.
There's even no indication whatsoever that the display
receives anything, it just keeps display its boot logo.
Now I'm running out of ideas ... How to proceed?
By the way, I have zero knowledge about HID. This is the
first time I do anything with a HID device, so please
excuse me if I'm asking anything stupid.
Also, any pointers to *useful* documentation about HID
(in particular on FreeBSD) would be greatly appreciated.
I would really like to RTFM, but I haven't been able to
find a good FM so far. :-)
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart
FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd
"FreeBSD is Yoda, Linux is Luke Skywalker"
-- Daniel C. Sobral
More information about the freebsd-usb
mailing list