diff --git a/.gitignore b/.gitignore index 9d2896a..ec8967d 100644 --- a/.gitignore +++ b/.gitignore @@ -233,11 +233,3 @@ missing mkinstalldirs stamp-h1 tags - -*.a -*.o -*.so -.deps -*.debian -*.LSB -*.rpm diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 01d28ee..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Travis-CI file for Espruino - -language: c - -before_install: - - chmod +x ./autogen.sh - -script: - - ./autogen.sh && ./configure --enable-drivers=all - - make diff --git a/CREDITS.md b/CREDITS.md deleted file mode 100644 index 6134eba..0000000 --- a/CREDITS.md +++ /dev/null @@ -1,436 +0,0 @@ -# Introduction - -LCDproc wouldn't have been possible without the efforts and work of many -dedicated enthusiasts and dabblers who have contributed to its development -over the years. We acknowledge their contributions here. - -Please help us keeping this file up to date. If you're submitting a pull -request for the project, be sure to update this file to include yourself -if you're not already listed. Include a brief bio if you'd like, and be sure -to highlight the contributions you've made to the project. It's your -spotlight! - -If you're absent, misattributed or your name and/or contact information -is inaccurate, please let us know (or submit a pull request to fix it)! - -If you'd like to be removed from this file for some reason, please let us -know so we can take care of it. You're also welcome to list only your -name (or profile name) with no email address or other contact information -as well. We love putting our contributors' names up in lights, but we're -flexible :) - -# Contributors - -(listed in order of appearance) - -- [William Ferrell (willfe)](mailto:willfe@gmail.com) - - - Project founder, author of first versions and much documentation, design - for V0.4, "benevolent dictator for life" (to shamelessly borrow a page - from Linus Torvald's playbook). - - > It's willfe's fault that LCDproc exists. He wanted his computer to have a - heartbeat, like some HP workstations and servers do. So he found a nice LCD, - wrote some amazingly spiffy software for it, and life was good. - -- [Selene Scriven (ToyKeeper)](mailto:lcdproc@toykeeper.net) - - - Wrote V0.3 and most of V0.4, and helped procrastinate the rest - of the time... - - > ToyKeeper was the main programmer for LCDproc 0.2 - 0.4-pre9. She took - willfe's idea and put it in its current form. - -- Gareth Watts (Xeno42) - - - Patches, mailing list, ideas, web hosting, CVS, etc. - - -- [Matrix Orbital Corporation](http://www.matrixorbital.com/) - - - Free displays for many of the developers, and immeasurable help - (especially early on). - - -- [Crystalfontz America, Inc.](http://www.crystalfontz.com/) - - - Sends us sample/test units to get LCDproc running on all their models - - Rescued the lcdproc.org/com/net domains when their registrations - expired and they were "ransomed" by a domain squatter - - -- [Lorand Bruhacs](mailto:bruhacs@ip23.net) - - - Developed LCDproc v0.3.5, which added lots of nifty stuff while - keeping the old program model - - -- [Benjamin Tse](mailto:blt@Comports.com), [Matthias Prinke](mailto:m.prinke@trashcan.mcnet.de) - - - HD44780 driver and predecessors - - -- [Richard Rognlie](mailto:rrognlie@gamerz.net) - - - Work on HD44780 driver - - GIF driver (lost code) - - -- Tom Wheeley - - - IRMan input driver - - -- Bjoern Andersson - - - Autoconf/automake build system - - Curses driver - - -- [Andrew McMeikan](mailto:andrewm@engineer.com) - - - HD44780 driver - - -- David Glaude - - - Lirc driver (not the current version) - - IRMAN driver, - - lcdproc big clocK screen. - - Matrix Orbital enhancement: Big Number, general-purpose output, - dynamic custom char allocation, i2c support (lost) - - Crystal Fontz drivers - - Matrix orbital GLK driver - - -- Todd Porter - - - Windows 95/98 and NT version - - -- Jason Dale Woodward - - - widget scrolling - - -- Ethan Dicks - - - PIC-an-LCD original driver (later merged into HD44780 driver) - - fixes & tests to the MtxOrb driver and some clients - - lcdident.pl client - - -- Michael Reinelt - - - SED1520 (copied work of him) - - -- Simon Harrison - - - SVGAlib driver - - -- Horizon Technologies - - - WIRZ-SLI driver - - -- Charles Steinkuehler - - - Work on HD44780 timing code - - -- Harald Klein - - - Lirc driver (initial version of the current code) - - Metar Client - -- Philip Pokorny - - - Crystal Fontz driver - - Matrix Orbital driver - - Matrix Orbital GLK driver - - Curses driver - - -- Glen Gray - -- David Douthitt - - - Crystal Fontz driver - - Matrix Orbital driver - - Matrix Orbital GLK driver - - Curses driver - -- Eddie Sheldrake - - - Crystal Fontz driver - - -- Rene Wagner - - - LCDM001 driver - - ASCII emulation of BigNum - - CFontz v2.0 patches merging, - - LIRC driver updates (new API, merged David's code) - - Lots of driver updates for v0.4.3 (configfile, reporting): - - CFontz - - curses - - glk - - MtxOrb - - EPM list file for automatic package generation, - - current documentation in docbook format - - v0.4.3 backlight and heartbeat implementation - - Lots of other stuff for the v0.4.3 release - - -- Andre Breiler - - - Matrix Orbital driver - - -- Joris Robijn - - - HD44780 driver maintenance and enhancement - - Config file stuff - - Reporting stuff - - Work on API v0.5 architecture and implementation, loadable drivers. - - Menu stuff of v0.5 - - SED1330 driver - - -- Guillaume Filion - - - Portability bug fixes on the curses, HD44780, SED1520 and - STV5730 drivers. - - Partially implemented Thomas Runge's BSD port of lcdproc. - - Ported the parallel functions in port.h to BSD. - - Autoconf/automake stuff. - - Various small 0.4.3 changes. - - -- Chris Debenham - - - Matrix Orbital GLK driver - - LB216 driver - - -- Mark Haemmerling - - - HD44780 character conversion table - -- Robin Adams - - - SED1520 driver - - STV5730 driver - - -- Manuel Stahl - - - T6963 driver - - -- Mike Patnode - - - Crystal Fontz - - Various 0.4.3 changes - - -- Peter Marschall - - - new drivers: IOWarrior, xosdlib - - bwctusb connectiontype for the HD44780 driver - - extensions to CFontz* drivers: support CF631 & CF635 - - various fixes in preparation of 0.5 - - lcd2usb connectiontype for the HD44780 driver - - -- Markus Dolze - - - project maintainer - - various fixes (especially for *BSD) - - merged and extended network interface statistics to lcdproc client - - new LCDd network input buffering - - -- Volker Boerchers - - - fixes and extensions to the menu system - -- Lucian Muresan - - - glcdlib meta driver - -- Matteo Pillon - - - lcdserializer connectiontype to the hd44780 driver - - various improvements to the serial connections of the hd44780 driver - - -- Laurent Arnal - - - connectiontype for LIS2 displays from VLSystem - (http://www.vlsys.co.kr) - - -- Simon Funke - - - driver for Noritake VFD - - -- Matthias Goebl - - - I2C connectiontype for the HD44780 driver - - -- Stefan Herdler - - - serialVFD driver - - bignum library - - -- Bernhard Walle - - - driver for the ULA-200 device from ELV (http://www.elv.de) - - -- Andrew Foss - - - menu support for lcdproc client - - -- Anthony J. Mirabella - - - Logitech g15 driver - - -- Cedric Tessier - - - EyeBoxOne driver - - -- John Sanders - - - iMon driver graphics support - - -- Eric Pooch - - - Mac OS X / Darwin support - - serialPOS driver - - uss720 connection type for hd44780 driver - - driver for SoundGraph iMON OEM LCD Modules - - -- Benjamin Wiedmann - - - Added functionality for HITACHI SP14Q002 gLCD (320x240) - - Implemented dynamic wiring scheme selection for SED1330 driver - ("ConnectionType") - - -- Frank Jepsen - - - vdr-wakeup support in hd44780 driver (originally for v0.4.5) - - new options for the hd44780 driver - -- Karsten Festag - - - ea65 driver - - -- Gatewood Green - - - picolcd driver - - -- Dave Platt - - - overhauled CwLnx driver - - -- Nicu Pavel - - - overhauled & extended picolcd driver - - -- Daryl Fonseca-Holt - - - lis driver - - -- Thien Vu - - - shuttleVFD driver - - -- Thomas Jarosch - - - support reporting in hd44780's ConnectionType functions - - build-system clean up: use pkg-config for some libs - - HD44780 connection type for a USB connection via a FTDI FT2232D chip - - i2500vfd driver - - -- Christian Jodar - - - mx5000 driver - - -- Mariusz Bialonczyk - - - ethlcd connection type for HD44780 - - -- Jack Cleaver - - - LIRC support in picolcd - - -- Aron Parsons (Phant0m) - - -IRtrans driver - - -- Malte Poeggel - - - support for ST7036 controller in hd44780 - - -- Dean Harding, Christian Leuschen, Jonathan Kyler - - - driver for SoundGraph iMON OEM LCD Modules - - -- Laurent Latil - - - SureElec driver for devices made by SURE Electronics - - -- Christoph Rasim - - - MDM166A driver for Futaba/Targa USB VFD - - -- bjo81 - - - Driver for lcm162-module (by H. Rasch) - (https://github.com/lcdproc/lcdproc/pull/6) - - -- [Harald Geyer](mailto:harald@ccbib.org) - - - Driver for the linux input subsystem - - Driver and font for Olimex MOD-LCD1x9 14 segment display - - Various minor and not-so-minor cleanups and fixes - - -- M. Feser and R. Geigenberger - - - Driver for YARD2 display devices - - -- Colin Munro (colinmunro) -- Shane Spencer (hardwire) -- Jim McCracken (merlin_jim) -- Luis Llorente (luisllo) diff --git a/ChangeLog.md b/ChangeLog.md deleted file mode 100644 index a20c80c..0000000 --- a/ChangeLog.md +++ /dev/null @@ -1,516 +0,0 @@ -v0.5dev (ongoing development) - - [added] Add travis file for Auto build testing of lcdproc (https://github.com/lcdproc/lcdproc/pull/2) - - [fixed] Update hd44780-i2c driver, pins defined via config file, rather than hardcoded (https://github.com/lcdproc/lcdproc/pull/1) - - [fixed] Portability fixes (https://github.com/lcdproc/lcdproc/pull/4) - - [added] Add driver for lcm162-module (by H. Rasch) (https://github.com/lcdproc/lcdproc/pull/6) - - [added] New driver linux_input (https://github.com/lcdproc/lcdproc/pull/7) - - [fixed] Cleanup I2C handling (https://github.com/lcdproc/lcdproc/pull/8) - - [fixed] Add more patterns to .gitignore (https://github.com/lcdproc/lcdproc/pull/9) - - [added] New driver for Olimex MOD-LCD1x9 - - [fixed] Allow multibyte characters (from string widget) - - [added] New driver for YARD2 devices (https://github.com/lcdproc/lcdproc/pull/19) - -v0.5.7 - - [fixed] Fix using the left key to change the ring and checkbox menu items - - [fixed] sed1520: Add an option for inverted segment mapping (idea by R. Buchert) - - [fixed] Fix build if compiled with --enable-permissive-menu-goto (#3599609) - - [fixed] glcd driver: Add direct support for framebuffer with paged memory layout - - [added] hd44780: Added 'raspberrypi' connection type (P. Corner) - - [fixed] Build system: Rename configure.in to configure.ac - - [added] hd44780: Add support for FreeBSD's iic I2C framework - - [added] hd44780: New connection type 'piplate' (J. Brogdon) - - [fixed] lcdproc client: Add option to turn off title on OldTime screen - - [added] glcd driver: Connection type 'x11' that draws to a X window (S. Meharg) - - [added] glcd driver: 'picolcdgfx' for picoLCD 256x64 from Mini-Box.com (S. Meharg) - - [fixed] picolcd: Improvements to IR processing (M. Jones) - - [added] hd44780: Added 'spi' connection type (S. Dawson) - - [fixed] hd55780/serial: Change data escape handling (G. Smith) - - [added] hd44780: New connection type 'pifacecad' (T. Preston) - - [added] new driver: rawserial - dump framebuffer to serial port (C. Wolf) - -v0.5.6 - - [removed] Remove deprecated CFontz633 driver. Use CFontzPacket with Model=633 instead! - - [added] new driver: glcd unified graphic display driver (M. Dolze) - - [added] new driver: vlsys_m428 driver for Moneual MonCaso 320 (W. Hauck) - - [fixed] hd44780/serial: Fix handling of keys for LoS-Panel (M. Kirchner) - - [fixed] hd44780/serial: Change backlight handling (see commit message) - - [added] glcd driver: Add FreeType 2 rendering support (B. Walle and M. Dolze) - - [added] glcd driver: New connection type 'png', writes framebuffer as PNG image - - [added] hd44780: Fix vBars and block icon not working correctly on the same screen - - [fixed] Build system: Link LCDd itself with pthread library if available - - [fixed] lcdproc client: Unbreak build on OpenBSD non-i386 (E. Barrett) - - [fixed] lcdproc client: Fix core dumps on FreeBSD if started as non-root - - [added] glcd driver: new connection type 'serdisplib' - - [added] glcd driver: new connection type 'glcd2usb' - - [fixed] lcdproc client: On FreeBSD show only unique processes in 'S' screen - - [fixed] picolcd: Use libusb-1.0 asynchronous transfers to fix missed keys (M. Jones) - - [fixed] sed1520: Make it work without using an external inverter - - [fixed] lis driver: Make the last pixel row work (add lastline option parsing) - - [fixed] hd44780/ftdi: Fix error in setting backlight and add backlight for 4bit mode - - [added] new driver: sdeclcd for Watchguard FireBox appliances (F. Mertz) - - [added] hd44780: Added 'usb4all' connection type (T. Mohaupt) - - [fixed] Fix RPM init script hanging on recent OS (#3488223) - - [fixed] lcdproc client: Fix build on OpenBSD >= 5.0 - - [fixed] hd44780/serial: Add support for adjustable backlight - - [fixed] Build system: Fix build with automake >= 1.11.3 (#3494755) - - [fixed] Fix clang compiler warnings about obsolete GNU designated initializers - - [fixed] Fix crash when adding a menu item without text and options (S. Dawson) - -v0.5.5 - - [added] sed1330 driver: Add support for HG25504 (L. Lagendijk) - - [fixed] Build system: Fix xosd detection - - [fixed] Reset ccmode on screen clear for NoritakeVFD, tyan driver - - [fixed] All drivers: Refactor CGmode enum into lcd.h - - [fixed] hd44780: New (possible faster) screen update algorithm - - [added] Add an option to start LCDd with screen rotation disabled (M. Zanetti) - - [fixed] Rewrite of the t6963 driver fixing several problems (see commit note). - - [fixed] picolcd: Add OffBrightness (S. Crane), more icons and fix bignum - - [fixed] lcdproc: Fix a single dot appearing on line 5 of the D screen - - [fixed] lcdproc: Make the iface screen more readable on 2x16 displays - - [fixed] All drivers: sync functions with prototypes - - [fixed] Port remaining drivers to 0.5 API (glk, lcdm001, stv5730) - - [fixed] Pyramid: Only send LED state changes, doxygen-ize - - [fixed] sed1520: Make it work with 68-family style interface, convert to 0.5 API - - [fixed] hd44780/imon: Add charmap for NEC uPD16314 and make it configurable - - [fixed] Pyramid: Convert set_char to 8 byte bitmap, add support for bignum - - [fixed] Convert set_char of drivers bayrad, lb216, lcterm, mtc_s16209x, wirz-sli - - [fixed] CFontzPacket: Fix not using select() even if its available - - [fixed] CFontzPacket: Use cellwidth = 5 on CFA-631 and CFA-635 too - - [fixed] t6963: Convert font to 8 byte bitmap - - [fixed] convert i2500vfd and mdm166a driver to use 8 byte bitmap custom character - - [fixed] ula200: convert custom characters to 8 byte bitmap - - [fixed] Build system: Fix trying to install svga driver twice - - [added] imon: Add bignum support (Y. Scheglyuk) - - [fixed] hd44780/ethlcd: fix LCDd hang up on network error (exits now) (M. Bialonczyk) - - [added] New common 5x8 font for t6963, sed1520, mdm166a and i2500vfd - - [fixed] t6963: Size has now to be configured in pixels instead of characters - - [added] Build system: --enable-extra-charmaps option adds language specific charmaps - - [fixed] imonlcd: Fix spinning of disc icon (E. Pooch) - - [fixed] SureElec: Change port initialization (SF 3212891) - - [fixed] curses: Fix missed keystrokes (from Debian) - - [fixed] curses: Correct the name of the info function. - - [fixed] Update LCDd.conf to be better understood by Config::Model (D. Dumont) - - [fixed] CFontz: Fix display of bars - -v0.5.4 - - [fixed] Update driver includes and LDFLAGS (fixed glk and bayrad binding error) - - [fixed] Modify all drivers to use server/drivers/report.h instead of shared/report.h - - [fixed] Make all drivers using parallel port fail if they cannot get IO permission - - [fixed] Include instead of everywhere (found by S. Klauer) - - [fixed] configure: Fix de-selecting of drivers - - [fixed] Build system: Add a check testing if SA_RESTART flag is available. - - [fixed] picolcd driver: Fix RC-5 for picoLCD 20x2 (A. van Schie) - - [fixed] Introduce shared/defines.h to collect commonly used macros - - [added] new driver: SureElec for devices made by SURE Electronics (Laurent Latil) - - [fixed] hd44780-4bit: Fix bug not checking for keypad rows 7-10 correctly - - [fixed] Modify serial drivers to use cfmakeraw - - [added] hd44780: Add a 'none' charmap which does not replace any character - - [fixed] hd44780: Change mapping for spanish 'n with tilde' characters - - [fixed] hd44780: Exclude pin for switchable backlight from keypad scanning - - [fixed] server core: New network input buffering - - [fixed] hd44780: Extended subdriver API and performance improvement for lcd2usb - - [fixed] hd44780: Add KOI8-R character mapping (Yura Scheglyuk) - - [fixed] shuttleVFD: Add support for devices with USB VID 0x1308 again - - [fixed] CFontzPacket: Add CFA-533. Use HD44780 character mapping for CFA533/633. - - [fixed] CFontzPacket: Report cell size correctly, use block character for icon. - - [fixed] CFontz633: Deprecate this driver. Use CFontzPacket with Model=633 instead! - - [removed] Remove native win32 support. - - [fixed] picolcd: Use module output function to control key LEDs (Martin Jones) - - [added] hd44780: Added 'usbtiny' connection type (Siarhei Herasimchuk) - - [fixed] SureElec: Fix stall on startup - - [added] new driver: MDM166A for Futaba/Targa USB VFD (Christoph Rasim) - - [fixed] picolcd: Fix backlight and contrast handling (M. T. Jones) - - [fixed] picolcd: Fix heartbeat icon messing up with vbar - - [fixed] imonlcd: Fix possible lockup in output (icons) function (E. Pooch) - - [fixed] pyramid: Fix buffer overflow in set_leds, incorrect escaping, and icons - -v0.5.3 - - [added] lcdexec: notification when called program finishes - - [added] xosd driver: offset from top-left corner - - [added] LCDd: Hello= config option for startup message - - [fixed] glk driver: bignum support fixed - - [fixed] update local snprintf to the last one, which is GPL - - [removed] server core: cleanup - remove unnecessary cruft - - [fixed] server core: refactor rendering code - - [added] LCDd: config options TitleSpeed= and Heartbeat= - - [fixed] overhauled CwLnx driver (Dave Platt) - - [fixed] overhauled picolcd driver (Nicu Pavel) - - [added] add ServerScreen=blank option value - - [fixed] MtxOrb driver: fix VFD/VKD support (Ethan Dicks) - - [added] new driver lis for VLSystem L.I.S VFD (Daryl Fonseca-Holt) - - [fixed] serialPOS driver: input support, cleanup (Eric Pooch) - - [added] new driver shuttleVFD for USB-based Shuttle VFDs (Thien Vu) - - [fixed] enable building lcdproc client on FreeBSD AMD64 platform (M. Dolze) - - [fixed] Autoconf fixes for Net/FreeBSD (M. Dolze) - - [fixed] fixes for the lcpdroc client iface screen on *BSD (M.Dolze) - - [added] key support for hd44780/lcd2usb (M. Dolze) - - [added] option Priority for NoritakeVFD (idea: Richard Muratti) - - [fixed] overhauled NoritakeVFD driver (idea: Richard Muratti) - - [fixed] allow wrapping slider menu items with <= 4 keys (M. Dolze) - - [fixed] a bit more Doxygen-ation and documentation - - [fixed] hd44780 driver: make ConnectionType 4bit more fool-proof (M. Dolze) - - [fixed] picolcd driver: overhaul USB init for more portability (M. Dolze) - - [added] curses driver: new option DrawBorder (Bruno Schwander) - - [fixed] avoid sending duplicate "success" messages in response to menu_add_item - - [added] lcdexec: parameter support using widgets - - [fixed] server core: display values in menu for all input MenuEntry types - - [fixed] hd44780 driver: reorganize ConnectionType recognition - - [added] hd44780 driver: new ConnectionType mplay - - [added] hd44780 driver: get/set contrast & brightness support for lcd2usb (M. Dolze) - - [added] hd44780 driver: reporting in ConnectionType functions (Thomas Jarosch) - - [fixed] clean up build system (T. Jarosch, with tests/fixes by M. Dolze) - - [added] hd44780 driver: new ConnectionType ftdi (Thomas Jarosch) - - [fixed] shuttleVFD driver: fix VendorID, support newer models (Miska Sulander) - - [added] i2500vfd driver for a graphical Noritake VFD (Thomas Jarosch) - - [fixed] hd44780 driver: more complete initialization (idea by Pierre Ossman) - - [fixed] hd44780 driver: "euro" character mapping table (Markus Dolze) - - [fixed] CwLnx driver: support for CW12832 - - [added] new driver mx5000 for Logitech MX5000 keyboards (Christian Jodar) - - [fixed] update debian init scripts to allow multiple instances of clients - - [added] serialVFD driver: support for 4 more display types (Stefan Herdler) - - [fixed] IOWarrior driver: fixed 4-line display use - - [added] IOWarrior driver: add ExtendedMode option - - [fixed] lcdproc: unbreak compilation on OS X 1.5 and higher (Topher Fangio) - - [fixed] server: fix interpretation of numeric priorities (Andrew M. Bishop) - - [added] hd44780 driver: new ConnectionType ethlcd (Mariusz Bialonczyk) - - [added] picolcd driver: support to send IR commands to LIRC (Jack Cleaver) - - [added] picolcd driver: support for 20x4 picoLCDs (Nicu Pavel) - - [added] hd44780 driver: new ConnectionType uss720 (Eric Pooch) - - [fixed] new make targets to compile & install server & clients separately - - [fixed] autoconf fixes: check for pkg-config macros - - [added] new driver irtrans (Phant0m / Aron Parsons) - - [added] serialVFD driver: support Siemens/Wincor Nixdorf BA63/66 (Stefan Herdler) - - [added] new client lcdident.pl (Ethan Dicks) - - [fixed] server: prevent stalling if time goes backwards (M. Vallevand) - - [fixed] hd44780 driver: update the backlight setting only on change - - [added] hd44780 driver: add lineaddress option to support ST7036 (Malte Poeggel) - - [added] lcdproc: Retrieve per CPU usage statistics on FreeBSD (M. Dolze) - - [fixed] Change drivers to start in background by default: bayrad, CFontz, ea65, glk - - [fixed] imon driver: Change hbars to make last char in-/decrease vertically - - [added] hd44780 driver: port usblcd connection type from 0.4.5 to 0.5 (M. Dolze) - - [fixed] server: Fix interpretation of named screen priorities - - [added] new driver imonlcd for SoundGraph iMON LCD (Dean Harding, Jonathan Kyler) - - [fixed] MtxOrb driver: Fix backlight for old firmware - - [fixed] Add checks for null pointer / failed malloc to menu code - - [fixed] lcdproc, lcdexec, lcdvc clients: Use our included getopt.h - - [fixed] documentation: Fix XML errors in user and developer guide - - [added] documentation: Add man page for lcdvc - -v.0.5.2 - - [fixed] fix switching on/off the Load screen in lcdproc client using the menu - - [fixed] refactor adv_bignum: support height > 4, loadable chars with offset - - [fixed] ged rid of global variables buffer & tmp in lcdproc client - - [added] add init-script templates for LSB 3.x conforming systems - - [fixed] fix cellwidth in iMon driver - - [added] graphics character support in iMon driver (John Saunders) - - [fixed] try harder to find a shell in lcdexec - - [added] big number support in CwLnx driver via bignum library - - [fixed] do not copy more bytes than reserved in get_fs() in lcdproc's machine_*.c - - [fixed] update lcdproc's About screen with credits - - [fixed] fixes to ula200 build environment and documentation (B. Walle) - - [fixed] update g15 driver to be compatible with g15daemon > 1.2 (Anthony J. Mirabella) - - [fixed] allow compiling with LDFLAG "--as-needed" (Robert Buchholz) - - [fixed] optimize MtxOrb flush() - - [fixed] make MtxOrb use Brightness and OffBrightness like CFontzPacket - - [fixed] make Brightness & OffBrightness run-time configurable in CFontz & MtxOrb - - [fixed] add support for Iface and ProcSize screens for OS X / Darwin (Eric Pooch) - - [fixed] update & fix serialVFD driver (Stefan Herdler) - - [added] Hitachi SP14Q002 support & ConnectionType setting for sed1330 (Benjamin Wiedmann) - - [fixed] replace obsolete index() by strchr() (Guillaume LECERF) - - [fixed] fixes for CwLinux driver (Gideon Tsang) - - [added] new ConnectionType vdr-wakeup in hd44780 driver (originally Frank Jepsen) - - [fixed] fixes for the hd44780-serial drivers (Matteo Pillon) - - [added] new options for the hd44780 driver (Frank Jepsen) - - [added] new driver for text based serial Point of Sale displays (Eric Pooch) - - [added] new 2-line bignum mode using 6 user defined characters (Robin Gilks) - - [fixed] fix custom characters [with NewFirmware=yes] & backlight in CFontz - - [added] ea65 - driver for VFD in AOpen XC Cube AV EA65 barebones (Karsten Festag) - - [added] picolcd - driver for Mini-box.com USB LCD picoLCD (Gatewood Green) - - [added] new ConnectionType pertelian in hd44780 driver (Matteo Pillon) - - [added] new ConnectionType lcd2usb in hd44780 driver - - [added] make LCDd's GoodBye message configurable - - [removed] remove compile-time option to read configuration from LDAP - -v.0.5.1 - - [added] config file support in lcdproc client (Andrew Foss) - - [fixed] install server & client config files in $(sysconfdir) - - [added] new client lcdvc: virtual console on LCD - - [fixed] convert adv_bignum library to bitwise set_char() - - [fixed] adapt drivers to modified bignum library: - - [added] CFontz - - [added] CFontz633 - - [added] CFontzPacket - - [added] hd44780 - - [added] IOWarrior - - [added] MtxOrb - - [added] serialVFD - - [added] tyan - - [added] add iface screen(s) to lcdproc client (Andrew Foss/Markus Dolze) - - [fixed] update sample Perl clients - - [fixed] fix LCDd crash on shutdown of clients using "menu_set_main" (Andrew Foss) - - [fixed] fix sock_connect() to allow 0 as legal socket (Frederick Nacino) - - [fixed] improve serialVFD driver (Stefan Herdler) - - [added] add MD8800 driver for LCDs in Medion MD8800 PCs (Stefan Herdler/Martin Møller) - - [fixed] make bigclock client screen more flexible: centered, require only 14 chars - - [fixed] correct axis mapping logic for joystick driver (Jannis Achstetter) - - [fixed] fixes to the CFontz driver - - [added] new unified serial sub-driver for hd44780 (Matteo Pillon) - - [removed] obsolete hd44780 subdrivers-removed: lcdserializer, picanlcd - - [fixed] character mapping for special HD44780 modules (Matteo Pillon) - - [added] g15 - driver for LCD in Logitech G15 gaming keyboards (Anthony J. Mirabella) - - [added] EyeboxOne - driver for the LCD display on the EyeboxOne (Cedric TESSIER) - - [fixed] more flexible parsing of config files: allow spaces around sections and keys - - [fixed] updated & extended documentation - - [fixed] command line options more synchronizd between server and clients - - [fixed] CFontzPacket & CFontz633 support big & little endian systems - - [fixed] MtxOrb driver completely rewritten to support used-defined characters - - [fixed] CwLnx driver completely rewritten to support Cw1602 LCDs in addition - to the CW12232 LCDs - - [fixed] more options in lcdproc's config file lcdproc.conf: - - [added] time and date formats can be changed using strftime formats - - [added] Load screen's LowLoad & HighLoad thresholds - - [fixed] revamped lcdexec's menu configuration - - [fixed] various little fixes - -v0.5.0 -This version has split off from unstable-0.4.3. Includes major changes. - - [added] LCDd now does dynamic loading of driver modules - - [fixed] New API in use - - [added] LCDd will use fill-in functions for drivers that don't support a certain - function. Available for: vbar, hbar, bignum, heartbeat, icon, cursor. - - [fixed] Server internal functions cleaned up, moved to other files etc. - - [fixed] Menu system rewritten - - [added] Client-supplied menus are now supported - - [fixed] Key support improved: now keys have descriptive names, not just a letter - anymore. - - [added] Reloading of configuration and drivers by sending a SIGHUP. Probably - needs improvement ;) - - [fixed] HD44780 output register support on winamp wiring - - [fixed] Reporting levels are now used more consistently - - [added] lcdexec client added - - [fixed] Display update frequency is now exactly 8Hz. Key scan frequency increased - to 32Hz. - - [fixed] Priority scheme changed. Priority classes are now used, that indicate what - kind of a screen we're dealing with. More useful for interactive clients. - - [added] better support for operating systems other than Linux: *BSD, Darwin - - [added] menu support for lcdproc client (configure option) - - [added] Added CFontz633 driver for CrytalFontz CFA633 - - [added] Added CFontzPacket driver fro CrystalFontz CFA-633, CFA-631, CFA-635 - - [added] Added glcdlib meta-driver for all LCDs supported by graphlcd-base - - [added] Added icp_a106 driver for A106 alarm/LCD boards in 19" racks by ICP - - [added] Added imon driver for iMON IR/VFD Modules from Silverstone, Uneed, ... - - [added] Added IOWarrior driver for IOWarrior USB controllers - - [added] Added lcterm driver for serial LCD terminal from Neumark Elektronik - - [added] Added ms6931 driver for MSI-6931 displays in 1U rack servers by MSI - - [added] Added mtc_s16209x driver for MTC-S16209x by Microtips Technology Inc - - [added] Added NoritakeVFD driver for Noritake VFD Device CU20045SCPB-T28A - - [added] Added pyramid driver for Pyramid LC-Displays - - [added] Added serialVFD driver for NEC FIPC8367 based serial VFDs - - [added] Added tyan driver for LCDs in Tyan Barebone GS series - - [added] Added ula200 driver for the USB board ULA-200 from ELV - - [added] Added xosd driver for On Screen Display on X - - [added] Added HD44780 subdriver bwctusb for USB-to-LCD converters from BWCT - - [added] Added HD44780 subdriver lcdserializer for an serial-LCD converter - - [added] Added HD44780 subdriver i2c to conned LCDs using the I2C bus - - [added] Added HD44780 subdriver lis2 for the LIS2 serial-to-USB converter - -v0.4.3 - - [removed] Removed possibility of passing arguments to the drivers from the - command line, which can be done in the configuration file now - - [added] Added configuration file support - - [added] Added ability of dropping root privileges to LCDd - - [added] Added LCDM001 driver (kernelconcepts.de) - - [added] Added Toshiba T6963 driver - - [added] Added Seiko-Epson SED 1520 driver - - [added] Added Seiko-Epson SED 1330 driver - - [added] Added STV5730 driver composite TV signal character generation driver - - [fixed] Modified the CFontz driver so that the new ROM version is - supported - - [added] Added ASCII emulation of BigNum to the drivers that did not - support custom characters - - [added] Added ability of configuring (rearranging) the keypad of MtxOrb - displays - - [added] Added .lircrc location to the options of the lirc driver - - [fixed] Fixed backlight code (partly rewritten) - - [fixed] Fixed heartbeat code (completely rewritten analogous to - the backlight code) - - [added] Added init scripts for debian and Redhat/Mandrake - - [added] Added EPM list file so that you can use EPM - (http://www.easysw.com/epm) to generate packages of LCDproc - - [added] Added documentation in docbook format - (LCDproc User's Guide - docs/lcdproc-user) - - [fixed] Ported some screens of lcdproc to *BSD. - - [fixed] Ported the parallel port functions in port.h to *BSD. - -v0.4.2: - - [removed] Removed multiple output driver support - to simplify life - - [fixed] Removed use of sprintf() (in favor of snprintf) for security - - [added] Added ability to use defined port and address to listen on - (for security) - now defaults to 127.0.0.1 - - [added] Revamped curses driver: now supports color; has border; and - can be (with recompile) placed anywhere on screen it fits - - [added] Added --waittime server argument. You can now specify how long - a screen should stay on the display. The default is 64 ticks or - 8 seconds. - - [added] Fixed compile problems on non-Linux platforms where cfmakeraw, - CBAUD, and ioperm don't exist. All drivers now use the same code - to initialize a serial port. - -v0.4.1: - - [added] Changed protocol to 0.3 because we now accept both -foo and foo - as argument introducers. in 0.4-pre10, these were changed - from foo to -foo and this broke many clients. This change - should fix that and be backward/forward compatible. - - [added] Added a noop function to the protocol. This is useful for writing - shell script clients of LCDproc. - - [added] Changed the shared sock_send_string function to NOT send the - ending NUL ('\0') byte with the string. This was confusing - in Perl clients which saw NUL's as the first character of - each reply. WARNING: The LCDPROC client depended on this - behavior, your client may too. Use the newline instead. - See the code in clients/lcdproc/main.c (look for "switch(buf[i])") - to see one way to handle this. This should allow new clients - to connect to old servers and vice-versa. - - [added] Messed with include structure in .c files. It should no longer - be necessary to specify ../.. to get to shared code headers. - Also, since we are using automake, the global config.h can be - found with just #include "config.h" as it's location is included - in a -I to the compilers. As a result "make distcheck" now works. - - [added] Added support for client_add_key and friends. Clients MUST now - request keys to get notified. Keys are NO LONGER broadcast to all - clients. Keys are now tied to a SCREEN and CLIENT. There are new - commands (screen_add_key, screen_del_key) to bind keys to a - screen. If the current screen has requested the key just pressed, - the client gets the key and no other client gets it. If the current - screen has not requested the current key, then the key is broadcast - to all clients who requested that key with client_add_key. Clients - might want to request a "hotkey" with client_add_key so they will - be notified of that key no matter what screen is currently on the - display, and then request whatever other keys a screen uses with - screen_add_key. - - [added] Added driver for Matrix Orbital GLK12232-25 graphical display. - Display is run in text mode since there isn't enough information in - the widgets. If we knew the max width/height of an hbar/vbar, we - could use graphical vbar/hbar's. Oh well. BigNums' look really - cool though. You'll need some additional characters in the "Small Font" - font (and the BigNumbers font) for this to work. - - [added] Rewrote Big Number Clock function in chrono.c. Many problems with - it have been fixed. It now uses number value 10 to display a colon - in between the digits. Don't know what this will do on a the MtxOrb - driver. GLK driver draws a colon. - - [added] Cleaned up the CPU GRAPH (G) function in cpu.c and made get_load take - a 'struct load' from the caller to save the last time values. This - allows two callers (CPU GRAPH and CPU LOAD) to call get_load and - both get reaosonable values. Without this, CPU GRAPH was always - getting 0 because it was called immediatly after CPU LOAD called - get_load and no clock ticks had gone by. - - [added] Changed --enable-debug autoconf option to be processed correctly. - Debug now turns on -g and turns off -O6 - - [added] Lots of other little fixes. - -v0.4-pre10: - - [added] Metar client added (Weather information) - - [added] Linux infrared control (LIRC) driver added. - - [added] "rotating slash" heartbeat mode (looks weird on CFontz displays) - Use "screen_set s -heartbeat slash" to use this. - - [fixed] Switched to client-server protocol V0.2, so arguments can come in - any order, and require a "-" on the front. Instead of - "widget_set s w 1 2 foo", use "widget_set s w -x 1 -y 2 -text foo". - - [fixed] Server info screen no longer enabled by default. - - [fixed] Merged Andrew McMeikan's HD44780 driver changes - - [removed] Removed WHATSNEW - - [added] Added ChangeLog (okay, fine, I renamed WHATSNEW and typed a few - entries into it :) - -V0.4-pre9: - - [fixed] small fixes for irix - - [fixed] Added flag in LCDd to shut off server screen: - "-i off" or "--serverinfo off" - - [added] Wirz SLI driver - - [added] 16x2 support (server only) - - [added] MtxOrb generic output support in driver - - [fixed] Misc libc5 fixes - - [added] support for arbitrary display sizes; anything 16-80 characters - wide, and 2-25 characters tall. (doesn't work if you try to use - a display size bigger than your LCD.. :) - - [fixed] curses driver looks slightly better (titles) - - [fixed] sizes > 20x4 no longer crash - -V0.4-pre8: - - [fixed] LCDd gives more updated info in the connect string: - cell size, lcd dimensions. - - [fixed] bargraphs are now the correct length on CFontz displays, in the main - lcdproc client. For other clients, please parse the connect string! - - [fixed] MtxOrb driver supports simultaneous vbars/hbars now, with a - mechanism to automatically use custom characters for as many - as possible. - - [added] 20x2 support in LCDd! Use "--type 20x2". - (LCDd --type 20x2 -d MtxOrb ) - - [fixed] LCDd can change backlight brightness instead of shutting it "off" - - [fixed] HD44780 should work again (LCDd forks earlier now.. oops :) - - [added] 20x2 support in lcdproc client for the following screens: - C G T M X D B S U A - Support will not be added for K and O screens. - - [added] BSD support (?) - - [fixed] 20x4 screens should display correctly on 40x4 displays - -V0.4-pre7: new driver - - [added] CrystalFontz (CFontz) LCD driver added - - [fixed] Backlight control improved - - [added] Brightness control added - -V0.4-pre6: - - [added] Backlight control added. Modes so far are "on", "off", and "open". - Client commands are "on", "off", "toggle", "blink", and "flash". - - [fixed] Main clients' screen titles now include hostname - - [added] New sample client: fortune.pl - - [fixed] Added changes from David Glaude: - - [added] IRman support - - [added] Big Digit support (MtxOrb driver doesn't display it correctly yet) - - [added] Big cloc[K] screen - - [fixed] MtxOrb serial speed is configurable with "--speed" - - [fixed] misc bugfixes - - [added] ... more - -V0.4-pre5: - - [fixed] Fixed bug which could take server down with a dead client - - [fixed] Fixed small scroller bug - - [added] Added "frame" widgets.. use "-in " after widget_add - to put something in a frame. - - [added] The disk screen is back! - - [removed] Frame rendering isn't finished.. the renderer probably needs a - complete rewrite. Any volunteers? :) - -V0.4-pre4: - - [added] Server menus (fairly small so far) - - [added] Ability to shut down, reboot, change some options, etc (menu only) - - [fixed] Driver arguments no longer required - - [fixed] Curses driver doesn't start server in background any more... - - [fixed] Argument handling fixed... - - [fixed] Drivers support "--help" for command-line info - -V0.4-pre3: - - [added] Scroller widgets - - [fixed] Proper errno messages... - - [fixed] "make install" should work now - - [fixed] Joystick driver allows key remapping - - [added] Screen "durations" are actually *used* now. (oops) - - [added] Initial support for screen priorities (strict priority queue) - - [fixed] Misc (but annoying!) bugs fixed, which hadn't yet affected anything - - [added] Drivers support parameters now (MtxOrb, joy, at least) - -V0.4-pre2: - - [fixed] Memory leaks fixed - - [added] Memory "top" screen (S) - - [added] Titles now autoscroll - - [fix] Fixed small screen-visibility bug (clients weren't always - notified of screen cycles) - - [added] Heartbeat modes implemented. Clients can remove it with - widget_del my_screen heartbeat - or turn it back on with - widget_add my_screen heartbeat " " - Note that the client only has control over this when the heartbeat - is in "open" mode. (currently, it always is) - -V0.4-pre1: - * Too much to mention... diff --git a/LCDd.conf b/LCDd.conf index 990b855..f0ac69b 100644 --- a/LCDd.conf +++ b/LCDd.conf @@ -46,11 +46,10 @@ DriverPath=server/drivers/ # The following drivers are supported: # bayrad, CFontz, CFontzPacket, curses, CwLnx, ea65, EyeboxOne, g15, glcd, # glcdlib, glk, hd44780, icp_a106, imon, imonlcd,, IOWarrior, irman, joy, -# lb216, lcdm001, lcterm, linux_input, lirc, lis, MD8800, mdm166a, ms6931, -# mtc_s16209x, MtxOrb, mx5000, NoritakeVFD, Olimex_MOD_LCD1x9, picolcd, -# pyramid, rawserial, sdeclcd, sed1330, sed1520, serialPOS, serialVFD, -# shuttleVFD, sli, stv5730, svga, t6963, text, tyan, ula200, vlsys_m428, -# xosd, yard2LCD +# lb216, lcdm001, lcterm, lirc, lis, MD8800,, mdm166a, ms6931, mtc_s16209x, +# MtxOrb, mx5000, NoritakeVFD, picolcd,, pyramid, rawserial, sdeclcd, +# sed1330, sed1520, serialPOS, serialVFD, shuttleVFD, sli,, stv5730, svga, +# t6963, text, tyan, ula200, vlsys_m428, xosd Driver=curses # Tells the driver to bind to the given interface. [default: 127.0.0.1] @@ -798,21 +797,6 @@ Device=/dev/ttyS1 Size=16x2 -## Linux event device input driver ## -[linux_input] - -# Select the input device to use [default: /dev/input/event0] -Device=/dev/input/event0 - -# specify a non-default key map -#key=1,Escape -#key=28,Enter -#key=96,Enter -#key=105,Left -#key=106,Right -#key=103,Up -#key=108,Down - ## LIRC input driver ## [lirc] @@ -987,13 +971,6 @@ Reboot=no -## Olimex MOD-LCD1x9 driver ## -[Olimex_MOD_LCD1x9] - -# device file of the i2c controler -Device=/dev/i2c-0 - - ## Mini-box.com picoLCD (usblcd) driver ## [picolcd] @@ -1387,9 +1364,4 @@ Offset=200x200 # X font to use, in XLFD format, as given by "xfontsel" Font=-*-terminus-*-r-*-*-*-320-*-*-*-*-* -## Y.A.R.D.2 LCD section -[yard2LCD] -Size=20x4 -# If rendering rate is too high, change in server\main.h #define RENDER_FREQ 8 to "1" - # EOF diff --git a/README.md b/README.md index 637f5e3..c51cff4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -[![Build Status](https://travis-ci.org/lcdproc/lcdproc.svg?branch=master)](https://travis-ci.org/lcdproc/lcdproc) - This is the official repository for the LCDproc project. _Note: this project is currently being migrated from Sourceforge. Documentation @@ -11,9 +9,10 @@ on GitHub, so please excuse the dust while we set up shop._ LCDproc is a client/server suite including drivers for all kinds of nifty LCD devices. The server works with different display sizes and supports several serial devices: Matrix Orbital, Crystal Fontz, Bayrad, LB216, LCDM001 -(kernelconcepts.de), Wirz-SLI and PIC-an-LCD; some devices connected to the -parallel port: HD44780, STV5730, T6963, SED1520 and SED1330; and also some -displays connected via USB: CFontzPacket, CwLnx, IOWarrior, LIS2 and BWCT. +(kernelconcepts.de), Wirz-SLI and PIC-an-LCD; some devices connected to +the parallel port: HD44780, STV5730, T6963, SED1520 and SED1330; and also +some displays connected via USB: CFontzPacket, CwLnx, IOWarrior, LIS2 and +BWCT. Various clients are available that display things like CPU load, system load, memory usage, uptime, and a lot more. @@ -21,102 +20,82 @@ memory usage, uptime, and a lot more. LCDproc also supports key or remote control input for controlling the clients. The client and the server use a TCP connection to communicate, so it is -possible to have a client on a box in Sweden showing its stats on a LCD device -in the United States. +possible to have a client on a box in Sweden showing its stats on a LCD +display in the United States. Visit our [website](http://lcdproc.org/) for more information. The project's -repository, issue tracking and pull requests can be found at -https://github.com/lcdproc/lcdproc. Our mailing list can be found at -https://groups.google.com/d/forum/lcdproc-mailing-list. +repository, issue tracking and pull request management can be found at +http://github.com/lcdproc/lcdproc. LCDproc was originally written by [William Ferrell](mailto:willfe@gmail.com) -and [Selene Scriven](mailto:lcdproc@toykeeper.net). +and [Selene Scriven](lcdproc@toykeeper.net). # Installation -Refer to [INSTALL](INSTALL) (included with this archive) for installation -instructions (including how to connect an LCD to your system). +Refer to the INSTALL file included with this archive for installation +instructions (including how to connect the LCD to your system). # Changes -Refer to [ChangeLog.md](ChangeLog.md) file for details. +Woow... a lot. :) +See the ChangeLog file for more details. # Contributing -If you've found a bug or want to add new functionality to LCDproc, feel free to -fork the repository, make your changes and send us a pull request. They're +If you've found a bug or want to add new functionality to LCDproc, feel free +to fork the repository, make your changes and send us a pull request. They're always welcome! -If you want to help but need some inspiration, take a look at the project's -[open issues](https://github.com/lcdproc/lcdproc/issues). +If you want to help but need some inspiration, take a look at the TODO +file to see what we think that needs to be done. To learn more about how LCDproc works, first have a look at the docs/ directory. Some important things are documented there, but because this is still somewhat a big hacking project, some documentation will be missing ;) -Please don't hesitate to ask us for help if you're having trouble getting LCDproc -working with your hardware or you'd like to contribute to the project but need -guidance on how something works or how things fit together. We're a friendly -bunch! - -## Mailing List - -We also maintain a [mailing list](https://groups.google.com/d/forum/lcdproc-mailing-list) -for development and user discussions. There are several ways to join the mailing list: - -- If you have a Google account, and you're already logged in, browse to - https://groups.google.com/d/forum/lcdproc-mailing-list and click "Join this group". - -- If you'd like to subscribe with a non-Google email address, you can either: - - - Browse to https://groups.google.com/forum/#!forum/lcdproc-mailing-list/join - and provide your email address, solve the displayed captcha (if any) and - click "Subscribe". You may need to click a confirmation link (that Google will - mail to the provided address) to actually be subscribed to the mailing list. - - - Send an email to lcdproc-mailing-list+subscribe@googlegroups.com. - ## Code of Merit -This project adopts the Code of Merit, version 1.0, originally published at -http://code-of-merit.org/. Refer to [CODE_OF_MERIT.md](CODE_OF_MERIT.md) for -details, but in short, we focus on writing software and leave politics out of -it. +This project adopts the Code of Merit, version 1.0, originally published +at http://code-of-merit.org/. Refer to CODE_OF_MERIT.md in this project's +source tree for a copy of this document. + +In short, let's focus on writing software and leave the politics out of it. # Special Thanks LCDproc wouldn't be possible without the ongoing patience and efforts by its amazing community of developers and users. We'd like to recognize everyone's -contributions to the project, and we've tried to list them all in -[CREDITS](CREDITS). If we've overlooked your contributions, please let us know -so we can attribute your work immediately! +contributions to the project, and we've tried to list them all in the CREDITS +file. If we've overlooked your contributions, please let us know so we can +attribute your work immediately! _From William Ferrell, original developer:_ This project is almost twenty years old as I write this, and I'm so proud of what it's become over the years thanks -in no small part to the people (past and present) who not only contributed -their work and ideas to the project, but helped to manage and maintain it when -I couldn't. To see this project start as a small single-system utility program -supporting a single type of device and flourish into a client/server daemon -used around the world to drive all sorts of display devices is beyond anything -I could have ever hoped for, and I'm eternally grateful to everyone who's -contributed over the years. Thank you all for being part of this project and -for making it amazing. Here's to another twenty years! :) +in no small part to the people (past and present) who not only contributed their +work and ideas to the project, but helped to manage and maintain it when I +couldn't. To see this project start as a small single-system utility program +supporting a single type of device and flourish into a client/server daemon used +around the world to drive all sorts of display devices is beyond anything I could +have ever hoped for, and I'm eternally grateful to everyone who's contributed +over the years. Thank you all for being part of this project and for making it +amazing. Here's to another twenty years! :) # Legal Stuff -LCDproc is Copyright (C) 1998-2016 William Ferrell, Selene Scriven and many -other contributors. +LCDproc is Copyright (C) 1998-2016 + William Ferrell, Selene Scriven and many other contributors. -This program 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 of the License, or (at your option) any later -version. +This program 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 +of the License, or (at your option) any later version. -This program 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. +This program 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. -The file COPYING contains the GNU General Public License. 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., 51 Franklin Street, Fifth -Floor, Boston, MA 02110-1301, USA. +The file COPYING contains the GNU General Public License. +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/acinclude.m4 b/acinclude.m4 index 6f651aa..76ca6c5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -11,19 +11,18 @@ AC_ARG_ENABLE(drivers, [ bayrad,CFontz,CFontzPacket,curses,CwLnx,ea65,] [ EyeboxOne,g15,glcd,glcdlib,glk,hd44780,i2500vfd,] [ icp_a106,imon,imonlcd,IOWarrior,irman,irtrans,] - [ joy,lb216,lcdm001,lcterm,linux_input,lirc,lis,MD8800,mdm166a,] + [ joy,lb216,lcdm001,lcterm,lirc,lis,MD8800,mdm166a,] [ ms6931,mtc_s16209x,MtxOrb,mx5000,NoritakeVFD,] - [ Olimex_MOD_LCD1x9,picolcd,pyramid,rawserial,] - [ sdeclcd,sed1330,sed1520,serialPOS,serialVFD,] - [ shuttleVFD,sli,stv5730,SureElec,svga,t6963,text,] - [ tyan,ula200,vlsys_m428,xosd,yard2LCD] + [ picolcd,pyramid,rawserial,sdeclcd,sed1330,sed1520,] + [ serialPOS,serialVFD,shuttleVFD,sli,stv5730,SureElec,] + [ svga,t6963,text,tyan,ula200,vlsys_m428,xosd] [ ] [ 'all' compiles all drivers;] [ 'all,!xxx,!yyy' de-selects previously selected drivers], drivers="$enableval", drivers=[bayrad,CFontz,CFontzPacket,curses,CwLnx,glk,lb216,lcdm001,MtxOrb,pyramid,text]) -allDrivers=[bayrad,CFontz,CFontzPacket,curses,CwLnx,ea65,EyeboxOne,g15,glcd,glcdlib,glk,hd44780,i2500vfd,icp_a106,imon,imonlcd,IOWarrior,irman,irtrans,joy,lb216,lcdm001,lcterm,linux_input,lirc,lis,MD8800,mdm166a,ms6931,mtc_s16209x,MtxOrb,mx5000,NoritakeVFD,Olimex_MOD_LCD1x9,picolcd,pyramid,sdeclcd,sed1330,sed1520,serialPOS,serialVFD,shuttleVFD,sli,stv5730,SureElec,svga,t6963,text,tyan,ula200,vlsys_m428,xosd,rawserial,yard2LCD] +allDrivers=[bayrad,CFontz,CFontzPacket,curses,CwLnx,ea65,EyeboxOne,g15,glcd,glcdlib,glk,hd44780,i2500vfd,icp_a106,imon,imonlcd,IOWarrior,irman,irtrans,joy,lb216,lcdm001,lcterm,lirc,lis,MD8800,mdm166a,ms6931,mtc_s16209x,MtxOrb,mx5000,NoritakeVFD,picolcd,pyramid,sdeclcd,sed1330,sed1520,serialPOS,serialVFD,shuttleVFD,sli,stv5730,SureElec,svga,t6963,text,tyan,ula200,vlsys_m428,xosd,rawserial] if test "$debug" = yes; then allDrivers=["${allDrivers},debug"] fi @@ -215,7 +214,7 @@ dnl else actdrivers=["$actdrivers glk"] ;; hd44780) - HD44780_DRIVERS="hd44780-hd44780-serial.o hd44780-hd44780-lis2.o hd44780-hd44780-usblcd.o hd44780-hd44780-lcm162.o" + HD44780_DRIVERS="hd44780-hd44780-serial.o hd44780-hd44780-lis2.o hd44780-hd44780-usblcd.o" if test "$ac_cv_port_have_lpt" = yes ; then HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-4bit.o hd44780-hd44780-ext8bit.o hd44780-lcd_sem.o hd44780-hd44780-winamp.o hd44780-hd44780-serialLpt.o" fi @@ -232,9 +231,6 @@ dnl else if test "$x_ac_have_i2c" = yes; then HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-i2c.o" HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-piplate.o" - HD44780_I2C="i2c.o" - else - HD44780_I2C="" fi if test "$x_ac_have_spi" = yes; then HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-spi.o hd44780-hd44780-pifacecad.o" @@ -314,14 +310,6 @@ dnl else DRIVERS="$DRIVERS lcterm${SO}" actdrivers=["$actdrivers lcterm"] ;; - linux_input) - case $host in - *-*-linux*) - DRIVERS="$DRIVERS linux_input${SO}" - actdrivers=["$actdrivers linux_input"] - ;; - esac - ;; lirc) AC_CHECK_LIB(lirc_client, main,[ LIBLIRC_CLIENT="-llirc_client" @@ -405,15 +393,6 @@ dnl else DRIVERS="$DRIVERS NoritakeVFD${SO}" actdrivers=["$actdrivers NoritakeVFD"] ;; - Olimex_MOD_LCD1x9) - AC_CHECK_HEADERS([linux/i2c.h],[ - DRIVERS="$DRIVERS Olimex_MOD_LCD1x9${SO}" - actdrivers=["$actdrivers Olimex_MOD_LCD1x9"] - ],[ -dnl else - AC_MSG_WARN([The Olimex MOD-LCD1x9 driver needs linux/i2c.h]) - ]) - ;; rawserial) DRIVERS="$DRIVERS rawserial${SO}" actdrivers=["$actdrivers rawserial"] @@ -557,10 +536,6 @@ dnl else actdrivers=["$actdrivers xosd"] fi ;; - yard2LCD) - DRIVERS="$DRIVERS yard2LCD${SO}" - actdrivers=["$actdrivers yard2LCD"] - ;; *) AC_MSG_ERROR([Unknown driver $driver]) ;; @@ -580,7 +555,6 @@ AC_SUBST(LIBLIRC_CLIENT) AC_SUBST(LIBSVGA) AC_SUBST(DRIVERS) AC_SUBST(HD44780_DRIVERS) -AC_SUBST(HD44780_I2C) AC_SUBST(GLCD_DRIVERS) AC_SUBST(LIBG15) AC_SUBST(LIBGLCD) diff --git a/clients/lcdproc/machine.h b/clients/lcdproc/machine.h index 86c3fc9..7618c39 100644 --- a/clients/lcdproc/machine.h +++ b/clients/lcdproc/machine.h @@ -12,7 +12,6 @@ #ifndef _lcdproc_machine_h_ #define _lcdproc_machine_h_ -#include #include "shared/LL.h" #ifndef LOADAVG_NSTATS diff --git a/clients/lcdproc/machine_OpenBSD.c b/clients/lcdproc/machine_OpenBSD.c index 47b4a33..255f028 100644 --- a/clients/lcdproc/machine_OpenBSD.c +++ b/clients/lcdproc/machine_OpenBSD.c @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/docs/LCDd.8.in b/docs/LCDd.8.in index 7ff461c..977e22d 100644 --- a/docs/LCDd.8.in +++ b/docs/LCDd.8.in @@ -247,9 +247,6 @@ kernelconcepts.de 20x4 serial LCD displays .B lcterm serial LCD terminal from Helmut Neumark Elektronik (http://www.neumark.de) .TP -.B linux_input -Linux event devices (input) -.TP .B lirc Infrared (input) .TP @@ -277,9 +274,6 @@ LCD display on the Logitech MX5000 keyboard .B NoritakeVFD Noritake VFD Device CU20045SCPB-T28A .TP -.B Olimex_MOD_LCD1x9 -Olimex MOD-LCD1x9 14 segment display -.TP .B rawserial Dumps the entire framebuffer to the serial port at a configurable rate. .TP @@ -334,9 +328,6 @@ ULA-200 device from ELV (http://www.elv.de) .B vlsys_m428 VFD/IR combination in case MonCaso 320 from Moneual .TP -.B yard2 -yard2 LCD module -.TP .B xosd On Screen Display on X11 .PP diff --git a/docs/lcdproc-user/drivers.docbook b/docs/lcdproc-user/drivers.docbook index d0fe900..72a4244 100644 --- a/docs/lcdproc-user/drivers.docbook +++ b/docs/lcdproc-user/drivers.docbook @@ -30,7 +30,6 @@ well as the configuration of LCDd. &lb216; &lcdm001; &lcterm; -&linux_input; &lirc; &lis; &MD8800; @@ -40,7 +39,6 @@ well as the configuration of LCDd. &MtxOrb; &mx5000; &NoritakeVFD; -&Olimex_MOD_LCD1x9; &rawserial; &picolcd; &pylcd; @@ -60,7 +58,6 @@ well as the configuration of LCDd. &ula200; &vlsys_m428; &xosd; -&yard2; &ppttrouble; diff --git a/docs/lcdproc-user/drivers/Makefile.am b/docs/lcdproc-user/drivers/Makefile.am index 21725d4..2efa0a9 100644 --- a/docs/lcdproc-user/drivers/Makefile.am +++ b/docs/lcdproc-user/drivers/Makefile.am @@ -32,7 +32,6 @@ EXTRA_DIST = bayrad.docbook \ mtxorb.docbook \ mx5000.docbook \ NoritakeVFD.docbook \ - Olimex_MOD_LCD1x9.docbook \ picolcd.docbook \ ppttrouble.docbook \ pylcd.docbook \ @@ -52,7 +51,6 @@ EXTRA_DIST = bayrad.docbook \ tyan.docbook \ ula200.docbook \ vlsys_m428.docbook \ - yard2.docbook \ xosd.docbook ## EOF diff --git a/docs/lcdproc-user/drivers/Olimex_MOD_LCD1x9.docbook b/docs/lcdproc-user/drivers/Olimex_MOD_LCD1x9.docbook deleted file mode 100644 index a575f10..0000000 --- a/docs/lcdproc-user/drivers/Olimex_MOD_LCD1x9.docbook +++ /dev/null @@ -1,32 +0,0 @@ - -The Olimex_MOD_LCD1x9 Driver - - -The Olimex_MOD_LCD1x9 driver supports the popular MOD-LCD1x9 14 segment -display on I2C lines. Currently this driver only supports Linux. - - - - -Configuration in LCDd.conf - - -[Olimex_MOD_LCD1x9] - - - - - Device = - DEVICE - - - Set the I2C device [default: /dev/i2c-0] - - - - - - - - - diff --git a/docs/lcdproc-user/drivers/hd44780.docbook b/docs/lcdproc-user/drivers/hd44780.docbook index 68991d0..324a82a 100644 --- a/docs/lcdproc-user/drivers/hd44780.docbook +++ b/docs/lcdproc-user/drivers/hd44780.docbook @@ -2516,61 +2516,6 @@ Size=40x2 DelayBus=false DelayMult=1 Keypad=no -#i2c_line_RS=0x10 -#i2c_line_RW=0x20 -#i2c_line_EN=0x40 -#i2c_line_BL=0x80 -#i2c_line_D4=0x01 -#i2c_line_D5=0x02 -#i2c_line_D6=0x04 -#i2c_line_D7=0x08 -# BacklightInvert=yes -# The Backlight Invert is used if a 0 turns the backlight on, and 1 turns it off, i.e. npn transistor -]]> - - - - -If your port expander has different wiring you can re-assign the pins in the config file - - - -HD44780: Configuration for I<superscript>2</superscript>C with port expander -Alternative Wiring - - - - - - -HD44780: Configuration for I<superscript>2</superscript>C with port expander -alternative config - - diff --git a/docs/lcdproc-user/drivers/linux_input.docbook b/docs/lcdproc-user/drivers/linux_input.docbook deleted file mode 100644 index 394d361..0000000 --- a/docs/lcdproc-user/drivers/linux_input.docbook +++ /dev/null @@ -1,57 +0,0 @@ - -The Linux Event Device Input Driver - - -This section covers the linux event device input driver for LCDd. - - - - -Configuration in LCDd.conf - - -[linux_input] - - - - - Device = - DEVICE - - - Select the input device to use [default: /dev/input/event0] - - - - - - key = - KEYCODE,KEY - - - - Set an alternate key map, e.g. to use custom buttons instead of the - standard codes for Escape, Enter, Left, Right, Up and Down. This entry - typically repeaded for any non-standard key code. - - - - KEYCODE is an integer like the ones defined in - /usr/include/linux/input.h. - - - - KEY can be one of the keys that LCDd recognizes - (Left, Right, Up, - Down, Enter or Escape) - or any other string that a client can parse. - - - - - - - - - - diff --git a/docs/lcdproc-user/drivers/yard2.docbook b/docs/lcdproc-user/drivers/yard2.docbook deleted file mode 100644 index 7fd29b6..0000000 --- a/docs/lcdproc-user/drivers/yard2.docbook +++ /dev/null @@ -1,30 +0,0 @@ - -The yard2 driver - - -General - - -The yard2 driver handles the yard2 LCD device. -The driver functionality is currently limited to character LCD. - - - -This driver writes via socket to yard2srvd deamon. - - - -The yard2 driver assumes the character encoding ISO 8859-1. - - - - -Configuration - - -The only configuration parameter is Size. -All other settings are done in yard2srvd daemon. - - - - \ No newline at end of file diff --git a/docs/lcdproc-user/lcdproc-user.docbook b/docs/lcdproc-user/lcdproc-user.docbook index 621f73f..1c73ed6 100644 --- a/docs/lcdproc-user/lcdproc-user.docbook +++ b/docs/lcdproc-user/lcdproc-user.docbook @@ -37,7 +37,6 @@ - @@ -47,7 +46,6 @@ - @@ -67,7 +65,6 @@ - diff --git a/hd44780.md b/hd44780.md deleted file mode 100644 index bef9851..0000000 --- a/hd44780.md +++ /dev/null @@ -1,3677 +0,0 @@ - -The HD44780 Driver - - -The HD44780 has become the de-facto standard of alphanumeric character displays. -Although the original Hitachi HD44780 is long out of production, its command -set has survived in a variety of (fully or nearly) compatible LCD, VFD and -even OLED displays sold by a broad range of manufacturers all over the world. -To name only a few: KS0066, KS0070, KS0076, LC7985, NT3881, SED1278, ST7066 ... - - - -The command set of these displays, which sometimes are advertised as being -"industry standards compatible", is thus the workhorse of controllers for -displays ranging from 8x1 to 20x4 or 40x2 characters. -There are even displays with larger dimensions sporting two controllers, -one for each half of the display. - - - -The HD44780 driver supports various ways of connecting HD44780 devices -to your system. -Each of these different ways is called a connection type -of the driver. - - - -Depending on the connection type and the display connected, the driver supports -various special features. - - Input keys - Software controllable brightness / backlight - Software controllable contrast - multiple displays / multi-controller displays - - - - -The following table lists the available connection types, sorted by the kind -of connection (parallel port, serial port, USB, I2C, SPI or others). - - - - - HD44780: Connection Types - - - - - - - ConnectionType - Wiring / Display Type - - - - - - Parallel port connection types: - - - 4bit - 4-bit wiring. This is the default. - - - 8bit - 8-bit wiring ("lcdtime" style) - - - winamp - 8-bit wiring ("winamp" style) - - - serialLpt - Serial LPT wiring - - - - Serial (RS-232) connection types: - - - picanlcd - PIC-an-LCD serial device "picanlcd" - - - lcdserializer - LCD serializer "lcdserializer" - - - los-panel - LCD on Serial panel device "los-panel" () - - - vdr-lcd - VDR LCD serial device "vdr-lcd" - - - vdr-wakeup - VDR-Wakeup module "vdr-wakeup" - - - - USB connection types: - - - pertelian - Pertelian X2040 LCD display () - - - lis2 - LIS2 from VLSystem () - - - mplay - MPlay Blast from VLSystem () - - - usblcd - USBLCD adapter from Adams IT Services () - - - bwctusb - BWCT USB device "bwctusb" () - - - lcd2usb - Till Harbaum's LCD2USB () - - - usbtiny - Dick Streefland's USBtiny () - - - uss720 - Belkin USS-720 USB-to-IEEE 1284 Bridge (Belkin F5U002) - - - USB-4-all - The USB-4-all controller board from Sprut () - - - ftdi - Display connected to a FTDI RS2232 (dual channel) or - FTDI RS232 (single channel) USB chip - - - - I2C connection types: - - - i2c - LCD driven by PCF8574(A)/PCA9554(A) connected via I2C - - - piplate - Adafruit RGB Positive 16x2 LCD+Keypad for Raspberry Pi - - - - SPI (Serial Peripheral Interface): - - - spi - Display using a KS0073 or similar in serial mode accessed via Linux SPI device - - - pifacecad - PiFace Control and Display for Raspberry Pi - - - - Other connection types: - - - ethlcd - Display connected via TCP to PoE powered ethlcd device - () - - - raspberrypi - LCD connected to the GPIO header of a Raspberry Pi - - - -
- - - - - If you suspect the table above to be outdated, you might want to have a look at - server/drivers/hd44780-drivers.h in LCDproc's - source directory which contains the actual translation code. - - -
- - - -Connections - - -Common connections for all connection types - - -No matter what connection type you choose, you will always need some -connections. They are explained here. - - - -Power - - -All variants use the same method of obtaining power. i.e., for each LCD: - - - -HD44780: Power Connections - - - - - - LCD - Signal - - - name - pin - - - - - VEE - 1 - GND (connect to any of pins 18 - 25 of you parallel port) - - - VCC - 2 - +5V - - - VLC - 3 - (contrast adjustment) - - - -
- - - - Always double check your power connection, your display will probably - not survive a reversely connected supply ! - - - - -There are several ways to get 5V: - - - - - Connect to a 5V line intended for disk drives (the red wire is 5V, - black is GND). - - - Get it from the VCC and GND pins of an USB connector. - For the USB connection types this is done automatically, as the circuits - used there automatically power the LCD. - - - Get it from a joystick port (pin 1 and 9 are 5V, 4, 5 and 12 are GND). - It seems that some soundcards can use these lines for communication, - so if you want to use this first check whether it really gives a 'clean' 5V. - - - If you don't have a backlight, you can sometimes get the needed mA's - from the LPT port itself. Connect a few diodes from the data pins to - a capacitor and you have the 5V. If it's strong enough is another question... - - - Get it from the keyboard connector. I do not recommend to use this with - a backlight, as the keyboard connector is often protected with a fuse - of 100mA or 200mA. - - - -
-HD44780: Connecting the contrast adjusting pin (V<subscript>LC</subscript>) - - - -
- -
- - -Keypad - - -You can connect a keypad with most connection types. The maximum supported -number of keys differs per type. There are several ways to connect the keys -to the input pins. - - - -Direct Keys - - -If you connect a key like sketched below, then you can only connect one key -per input pin. It is a simple solution if you need only few keys. - - -
-HD44780: Direct Keys - - - -
- - -By default, the following keystrokes are generated by the different keys: - - - HD44780: Direct Key Mapping - - - - key index - mapped string - - - - - X1 - A - - - X2 - B - - - X3 - C - - - X4 - D - - - X5 - E - - - -
- -You can change the mapping using the -KeyDirect_NUM -configuration option, where NUM -is the subscript to the X in the table above. -
- -
- - -Matrix Keys - - -Using a matrix, we can connect much more keys. To simplify the drawing here, -we replace all switches with an @ symbol: - - -
-HD44780: Single Matrix Key - - - -
- - -We connect the matrix of keys like this: - - -
-HD44780: Complete Key Matrix - - - -
- - -As you can see, you need 1 resistor per X line, and 1 diode per Y line. -By default, lcdproc will presume that you have a keypad with a layout -like a telephone connected, with X and Y lines connected as show. -To be more precise, it assumes this mapping: - - - -HD44780: Matrix Keypad Layout - - - - - X1 - X2 - X3 - X4 - X5 - - - Y1 - 1 - 2 - 3 - A - E - - - Y2 - 4 - 5 - 6 - B - F - - - Y3 - 7 - 8 - 9 - C - G - - - Y4 - * - 0 - # - D - H - - - -
- - -This mapping can be changed using the -KeyMatrix_X_Y -configuration option, where X and -Y are the subscripts to the respective axes above. - - - -If you only need e.g. 10 keys, leave the rest away. -You should modify and recompile the -driver to get an other keypad layout. - - - -You can buy arrays of keys that are connected like this in the electronics -shop. They usually call it a matrix keypad. To hook it to lcdproc, you -would only need to add the resistors and diodes. - - - -If you want to use just one return line, for example with the serialLpt -wiring, it looks (completely drawn) like this: - - -
-HD44780: One Return Line - - - -
- - - - If the driver generates keypresses without that you actually press a key, - it might be that the unconnected input lines are picking up - electromagnetic waves from the air. In that case connect the unconnected - input lines (pin 10, 11, 12, 13 and 15 of the LPT) to VCC = 5V. - - - -
- -
- - -Backlight - - -A small extension allows you to switch the backlight of the display on -and off. At the moment only the 4bit and winamp -connection types support this. -The extension uses one output pin, you cannot use that pin for other -functions anymore. The wiring looks like this: - - -
-HD44780: Backlight Wiring - - - -
- - - - Sometimes the backlight connections are not on the 'main' connector, but on - the side. If that is the case, there is usually NO RESISTOR present to limit - the current through the LEDs. Therefore you should then add a resistor after - the transistor of about 10 ohm (see display documentation). - - - - - - If you want the backlight to light a bit while it is "switched off", you can - add a resistor bypassing the transistor from e to c, with a value of, say - 47ohm or 22ohm. (My 4x20 has an internal resistor of 6ohm, so with 47 ohm - extra it lights at only 1/9th. I like this. Joris.) - - - -
- -
- - -4bit - - -This wiring is originally based on "lcdtext" (by Matthias Prinke). - - - -HD44780: 4bit Pinouts (1) - - - - - - - - - printer port - <-> - LCD - - - name - pin - name - pin - - - - - - - GND - VEE - 1 - - - - - +5V - VCC - 2 - - - - - (contrast adjustment) - VLC - 3 - - - D4 - 6 - - RS - 4 - - - - - GND - RW - 5 - - - D6 - 8 - - EN - 6 - - - D0 - 2 - - D4 - 11 - - - D1 - 3 - - D5 - 12 - - - D2 - 4 - - D6 - 13 - - - D3 - 5 - - D7 - 14 - - - -
- - - -The RW (pin 5) line of the display decides whether the display receives data from the -LPT port, or whether it sends data to the LPT port: if grounded it receives, if High or connected -to nothing at all it "sends" (i.e., will not work as intended). So, if you are not sure that -you need it otherwise, then connect it to GND. This certainly applies if you have only one display. - - -Theoretically this wiring sends the data over twice as slow as the -winamp or ext8bit wirings, because it only sends 4 bits at a time. - - - - -The 4bit connection type supports more than one display connected -to the same parallel port. -If you want to connect more than one display, then wire the all the displays to the -parallel port according to the scheme above with the exception of the EN -(pin 6) line of the LCDs. - - - -For the second and further displays, you can find the wiring for the EN -(pin 6) line in the table below. - - - -HD44780: 4bit Pinouts (2) - - - - - - - - - printer port - <-> - LCD - - - name - pin - name - pin - - - - - D7 - 9 - - EN2 - 6 of 2nd display - - - D5 - 7 - - EN3 - 6 of 3rd display - - - STR - 1 - - EN4 - 6 of 4th display - - - LF - 14 - - EN5 - 6 of 5th display - - - INIT - 16 - - EN6 - 6 of 6th display - - - SEL - 17 - - EN7 - 6 of 7th display - - - -
- - -The optional keypad can be connected as follows: - - - -HD44780: 4bit Keypad Pinouts - - - - - - - printer port - <-> - keypad - remarks - - - name - pin - pin - - - - - D0 - 2 - - Y1 - - - - D1 - 3 - - Y2 - - - - D2 - 4 - - Y3 - - - - D3 - 5 - - Y4 - - - - D4 - 6 - - Y5 - - - - D5 - 7 - - Y6 - Only if not used for backlight or 3rd controller. - - - nSTRB - 1 - - Y7 - Only if not used for additional controllers. - - - nLF - 14 - - Y8 - - - INIT - 16 - - Y9 - - - nSEL - 17 - - Y10 - - - nACK - 10 - - X1 - - - - BUSY - 11 - - X2 - - - - PAPEREND - 12 - - X3 - - - - SELIN - 13 - - X4 - - - - nFAULT - 15 - - X5 - - - - -
- - -The optional backlight wiring should be connected to D5, pin 7. - - -
- - -8bit "Winamp" - - -This type of connection should work with winamp. - - - -HD44780: "Winamp" wiring - - - - - - - - - printer port - <-> - LCD - - - name - pin - name - pin - - - - - D0 - 2 - - D0 - 7 - - - D1 - 3 - - D1 - 8 - - - D2 - 4 - - D2 - 9 - - - D3 - 5 - - D3 - 10 - - - D4 - 6 - - D4 - 11 - - - D5 - 7 - - D5 - 12 - - - D6 - 8 - - D6 - 13 - - - D7 - 9 - - D7 - 14 - - - nSTRB - 1 - - EN - 6 - - - nLF - 14 - - RW - 5 (EN3 6 - LCD 3) (optional (*) ) - - - INIT - 16 - - RS - 4 - - - nSEL - 17 - - EN2 - (6 - LCD 2) (optional) - - - -
- - -(*) on the RW line of the display: this line decides whether the display receives data from the -LPT port, or whether it sends data to the LPT port: if grounded it receives, if High or connected -to nothing at all it "sends" (i.e., will not work as intended). So, if you are not sure that -you need it otherwise, then connect it to GND. This certainly applies if you have only one display. - - - -If you want the display to work with the Winamp plugin, wire nLF (pin 14) -to RW of your LCD. You can then use the plugin in bidirectional mode (which -is much faster). With 3 connected LCDs this is not possible. -Note from Benjamin: I haven't tried using winamp while having the third LCD -connected to this line. - - - -The optional keypad can be connected as follows: - - - -HD44780: "Winamp" wiring - Keypad - - - - - - - printer port - <-> - keypad - - - name - pin - pin - - - - - D0 - 2 - - Y1 - - - D1 - 3 - - Y2 - - - D2 - 4 - - Y3 - - - D3 - 5 - - Y4 - - - D4 - 6 - - Y5 - - - D5 - 7 - - Y6 - - - D6 - 8 - - Y7 - - - D7 - 9 - - Y8 - - - nACK - 10 - - X1 - - - BUSY - 11 - - X2 - - - PAPEREND - 12 - - X3 - - - SELIN - 13 - - X4 - - - nFAULT - 15 - - X5 - - - -
- - -The optional backlight wiring should be connected to nSEL, pin 17. - - -
- - -8bit "lcdtime" - - -This is originally based on "lcdtime" (by Benjamin Tse -blt@ComPorts.com) and allows you to combine the LCD with a LED -bargraph. The LCD is driven by LCDproc and the LEDs by another program -such as portato. Further details can be obtained from: - - - - - - - - - - - - - - - -The LCD connections are: - - - -HD44780: "lcdtime" wiring - - - - - - - - - printer port - <-> - LCD - - - name - pin - name - pin - - - - - D0 - 2 - - D0 - 7 - - - D1 - 3 - - D1 - 8 - - - D2 - 4 - - D2 - 9 - - - D3 - 5 - - D3 - 10 - - - D4 - 6 - - D4 - 11 - - - D5 - 7 - - D5 - 12 - - - D6 - 8 - - D6 - 13 - - - D7 - 9 - - D7 - 14 - - - nSEL - 17 - - - - - - - nSTRB - 1 - - RS - 4 - - - nLF - 14 - - RW - 5 (optional - pull LCD RW low (*) - - - INIT - 16 - - EN - 6 - - - -
- - -(*) on the RW line of the display: this line decides whether the display receives data from the -LPT port, or whether it sends data to the LPT port: if grounded it receives, if High or connected -to nothing at all it "sends" (i.e., will not work as intended). So, if you are not sure that -you need it otherwise, then connect it to GND. - - - -See the lcdtime tar-ball (above) for full details of the bargraph -connections. - - - -The optional keypad can be connected as follows: - - - -HD44780: "lcdtime" wiring - keypad - - - - - - - printer port - <-> - keypad - - - name - pin - pin - - - - - D0 - 2 - - Y1 - - - D1 - 3 - - Y2 - - - D2 - 4 - - Y3 - - - D3 - 5 - - Y4 - - - D4 - 6 - - Y5 - - - D5 - 7 - - Y6 - - - D6 - 8 - - Y7 - - - D7 - 9 - - Y8 - - - nSTRB - 1 - - Y9 - - - nSEL - 17 - - Y10 (only if not used for backlight) - - - nACK - 10 - - X1 - - - BUSY - 11 - - X2 - - - PAPEREND - 12 - - X3 - - - SELIN - 13 - - X4 - - - nFAULT - 15 - - X5 - - - -
- - -The backlight wiring should be attached to nSEL, pin 17. Because the portato -program (mentioned above) also uses this pin to control the bargraph, you -cannot use the backlight control together with the bargraph. - - -
- - -Serial LPT - - -This interface uses a handful of wires to interface to the -HD44780. Suitable for high noise, long connections. Designed by -Andrew McMeikan andrewm@engineer.com. - - - -I (Joris) have extended this driver and the wiring a bit. It now supports -keys again (it had earlier supported keys, but some time did not). - - - -Further I have extended the driver and the wiring to be able to run -using 2 instead of 3 output pins. That's even one less pin ! :) - - - -Of course the use of fewer lines than the other wirings can not stay -without drawbacks. In this case the simplicity of the long feeding wires -is compensated by some intelligence in the decoding of the data. If you -have no experience with the soldering iron, I do not recommend to build -this wiring. - - - -OK, so here is the wiring. First of the 'simple' 3 wires version. IC1 is -the shift register, a 4094. Do not forget to connect the 5V to pin 16 and -GND to pin 8 of the IC. - - -
-HD44780: Serial LPT wiring ('simple') - - - -
- - -The second possible wiring is with 2 output lines. This one is a bit more -complex. If you do not understand the schematic, do not build it. - - -
-HD44780: Serial LPT wiring ('complex') - -o----|R Q6|--------------------o Y7 - | 22k | |/ | |13 - | --- IC1 | Q7|---+ +--o 5 RW - | --- | | | 5V | - | |100p ----------- | O === - | | | | - | === | .-. - | | | |22k - +--------------------------------------+ | | - | '-' - | ___ 11|\ 10 | 5|\ 6 - +--|___|--+----| >o-------------------||-----+----| >o--o 6 EN - 22k | |/ 22p |/ - --- IC1 IC1 - --- - |22p - | IC1=74HCT14 (6x Schmitt trigger inverter) - === - - - 5V O--+-------+------+------+-----------------------+-----o 2 VCC - | | | | 13|\ 12 | - | | | +---| >o- | - |100n O 14 O 14 |/ .-. - --- IC1 IC2 | |<---o 3 Vlcd - --- O 7 O 7 1|\ 2 3|\ 4 | |10k - | | | +--| >o- +--| >o- '-' - GND | | | | |/ | |/ | - 18..25 o------+-------+------+-------+----------+-----+-----+-----o 1 GND - | - === GND - -]]> - -
- - -Serial LPT Keypad - - - -To understand this part of the serialLpt documentation, you also need to -read the keypad section in this document. - - - - -serialLpt wiring supports a keypad. The 3 wires version supports -8 keys, or if you use multiple return lines up to 8 x 5 = 40 lines. The -2 wires version supports 7 keys, or with multiple return lines -7 x 5 = 35 keys. - - - -HD44780: Serial LPT - Keypad return lines - - - - - - - printer port - <-> - keypad - - - name - pin - pin - - - - - nACK - 10 - - X1 - - - BUSY - 11 - - X2 - - - PAPEREND - 12 - - X3 - - - SELIN - 13 - - X4 - - - nFAULT - 15 - - X5 - - - -
- - -On lines longer than, say a meter, you should buffer the return line(s). -If you only have 1 return line, you can buffer it with two remaining -buffers from the 74HCT14: - - -
-HD44780: Serial LPT - Keypad return lines buffered - -o------| >o---|___|---+---o input pin on LPT port - return |/ |/ 220E | - IC1 IC1 --- - --- 1nF - | - === - -]]> - -
- -
- - -Serial LPT Backlight - - -Also a backlight is supported. You will also need a port from the 74HCT14 for -that. The BL output below should be connected to the BL input in the -backlight section - - -
-HD44780: Serial LPT - Backlight extra circuit - -o----o BL output - LPT-D3 470k | |/ - --- IC1 - --- - |100nF - | - === - -]]> - -
- -
- -
- - -spi - - -This connection type drives a LCD in serial mode (supported on Hitachi HD66712, -Samsung KS0073 and KS0074 (and clones) controllers) connected to some Linux -SPI device. - - -This connection type is currently only supported on Linux. It is strongly -recommended to use a SPI implementation with hardware support, e.g. on the -Raspberry Pi. - - -As the SPI communication to the display cannot drive a backlight switch, this -connection type features a BacklightDevice option -that can use a GPIO pin exposed via sysfs (see eLinux GPIO). - - - - - -FTDI FT2232D USB chip "ftdi" - - -You can use a FTDI FT2232D dual channel USB <-> parallel FIFO chip -to connect a display via the USB bus. The chip is switched to bitbang mode -and drives both channels as outputs to control the display in 8bit mode. - - - -HD44780: 8bit FTDI - - - - - - - - - FTDI chip - <-> - LCD - - - name - pin - name - pin - - - - - ADBUS0 - 24 - - D0 - 7 - - - ADBUS1 - 23 - - D1 - 8 - - - ADBUS2 - 22 - - D2 - 9 - - - ADBUS3 - 21 - - D3 - 10 - - - ADBUS4 - 20 - - D4 - 11 - - - ADBUS5 - 19 - - D5 - 12 - - - ADBUS6 - 18 - - D6 - 13 - - - ADBUS7 - 17 - - D7 - 14 - - - BDBUS0 - 40 - - RS - 4 - - - BDBUS1 - 39 - - RW - 5 - - - BDBUS2 - 38 - - EN - 6 - - - BDBUS3 - 37 - - BL - Backlight (optional) - - - -
- - -You can configure the USB vendor/product ID in LCDd.conf. -The wiring of the control lines can optionally be reconfigured, -please look at the driver source if you really need that. - - - -The backlight line is driven high when the backlight is on. -Therefore the standard backlight circuit () -will not work. Use the following instead. - - -
-hd44780/ftdi: Backlight Wiring - - - -
- - - -Alternatively you can use a single channel FTDI FT245BM USB <-> parallel -FIFO chip and use the display in its 4 bit mode. - - - -HD44780: 4bit FTDI - - - - - - - - - FTDI chip - <-> - LCD - - - name - pin - name - pin - - - - - D0 - 25 - - D4 - 11 - - - D1 - 24 - - D5 - 12 - - - D2 - 23 - - D6 - 13 - - - D3 - 22 - - D7 - 14 - - - D4 - 21 - - EN - 6 - - - D5 - 20 - - RS - 4 - - - D6 - 19 - - RW - 5 - - - D7 - 18 - - BL - Backlight (optional) - - - -
- - -The following special configuration settings are required to use a single -channel FTDI FIFO chip: - - - -HD44780: Configuration for FTDI 4bit - - - - - - -
- - -LIS2 USB device "lis2" - - -LIS2 from VLSystem () -is a full featured USB VFD module with four channel fan controls. -This device can be accessed as a serial device with the help of the kernel -module ftdi_sio.ko that maps the USB port to a serial port -(e.g. /dev/ttyUSBx). - - - - - -MPlay Blast USB device "mplay" - - -MPlay Blast from VLSystem () -is a full featured USB VFD module with two channel fan controls and -two channel temperature sensors. -This device can be accessed as a serial device with the help of the kernel -module ftdi_sio.ko that maps the USB port to a serial port -(e.g. /dev/ttyUSBx). - - - - - -LCD on Serial panel device "los-panel" - -The LoS-Panel is a DIY device built using an Atmel ATtiny2313 and -supports the following features: - - Drives displays with one controller. - Switchable backlight. - One 4x4 matrix keypad and 4 direct keys. - - - - - - The direct keys are reported as a fifth column of a matrix keypad to LCDd. - - - Column and rows are reported reverse (column 1 / row 1 is in the lower - right corner) to LCDd which expects (1/1) to be the upper left corner. - You have to take this into account when configuring keys. - - - - -See -for more information on this device. - - - - - -VDR LCD serial device "vdr-lcd" - - -… to be documented … - - - -Please address Matteo Pillon for further information. - - - - - -VDR-Wakeup module "vdr-wakeup" - - -The VDR-Wake module by Frank Jepsen is a serial IO extension module for the -famous Linux-based VDR that allows to connect an LCD to it and supports LCDproc. - - - -See -(German) for more information on VDR-Wakeup. - - - - - -Pertelian X2040 "pertelian" - - -The Pertelian X2040 includes an HD44780 display with enclosure and USB -connection. - -In order to work with LCDproc in Linux you need -the usbserial.ko and ftdi_sio.ko -kernel modules loaded. The display will then be available on a -serial port /dev/ttyUSBx. - - - - See the - - X4020 product page for more information. - - - - - - -PIC-an-LCD serial device "picanlcd" - - -The PIC-an-LCD module is also supported. It is not connected to the LPT port -but to a serial port, which saves you from a lot of potential problems. -To use it, specify the device to which you have connected the module in the -config file with the Device setting. -The default is /dev/lcd. -It does not support a keypad nor backlight switching. - - - - -As of 2012 these devices are not sold anymore. Search the Internet Archive for -a copy of if you need -the manual. - - - - - - -LCD serializer device "lcdserializer" - - -LCD serializer connection is technically the same as PIC-an-LCD with the same advantages, -it uses the serial port making things really simple. -Unlike PIC-an-LCD -LCD serializer -is not a commercial product. it's just a project found digging on the net and freely available. -You have all the tools and the code to build it yourself and to customize the behaviour of the device. - - - -What you need - - - -Some electronic knowledge and familiarity with the soldering iron -A PIC16F84 (I used PIC16F84A) or PIC16C54 -JDM PIC programmer -gputils and picprog installed on your GNU/Linux box - - - - - -Burning the PIC - - -First, you need to download the ASM source for your PIC and then make the hex: - - - -$ gpasm lcd16f84_custom.asm - - - -Now the binary is ready to be flashed to the PIC. -Connect the programmer with the PIC installed and issue the following command to see it burning ;-): - - - -$ picprog --erase --burn --input lcd16f84.hex --pic /dev/ttyS0 - - - - - -Running lcdproc - - -It's time to build the operating circuit, -remember this driver uses a baud rate of 9600, so JP2 need to be closed. - - - -Now power on the board. You should see OK on the LCD screen. -Otherwise double-check all the connections. - - - -Change LCDd.conf to include the following statements in the [hd44780] section: - - - -ConnectionType=lcdserializer -Device=/dev/ttyS0 - - - -Finally, start the daemon and relax watching lcdproc running. - - - - - - -BWCT USB LCD module "bwctusb" - - -The BWCT USB LCD module, sold by Bernd Walter Computing Technology -() is a little board -that can be piggy-packed to a HD44780 display and connects that to USB. - - - -The board, driven by the bwctusb connection type, -does neither support a keypad for input, nor more than one single-controller -display, nor does it allow setting the backlight or brightness. -But you can set the display's contrast using software -(see the Contrast configuration parameter). - - - -Special configuration options - - -If there is more than one BWCT USB module connected to the system, -the SerialNumber configuration parameter allows -selecting which display is used in LCDd. - - - - - - - - -Till Harbaum's "lcd2usb" - - -LCD2USB -is a cheap but powerful do-it-yourself interface to connect HD44780 -based displays via USB, consisting of easily available parts only. -The device supports software adjustable contrast and backlight -as well as dual controller displays (required for 4*27 and 4*40). - - - -It is based upon an Atmel AVR Mega8 CPU with a pure software implementation -of the USB protocol for the Atmel AVR microcontroller series. - - - -The whole interface incl. the hardware layout is under a GPL like license. -This means that you can take these schematics and use it as a basis -for your own interface e.g. for a graphic LCD. - - - -Two keys can be connected to the LCD2USB interface board. -They can generate three key events that can be mapped to key names using -the DirectKey_1 to DirectKey_3 commands: -one for each key and the third if the keys are pressed simultaneously. -With this 3-key setup, menus can be used (see example below). - - - -This driver supports the original LCD2USB interface board as described above -as well as compatible devices like those sold by Lcdmod Kit -or those developed by Malte Pöggel. - - - -Special configuration options - - -Besides the standard configuration options for hd44780 displays, the -lcd2usb connection type supports three additional options: -Contrast to set the display's contrast, -Brightness to set the display's brightness when the backlight is switched on and -OffBrightness to set the display's brightness when is backlight is switched off. -All three options expect a number in the range from 0 to 1000. - - - -HD44780: Configuration for LCD2USB - - - - - - - - In order to make the lcd2usb connection type work with a 2-controller display - you may need to set the vSpan config option accordingly. - - - - - - - -Dick Streefland's "USBtiny" - - -USBtiny -is a software implementation of the USB low-speed protocol for -the Atmel ATtiny microcontrollers. It is also the name of a 'reference -circuit' using the ATtiny2313. - - - -The reference circuit features an IR receiver for remote controls and a LCD. -Due to hardware limitations of the ATtiny2313 the LCD does not have switchable -backlight, adjustable contrast, any keys, nor does it support displays with -more than one controller. If you want these features and do not require the -IR receiver we recommend to take a look at the LCD2USB -device. - - - - - LCDproc does not make use of the IR receiver. 3rd party software is required - to make it do anything, e.g. LIRC. - - - - - - - -USS-720 USB-to-IEEE 1284 Bridge (Belkin F5U002) "uss720" - - -The USS-720 USB-to-IEEE 1284 Bridge is a fully featured USB to parallel chip that is used -in most (but not all) Belkin F5U002 USB Parallel Printer Adapters. Because these adapters are -inexpensive and readily available on the second-hand market, they provide an excellent solution -for users who want to experiment with a parallel port but only have USB ports on their computers. - - - -Because the chip acts as a parallel port, the driver maintains the same features and wiring as -the 8-bit "winamp" driver. However, because most USB Parallel Printer Adapters use a centronics -printer connector, be sure to convert the pin numbering of the parallel port pins in the "winamp" -wiring to the pin numbering of the centronics port. Many tables are available on the internet -that illustrate how the pin numbering differs between the two. - - - -Special configuration options - - -Because several manufacturers used the USS720 chip in their USB Parallel Printer Adapters, the -VendorID and ProductID options are configurable in the -LCDd.conf file. - - - - -Not all Belkin F5U002 USB Parallel Printer Adapters used the USS720 chip. Look for the dark grey -adapters with the removable USB cable for best results. - - - - - - - - - -I<superscript>2</superscript>C with Port-Expander - - -If you have an I2C port available that is supported by your kernel -(through /dev/i2c*), you can add a I2C -port expander there (PCF8574P in this example). - - -
-HD44780: PCF8574P port expander on I<superscript>2</superscript>C bus - - - -
- - -Configuration - - -HD44780: Configuration for I<superscript>2</superscript>C with port expander - - - - - - -If your port expander has different wiring you can re-assign the pins in the config file - - - -HD44780: Configuration for I<superscript>2</superscript>C with port expander -Alternative Wiring - - - - - - -HD44780: Configuration for I<superscript>2</superscript>C with port expander -alternative config - - - - - - -The Device configuration setting denotes the device file -of your I2C bus (here /dev/i2c-0). -You have to load the kernel standard module i2c-dev.ko and -the bus driver, but no I2C -chip modules (e.g. pcf8574.ko)! - - - -The Port config option contains the I2C -address of the I2C port expander -(here 0x20, the PCF8574 from the example above, with all address bits set to 0). - -Bit 8 of the address (normally 0 in I2C addresses) -has a special meaning: -It tells the driver to treat the device as PCA9554 or similar, -a device that needs a 2-byte command, and it will be stripped -off the address. - - - -HD44780: Examples of I<superscript>2</superscript>C port expander addresses - - - - Port value - Meaning - - - - - 0x20…0x27 - PCF8574 with A[012]=0…7 - - - 0x38…0x3f - PCF8574A with A[012]=0…7 - - - 0xa0…0xa7 - PCA9554 with A[012]=0…7 - - - 0xa0…0xa7 - PCA9554A with A[012]=0…7 - - - -
- -
- -
- - -ethlcd Device - - -The ethlcd () device is simply -an LCD display driven by an ATmega microcontroller, controlled and powered by -"home-made" Power over Ethernet. The hardware and software are open source. - - -Features -ethernet connection using ENC28J60 ethernet controller -Power over Ethernet (data and power using single UTP cable) -Atmel's ATmega168 microcontroller -6 buttons (MENU, UP, DOWN, LEFT, RIGHT, ENTER) -backlight control in three states: ON, Night-Mode (partialy ON) and OFF -beeper -device act as a TCP server - LCDproc driver is connecting to device just by creating -a TCP socket - no need to PC-side additional hardware besides NIC - - - -
-HD44780: ethlcd - block diagram - - | ethernet |<========+------> PC running - | | | | | | controller | | | LCDproc - | | | | | | | | | - | |_________| |___________| |____________| | | - | | | | - | | | | - | beeper | | - |_____________________________________________________| | - ethlcd AC Adapter - -]]> - -
- - -The device is "visible" to LCDproc just like any other HD44780 device. The difference -is the wiring - instead of connecting the display directly to PC (via serial/parallel/usb port), -it is connected via ethernet and the communication is done over TCP connection. -The main feature is - that to power and control the LCD is needed single UTP cable. -To use the driver, specify the device IP address or hostname, on which the ethlcd device -is accessible by setting in config file the Device value. -The default is ethlcd. - - -
- - -USBLCD adapter - - -The USBLCD adapter from Adams IT Services () -is a small interface board which allows you to connect an alphanumerical display -module based on the HD44780 or compatible controller to the USB. The display -will be powered by the USB. It features a switchable backlight (on or off) and -can be used with 16x2, 16x4 or 20x4 displays. - - - -The usblcd connection type communicates with a kernel -driver by using a device file /dev/usb/lcdx. -The kernel driver providing this device currently only exists for Linux kernels -newer than 2.4.20-pre7. - - - - -As of 2007 these device are not sold anymore. This driver has been ported from -lcdproc 0.4.5 to support existing users. - - - - - -USB-4-all controller - - -The USB-4-all controller board from Sprut () -is a small interface board which allows you to connect different hardware to the USB. -The subdriver for LCDproc supports dual HD44780 displays and a 4x4 keypad as well as -software adjustable contrast and brightness (backlight). - - - -HD44780: USB-4-all - Display connection - - - - - - - - USB-4-all - LCD1 - LCD2 - - - name - pin - name - name - - - - - RB7 - 28 - D7 - D7 - - - RB6 - 27 - D6 - D6 - - - RB5 - 26 - D5 - D5 - - - RB4 - 25 - D4 - D4 - - - RB3 - 24 - R/W - R/W - - - RB2 - 23 - RS - RS - - - RB0 - 21 - EN - - - - RC0 - 11 - - EN - - - -
- - -HD44780: USB-4-all - Keypad connection - - - - - - - USB-4-all - keypad - - - name - pin - name - - - - - RA0 - 2 - X1 - - - RA1 - 3 - X2 - - - RA2 - 4 - X3 - - - RA3 - 5 - X4 - - - RA4 - 6 - Y1 - - - RA5 - 7 - Y2 - - - RC6 - 17 - Y3 - - - RC7 - 18 - Y4 - - - -
- - -HD44780: USB-4-all - Brightness and contrast connection - - - - - - - USB-4-all - Desc - - - name - pin - - - - - - RC1 - 12 - brightness - - - RC2 - 13 - contrast - - - -
- - -
-HD44780: USB-4-all brightness control - - LCD 15 (+ Backlight) - - +---> LCD 16 (- Backlight) - | - === GND -]]> - -
- -
-HD44780: USB-4-all contrast control - - LCD 3 (Contrast) - |c 680R | - ___ b |/ |+ - RC2 o------|___|------| npn --- 10uF - 22k |\ --- - |e | - | | - | | - === === GND -]]> - -
- -
- - - -Raspberry Pi - -This connection type supports a LCD connected to the GPIO header P1 on -a Raspberry Pi. Displays with one or two controllers are supported. - -It supports a switchable backlight connected to pin P1-11 by default. Use -the switch circuit as described in . - - - The signal level on the GPIO pins is 3.3 V and they are said not to - be 5 V tolerant. Therefore the R/W pin of the display must - be wired to GND to prevent 5V logic appearing on the GPIO - pins. For the same reason the backlight cicuit from must not be - used. - Powering a LCD that uses 5 V from pin P1-02 will work. Powering a - LCD from 3.3 V (pin P1-01) will only work if it is designed for 3.3 V - operation. - - - -HD44780: Default pin mapping for Raspberry Pi - - - - - - - - - Connector - <-> - LCD - - - Pin Name - Pin Number - Name - Pin - - - - - GPIO18 - P1-12 - - D7 - 14 - - - GPIO23 - P1-16 - - D6 - 13 - - - GPIO24 - P1-18 - - D5 - 12 - - - GPIO25 - P1-22 - - D4 - 11 - - - GPIO08 - P1-24 - - EN - 6 - - - GPIO07 - P1-26 - - RS - 4 - - - GND - P1-06 - - RW - 5 - - - GPIO22 - P1-15 - - EN2 - Second controller (optional) - - - GPIO17 - P1-11 - - BL - Backlight (optional) - - - -
- -GPIO07 and GPIO08 used for RS and EN signal are also used by the SPI -bus. If you loaded the SPI driver you will need to assign them to a different -GPIO, e.g. GPIO04 and GPIO22. - -When using a display with two controllers the vspan -option has to be configured as well (e.g. vspan=2,2 for a -40x4 display). - - -Special Raspberry Pi configuration options - -This connection driver can be configured to use other pins than the -one described in the table -above. Using the pin_ - configuration option, any LCD pin can be assigned -to any GPIO pin. - - - The values for the pin_ - configuration option are the number part from the - GPIO signal name, not the pin number from the header connector! To find - out which signal is routed to which connector pin refer to the RPi Low-level peripherals - description. - - -The connection driver contains a check for possible signal names. You -will receive an error message if you try to assign a pin to a signal that is -not available on connector P1 or P5. - - -HD44780: Alternate configuration for Raspberry Pi GPIO pins - - - - - - -
- - -Adafruit Pi Plate - - -The Adafruit RGB Positive 16x2 LCD+Keypad for Raspberry Pi (aka Pi Plate, -see ()) combines -a 16x2 Character LCD, up to 3 backlight pins AND 5 keypad pins using only -the two I2C pins on the Rasperry Pi. - - - -Note that this connection type drives all RGB pins of the backlight at the -same time, resulting in a white backlight. You will need to modify the -source code if you want to have some other color. - - - -HD44780: Configuration example for Pi Plate connection type - - - - - - - - -PiFace Control and Display - - -The PiFace Control and Display for Raspberry Pi -from OpenLX SP Ltd combines a 16x2 Character LCD and navigation buttons using -the SPI bus on the Rasperry Pi. - - - - -The PiFace Control and Display features a IR receiver, which LCDproc does not -make use of. You have to setup and use LIRC for that. See - -Setting up PiFace Control And Display to use a remote. - - - - -HD44780: Configuration example for PiFace Control and Display connection type - - - - - - - -
- - - -Compiling - - -Make sure that the HD44780 files are built when you run ./configure. -This can be done by specifying or by including -hd44780 in the list of enabled drivers -(e.g. ). - - - - - - - -Configuration in LCDd.conf - - -[hd44780] - - - - - Port = - PORT - - - For parallel connections, specify the address of the parallel port the LCD is connected to. - Common values for PORT are 0x278, - 0x378 and 0x3BC. - If not given, the default is 0x378. - - For I2C connection types this sets the slave - address. - - - - - - Device = - DEVICE - - - If you are using a serial or I2C connection, - you need to set this parameter to the device your LCD is connected to. - For example, if the display is connected to the first serial port, - you have to set it to /dev/ttyS0. - The default value is /dev/lcd. - - - - - - ConnectionType = - { - - 4bit | - 8bit | - serialLpt | - winamp | - picanlcd | - lcdserializer | - los-panel | - vdr-lcd | - vdr-wakeup | - pertelian | - lis2 | - mplay | - usblcd | - bwctusb | - lcd2usb | - usbtiny | - uss720 | - usb4all | - ftdi | - i2c | - piplate | - spi | - pifacecad | - ethlcd | - raspberrypi - } - - - - Select the type of the wiring / display connection. See also - (). - - - - - - - Speed = - BITRATE - - - For a serial connection, set to the serial port bitrate. To use - the default value for the chosen interface, just set to 0. - - - - - - CharMap = - { - hd44780_default | - hd44780_euro | - ea_ks0073 | - sed12780f_0b | - hd44780_koi8_r | - hd44780_cp1251 | - hd44780_8859_5 | - upd16314 | - none - } - - - - Set the character mapping depending on the display you have: - - - The default, hd44780_default, is for "classic" - HD44780 displays. - - - hd44780_euro is for displays with a ROM mask - supporting the european charset (ROM code A02). - - - ea_ks0073 is the charmap for Electronic - Assembly's KS0073 based displays. These devices have a richer - charset, including many icons and many more characters of the - ISO-8859-1 than standard HD44780s. - - - sed12780f_0b is for some SED 1278 displays. - - - The none charmap does not translate any characters. - It displays the characters the display controllers actually has - stored in its CGROM for that position instead. This setting is - intended for debugging purpose. - - - You only need to set this parameter if you have a non-standard - HD44780 display or charmap. - - - If LCDproc was configured with '--enable-extra-charmaps' option the - following character mappings are available, too: - - - hd44780_koi8_r maps input from a client in - Russian KOI8-R to displays with a ROM mask supporting the european - charset (ROM code A02). - - - hd44780_cp1251 maps input from a client in - Russian CP1251 (Windows-1251) to displays with a ROM mask supporting - the european charset (ROM code A02). - - - hd44780_8859_5 maps input from a client in - Russian ISO 8859-5 to displays with a ROM mask supporting the european - charset (ROM code A02). - - - upd16314 is for displays with a Nec uPD16314 - vacuum fluorescent display (VFD) controller with ROM code 002 - character set. If your display has ROM code 001 character set you - may use the hd44780_euro charmap instead. - - - - - - See server/drivers/hd44780-charset.h - in LCDproc's source directory for the actual - mappings. - - - - - - - - Keypad = ¶meters.yesnodef; - - - Tell whether you have a keypad connected. - You may also need to configure the keypad layout further on in this file. - - - - - - Brightness = - BRIGHTNESS - - - Set the initial brightness when the backlight is on - for the lcd2usb connection type. - Legal values are 0 - 1000, - with 800 being the default. - - - - - - OffBrightness = - BRIGHTNESS - - - Set the initial off-brightness, i.e. the brightness when the backlight is off, - for the lcd2usb connection type. - The legal range is 0 - 1000. - If not given, it defaults to 300. - - - - - - Contrast = - CONTRAST - - - Set the initial contrast for the bwctusb and - lcd2usb connection types. - Legal values for CONTRAST are - 0 - 1000. - If not given, it defaults to 500 which may - be too low or too high for the selected connection type. - So, if the screen is blank or dark, please try playing with - the contrast a bit. - - - - - - Backlight = ¶meters.yesnodef; - - - Specify if you have a switchable backlight. - - - - - - OutputPort = ¶meters.yesnodef; - - - Tell if you have the additional output port ("bargraph") and you want to - be able to control it with the lcdproc OUTPUT command. - - - - - - Lastline = ¶meters.yesdefno; - - - Specifies whether the lowest pixel line of a character is pixel addressable - or if it controls an underline effect. - The default is yes, meaning a pixel addressable last pixel line. - - - - - - Size = ¶meters.size; - - - Specifies the size of the LCD. - Default: 20x4 - In case of multiple combined displays, this should be the total size. - - - - - - vSpan = - - HEIGHT - ,… - - - - The "vertical span" when using the driver with multi-controller displays - or with multiple displays that are treated as a single virtual display. - It is a comma separated list of the heights of each display. - In multi-controller displays it lists the number of lines each controller - is responsible for. - - - E.g. vSpan=2,2,1 means you have three physical displays, the first - two having two lines each, and the third having one line, that together form - a virtual display that is 5 lines high. - - - The sum of the HEIGHTs must match the total height - given in Size=. - - - - - - ExtendedMode = ¶meters.yesnodef; - - - If you have a KS0073 or an other 'almost HD44780-compatible', set this - flag to get into extended,4-line linear addressing mode. - - - - - - LineAddress = - ADDR - - - If the next line of your display doesn't start 0x20 higher in - DDRAM you can override the default value of the ExtendedMode with this parameter. - - - - - - DelayMult = - DELAY - - - If your display is slow and cannot keep up with the flow of data from - LCDd, garbage can appear on the LCDd. Set this delay multiplier to - 2 or 4 to increase the delays. - The default is 1 for a non-multiplied delay. - - - - - - DelayBus = ¶meters.yesdefno; - - - You can reduce the inserted delays by setting this to no. - On fast PCs it is possible your LCD does not respond correctly. - Default: yes. - - - - - - KeepAliveDisplay = - SECONDS - - - Some displays (e.g. vdr-wakeup) need a message from the driver to - indicate that it is still alive. - When set to a value greater than 0 the character in the - upper left corner is updated every SECONDS seconds. - The default 0 does not cause any extra updates. - - - - - - RefreshDisplay = - SECONDS - - - If you experience occasional garbage on your display you can use this - option as workaround. If set to a value greater than 0 it forces a - full screen refresh every SECONDS seconds. - Default: 0. - - - - - - KeyDirect_NUM = - KEY - - - KeyMatrix_X_Y = - KEY - - - - If you have a keypad you can assign keystrings to the keys. - See the keypad section - for used terms and the section on the specific connection type how to - wire it. - - - To map, for example, the directly connected key 4 - to the string Enter, use KeyDirect_4=Enter. - For matrix keys use the X and - Y coordinates of the key; - e.g. KeyMatrix_1_3=Enter. - - - - - - - VendorID = - VENDORID - - - USB vendor ID to look for in certain USB connection types. - When using an FTDI chip with connection type ftdi, the default value is - 0x4003. - When using a USS720 chip with connection type uss720, the default value is - 0x1293. - - - - - - ProductID = - PRODUCTID - - - USB product ID to look for in certain USB connection types. - When using an FTDI chip with connection type ftdi, the default value is - 0x6001. - When using a USS720 chip with connection type uss720, the default value is - 0x0002. - - - - - - SerialNumber = - SERIALNO - - - Serial number of the USB device to look for with - connection type bwctusb. - If not given, the first BWCT USB module found will be used. - - - - - - - - - - -Miscellanea - - -This text has originally been taken from a message by Bill Farrow -bfarrow@arrow.bsee.swin.edu.au. - - - -Updated February 2000, Benjamin Tse blt@ComPorts.com - - - -Updated October 2001, Joris Robijn joris@robijn.net - - - -Converted to Docbook March 2002, Rene Wagner reenoo@gmx.de - - - -Updated April 2002, Rene Wagner reenoo@gmx.de - - - -Updated and extended April 2006 to November 2007, Peter Marschall peter@adpm.de - - - - -
diff --git a/server/drivers/Makefile.am b/server/drivers/Makefile.am index 418cfad..0fa38f2 100644 --- a/server/drivers/Makefile.am +++ b/server/drivers/Makefile.am @@ -23,7 +23,7 @@ AM_LDFLAGS = @LDSHARED@ lcdexecbindir = $(pkglibdir) lcdexecbin_PROGRAMS = @DRIVERS@ -EXTRA_PROGRAMS = bayrad CFontz CFontzPacket curses CwLnx debug ea65 EyeboxOne g15 glcd glcdlib glk hd44780 i2500vfd icp_a106 imon imonlcd IOWarrior irman irtrans joy lb216 lcdm001 lcterm linux_input lirc lis MD8800 mdm166a ms6931 mtc_s16209x MtxOrb mx5000 NoritakeVFD Olimex_MOD_LCD1x9 picolcd pyramid rawserial sdeclcd sed1330 sed1520 serialPOS serialVFD shuttleVFD sli stv5730 SureElec svga t6963 text tyan ula200 vlsys_m428 xosd yard2LCD +EXTRA_PROGRAMS = bayrad CFontz CFontzPacket curses CwLnx debug ea65 EyeboxOne g15 glcd glcdlib glk hd44780 i2500vfd icp_a106 imon imonlcd IOWarrior irman irtrans joy lb216 lcdm001 lcterm lirc lis MD8800 mdm166a ms6931 mtc_s16209x MtxOrb mx5000 NoritakeVFD picolcd pyramid rawserial sdeclcd sed1330 sed1520 serialPOS serialVFD shuttleVFD sli stv5730 SureElec svga t6963 text tyan ula200 vlsys_m428 xosd noinst_LIBRARIES = libLCD.a libbignum.a g15_CFLAGS = @LIBUSB_CFLAGS@ $(AM_CFLAGS) @@ -48,8 +48,8 @@ glcd_LDADD = libLCD.a @GLCD_DRIVERS@ @FT2_LIBS@ @LIBPNG_LIBS@ @LIBSERDIS glcd_DEPENDENCIES = @GLCD_DRIVERS@ glcd-glcd-render.o glcdlib_LDADD = @LIBGLCD@ glk_LDADD = libbignum.a -hd44780_LDADD = libLCD.a @HD44780_DRIVERS@ @HD44780_I2C@ @LIBUSB_LIBS@ @LIBFTDI_LIBS@ libbignum.a -hd44780_DEPENDENCIES = @HD44780_DRIVERS@ @HD44780_I2C@ +hd44780_LDADD = libLCD.a @HD44780_DRIVERS@ @LIBUSB_LIBS@ @LIBFTDI_LIBS@ libbignum.a +hd44780_DEPENDENCIES = @HD44780_DRIVERS@ i2500vfd_LDADD = @LIBFTDI_LIBS@ imon_LDADD = libLCD.a libbignum.a imonlcd_LDADD = libLCD.a @@ -94,8 +94,8 @@ glcd_SOURCES = lcd.h report.h glcd_drv.c glcd_drv.h glcd-low.h glcd-driver EXTRA_glcd_SOURCES = glcd-t6963.c t6963_low.c t6963_low.h glcd-png.c glcd-serdisp.c glcd-glcd2usb.c glcd-glcd2usb.h glcd-x11.c glcd-picolcdgfx.c glcdlib_SOURCES = lcd.h lcd_lib.h glcdlib.h glcdlib.c report.h glk_SOURCES = lcd.h glk.c glk.h glkproto.c glkproto.h report.h -hd44780_SOURCES = lcd.h lcd_lib.h hd44780.h hd44780.c hd44780-drivers.h hd44780-low.h hd44780-charmap.h report.h adv_bignum.h i2c.h -EXTRA_hd44780_SOURCES = port.h lpt-port.h timing.h i2c.c lcd_sem.c lcd_sem.h hd44780-4bit.c hd44780-4bit.h hd44780-bwct-usb.c hd44780-bwct-usb.h hd44780-ethlcd.c hd44780-ethlcd.h hd44780-ext8bit.c hd44780-ext8bit.h hd44780-ftdi.c hd44780-ftdi.h hd44780-i2c.c hd44780-i2c.h hd44780-lcd2usb.c hd44780-lcd2usb.h hd44780-lis2.c hd44780-lis2.h hd44780-pifacecad.c hd44780-pifacecad.h hd44780-piplate.c hd44780-piplate.h hd44780-rpi.c hd44780-rpi.h hd44780-serial.c hd44780-serial.h hd44780-serialLpt.c hd44780-serialLpt.h hd44780-spi.c hd44780-spi.h hd44780-usb4all.c hd44780-usb4all.h hd44780-usblcd.c hd44780-usblcd.h hd44780-usbtiny.c hd44780-usbtiny.h hd44780-uss720.c hd44780-uss720.h hd44780-winamp.c hd44780-winamp.h hd44780-lcm162.c hd44780-lcm162.h +hd44780_SOURCES = lcd.h lcd_lib.h hd44780.h hd44780.c hd44780-drivers.h hd44780-low.h hd44780-charmap.h report.h adv_bignum.h +EXTRA_hd44780_SOURCES = port.h lpt-port.h timing.h lcd_sem.c lcd_sem.h hd44780-4bit.c hd44780-4bit.h hd44780-bwct-usb.c hd44780-bwct-usb.h hd44780-ethlcd.c hd44780-ethlcd.h hd44780-ext8bit.c hd44780-ext8bit.h hd44780-ftdi.c hd44780-ftdi.h hd44780-i2c.c hd44780-i2c.h hd44780-lcd2usb.c hd44780-lcd2usb.h hd44780-lis2.c hd44780-lis2.h hd44780-pifacecad.c hd44780-pifacecad.h hd44780-piplate.c hd44780-piplate.h hd44780-rpi.c hd44780-rpi.h hd44780-serial.c hd44780-serial.h hd44780-serialLpt.c hd44780-serialLpt.h hd44780-spi.c hd44780-spi.h hd44780-usb4all.c hd44780-usb4all.h hd44780-usblcd.c hd44780-usblcd.h hd44780-usbtiny.c hd44780-usbtiny.h hd44780-uss720.c hd44780-uss720.h hd44780-winamp.c hd44780-winamp.h i2500vfd_SOURCES = lcd.h i2500vfd.c i2500vfd.h glcd_font5x8.h report.h icp_a106_SOURCES = lcd.h lcd_lib.h icp_a106.c icp_a106.h report.h imon_SOURCES = lcd.h lcd_lib.h hd44780-charmap.h imon.h imon.c report.h adv_bignum.h @@ -107,7 +107,6 @@ joy_SOURCES = lcd.h joy.c joy.h port.h report.h lb216_SOURCES = lcd.h lcd_lib.h lb216.c lb216.h report.h lcdm001_SOURCES = lcd.h lcdm001.c lcdm001.h report.h lcterm_SOURCES = lcd.h lcd_lib.h lcterm.c lcterm.h report.h -linux_input_SOURCES = lcd.h linux_input.h linux_input.c report.h lirc_SOURCES = lcd.h lircin.c lircin.h report.h lis_SOURCES = lcd.h lcd_lib.h lis.h lis.c report.h MD8800_SOURCES = lcd.h lcd_lib.h MD8800.c MD8800.h report.h @@ -117,7 +116,6 @@ mtc_s16209x_SOURCES = lcd.h lcd_lib.h mtc_s16209x.c mtc_s16209x.h report.h MtxOrb_SOURCES = lcd.h lcd_lib.h MtxOrb.c MtxOrb.h report.h adv_bignum.h mx5000_SOURCES = lcd.h mx5000.c mx5000.h report.h NoritakeVFD_SOURCES = lcd.h lcd_lib.h NoritakeVFD.c NoritakeVFD.h report.h adv_bignum.h -Olimex_MOD_LCD1x9_SOURCES = lcd.h report.h i2c.h i2c.c Olimex_MOD_LCD1x9.h Olimex_MOD_LCD1x9.c Olimex_MOD_LCD1x9_font.h rawserial_SOURCES = lcd.h rawserial.c rawserial.h picolcd_SOURCES = lcd.h picolcd.h picolcd.c report.h pyramid_SOURCES = lcd.h pylcd.c pylcd.h @@ -137,8 +135,6 @@ tyan_SOURCES = lcd.h lcd_lib.h tyan_lcdm.h tyan_lcdm.c report.h adv_bignum ula200_SOURCES = lcd.h adv_bignum.h ula200.h ula200.c report.h vlsys_m428_SOURCES = lcd.h report.h vlsys_m428.c vlsys_m428.h xosd_SOURCES = lcd.h xosdlib_drv.c xosdlib_drv.h report.h adv_bignum.h -yard2LCD = lcd.h yard2LCD.c yard2LCD.h report.h - AM_CPPFLAGS = -I$(top_srcdir) diff --git a/server/drivers/Olimex_MOD_LCD1x9.c b/server/drivers/Olimex_MOD_LCD1x9.c deleted file mode 100644 index 13a8371..0000000 --- a/server/drivers/Olimex_MOD_LCD1x9.c +++ /dev/null @@ -1,227 +0,0 @@ -/** \file server/drivers/Olimex_MOD_LCD1x9.c - * LCDd \c Olimex_MOD_LCD1x9 driver for MOD-LCD1x9 from Olimex. - * This display uses a PCF857DU style controller. - */ - -/* Copyright (C) 2015 Harald Geyer - * - * This program 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 of the License, or - * any later version. - * - * This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "lcd.h" -#include "report.h" - -#include -#include -#include -#include -#include - -#include "i2c.h" -#include "Olimex_MOD_LCD1x9_font.h" - -#define BUS_ADDRESS 0x38 -#define LEN_INIT_SEQ 24 - -/** private data for the \c Olimex_MOD_LCD1x9 driver */ -typedef struct olimex1x9_private_data { - I2CHandle *dev; /**< handle of the i2c device */ - uint16_t buf[11]; /**< header + frame buffer */ -} PrivateData; - -/* Vars for the server core */ -MODULE_EXPORT char *api_version = API_VERSION; -MODULE_EXPORT int stay_in_foreground = 0; -MODULE_EXPORT int supports_multiple = 1; -MODULE_EXPORT char *symbol_prefix = "olimex1x9_"; - -/** - * Initialize the driver. - * \param drvthis Pointer to driver structure. - * \retval 0 Success. - * \retval <0 Error. - */ -MODULE_EXPORT int -olimex1x9_init (Driver *drvthis) -{ - PrivateData *p; - const char *configvalue; - char buffer[LEN_INIT_SEQ]; - uint8_t *preamble; - int i; - - /* Allocate and store private data */ - p = (PrivateData *) malloc(sizeof(PrivateData)); - if (p == NULL) - return -1; - if (drvthis->store_private_ptr(drvthis, p)) - return -1; - - configvalue = drvthis->config_get_string(drvthis->name, "Device", 0, I2C_DEFAULT_DEVICE); - p->dev = i2c_open(configvalue, BUS_ADDRESS); - if (!p->dev) { - report(RPT_ERR, "open i2c device '%s' failed: %s", configvalue, strerror(errno)); - return(-1); - } - - buffer[0] = 0xC8; /* Mode register */ - buffer[1] = 0xF0; /* Blink register */ - buffer[2] = 0xE0; /* Device select register */ - buffer[3] = 0x00; /* Point register */ - for (i = 4; i < LEN_INIT_SEQ; ++i) - buffer[i] = 0xFF; - - if (i2c_write(p->dev, buffer, LEN_INIT_SEQ) < 0) { - report(RPT_ERR, "I2C: %s: sending of initialization data failed: %s", configvalue, strerror(errno)); - return (-1); - } - - preamble = (uint8_t *) p->buf; - preamble[0] = 0xE0; /* Device select register */ - preamble[1] = 0x00; /* Point register */ - - report(RPT_DEBUG, "%s: init() done", drvthis->name); - - return 0; -} - - -/** - * Close the driver (do necessary clean-up). - * \param drvthis Pointer to driver structure. - */ -MODULE_EXPORT void -olimex1x9_close (Driver *drvthis) -{ - PrivateData *p = drvthis->private_data; - - if (p != NULL) { - i2c_close(p->dev); - free(p); - } - drvthis->store_private_ptr(drvthis, NULL); -} - - -/** - * Return the display width in characters. - * \param drvthis Pointer to driver structure. - * \return Number of characters the display is wide. - */ -MODULE_EXPORT int -olimex1x9_width (Driver *drvthis) -{ - return 9; -} - - -/** - * Return the display height in characters. - * \param drvthis Pointer to driver structure. - * \return Number of characters the display is high. - */ -MODULE_EXPORT int -olimex1x9_height (Driver *drvthis) -{ - return 1; -} - - -/** - * Clear the screen. - * \param drvthis Pointer to driver structure. - */ -MODULE_EXPORT void -olimex1x9_clear (Driver *drvthis) -{ - PrivateData *p = drvthis->private_data; - - /* Don't overwrite the preamble part of the buffer */ - memset(&p->buf[1], 0, sizeof(p->buf) - sizeof(p->buf[0])); -} - - -/** - * Flush data on screen to the display. - * \param drvthis Pointer to driver structure. - */ -MODULE_EXPORT void -olimex1x9_flush (Driver *drvthis) -{ - PrivateData *p = drvthis->private_data; - - i2c_write(p->dev, p->buf, sizeof(p->buf)); -} - - -/** - * Print a string on the screen at position (x,y). - * The upper-left corner is (1,1), the lower-right corner is (9, 1). - * \param drvthis Pointer to driver structure. - * \param x Horizontal character position (column). - * \param y Vertical character position (row). - * \param string String that gets written. - */ -MODULE_EXPORT void -olimex1x9_string (Driver *drvthis, int x, int y, const unsigned char string[]) -{ - PrivateData *p = drvthis->private_data; - int pos = 10 - x; /* The left side is on the upper end of the buffer */ - int count = 0; - - while (string[count]) { - switch (string[count]) { - case '\b': /* Allow composition of characters */ - ++pos; - break; - case ':': /* We can't display a proper ':' */ - case '.': /* Use the dot between characters if possible */ - if (pos < 9 && - !(p->buf[pos+1] & htons(olimex1x9_font['.']))) - ++pos; - /* fall through */ - default: - if (pos >= 1 && pos <= 9) /* no buffer overflow */ - p->buf[pos] |= - htons(olimex1x9_font[string[count]]); - --pos; - } - ++count; - } -} - - -/** - * Print a character on the screen at position (x,y). - * The upper-left corner is (1,1), the lower-right corner is (9, 1). - * \param drvthis Pointer to driver structure. - * \param x Horizontal character position (column). - * \param y Vertical character position (row). - * \param c Character that gets written. - */ -MODULE_EXPORT void -olimex1x9_chr (Driver *drvthis, int x, int y, unsigned char c) -{ - PrivateData *p = drvthis->private_data; - - if (x < 1 || x > 9) - return; - - p->buf[10-x] |= olimex1x9_font[c]; -} diff --git a/server/drivers/Olimex_MOD_LCD1x9.h b/server/drivers/Olimex_MOD_LCD1x9.h deleted file mode 100644 index 87d5c66..0000000 --- a/server/drivers/Olimex_MOD_LCD1x9.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef OLIMEX_LCD1x9_H -#define OLIMEX_LCD1x9_H - -MODULE_EXPORT int olimex1x9_init (Driver *drvthis); -MODULE_EXPORT void olimex1x9_close (Driver *drvthis); -MODULE_EXPORT int olimex1x9_width (Driver *drvthis); -MODULE_EXPORT int olimex1x9_height (Driver *drvthis); -MODULE_EXPORT void olimex1x9_clear (Driver *drvthis); -MODULE_EXPORT void olimex1x9_flush (Driver *drvthis); -MODULE_EXPORT void olimex1x9_string (Driver *drvthis, int x, int y, const char string[]); -MODULE_EXPORT void olimex1x9_chr (Driver *drvthis, int x, int y, char c); - -#endif diff --git a/server/drivers/Olimex_MOD_LCD1x9_font.h b/server/drivers/Olimex_MOD_LCD1x9_font.h deleted file mode 100644 index aec1739..0000000 --- a/server/drivers/Olimex_MOD_LCD1x9_font.h +++ /dev/null @@ -1,131 +0,0 @@ -#ifndef OLIMEX_LCD1x9_FONT_H -#define OLIMEX_LCD1x9_FONT_H - -uint16_t olimex1x9_font[256] = { - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, - 0x0000, /* ' ' */ - 0x9800, /* '!' */ - 0x0101, /* '"' */ - 0x5054, /* '#' -- use this for a degree sign */ - 0x0000, /* '$' */ - 0x0000, /* '%' */ - 0x0000, /* '&' */ - 0x0100, /* ''' */ - 0x0096, /* '(' */ - 0x9090, /* ')' */ - 0x6761, /* '*' */ - 0x4640, /* '+' */ - 0x0020, /* ',' */ - 0x4040, /* '-' */ - 0x0800, /* '.' */ - 0x0120, /* '/' */ - 0x9096, /* '0' */ - 0x9000, /* '1' */ - 0x50d2, /* '2' */ - 0xd0d0, /* '3' */ - 0xd044, /* '4' */ - 0xc0d4, /* '5' */ - 0xc0d6, /* '6' */ - 0x9010, /* '7' */ - 0xd0d6, /* '8' */ - 0xd0d4, /* '9' */ - 0x0800, /* ':' same as '.' */ - 0x0000, /* ';' */ - 0x2100, /* '<' */ - 0x0000, /* '=' */ - 0x0021, /* '>' */ - 0x0000, /* '?' */ - 0xffff, /* '@' */ - 0xd056, /* 'A' */ - 0x21d6, /* 'B' */ - 0x0096, /* 'C' */ - 0x0027, /* 'D' */ - 0x00d6, /* 'E' */ - 0x4056, /* 'F' */ - 0xc0d6, /* 'G' */ - 0xd046, /* 'H' */ - 0x0688, /* 'I' */ - 0x9080, /* 'J' */ - 0x2146, /* 'K' */ - 0x0086, /* 'L' */ - 0x9107, /* 'M' */ - 0xb007, /* 'N' */ - 0x9096, /* 'O' */ - 0x5056, /* 'P' */ - 0xb096, /* 'Q' */ - 0x7056, /* 'R' */ - 0xc0d4, /* 'S' */ - 0x0610, /* 'T' */ - 0x9086, /* 'U' */ - 0x0126, /* 'V' */ - 0xb026, /* 'W' */ - 0x2121, /* 'X' */ - 0xd0c4, /* 'Y' */ - 0x01b0, /* 'Z' */ - 0x0096, /* '[' */ - 0x2001, /* '\' */ - 0x9090, /* ']' */ - 0x0010, /* '^' */ - 0x0080, /* '_' */ - 0x0400, /* '`' */ - 0x02c2, /* 'a' */ - 0xc0c6, /* 'b' */ - 0x00c2, /* 'c' */ - 0xd0c2, /* 'd' */ - 0x00e2, /* 'e' */ - 0x0056, /* 'f' */ - 0xe080, /* 'g' */ - 0xc046, /* 'h' */ - 0x8000, /* 'i' */ - 0x9080, /* 'j' */ - 0x6046, /* 'k' */ - 0x0026, /* 'l' */ - 0xc242, /* 'm' */ - 0xc042, /* 'n' */ - 0xc0c2, /* 'o' */ - 0x5056, /* 'p' */ - 0xd054, /* 'q' */ - 0x0042, /* 'r' */ - 0x6080, /* 's' */ - 0x00c6, /* 't' */ - 0x8082, /* 'u' */ - 0x0022, /* 'v' */ - 0xa022, /* 'w' */ - 0x2121, /* 'x' */ - 0xa080, /* 'y' */ - 0x00e0, /* 'z' */ - 0x0000 -}; - -#endif diff --git a/server/drivers/glk.c b/server/drivers/glk.c index c3bead8..75c1378 100644 --- a/server/drivers/glk.c +++ b/server/drivers/glk.c @@ -188,11 +188,6 @@ glk_init(Driver *drvthis) p->width = 40; p->height = 8; p->gpo_count = 1; break; - case 0x20 : - p->model = "GLK12232-25-SM-USB"; - p->width = 20; p->height = 4; - p->gpo_count = 2; - break; case 0x21 : p->model = "GLK128128-25"; p->width = 20; p->height = 16; @@ -203,10 +198,6 @@ glk_init(Driver *drvthis) p->gpo_count = 2; break; case 0x23 : - p->model = "GLT12232-SM-USB"; - p->width = 20; p->height = 4; - p->gpo_count = 2; - break; case 0x24 : p->model = "GLK12232-25-SM"; p->width = 20; p->height = 4; @@ -762,23 +753,17 @@ glk_get_key(Driver *drvthis) /* Remap keys according to what LCDproc expects */ switch (c) { - case 'V' : // default mapping - case 'I' : key = "Enter"; // pyramid mapping + case 'V' : key = "Enter"; break; - case 'P' : // default mapping - case 'D' : key = "Left"; // pyramid mapping + case 'P' : key = "Left"; break; - case 'Q' : // default mapping - case 'E' : key = "Right"; // pyramid mapping + case 'Q' : key = "Right"; break; - case 'L' : // default mapping - case 'J' : key = "Escape"; // pyramid mapping + case 'L' : key = "Escape"; break; - case 'U' : // default mapping - case 'C' : key = "Up"; // pyramid mapping + case 'U' : key = "Up"; break; - case 'K' : // default mapping - case 'H' : key = "Down"; // pyramid mapping + case 'K' : key = "Down"; break; default : break; diff --git a/server/drivers/hd44780-drivers.h b/server/drivers/hd44780-drivers.h index 8243105..3b00ec4 100644 --- a/server/drivers/hd44780-drivers.h +++ b/server/drivers/hd44780-drivers.h @@ -16,7 +16,6 @@ # include "hd44780-ext8bit.h" # include "hd44780-serialLpt.h" # include "hd44780-winamp.h" -# include "hd44780-lcm162.h" #endif #include "hd44780-serial.h" #include "hd44780-lis2.h" @@ -61,7 +60,6 @@ static const ConnectionMapping connectionMapping[] = { { "8bit", HD44780_CT_8BIT, IF_TYPE_PARPORT, hd_init_ext8bit }, { "serialLpt", HD44780_CT_SERIALLPT, IF_TYPE_PARPORT, hd_init_serialLpt }, { "winamp", HD44780_CT_WINAMP, IF_TYPE_PARPORT, hd_init_winamp }, - { "lcm162", HD44780_CT_LCM162, IF_TYPE_PARPORT, hd_init_lcm162 }, #endif /* serial connection types */ { "picanlcd", HD44780_CT_PICANLCD, IF_TYPE_SERIAL, hd_init_serial }, diff --git a/server/drivers/hd44780-i2c.c b/server/drivers/hd44780-i2c.c index 2968776..0a5e45e 100644 --- a/server/drivers/hd44780-i2c.c +++ b/server/drivers/hd44780-i2c.c @@ -13,38 +13,17 @@ * 1997 Matthias Prinke * * The connections are: - * PCF8574AP Bit LCD - * P0 (4) 0x01 D4 (11) - * P1 (5) 0x02 D5 (12) - * P2 (6) 0x04 D6 (13) - * P3 (7) 0x08 D7 (14) - * P4 (9) 0x10 RS (4) - * P5 (10) 0x20 RW (5) - * P6 (11) 0x40 EN (6) - * P7 (12) 0x80 /backlight (optional, active-low) + * PCF8574AP LCD + * P0 (4) D4 (11) + * P1 (5) D5 (12) + * P2 (6) D6 (13) + * P3 (7) D7 (14) + * P4 (9) RS (4) + * P5 (10) RW (5) + * P6 (11) EN (6) * - * Configuration: - \verbatim - alternative wiring example: - PCF8574AP: P0 P1 P2 P3 P4 P5 P6 P7 - | | | | | | | | - HD44780: RS RW EN BL D4 D5 D6 D7 - - in LCDd.conf we then need to define - i2c_line_RS=0x01 - i2c_line_RW=0x02 - i2c_line_EN=0x04 - i2c_line_BL=0x80 - i2c_line_D4=0x10 - i2c_line_D5=0x20 - i2c_line_D6=0x40 - i2c_line_D7=0x80 - Backlight=yes - BacklightInvert=yes - - The Backlight Invert is used if a 0 turns the backlight on, and 1 turns it off, i.e. npn transistor -\endverbatim - + * Backlight + * P7 (12) /backlight (optional, active-low) * * Configuration: * device=/dev/i2c-0 # the device file of the i2c bus @@ -82,8 +61,19 @@ #include #include #include +#include +#include + +#ifdef HAVE_DEV_IICBUS_IIC_H +#include +#else /* HAVE_LINUX_I2C_DEV_H */ +#include +/* I2C_SLAVE is missing in linux/i2c-dev.h from kernel headers of 2.4.x kernels */ +#ifndef I2C_SLAVE +#define I2C_SLAVE 0x0703 /* Change slave address */ +#endif +#endif -#include "i2c.h" // Generally, any function that accesses the LCD control lines needs to be // implemented separately for each HW design. This is typically (but not @@ -99,11 +89,6 @@ void i2c_HD44780_close(PrivateData *p); #define RW 0x20 #define EN 0x40 #define BL 0x80 -#define D4 0x01 -#define D5 0x02 -#define D6 0x04 -#define D7 0x08 -#define BL_INVERT 0 // note that the above bits are all meant for the data port of PCF8574 #define I2C_ADDR_MASK 0x7f @@ -112,9 +97,13 @@ void i2c_HD44780_close(PrivateData *p); static void i2c_out(PrivateData *p, unsigned char val) { - unsigned char data[2]; + char data[2]; int datalen; static int no_more_errormsgs=0; +#ifdef HAVE_DEV_IICBUS_IIC_H + struct iiccmd cmd; + bzero(&cmd, sizeof(cmd)); +#endif if (p->port & I2C_PCAX_MASK) { // we have a PCA9554 or similar, that needs a 2-byte command data[0]=1; // command: read/write output port register @@ -125,13 +114,24 @@ i2c_out(PrivateData *p, unsigned char val) datalen=1; } - if (i2c_write(p->i2c, data, datalen) < 0) { - p->hd44780_functions->drv_report(no_more_errormsgs?RPT_DEBUG:RPT_ERR, "HD44780: I2C: i2c write data %u failed: %s", - val, strerror(errno)); +#ifdef HAVE_DEV_IICBUS_IIC_H + cmd.slave = (p->port & I2C_ADDR_MASK) << 1; + cmd.last = 1; + cmd.count = datalen; + cmd.buf = data; + + if (ioctl(p->fd, I2CWRITE, &cmd) < 0) { +#else /* HAVE_LINUX_I2C_DEV_H */ + if (write(p->fd,data,datalen) != datalen) { +#endif + p->hd44780_functions->drv_report(no_more_errormsgs?RPT_DEBUG:RPT_ERR, "HD44780: I2C: i2c write data %u to address 0x%02X failed: %s", + val, p->port & I2C_ADDR_MASK, strerror(errno)); no_more_errormsgs=1; } } +#define DEFAULT_DEVICE "/dev/i2c-0" + /** * Initialize the driver. @@ -144,60 +144,61 @@ hd_init_i2c(Driver *drvthis) { PrivateData *p = (PrivateData*) drvthis->private_data; HD44780_functions *hd44780_functions = p->hd44780_functions; - char device[256] = I2C_DEFAULT_DEVICE; - p->i2c_backlight_invert = drvthis->config_get_bool(drvthis->name, "BacklightInvert", 0, BL_INVERT); - p->i2c_line_RS = drvthis->config_get_int(drvthis->name, "i2c_line_RS", 0, RS); - p->i2c_line_RW = drvthis->config_get_int(drvthis->name, "i2c_line_RW", 0, RW); - p->i2c_line_EN = drvthis->config_get_int(drvthis->name, "i2c_line_EN", 0, EN); - p->i2c_line_BL = drvthis->config_get_int(drvthis->name, "i2c_line_BL", 0, BL); - p->i2c_line_D4 = drvthis->config_get_int(drvthis->name, "i2c_line_D4", 0, D4); - p->i2c_line_D5 = drvthis->config_get_int(drvthis->name, "i2c_line_D5", 0, D5); - p->i2c_line_D6 = drvthis->config_get_int(drvthis->name, "i2c_line_D6", 0, D6); - p->i2c_line_D7 = drvthis->config_get_int(drvthis->name, "i2c_line_D7", 0, D7); - - report(RPT_INFO, "HD44780: I2C: Init using D4 and D5, and or'd lines, invert", p->i2c_line_RS); - report(RPT_INFO, "HD44780: I2C: Pin RS mapped to 0x%02X", p->i2c_line_RS); - report(RPT_INFO, "HD44780: I2C: Pin RW mapped to 0x%02X", p->i2c_line_RW); - report(RPT_INFO, "HD44780: I2C: Pin EN mapped to 0x%02X", p->i2c_line_EN); - report(RPT_INFO, "HD44780: I2C: Pin BL mapped to 0x%02X", p->i2c_line_BL); - report(RPT_INFO, "HD44780: I2C: Pin D4 mapped to 0x%02X", p->i2c_line_D4); - report(RPT_INFO, "HD44780: I2C: Pin D5 mapped to 0x%02X", p->i2c_line_D5); - report(RPT_INFO, "HD44780: I2C: Pin D6 mapped to 0x%02X", p->i2c_line_D6); - report(RPT_INFO, "HD44780: I2C: Pin D7 mapped to 0x%02X", p->i2c_line_D7); - report(RPT_INFO, "HD44780: I2C: Invert Backlight %d", p->i2c_backlight_invert); - + int enableLines = EN; + char device[256] = DEFAULT_DEVICE; #ifdef HAVE_DEV_IICBUS_IIC_H struct iiccmd cmd; bzero(&cmd, sizeof(cmd)); #endif - p->backlight_bit = p->i2c_line_BL; + p->backlight_bit = BL; /* READ CONFIG FILE */ /* Get serial device to use */ - strncpy(device, drvthis->config_get_string(drvthis->name, "Device", 0, I2C_DEFAULT_DEVICE), sizeof(device)); + strncpy(device, drvthis->config_get_string(drvthis->name, "Device", 0, DEFAULT_DEVICE), sizeof(device)); device[sizeof(device)-1] = '\0'; report(RPT_INFO,"HD44780: I2C: Using device '%s' and address 0x%02X for a %s", device, p->port & I2C_ADDR_MASK, (p->port & I2C_PCAX_MASK) ? "PCA9554(A)" : "PCF8574(A)"); - p->i2c = i2c_open(device, p->port & I2C_ADDR_MASK); - if (!p->i2c) { - report(RPT_ERR, "HD44780: I2C: connecting to device '%s' slave 0x%02X failed:", device, p->port & I2C_ADDR_MASK, strerror(errno)); + // Open the I2C device + p->fd = open(device, O_RDWR); + if (p->fd < 0) { + report(RPT_ERR, "HD44780: I2C: open i2c device '%s' failed: %s", device, strerror(errno)); return(-1); } + // Set I2C address +#ifdef HAVE_DEV_IICBUS_IIC_H + cmd.slave = (p->port & I2C_ADDR_MASK) << 1; + cmd.last = 0; + cmd.count = 0; + if (ioctl(p->fd, I2CRSTCARD, &cmd) < 0) { + report(RPT_ERR, "HD44780: I2C: reset bus failed: %s", strerror(errno)); + return -1; + } + if (ioctl(p->fd, I2CSTART, &cmd) < 0) { + report(RPT_ERR, "HD44780: I2C: set address to 0x%02X: %s", p->port & I2C_ADDR_MASK, strerror(errno)); + return -1; + } +#else /* HAVE_LINUX_I2C_DEV_H */ + if (ioctl(p->fd,I2C_SLAVE, p->port & I2C_ADDR_MASK) < 0) { + report(RPT_ERR, "HD44780: I2C: set address to '%i': %s", p->port & I2C_ADDR_MASK, strerror(errno)); + return(-1); + } +#endif + if (p->port & I2C_PCAX_MASK) { // we have a PCA9554 or similar, that needs special config - unsigned char data[2]; + char data[2]; data[0] = 2; // command: set polarity inversion data[1] = 0; // -> no polarity inversion - if (i2c_write(p->i2c, data, 2) < 0) { + if (write(p->fd,data,2) != 2) { report(RPT_ERR, "HD44780: I2C: i2c set polarity inversion failed: %s", strerror(errno)); } data[0] = 3; // command: set output direction data[1] = 0; // -> all pins are outputs - if (i2c_write(p->i2c, data, 2) <0) { + if (write(p->fd,data,2) != 2) { report(RPT_ERR, "HD44780: I2C: i2c set output direction failed: %s", strerror(errno)); } } @@ -208,49 +209,44 @@ hd_init_i2c(Driver *drvthis) // powerup the lcd now /* We'll now send 0x03 a couple of times, - * which is in fact (FUNCSET | IF_8BIT) >> 4 - */ - i2c_out(p, p->i2c_line_D4 | p->i2c_line_D5); + * which is in fact (FUNCSET | IF_8BIT) >> 4 */ + i2c_out(p, 0x03); if (p->delayBus) hd44780_functions->uPause(p, 1); - i2c_out(p, p->i2c_line_EN | p->i2c_line_D4 | p->i2c_line_D5); + i2c_out(p, enableLines | 0x03); if (p->delayBus) hd44780_functions->uPause(p, 1); - i2c_out(p, p->i2c_line_D4 | p->i2c_line_D5); + i2c_out(p, 0x03); hd44780_functions->uPause(p, 15000); - i2c_out(p, p->i2c_line_EN | p->i2c_line_D4 | p->i2c_line_D5); + i2c_out(p, enableLines | 0x03); if (p->delayBus) hd44780_functions->uPause(p, 1); - i2c_out(p, p->i2c_line_D4 | p->i2c_line_D5); + i2c_out(p, 0x03); hd44780_functions->uPause(p, 5000); - i2c_out(p, p->i2c_line_EN | p->i2c_line_D4 | p->i2c_line_D5); + i2c_out(p, enableLines | 0x03); if (p->delayBus) hd44780_functions->uPause(p, 1); - i2c_out(p, p->i2c_line_D4 | p->i2c_line_D5); + i2c_out(p, 0x03); hd44780_functions->uPause(p, 100); - i2c_out(p, p->i2c_line_EN | p->i2c_line_D4 | p->i2c_line_D5); + i2c_out(p, enableLines | 0x03); if (p->delayBus) hd44780_functions->uPause(p, 1); - i2c_out(p, p->i2c_line_D4 | p->i2c_line_D5); + i2c_out(p, 0x03); hd44780_functions->uPause(p, 100); // now in 8-bit mode... set 4-bit mode - /* - OLD (FUNCSET | IF_4BIT) >> 4 0x02 - ALT (FUNCSET | IF_4BIT) 0x20 - */ - i2c_out(p, p->i2c_line_D5); + i2c_out(p, 0x02); if (p->delayBus) hd44780_functions->uPause(p, 1); - i2c_out(p, p->i2c_line_EN | p->i2c_line_D5); + i2c_out(p, enableLines | 0x02); if (p->delayBus) hd44780_functions->uPause(p, 1); - i2c_out(p, p->i2c_line_D5); + i2c_out(p, 0x02); hd44780_functions->uPause(p, 100); // Set up two-line, small character (5x8) mode @@ -264,8 +260,12 @@ hd_init_i2c(Driver *drvthis) void i2c_HD44780_close(PrivateData *p) { - if (p->i2c >= 0) - i2c_close(p->i2c); + if (p->fd >= 0) { +#ifdef HAVE_DEV_IICBUS_IIC_H + ioctl(p->fd, I2CSTOP); +#endif + close(p->fd); + } } @@ -279,28 +279,23 @@ i2c_HD44780_close(PrivateData *p) { void i2c_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch) { - unsigned char portControl = 0; - unsigned char h=0; - unsigned char l=0; - if( ch & 0x80 ) h |= p->i2c_line_D7; - if( ch & 0x40 ) h |= p->i2c_line_D6; - if( ch & 0x20 ) h |= p->i2c_line_D5; - if( ch & 0x10 ) h |= p->i2c_line_D4; - if( ch & 0x08 ) l |= p->i2c_line_D7; - if( ch & 0x04 ) l |= p->i2c_line_D6; - if( ch & 0x02 ) l |= p->i2c_line_D5; - if( ch & 0x01 ) l |= p->i2c_line_D4; + unsigned char enableLines = 0, portControl = 0; + unsigned char h = (ch >> 4) & 0x0f; // high and low nibbles + unsigned char l = ch & 0x0f; + if (flags == RS_INSTR) portControl = 0; else //if (flags == RS_DATA) - portControl = p->i2c_line_RS; + portControl = RS; portControl |= p->backlight_bit; + enableLines = EN; + i2c_out(p, portControl | h); if (p->delayBus) p->hd44780_functions->uPause(p, 1); - i2c_out(p, p->i2c_line_EN | portControl | h); + i2c_out(p, enableLines | portControl | h); if (p->delayBus) p->hd44780_functions->uPause(p, 1); i2c_out(p, portControl | h); @@ -308,7 +303,7 @@ i2c_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flag i2c_out(p, portControl | l); if (p->delayBus) p->hd44780_functions->uPause(p, 1); - i2c_out(p, p->i2c_line_EN | portControl | l); + i2c_out(p, enableLines | portControl | l); if (p->delayBus) p->hd44780_functions->uPause(p, 1); i2c_out(p, portControl | l); @@ -322,9 +317,7 @@ i2c_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flag */ void i2c_HD44780_backlight(PrivateData *p, unsigned char state) { - if ( p->i2c_backlight_invert == 0 ) - p->backlight_bit = ((!p->have_backlight||state) ? 0 : p->i2c_line_BL); - else // Inverted backlight - npn transistor - p->backlight_bit = ((p->have_backlight && state) ? p->i2c_line_BL : 0); + p->backlight_bit = ((!p->have_backlight||state) ? 0 : BL); + i2c_out(p, p->backlight_bit); } diff --git a/server/drivers/hd44780-lcm162.c b/server/drivers/hd44780-lcm162.c deleted file mode 100644 index b625e2c..0000000 --- a/server/drivers/hd44780-lcm162.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 8-bit driver module for Hitachi HD44780 based LCD displays. - * The LCD is operated in it's 8 bit-mode to be connected to a single - * PC parallel port. - * - * Copyright (c) 1999, 1995 Benjamin Tse - * 2001 Joris Robijn - * 2009 Holger Rasch - * - * Created modular driver Dec 1999, Benjamin Tse - * - * Based on the code in the lcdtime package which uses the LCD - * controller in its 8-bit mode. - * - * This file is released under the GNU General Public License. Refer to the - * COPYING file distributed with this package. - */ - -/* - * Copied from "hd44780-ext8.c" and modified for lcm-162 module - * found in nexcom nsaXXXX models. - */ - -#include "hd44780-lcm162.h" -#include "hd44780-low.h" -#include "lpt-port.h" -#include "port.h" -#include "report.h" - -#include -#include -#include - -// Generally, any function that accesses the LCD control lines needs to be -// implemented separately for each HW design. This is typically (but not -// restricted to): -// HD44780_senddata -// HD44780_readkeypad - -void lcm162_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch); -void lcm162_HD44780_backlight(PrivateData *p, unsigned char state); -unsigned char lcm162_HD44780_readkeypad(PrivateData *p, unsigned int YData); -void lcm162_HD44780_output(PrivateData *p, int data); - -/* lcm-162 specific mapping parport <-> hd44780 signals */ -#define RS SEL -#define RW INIT -#define EN1 LF - - -// initialise the driver -int -hd_init_lcm162(Driver *drvthis) -{ - PrivateData *p = (PrivateData*) drvthis->private_data; - HD44780_functions *hd44780_functions = p->hd44780_functions; - - // Reserve the port registers - if (port_access_multiple(p->port,3)) { - report(RPT_ERR, "%s: cannot get IO-permission for 0x%03X: %s", - drvthis->name, p->port, strerror(errno)); - return -1; - } - - hd44780_functions->senddata = lcm162_HD44780_senddata; - hd44780_functions->backlight = lcm162_HD44780_backlight; - hd44780_functions->readkeypad = lcm162_HD44780_readkeypad; - - // setup the lcd in 8 bit mode - hd44780_functions->senddata(p, 0, RS_INSTR, FUNCSET | IF_8BIT); - hd44780_functions->uPause(p, 4100); - hd44780_functions->senddata(p, 0, RS_INSTR, FUNCSET | IF_8BIT); - hd44780_functions->uPause(p, 100); - hd44780_functions->senddata(p, 0, RS_INSTR, FUNCSET | IF_8BIT | TWOLINE | SMALLCHAR); - hd44780_functions->uPause(p, 40); - - common_init (p, IF_8BIT); - - if (p->have_keypad) - p->stuckinputs = 0; /* unused here */ - - // Writes new value to the "bargraph" latches - hd44780_functions->output = 0; - return 0; -} - -// lcm162_HD44780_senddata -void -lcm162_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch) -{ - unsigned char enableLines = 0, portControl; - - // Only one controller is supported - enableLines = EN1; - - if (flags == RS_INSTR) - portControl = 0; - else //if (iflags == RS_DATA) - portControl = RS; - - portControl |= p->backlight_bit; - - port_out(p->port + 2, portControl ^ OUTMASK); - port_out(p->port, ch); - if (p->delayBus) p->hd44780_functions->uPause(p, 1); - port_out(p->port + 2, (enableLines|portControl) ^ OUTMASK); - if (p->delayBus) p->hd44780_functions->uPause(p, 1); - port_out(p->port + 2, portControl ^ OUTMASK); -} - -void lcm162_HD44780_backlight(PrivateData *p, unsigned char state) -{ - /* ignore config, there is no backlight control on the lcm-162 */ - return; -} - -unsigned char lcm162_HD44780_readkeypad(PrivateData *p, unsigned int YData) -{ - unsigned char readval; - - if (YData) return 0; /* no keymatrix */ - - readval = port_in(p->port + 1); - if (readval & ACK) { /* a key is pressed */ - /* 4 keys encoded in signals PAPEREND and FAULT */ - /* map them to low nibble (multiple keys not supported) */ - return 1 << ( - ((readval & FAULT) / FAULT << 1) | - ((readval & PAPEREND) / PAPEREND) - ); - } else - return 0; -} diff --git a/server/drivers/hd44780-lcm162.h b/server/drivers/hd44780-lcm162.h deleted file mode 100644 index fb1d004..0000000 --- a/server/drivers/hd44780-lcm162.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef HD_LCM162_H -#define HD_LCM162_H - -#include "lcd.h" /* for Driver */ - -// initialise this particular driver -int hd_init_lcm162(Driver *drvthis); - -#endif diff --git a/server/drivers/hd44780-low.h b/server/drivers/hd44780-low.h index 006625c..47acf45 100644 --- a/server/drivers/hd44780-low.h +++ b/server/drivers/hd44780-low.h @@ -29,8 +29,6 @@ # include #endif -#include "i2c.h" - /** \name Symbolic names for connection types *@{*/ #define HD44780_CT_UNKNOWN 0 @@ -59,7 +57,6 @@ #define HD44780_CT_PIPLATE 23 #define HD44780_CT_SPI 24 #define HD44780_CT_PIFACECAD 25 -#define HD44780_CT_LCM162 26 /**@}*/ /** \name Symbolic names for interface types @@ -158,22 +155,6 @@ typedef struct hd44780_private_data { int ftdi_line_backlight; #endif -#ifdef HAVE_I2C - /* i2c based connection types */ - - int i2c_backlight_invert; - int i2c_line_RS; - int i2c_line_RW; - int i2c_line_EN; - int i2c_line_BL; - int i2c_line_D4; - int i2c_line_D5; - int i2c_line_D6; - int i2c_line_D7; - - I2CHandle *i2c; -#endif - #ifdef WITH_ETHLCD int sock; /**< socket for TCP devices */ #endif diff --git a/server/drivers/hd44780-rpi.c b/server/drivers/hd44780-rpi.c index 26ffb94..5ef9d18 100644 --- a/server/drivers/hd44780-rpi.c +++ b/server/drivers/hd44780-rpi.c @@ -71,8 +71,6 @@ void lcdrpi_HD44780_close(PrivateData *p); */ static volatile unsigned int *gpio_map = NULL; -static unsigned int gpio_base_address = 0; - /* * Two different board revisions are currently in widespread use. The * GPIO mappings differ slightly - Not enough to kill a system yet. @@ -121,7 +119,7 @@ setup_io(Driver *drvthis) PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, - gpio_base_address); + GPIO_BASE); if (gpio_map == MAP_FAILED) { report(RPT_ERR, "setup_io: mmap failed: %s", strerror(errno)); @@ -163,8 +161,9 @@ check_board_rev(Driver *drvthis) /* On boards that have been overvolted, the MSB will be set */ rev &= 0x00ff; - if ((strcmp(hw, "BCM2708") != 0 && strcmp(hw, "BCM2709") != 0) || rev == 0) { - report(RPT_ERR, "check_board_rev: This board is not recognized as a Raspberry Pi! Found:%s",hw); + + if (strcmp(hw, "BCM2708") != 0 || rev == 0) { + report(RPT_ERR, "check_board_rev: This board is not recognized as a Raspberry Pi!"); return NULL; } @@ -172,22 +171,17 @@ check_board_rev(Driver *drvthis) * in the wild). */ if (rev < 4) { report(RPT_INFO, "check_board_rev: Revision 1 board detected"); - gpio_base_address = BCM2835_PERI_BASE_PI12 + GPIO_BASE_OFFSET; return gpio_pins_R1; } /* Currently, Rev 2 boards are 0x004, 0x005, or 0x006. This will need * updating as new revisions are released, but it is unlikely that P1 * will change. */ - if (rev > 3 && rev <= 21) { + if (rev > 3) { report(RPT_INFO, "check_board_rev: Revision 2 board detected"); - gpio_base_address = BCM2835_PERI_BASE_PI12 + GPIO_BASE_OFFSET; return gpio_pins_R2; } - report(RPT_INFO, "check_board_rev: Raspberry Pi 3 board detected"); - gpio_base_address = BCM2835_PERI_BASE_PI3 + GPIO_BASE_OFFSET; - return gpio_pins_R2; - + return NULL; } @@ -291,7 +285,7 @@ lcdrpi_HD44780_close(PrivateData *p) /* Unmap and free memory */ if (gpio_map != NULL) - munmap((void *) gpio_map, GPIO_BLOCK_SIZE); + munmap((caddr_t) gpio_map, GPIO_BLOCK_SIZE); if (p->rpi_gpio != NULL) free(p->rpi_gpio); p->rpi_gpio = NULL; diff --git a/server/drivers/hd44780-rpi.h b/server/drivers/hd44780-rpi.h index fc34408..8b01be7 100644 --- a/server/drivers/hd44780-rpi.h +++ b/server/drivers/hd44780-rpi.h @@ -20,10 +20,9 @@ struct rpi_gpio_map { }; /** Peripheral base address of the BCM2835 */ -#define BCM2835_PERI_BASE_PI12 0x20000000 -#define BCM2835_PERI_BASE_PI3 0x3F000000 -/** GPIO register start address offset from PERI_BASE */ -#define GPIO_BASE_OFFSET 0x200000 +#define BCM2835_PERI_BASE 0x20000000 +/** GPIO register start address */ +#define GPIO_BASE BCM2835_PERI_BASE + 0x200000 /** Length of register space */ #define GPIO_BLOCK_SIZE 180 /** The Pi has 32 GPIO pins */ diff --git a/server/drivers/i2c.c b/server/drivers/i2c.c deleted file mode 100644 index 2ea0486..0000000 --- a/server/drivers/i2c.c +++ /dev/null @@ -1,120 +0,0 @@ -/** \file server/drivers/i2c.c - * OS agnostic functions to access i2c devices. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include -#include - -#ifdef HAVE_DEV_IICBUS_IIC_H -#include -#else /* HAVE_LINUX_I2C_DEV_H */ -#include -/* I2C_SLAVE is missing in linux/i2c-dev.h from kernel headers of 2.4.x kernels -*/ -#ifndef I2C_SLAVE -#define I2C_SLAVE 0x0703 /* ioctl to change slave address */ -#endif -#endif - -#define I2C_DEFAULT_DEVICE "/dev/i2c-0" - -/** data to access an i2c slave */ -typedef struct { - int fd; /**< file descriptor of the i2c device */ -#ifdef HAVE_DEV_IICBUS_IIC_H - unsigned int slave; /**< slave address */ -#endif -} I2CHandle; - - -/** - * setup connection to i2c slave - * \param device device file of the i2c bus - * \param addr use this slave address - * \retval NULL Error - * \retval Pointer to handle of the connection - */ -I2CHandle *i2c_open(const char *device, unsigned int addr) -{ - I2CHandle *h; -#ifdef HAVE_DEV_IICBUS_IIC_H - struct iiccmd cmd; - bzero(&cmd, sizeof(cmd)); -#endif - - - h = malloc(sizeof(*h)); - if(!h) - return NULL; - - h->fd = open(device, O_RDWR); - if(h->fd < 0) - goto free; - -#ifdef HAVE_DEV_IICBUS_IIC_H - cmd.slave = h->slave = addr << 1; - cmd.last = 0; - cmd.count = 0; - if (ioctl(h->fd, I2CRSTCARD, &cmd) < 0) - goto close; - if (ioctl(h->fd, I2CSTART, &cmd) < 0) - goto close; -#else /* HAVE_LINUX_I2C_DEV_H */ - if (ioctl(h->fd, I2C_SLAVE, addr) < 0) { - goto close; - } -#endif - - return h; - -close: - close(h->fd); -free: - free(h); - return NULL; -} - -/** - * close connection to i2c slave - */ -void i2c_close(I2CHandle *h) -{ -#ifdef HAVE_DEV_IICBUS_IIC_H - ioctl(h->fd, I2CSTOP); -#endif - close(h->fd); - free(h); -} - -/** - * write data to an i2c slave - * \param h Handle of i2c slave - * \param buf Buffer to send to the device - * \param count Number of bytes to write - * \retval >=0 Success. - * \retval <0 Error. - */ -int i2c_write(I2CHandle *h, void *buf, unsigned int count) -{ -#ifdef HAVE_DEV_IICBUS_IIC_H - struct iiccmd cmd; - bzero(&cmd, sizeof(cmd)); - cmd.slave = h->slave; - cmd.last = 1; - cmd.count = count; - cmd.buf = buf; - - return ioctl(h->fd, I2CWRITE, &cmd); -#else /* HAVE_LINUX_I2C_DEV_H */ - if (write(h->fd, buf, count) != count) - return -1; - return 0; -#endif -} diff --git a/server/drivers/i2c.h b/server/drivers/i2c.h deleted file mode 100644 index 4b38d22..0000000 --- a/server/drivers/i2c.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef I2C_H -#define I2C_H - -struct i2c_data; - -typedef struct i2c_data I2CHandle; - -#define I2C_DEFAULT_DEVICE "/dev/i2c-0" - -extern I2CHandle *i2c_open(const char *device, unsigned int addr); -extern void i2c_close(I2CHandle *h); -extern int i2c_write(I2CHandle *h, void *buf, unsigned int count); - -#endif /* I2C_H */ diff --git a/server/drivers/lcd_lib.c b/server/drivers/lcd_lib.c index 2e990fd..7a11605 100644 --- a/server/drivers/lcd_lib.c +++ b/server/drivers/lcd_lib.c @@ -34,9 +34,9 @@ lib_hbar_static (Driver *drvthis, int x, int y, int len, int promille, int optio if ( pixels >= cellwidth ) { /* write a "full" block to the screen... */ -// #if defined(SEAMLESS_HBARS) -// drvthis->chr (drvthis, x+pos, y, cellwidth + cc_offset); -// #else +#if defined(SEAMLESS_HBARS) + drvthis->chr (drvthis, x+pos, y, cellwidth + cc_offset); +#else drvthis->icon (drvthis, x+pos, y, ICON_BLOCK_FILLED); #endif } diff --git a/server/drivers/linux_input.c b/server/drivers/linux_input.c deleted file mode 100644 index 86a3855..0000000 --- a/server/drivers/linux_input.c +++ /dev/null @@ -1,230 +0,0 @@ -/** \file server/drivers/linux_input.c - * LCDd \c linux event device driver for inputting data from the input - * subsystem of the linux kernel.. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "lcd.h" -#include "linux_input.h" -#include "report.h" -#include "shared/LL.h" - -#define LINUXINPUT_DEFAULT_DEVICE "/dev/input/event0" - -/** describe the button of a keycode */ -struct keycode { - unsigned short code; - char *button; -}; - -/** - * Parse key definition from config file - * \param configvalue value part of the config file entry - * \retval NULL Error. - * \retval else Pointer to newly allocated struct keycode. - */ -static struct keycode * -keycode_create(const char *configvalue) -{ - int code; - char *button; - struct keycode *ret; - - code = atoi(configvalue); - if (code < 0 || code > UINT16_MAX) - return NULL; - - button = strchr(configvalue,','); - if (!button) - return NULL; - button = strdup(&button[1]); - if (!button) - return NULL; - - ret = malloc(sizeof(*ret)); - if (ret) { - ret->code = code; - ret->button = button; - } - - return ret; -} - -/** private data for the linux event device driver */ -typedef struct linuxInput_private_data { - int fd; - LinkedList *buttonmap; -} PrivateData; - - -// Vars for the server core -MODULE_EXPORT char *api_version = API_VERSION; -MODULE_EXPORT int stay_in_foreground = 0; -MODULE_EXPORT int supports_multiple = 1; -MODULE_EXPORT char *symbol_prefix = "linuxInput_"; - - -/** - * Initialize the driver. - * \param drvthis Pointer to driver structure. - * \retval 0 Success. - * \retval <0 Error. - */ -MODULE_EXPORT int -linuxInput_init (Driver *drvthis) -{ - PrivateData *p; - const char *s; - struct keycode *key; - int i; - - /* Allocate and store private data */ - p = (PrivateData *) calloc(1, sizeof(PrivateData)); - if (p == NULL) - return -1; - if (drvthis->store_private_ptr(drvthis, p)) - return -1; - - /* initialize private data */ - p->fd = -1; - if ((p->buttonmap = LL_new()) == NULL) { - report(RPT_ERR, "%s: cannot allocate memory for buttons", drvthis->name); - return -1; - } - - /* Read config file */ - - /* What device should be used */ - s = drvthis->config_get_string(drvthis->name, "Device", 0, - LINUXINPUT_DEFAULT_DEVICE); - report(RPT_INFO, "%s: using Device %s", drvthis->name, s); - - - if ((p->fd = open(s, O_RDONLY | O_NONBLOCK)) < 0) { - report(RPT_ERR, "%s: open(%s) failed (%s)", - drvthis->name, s, strerror(errno)); - return -1; - } - - for (i = 0; (s = drvthis->config_get_string(drvthis->name, "key", i, NULL)) != NULL; i++) { - if ((key = keycode_create(s)) == NULL) { - report(RPT_ERR, "%s: parsing configvalue '%s' failed", - drvthis->name, s); - continue; - } - LL_AddNode(p->buttonmap, key); - } - - report(RPT_DEBUG, "%s: init() done", drvthis->name); - - return 0; -} - - -/** - * Close the driver (do necessary clean-up). - * \param drvthis Pointer to driver structure. - */ -MODULE_EXPORT void -linuxInput_close (Driver *drvthis) -{ - PrivateData *p = drvthis->private_data; - struct keycode *k; - - if (p != NULL) { - if (p->fd >= 0) - close(p->fd); - - if (p->buttonmap != NULL) { - while ((k = LL_Pop(p->buttonmap)) != NULL) { - free(k->button); - free(k); - } - LL_Destroy(p->buttonmap); - } - - free(p); - } - drvthis->store_private_ptr(drvthis, NULL); -} - - -/** - * Helper function to check LL items against a given key code. - * \param data Pointer to data of list item - * \param codep Pointer to value holding the received key code - * \retval 0 We found the right item. - * \retval else We need to continue searching. - */ -static int -compare_with_keycode (void *data, void *codep) -{ - uint16_t code = *(uint16_t *)codep; - struct keycode *k = data; - - return k->code != code; -} - -/** - * Read the next input event. - * \param drvthis Pointer to driver structure. - * \retval String representation of the key; - * \c NULL for nothing available / error. - */ -MODULE_EXPORT const char * -linuxInput_get_key (Driver *drvthis) -{ - PrivateData *p = drvthis->private_data; - struct input_event event; - struct keycode *k; - - if (read(p->fd, &event, sizeof(event)) != sizeof(event)) - return NULL; - - /* Ignore release events and not-key events */ - if (event.type != EV_KEY || event.value == 0) - return NULL; - - switch (event.code) { - case KEY_ESC: - return "Escape"; - - case KEY_UP: - return "Up"; - - case KEY_LEFT: - return "Left"; - - case KEY_RIGHT: - return "Right"; - - case KEY_DOWN: - return "Down"; - - case KEY_ENTER: - case KEY_KPENTER: - return "Enter"; - - default: - LL_Rewind(p->buttonmap); - k = LL_Find(p->buttonmap, compare_with_keycode, &event.code); - if (k) - return k->button; - - return NULL; - } -} diff --git a/server/drivers/linux_input.h b/server/drivers/linux_input.h deleted file mode 100644 index 8477f58..0000000 --- a/server/drivers/linux_input.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef LINUX_INPUT_H -#define LINUX_INPUT_H - -#include "lcd.h" - -MODULE_EXPORT int linuxInput_init (Driver *drvthis); -MODULE_EXPORT void linuxInput_close (Driver *drvthis); - -MODULE_EXPORT const char *linuxInput_get_key (Driver *drvthis); - -#endif diff --git a/server/drivers/mtc_s16209x.c b/server/drivers/mtc_s16209x.c index fda30f8..55e48e7 100644 --- a/server/drivers/mtc_s16209x.c +++ b/server/drivers/mtc_s16209x.c @@ -49,7 +49,6 @@ #include #include #include -#include #ifdef HAVE_CONFIG_H # include "config.h" diff --git a/server/drivers/rawserial.c b/server/drivers/rawserial.c index e05ffb4..433273a 100644 --- a/server/drivers/rawserial.c +++ b/server/drivers/rawserial.c @@ -60,13 +60,13 @@ typedef struct rawserial_private_data { /** \name Event loop timing. refresh_time and refresh_delta form the * event loop timing mechanism for configurable update rates. *@{*/ - unsigned int refresh_time; /**< time at the last screen update */ - unsigned int refresh_delta; /**< time step to next screen update */ + uint refresh_time; /**< time at the last screen update */ + uint refresh_delta; /**< time step to next screen update */ /**@}*/ } PrivateData; /* Local prototypes */ -static unsigned int get_millisecond_time(void); +static uint get_millisecond_time(void); /* Vars for the server core */ @@ -303,7 +303,7 @@ rawserial_flush(Driver *drvthis) PrivateData *p = drvthis->private_data; char out[LCD_MAX_WIDTH * LCD_MAX_HEIGHT]; - unsigned int currentTime = get_millisecond_time(); + uint currentTime = get_millisecond_time(); int t_delta = currentTime - p->refresh_time; /* @@ -415,7 +415,7 @@ rawserial_get_info(Driver *drvthis) * * \return int with current millisecond time. */ -static unsigned +static uint get_millisecond_time(void) { struct timeval ts; diff --git a/server/drivers/yard2LCD.c b/server/drivers/yard2LCD.c deleted file mode 100644 index d2d7eb4..0000000 --- a/server/drivers/yard2LCD.c +++ /dev/null @@ -1,658 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by M. Feser * - * Copyright (C) 2013 by R. Geigenberger (Update for YARD2) * - * yard2lcdproc (.A.T.) yard2usb.de * - * * - * * - * This program 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 of the License, or * - * (at your option) any later version. * - * * - * This program 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., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include "lcd.h" -//#define DEBUG -#include "report.h" -#include "yard2LCD.h" -#include "lcd_lib.h" - -/* -//Type of characters currently stored in CGRAM. from lcd.h as info -typedef enum { - standard, // one char is used for heartbeat - vbar, // vertical bars - hbar, // horizontal bars - icons, // standard icons - custom, // custom settings - bignum, // big numbers -} CGmode; -*/ - -typedef enum { - Dmode_standard, - Dmode_graphical -} Dmode; - - -/* Driver private data */ -typedef struct driver_private_data { - int fd; - int width, height; - int gwidth, gheight; - int hspace, vspace; - int cellwidth, cellheight; - int bigcellwidth, bigcellheight; - char *framebuf; - int on_brightness; - int off_brightness; - char hw_brightness; - CGmode ccmode; - Dmode dispmode; - char info[255]; - char LCDtype; -} PrivateData; - -/* Prototypes of internal functions */ -static int yard_hwWrite(Driver *drvthis, unsigned char *yardData, unsigned char Datalen); -static int yard_hwClearLCD(Driver *drvthis); -static int yard_hwEnterGmode(Driver *drvthis); -static int yard_hwGotoXY(Driver *drvthis, unsigned char x, unsigned char y); -static int yard_hwPrintChar(Driver *drvthis, char c); -static int yard_hwPrintCharArray(Driver *drvthis, char *str, unsigned char len); -static int yard_hwSetBrightness(Driver *drvthis, unsigned char brightVal); -static int yard_hwWriteCGRam(Driver *drvthis, unsigned char numChar, unsigned char *data); - - -/* Vars for the server core */ -MODULE_EXPORT char *api_version = API_VERSION; -MODULE_EXPORT int stay_in_foreground = 0; -MODULE_EXPORT int supports_multiple = 0; -MODULE_EXPORT char *symbol_prefix = "yard_"; - -unsigned char yardCmd[64]; - -/* - * Hardware function: Write YARD command to KeyLcd via socket - */ -static int -yard_hwWrite(Driver *drvthis, unsigned char *yardData, unsigned char Datalen) -{ - debug(RPT_DEBUG, "%s: Event 01 - Enter yard_hwWrite: %d - %s",drvthis->name,Datalen,yardData); - PrivateData *p = drvthis->private_data; - unsigned char byteCnt; - - // Send data to YARD server - if ( (Datalen > 0) && (Datalen <= MAX_YARDDATA_SIZE)) - { - byteCnt = write(p->fd, yardData, Datalen); //(char *)&yardCMD - //byteCnt = write(p->fd, "WTEST",5); - if (byteCnt < 0) - { - report(RPT_WARNING, "%s: Can't send data to YARD2 LCDserver !", drvthis->name); - debug(RPT_DEBUG, "%s: Event 01.1 - Can't send data to YARD2 LCDserver !", drvthis->name); - return -1; - } - } - else - { - debug(RPT_DEBUG, "%s: Event 01.1 - %s: Too much Data for YARD Server: %d !", drvthis->name,Datalen); - report(RPT_WARNING, "%s: Too much Data for YARD Server: %d !", drvthis->name,Datalen); - return -1; - } - - - // Just wait for YARD server response; No matter of Data received, but > 2 bytes, normally ROK is send - byteCnt = read(p->fd, (char *)&yardData, sizeof(yardData) ); - if (byteCnt < 0) - { - debug(RPT_DEBUG, "%s: Cannot receive ROK from YARD2 server !", drvthis->name); - report(RPT_ERR, "%s: Cannot receive ROK from YARD2 server !", drvthis->name); - return -1; - } - - return 0; -} - - -/* - * Hardware function: Clears screen - */ -static int -yard_hwClearLCD(Driver *drvthis) -{ - debug(RPT_DEBUG, "%s: Event 02 - Enter yard_hwClearLCD",drvthis->name); - unsigned char cmd; - - cmd = 'C'; // = Clear cmd for YARD - return yard_hwWrite(drvthis, &cmd, 1); -} - -/* - * Hardware function: Shifts cursor to position (x,y), left upper corner equals (1,1) - */ -static int -yard_hwGotoXY(Driver *drvthis, unsigned char x, unsigned char y) -{ - debug(RPT_DEBUG, "%s: Event 03 - Enter yard_hwGotoXY: X.%d - Y.%d",drvthis->name,x,y); - PrivateData *p = (PrivateData *)drvthis->private_data; - unsigned char cmdBuf[5]; - - // Error check - switch (p->dispmode) - { - case Dmode_standard: - { - if ( (x > p->width) || (x < 1) || (y > p->height) || (y < 1) ) - return -1; - - // Setup and send YARD command - cmdBuf[0] = 'G'; - cmdBuf[1] = x - 1; // Zero index start ! lcdproc starts with 1,1, YARD 0,0 - cmdBuf[2] = y - 1; - return yard_hwWrite(drvthis, cmdBuf, 3); - - } - default: { - return -1; - } - } -} - - -/* - * Hardware function: Prints a single character - */ -static int -yard_hwPrintChar(Driver *drvthis, char c) -{ - debug(RPT_DEBUG, "%s: Event 04 - Enter yard_hwPrintChar: %s",drvthis->name,c); - unsigned char cmdBuf[2]; - - // Setup YARD command - cmdBuf[0] = 'W'; - cmdBuf[1] = c; - - // Send command - return yard_hwWrite(drvthis, cmdBuf, 2); -} - -/* - * Hardware function: Prints a character array - */ -static int -yard_hwPrintCharArray(Driver *drvthis, char *str, unsigned char len) -{ - debug(RPT_DEBUG, "%s: Event 05 - Enter yard_hwPrintCharArray: %d - %s",drvthis->name,len,str); - unsigned char cmdBuf[MAX_YARDDATA_SIZE]; - - // Error check - if (len > MAX_YARDDATA_SIZE) - { - report(RPT_WARNING, "%s: PrintCharArray parameter too large !", drvthis->name); - return -1; - } - - cmdBuf[0] = 'W'; - memcpy(&cmdBuf[1], str, len); - - // Send command - return yard_hwWrite(drvthis, cmdBuf, len + 1); -} - -/* - * Hardware function: Sets brightness of the backlight - */ -yard_hwSetBrightness(Driver *drvthis, unsigned char brightVal) -{ - debug(RPT_DEBUG, "%s: Event 06 - Enter yard_hwSetBrightness: %d",drvthis->name,brightVal); - unsigned char cmdBuf[3]; - - // Setup YARD command - cmdBuf[0] = 'B'; - cmdBuf[1] = brightVal; - return yard_hwWrite(drvthis, cmdBuf, 2); -} - -/* - * Hardware function: Writes a character into the CGRAM - */ -static int -yard_hwWriteCGRam(Driver *drvthis, unsigned char numChar, unsigned char *data) -{ - debug(RPT_DEBUG, "%s: Event 07 - Enter yard_hwWriteCGRam: %d - %02X",drvthis->name,numChar,data); - unsigned char cmdBuf[11]; - - // Setup YARD command - cmdBuf[0] = 'I'; - cmdBuf[1] = numChar; - memcpy(&cmdBuf[2], data, 8); - return yard_hwWrite(drvthis, cmdBuf, 10); -} - -/* - * Inits settings and connection - */ -MODULE_EXPORT int -yard_init(Driver *drvthis) -{ - debug(RPT_DEBUG, "%s: Event 08 - Enter yard_init",drvthis->name); - struct sockaddr_un srvAddr; - int tmp, srvAddrLen; - PrivateData *p; - char sockpath[200] = DEFAULT_SOCK_PATH; - unsigned char byteCnt; - char Recbuffer[10]; - - - // Allocate and store private data - p = (PrivateData *)malloc(sizeof(PrivateData)); - if (p == NULL) - return -1; - if (drvthis->store_private_ptr(drvthis, p) < 0) - return -1; - - // Initialize cellsize, character spacing and graphical offset - p->fd = -1; - p->cellwidth = DEFAULT_CELLWIDTH; - p->cellheight = DEFAULT_CELLHEIGHT; - p->bigcellwidth = DEFAULT_CELLWIDTH_BIG; - p->bigcellheight = DEFAULT_CELLHEIGHT_BIG; - p->hspace = DEFAULT_HSPACE; - p->vspace = DEFAULT_VSPACE; - p->ccmode = standard; - p->dispmode = Dmode_standard; - p->LCDtype = 0; //only use 0=HD44780; not supported now 1=KS0066;2=T6963c;3=KS0108 - p->width = DEFAULT_WIDTH; - p->height = DEFAULT_HEIGHT; - p->gwidth = DEFAULT_GWIDTH; - p->gheight = DEFAULT_GHEIGHT; - - // Establish connection to YARD server - bzero( (char *)&srvAddr, sizeof(srvAddr)); - srvAddr.sun_family = AF_UNIX; - strcpy(srvAddr.sun_path, sockpath); - srvAddrLen = strlen(srvAddr.sun_path) + sizeof(srvAddr.sun_family); - - p->fd = socket(AF_UNIX, SOCK_STREAM, 0); - if (p->fd < 0) { - report(RPT_ERR, "%s: Can't create socket !", drvthis->name); - return -1; - } - if (connect(p->fd, (struct sockaddr *)&srvAddr, srvAddrLen) < 0) { - report(RPT_ERR, "%s: Can't connect to yardsrv !", drvthis->name); - return -1; - } - - //Get the config from yard2srvd. Config is not in LCDd.conf ! - sprintf(Recbuffer,"LCDPROC\0"); - byteCnt = write(p->fd,Recbuffer, strlen(Recbuffer)); - if (byteCnt < 0) - { - report(RPT_ERR, "%s: Can't send config request to YARD2 LCDserver !", drvthis->name); - return -1; - } - - // Wait for YARD server response - byteCnt = read(p->fd, Recbuffer, sizeof(Recbuffer) ); - if (byteCnt < 0) - { - report(RPT_ERR, "%s: Cannot receive config from YARD server !", drvthis->name); - return -1; - } - else if (byteCnt == 1) - { - report(RPT_ERR, "%s: YARD communication timeout !", drvthis->name); - return -1; - } - - //Receiveconfig format: 0='C';1=sizeX;2=sizeY;3=LCDType(0=HD44780,1=KS0066,2=T6963,3=KS0108) - if(Recbuffer[0] == 'C') //C=Config - { - p->width = Recbuffer[1]; - p->height = Recbuffer[2]; - p->LCDtype = Recbuffer[3]; - } - else - { - report(RPT_ERR, "%s: YARD Config Receive error !", drvthis->name); - return -1; - } - - if(p->LCDtype > 1) //only char LCDs are currently supported - { - report(RPT_ERR, "%s: YARD LCD type %d not supported by this version or the driver !", drvthis->name,p->LCDtype); - return -1; - } - - // Allocate framebuf & Setup frame buffer x2 to be sure that the buffer is big enough - p->framebuf = (unsigned char *) malloc((p->width * p->height)*2); - if (p->framebuf == NULL) - { - report(RPT_ERR, "%s: Can't create framebuffer !", drvthis->name); - return -1; - } - memset(p->framebuf, ' ', (p->width * p->height)*2); - -/* not done yet - // Init size and graphical size -*/ - -/* - // Init backlight-on brightness -> done by YARD2 normally in auto mode -*/ - p->on_brightness = DEFAULT_ON_BRIGHTNESS; -/* - // Init backlight-off brightness -> done by YARD2 normally in auto mode -*/ - tmp = DEFAULT_OFF_BRIGHTNESS; - p->off_brightness = tmp; - - - report(RPT_DEBUG, "%s: Init done", drvthis->name); - return 0; -} - -/* - * Closes down the driver - */ -MODULE_EXPORT void -yard_close(Driver *drvthis) -{ - debug(RPT_DEBUG, "%s: Event 09 - Enter yard_close",drvthis->name); - PrivateData *p = (PrivateData *)drvthis->private_data; - - if (p != NULL) { - close(p->fd); - if (p->framebuf) - free(p->framebuf); - free(p); - } - - drvthis->store_private_ptr(drvthis, NULL); -} - -/* - * Returns the display width in characters - */ -MODULE_EXPORT int -yard_width(Driver *drvthis) -{ - debug(RPT_DEBUG, "%s: Event 10 - Enter yard_width",drvthis->name); - PrivateData *p = (PrivateData *)drvthis->private_data; - - return p->width; -} - -/* - * Returns the display height in characters - */ -MODULE_EXPORT int -yard_height(Driver *drvthis) -{ - debug(RPT_DEBUG, "%s: Event 11 - Enter yard_height",drvthis->name); - PrivateData *p = (PrivateData *)drvthis->private_data; - - return p->height; -} - -/* - * Clears the framebuffer - */ -MODULE_EXPORT void -yard_clear(Driver *drvthis) -{ - debug(RPT_DEBUG, "%s: Event 12 - Enter yard_clear",drvthis->name); - PrivateData *p = (PrivateData *)drvthis->private_data; - - // Reset custom char mode and clear frambuffer - p->ccmode = standard; - memset(p->framebuf, ' ', p->width * p->height); -} - -/* - * Flushes a single frame to the LCD - */ -MODULE_EXPORT void -yard_flush(Driver *drvthis) -{ - debug(RPT_DEBUG, "%s: Event 13 - Enter yard_flush",drvthis->name); - PrivateData *p = (PrivateData *)drvthis->private_data; - int i; - int width, height; - - switch (p->dispmode) { - case Dmode_standard: - { - // Set width and height - width = p->width; - height = p->height; - break; - } - default: - { - debug(RPT_DEBUG, "%s: Event 24 - Only Char. Mode supported: %d",drvthis->name,p->dispmode); - return; - break; - } - } - - // Send framebuffer content to LCD - for (i = 0; i < height; i++) - { - // Line feed - yard_hwGotoXY(drvthis, 1, i+1); - - // Write single line - yard_hwPrintCharArray(drvthis, &(p->framebuf[i*width]), width); - debug(RPT_DEBUG, "YARD2: flushed line %d - chars %d", i,width); - } - - -} - -/* - * Prints a string on the LCD - */ -MODULE_EXPORT void -yard_string(Driver *drvthis, int x, int y, const char string[]) -{ - debug(RPT_DEBUG, "%s: Event 14 - Enter yard_string: X.%d - Y.%d - %s",drvthis->name,x,y,string); - - PrivateData *p = (PrivateData *)drvthis->private_data; - int i; - - // Change display mode if necessary; Only char mode 0 is supported right now - if (p->dispmode == Dmode_graphical) - { - yard_hwClearLCD(drvthis); - p->dispmode = Dmode_standard; - } - - x--; //start with 0,0 - y--; - - if ((y < 0) || (y >= p->height)) return; - - - - for (i = 0; (string[i] != '\0') && (x < p->width); i++) //, x++) - { - if (x >= 0) // no write left of left border - p->framebuf[(y * p->width) + x + i] = string[i]; - } - -/* - for (i = 0; string[i] != '\0'; i++) - { - // Check for buffer overflow - if ( (y * p->width + x + i) >= (p->width * p->height) ) - break; - p->framebuf[(y * p->width) + x + i] = string[i]; - } -*/ -} - -/* - * Prints a single character on the LCD - */ -MODULE_EXPORT void -yard_chr(Driver *drvthis, int x, int y, char c) -{ - PrivateData *p = (PrivateData *)drvthis->private_data; - debug(RPT_DEBUG, "%s: Event 15 - Enter yard_chr",drvthis->name); - - // Error check - if ( (x > p->width) || (y > p->height) ) - return; - - // Change display mode if necessary - if (p->dispmode == Dmode_graphical) - { - yard_hwClearLCD(drvthis); - p->dispmode = 0; - } - - y--; //start with 0,0 - x--; - p->framebuf[(y * p->width) + x ] = c; -} - -/* - * Returns the number of custom characters - */ -MODULE_EXPORT int -yard_get_free_chars(Driver *drvthis) -{ - debug(RPT_DEBUG, "%s: Event 16 - Enter yard_get_free_chars",drvthis->name); - return NUM_CUSTOMCHARS; -} - -/* - * Sets a custom character - */ -MODULE_EXPORT void -yard_set_char(Driver *drvthis, int n, unsigned char *dat) -{ - debug(RPT_DEBUG, "%s: Event 17 - Enter yard_set_char: Nr.%d - %02X",drvthis->name,n,dat); - - if ( (n < 0) || (n >= NUM_CUSTOMCHARS) ) - return; - if (!dat) - return; - - yard_hwWriteCGRam(drvthis, n, dat); -} - -/* - * Returns the width of a character in pixels - */ -MODULE_EXPORT int -yard_cellwidth(Driver *drvthis) -{ - debug(RPT_DEBUG, "%s: Event 18 - Enter yard_cellwidth",drvthis->name); - PrivateData *p = (PrivateData *)drvthis->private_data; - - return p->cellwidth; -} - -/* - * Returns the height of a character in pixels - */ -MODULE_EXPORT int -yard_cellheight(Driver *drvthis) -{ - debug(RPT_DEBUG, "%s: Event 19 - Enter yard_cellheight",drvthis->name); - PrivateData *p = (PrivateData *)drvthis->private_data; - - return p->cellheight; -} - -/* - * Reads brightness (in promille) - */ -MODULE_EXPORT int -yard_get_brightness(Driver *drvthis, int state) -{ - debug(RPT_DEBUG, "%s: Event 20 - Enter yard_get_brightness: %d",drvthis->name,state); - PrivateData *p = (PrivateData *)drvthis->private_data; - - return (state == BACKLIGHT_ON) ? p->on_brightness : p->off_brightness; -} - -/* - * Sets brightness (in promille) - */ -MODULE_EXPORT void -yard_set_brightness(Driver *drvthis, int state, int promille) -{ - debug(RPT_DEBUG, "%s: Event 21 - Enter yard_set_brightness: %d - %d",drvthis->name,state,promille); - PrivateData *p = (PrivateData *)drvthis->private_data; - - // Error check - if (promille < 0 || promille > 1000) - return; - - // Store values - if (state == BACKLIGHT_ON) { - p->on_brightness = promille; - } - else { - p->off_brightness = promille; - } -} - -/* - * Sets the backlight on or off - * The hardware supports any value between 0 and 255 - */ -MODULE_EXPORT void -yard_backlight(Driver *drvthis, int on) -{ - debug(RPT_DEBUG, "%s: Event 22 - Enter yard_backlight: %d",drvthis->name,on); - PrivateData *p = (PrivateData *)drvthis->private_data; - - int hardware_value = (on == BACKLIGHT_ON) ? p->on_brightness : p->off_brightness; - - // Map range to hardware [0, 1000] -> [0, 255] - hardware_value /= 4; - if (hardware_value != p->hw_brightness) - { - // Send command and update private data - yard_hwSetBrightness(drvthis, hardware_value); - p->hw_brightness = (char)hardware_value; - } -} - -/* - * Provides info about the driver - */ -MODULE_EXPORT const char * -yard_get_info(Driver *drvthis) -{ - debug(RPT_DEBUG, "%s: Event 23 - Enter yard_get_info",drvthis->name); - PrivateData *p = (PrivateData *)drvthis->private_data; - - strcpy(p->info, "Socket-based driver for Y.A.R.D.2 USB LCD"); - return p->info; -} diff --git a/server/drivers/yard2LCD.h b/server/drivers/yard2LCD.h deleted file mode 100644 index b10a303..0000000 --- a/server/drivers/yard2LCD.h +++ /dev/null @@ -1,59 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2013 by R. Geigenberger * - * * - * * - * This program 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 of the License, or * - * (at your option) any later version. * - * * - * This program 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., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef yard2LCD_H -#define yard2LCD_H - -#define MAX_YARDDATA_SIZE 40 -#define DEFAULT_SOCK_PATH "/tmp/lcdserver" -#define DEFAULT_OFF_BRIGHTNESS 100 -#define DEFAULT_ON_BRIGHTNESS 1000 -#define DEFAULT_WIDTH 16 -#define DEFAULT_HEIGHT 4 -#define DEFAULT_GWIDTH 64 -#define DEFAULT_GHEIGHT 32 -#define DEFAULT_CELLWIDTH 5 -#define DEFAULT_CELLHEIGHT 8 -#define DEFAULT_CELLWIDTH_BIG 10 -#define DEFAULT_CELLHEIGHT_BIG 14 -#define DEFAULT_HSPACE 2 -#define DEFAULT_VSPACE 1 -#define NUM_CUSTOMCHARS 8 - - -MODULE_EXPORT int yard_init (Driver *drvthis); -MODULE_EXPORT void yard_close (Driver *drvthis); -MODULE_EXPORT int yard_width (Driver *drvthis); -MODULE_EXPORT int yard_height (Driver *drvthis); -MODULE_EXPORT void yard_clear (Driver *drvthis); -MODULE_EXPORT void yard_flush (Driver *drvthis); -MODULE_EXPORT void yard_string (Driver *drvthis, int x, int y, const char string[]); -MODULE_EXPORT void yard_chr (Driver *drvthis, int x, int y, char c); -MODULE_EXPORT void yard_num(Driver *drvthis, int x, int num); -MODULE_EXPORT void yard_set_char(Driver *drvthis, int n, unsigned char *dat); -MODULE_EXPORT int yard_get_free_chars(Driver *drvthis); -MODULE_EXPORT int yard_cellwidth (Driver *drvthis); -MODULE_EXPORT int yard_cellheight (Driver *drvthis); -MODULE_EXPORT int yard_get_brightness (Driver *drvthis, int state); -MODULE_EXPORT void yard_set_brightness (Driver *drvthis, int state, int promille); -MODULE_EXPORT void yard_backlight (Driver *drvthis, int on); -MODULE_EXPORT const char * yard_get_info( Driver *drvthis ); - - -#endif diff --git a/server/render.c b/server/render.c index 92b5326..78119b4 100644 --- a/server/render.c +++ b/server/render.c @@ -310,6 +310,9 @@ render_string(Widget *w, int left, int top, int right, int bottom, int fy) if ((w != NULL) && (w->text != NULL) && (w->x > 0) && (w->y > 0) && (w->y > fy) && (w->y <= bottom - top)) { + int length; + char str[BUFSIZE]; + /* * FIXME: Could be a bug here? w->x is recalculated (On first * call only? Is it preserved between calls?) and first @@ -317,7 +320,10 @@ render_string(Widget *w, int left, int top, int right, int bottom, int fy) * strings totally off-screen. Is this on purpose? (M. Dolze) */ w->x = min(w->x, right - left); - drivers_string(w->x + left, w->y + top, w->text); + length = min(right - left - w->x + 1, sizeof(str)-1); + strncpy(str, w->text, length); + str[length] = '\0'; + drivers_string(w->x + left, w->y + top, str); } return 0; }