/* $Id: drv_LCDLinux.c,v 1.8 2005/05/08 04:32:44 reinelt Exp $ * * driver for the LCD-Linux HD44780 kernel driver * http://lcd-linux.sourceforge.net * * Copyright (C) 2005 Michael Reinelt * Copyright (C) 2005 The LCD4Linux Team * * This file is part of LCD4Linux. * * LCD4Linux is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * LCD4Linux is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * $Log: drv_LCDLinux.c,v $ * Revision 1.8 2005/05/08 04:32:44 reinelt * CodingStyle added and applied * * Revision 1.7 2005/05/02 05:15:46 reinelt * make busy-flag checking configurable for LCD-Linux driver * * Revision 1.6 2005/04/30 06:02:09 reinelt * LCD-Linux display size set up from lcd4linux.conf * * Revision 1.5 2005/04/09 07:36:42 reinelt * updated LCD-Linux driver to version 0.8.8 * * Revision 1.4 2005/02/24 07:06:48 reinelt * SimpleLCD driver added * * Revision 1.3 2005/02/24 06:51:40 reinelt * LCD-Linux driver GOTO_COST corrected * * Revision 1.2 2005/01/30 06:43:22 reinelt * driver for LCD-Linux finished * * Revision 1.1 2005/01/22 22:57:57 reinelt * LCD-Linux driver added * */ /* * * exported fuctions: * * struct DRIVER drv_LCDLinux * */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "debug.h" #include "cfg.h" #include "qprintf.h" #include "plugin.h" #include "widget.h" #include "widget_text.h" #include "widget_icon.h" #include "widget_bar.h" #include "drv.h" #include "drv_generic_text.h" #include "drv_LCDLinux.h" static char Name[] = "LCD-Linux"; static char Device[] = "/dev/lcd"; static int lcdlinux_fd = -1; /****************************************/ /*** hardware dependant functions ***/ /****************************************/ static void drv_LL_send(const char *string, const int len) { int run, ret; for (run = 0; run < 10; run++) { ret = write(lcdlinux_fd, string, len); if (ret >= 0 || errno != EAGAIN) break; if (run > 0) info("%s: write(%s): EAGAIN #%d", Name, Device, run); usleep(1000); } if (ret < 0) { error("%s: write(%s) failed: %s", Name, Device, strerror(errno)); } else if (ret != len) { error("%s: partial write(%s): len=%d ret=%d", Name, Device, len, ret); } return; } static void drv_LL_clear(void) { /* Fixme: is there no otherway to clear the display? */ drv_LL_send("\14", 1); /* Form Feed */ } static void drv_LL_write(const int row, const int col, const char *data, int len) { int pos = row * DCOLS + col; if
# Sweden - Gullbrandstorp
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 602000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
bug", 0, 0, 1, &asc255bug); drv_generic_text_bar_add_segment(0, 0, 255, 32); /* ASCII 32 = blank */ if (!asc255bug) drv_generic_text_bar_add_segment(255, 255, 255, 255); /* ASCII 255 = block */ /* register text widget */ wc = Widget_Text; wc.draw = drv_generic_text_draw; widget_register(&wc); /* register icon widget */ wc = Widget_Icon; wc.draw = drv_generic_text_icon_draw; widget_register(&wc); /* register bar widget */ wc = Widget_Bar; wc.draw = drv_generic_text_bar_draw; widget_register(&wc); /* register plugins */ /* none */ return 0; } /* close driver & display */ int drv_LL_quit(const int quiet) { info("%s: shutting down.", Name); drv_generic_text_quit(); /* clear display */ drv_LL_clear(); /* say goodbye... */ if (!quiet) { drv_generic_text_greet("goodbye!", NULL); } /* close device */ close(lcdlinux_fd); return (0); } DRIVER drv_LCDLinux = { name:Name, list:drv_LL_list, init:drv_LL_init, quit:drv_LL_quit, };