/* $Id: Cwlinux.c,v 1.15 2003/10/05 17:58:50 reinelt Exp $ * * driver for Cwlinux serial display modules * * Copyright 2002 Andrew Ip * * 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: Cwlinux.c,v $ * Revision 1.15 2003/10/05 17:58:50 reinelt * libtool junk; copyright messages cleaned up * * Revision 1.14 2003/09/13 06:45:43 reinelt * icons for all remaining drivers * * Revision 1.13 2003/09/09 06:54:43 reinelt * new function 'cfg_number()' * * Revision 1.12 2003/08/24 05:17:58 reinelt * liblcd4linux patch from Patrick Schemitz * * Revision 1.11 2003/08/16 07:31:35 reinelt * double buffering in all drivers * * Revision 1.10 2003/08/01 05:15:42 reinelt * last cleanups for 0.9.9 * * Revision 1.9 2003/07/24 04:48:09 reinelt * 'soft clear' needed for virtual rows * * Revision 1.8 2003/05/19 05:55:17 reinelt * Cwlinux sleep optimization * * Revision 1.7 2003/05/14 06:17:39 reinelt * added support for CW1602 * * Revision 1.6 2003/02/24 04:50:57 reinelt * cwlinux fixes * * Revision 1.5 2003/02/22 07:53:09 reinelt * cfg_get(key,defval) * * Revision 1.4 2003/02/22 07:23:24 reinelt * Cwlinux fixes * * Revision 1.3 2002/09/12 05:24:54 reinelt * code cleanup, character defining for bars * * Revision 1.2 2002/09/11 05:32:35 reinelt * changed to use new bar functions * * Revision 1.1 2002/09/11 05:16:32 reinelt * added Cwlinux driver * */ /* * * exported fuctions: * * struct LCD Cwlinux[] * */ #include #include #include #include #include #include #include #include "debug.h" #include "cfg.h" #include "lock.h" #include "display.h" #include "bar.h" #include "icon.h" #define CHARS 8 static LCD Lcd; static char *Port = NULL; static speed_t Speed; static int Device = -1; static int Icons; static char *FrameBuffer1=NULL; static char *FrameBuffer2=NULL; static int CW_open(void) { int fd; pid_t pid; struct termios portset; if ((pid = lock_port(Port)) != 0) { if (pid == -1) error("Cwlinux: port %s could not be locked", Port); else error("Cwlinux: port %s is locked by process %d", Port, pid); return -1; } fd = open(Port, O_RDWR | O_NOCTTY | O_NDELAY); if (fd == -1) { error("Cwlinux: open(%s) failed: %s", Port, strerror(errno)); unlock_port(Port); return -1; }
# Sweden - Ludvika/Björkåsen
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 498000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
T 474000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
(row, col); for (pos1=col++, pos2=pos1, equal=0; col6) break; } else { pos2=col; equal=0; } } CW_write (FrameBuffer1+row*Lcd.cols+pos1, pos2-pos1+1); } } memcpy (FrameBuffer2, FrameBuffer1, Lcd.rows*Lcd.cols*sizeof(char)); return 0; } int CW12232_flush(void) { bar_process(CW12232_define_char); return CW_flush(); } int CW1602_flush(void) { bar_process(CW1602_define_char); return CW_flush(); } int CW_quit(void) { info("Cwlinux: shutting down."); debug("closing port %s", Port); close(Device); unlock_port(Port); if (FrameBuffer1) { free(FrameBuffer1); FrameBuffer1=NULL; } if (FrameBuffer2) { free(FrameBuffer2); FrameBuffer2=NULL; } return (0); } LCD Cwlinux[] = { { name: "CW12232", rows: 4, cols: 20, xres: 6, yres: 8, bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2, icons: 0, gpos: 0, init: CW_init, clear: CW_clear, put: CW_put, bar: CW_bar, icon: CW_icon, gpo: NULL, flush: CW12232_flush, quit: CW_quit }, { name: "CW1602", rows: 2, cols: 16, xres: 5, yres: 8, bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2, icons: 0, gpos: 0, init: CW_init, clear: CW_clear, put: CW_put, bar: CW_bar, icon: CW_icon, gpo: NULL, flush: CW1602_flush, quit: CW_quit }, {NULL} };