/* $Id$ * $URL$ * * driver for picoLCD displays from mini-box.com * * Copyright (C) 2005 Michael Reinelt * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team * * Copyright (C) 2007 Nicu Pavel, Mini-Box.com * * This file is part of LCD4Linux. * * LCD4Linux 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, or (at your option) * any later version. * * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * * exported fuctions: * * struct DRIVER drv_picoLCD * */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "debug.h" #include "cfg.h" #include "qprintf.h" #include "udelay.h" #include "plugin.h" #include "widget.h" #include "widget_text.h" #include "widget_icon.h" #include "widget_bar.h" #include "drv.h" #include "drv_generic_text.h" #include "drv_generic_gpio.h" #include "drv_generic_keypad.h" #define picoLCD_VENDOR 0x04d8 #define picoLCD_DEVICE 0x0002 static char Name[] = "picoLCD"; static unsigned int gpo = 0; static char *Buffer; static char *BufPtr; static usb_dev_handle *lcd; extern int usb_debug; /****************************************/ /*** hardware dependant functions ***/ /****************************************/ static int drv_pL_open(void) { struct usb_bus *busses, *bus; struct usb_device *dev; char driver[1024]; char product[1024]; char manufacturer[1024]; char serialnumber[1024]; int ret; lcd = NULL; info("%s: scanning for picoLCD...", Name); usb_debug = 0; usb_init(); usb_find_busses(); usb_find_devices(); busses = usb_get_busses(); for (bus = busses; bus; bus = bus->next) { for (dev = bus->devices; dev; dev = dev->next) { if ((dev->descriptor.idVendor == picoLCD_VENDOR) && (dev->descriptor.idProduct == picoLCD_DEVICE)) { info("%s: found picoLCD on bus %s device %s", Name, bus->dirname, dev->filename); lcd = usb_open(dev); ret = usb_get_driver_np(lcd, 0, driver, sizeof(driver)); if (ret == 0) { info("%s: interface 0 already claimed by '%s'", Name, driver); info("%s: attempting to detach driver...", Name); if (usb_detach_kernel_driver_np(lcd, 0) < 0) { error("%s: usb_d
<html><head>
<title>PNG Test</title>
</head>
<body>
<h1>PNG test</h1>
<img src=/cgi-bin/nph-png>
</body>
</html>
dget_register(&wc); /* register plugins */ AddFunction("LCD::contrast", -1, plugin_contrast); AddFunction("LCD::backlight", -1, plugin_backlight); AddFunction("LCD::gpo", -1, plugin_gpo); return 0; } /* close driver & display */ int drv_pL_quit(const int quiet) { info("%s: shutting down.", Name); drv_generic_text_quit(); /* clear display */ drv_pL_clear(); /* say goodbye... */ if (!quiet) { drv_generic_text_greet("goodbye!", NULL); } drv_pL_close(); if (Buffer) { free(Buffer); Buffer = NULL; BufPtr = Buffer; } return (0); } DRIVER drv_picoLCD = { .name = Name, .list = drv_pL_list, .init = drv_pL_init, .quit = drv_pL_quit, };