From: Theo S. <to...@sc...> - 2005-09-25 16:59:38
|
i has the LCD from tilofranz.net/lcdshop The Display has an ftdi232bm chip to communicate with USB and an S1D13305F for Display. USB VendorID=3D0x403 and ProductID=3D0xe588 I added to ftdio_sio.h and ftdi_sio.c the product ID and recompile the ftdi_sio kernel modul. Then i add : BUS=3D"usb", SYSFS{idProduct}=3D"e588", NAME=3D"lcd", SYMLINK=3D"usb/lcd"= , MODE=3D"0666" to my udev rules. Now when i connect the Display dmesg say: drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI USB Serial Device ftdi_sio 2-2:1.0: FTDI USB Serial Device converter detected drivers/usb/serial/ftdi_sio.c: Detected FT232BM usb 2-2: FTDI USB Serial Device converter now attached to ttyUSB0 usbcore: registered new driver ftdi_sio drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters Driver and i has an dev in /dev/usb/lcd But how can i send some informations to Display? First i thought that serdisplib can help, but at this time there is no rs232 support. Then i asked the on the serdisplib mailinglist if there is any linux library for this display, but the answer was "Not now, maybe later". So i conntect the LCD to an windows computer and record the data with usbsnoop (http://benoit.papillaut.free.ft/usbsnoop). lsusb -v : code: Bus 002 Device 002: ID 0403:e588 Future Technology Devices International,= Ltd=20 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0=20 bDeviceProtocol 0=20 bMaxPacketSize0 8 idVendor 0x0403 Future Technology Devices International, Ltd idProduct 0xe588=20 bcdDevice 4.00 iManufacturer 1 Wallbraun-Elect. iProduct 2 LCD-USB-Interface V1 iSerial 3 WE3EFDQG bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0=20 bmAttributes 0xc0 Self Powered MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 2 LCD-USB-Interface V1 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Next i write this small c program: code: #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdio.h> #include <stdlib.h> #include <usb.h> #define USBLCD_VENDOR_ID 0x0403 #define USBLCD_PRODUCT_ID 0xe588 extern int usb_debug; static usb_dev_handle *lcd; static int interface; static char *Buffer; static char *BufPtr; int drv_UL_open(void) { struct usb_bus *busses, *bus; struct usb_device *dev; lcd =3D NULL; usb_debug =3D 0; usb_init(); usb_find_busses(); usb_find_devices(); busses =3D usb_get_busses(); for (bus =3D busses; bus; bus =3D bus->next) { for (dev =3D bus->devices; dev; dev =3D dev->next) { if ((dev->descriptor.idVendor =3D=3D USBLCD_VENDOR_ID) && (dev->descriptor.idProduct =3D=3D USBLCD_PRODUCT_ID)) { printf ("USB LCD gefunden\n"); lcd =3D usb_open(dev); if (usb_claim_interface(lcd, interface) < 0) { printf ("FEHLER : usb_claim_interface\n"); return -1; } else { printf ("usb_claim_interface erfolgreich\n"); =20 } } } } return -1; } int drv_UL_close(void) { usb_release_interface (lcd, interface); usb_close(lcd); printf (" LCD wieder freigegeben\n"); } int drv_CMD(void) { char *cmdBuf, *cmdPtr, *inBuf, *inPtr; int rv, i, inrv; inBuf =3D (char *) malloc(1024); if (inBuf =3D=3D NULL) { printf ("kann speicher nicht reservieren!\n"); return -1; } inrv =3D usb_bulk_read(lcd, 0x81, inBuf, 1000, 1000); printf ("Ergebnis von usb_bulk_read: %d\n", inrv); cmdBuf =3D (char *) malloc(1024); if (cmdBuf =3D=3D NULL) { printf ("Kann Speicher f=C31/4r cmd nicht reservieren!\n"); return -1; }=20 cmdPtr=3DcmdBuf; *cmdPtr++=3D0x04; *cmdPtr++=3D0x00; *cmdPtr++=3D0x03; *cmdPtr++=3D0x00; *cmdPtr++=3D0x00; *cmdPtr++=3D0x4c; rv=3Dusb_bulk_write (lcd, 0x02, cmdBuf, 6, 1000); printf ("ergebnis von usb_bulk_write2 %d\n", rv); cmdPtr=3DcmdBuf; *cmdPtr++=3D0x08; *cmdPtr++=3D0x03; *cmdPtr++=3D0xFD; *cmdPtr++=3D0x54; *cmdPtr++=3D0x68; *cmdPtr++=3D0x65; *cmdPtr++=3D0x6f; *cmdPtr++=3D0x20; *cmdPtr++=3D0x53; *cmdPtr++=3D0x63; *cmdPtr++=3D0x68; *cmdPtr++=3D0x6e; *cmdPtr++=3D0x65; *cmdPtr++=3D0x69; *cmdPtr++=3D0x64; *cmdPtr++=3D0x65; *cmdPtr++=3D0x72; for (i=3D1; i <=3D1007; ++i) { *cmdPtr++=3D0x20; } rv=3Dusb_bulk_write (lcd, 0x02, cmdBuf, 1024, 1000); printf ("ergebnis von usb_bulk_write3 %d\n", rv); inPtr=3DinBuf; for (i=3D1; i <=3D inrv; ++i) { printf ("Inhalt inBuf %x\n", *inPtr++); } free (inBuf); free (cmdBuf); } int main(int argc, char *argv[]) { drv_UL_open(); drv_CMD(); drv_UL_close(); return EXIT_SUCCESS; } All the program to is, write my name to the LCD. Take a look at // First DATA to LCD, the second and third byte are the lengt of data that follow, but dont know for what is 0x04 and 0x4f? // Second DATA to LCD First byte 0x08 ? Second and third byte =3D 0x03FD =3D lengt of the follow data rest is easy, my Name and some spaces. Anyone know for what is 0x04, 0x4f and 0x08? Hope you can read my english. mfg Theo |
From: Thomas S. <se...@gm...> - 2005-09-27 19:40:17
|
Hi, Is there anybody out there who has experiences with Lcd4linux and asterisk (http://www.asterisk.org/) or (www.asteriskathome.de <http://www.asteriskathome.de/> ). Are there any modules available for this great pbx? I want to use the lcd4linux programm and a SED1330 To Display the incoming calls, the numbers calling in, the status of the answering machines and the fax status. Thank you for any hints and comments. Greetings Thomas |