/* $Id$ * $URL$ * * driver for serdisplib displays * * 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. * */ /* * * exported fuctions: * * struct DRIVER drv_serdisplib * */ #include "config.h" #include "debug.h" // verbose_level #include #include #include #include #include /* Fixme: This should be removed as soon as serdisp.h * contains this macros */ #ifndef SERDISP_VERSION_GET_MAJOR #define SERDISP_VERSION_GET_MAJOR(_c) ((int)( (_c) >> 8 )) #define SERDISP_VERSION_GET_MINOR(_c) ((int)( (_c) & 0xFF )) #endif #include "debug.h" #include "cfg.h" #include "qprintf.h" #include "plugin.h" #include "drv.h" #include "drv_generic_graphic.h" #ifdef WITH_DMALLOC #include #endif static char Name[] = "serdisplib"; static serdisp_CONN_t *sdcd; static serdisp_t *dd; int NUMCOLS = 1; /****************************************/ /*** hardware dependant functions ***/ /****************************************/ static void drv_SD_blit(const int row, const int col, const int height, const int width) { int r, c; RGBA p; for (r = row; r < row + height; r++) { for (c = col; c < col + width; c++) { p = drv_generic_graphic_rgb(r, c); // printf("blit (%d,%d) A%d.R%d.G%d.B%d\n", c, r, p.A, p.R, p.G, p.B); serdisp_setcolour(dd, c, r, serdisp_pack2ARGB(0xff, p.R, p.G, p.B)); } } serdisp_update(dd); } static int drv_SD_contrast(int contrast) { if (contrast < 0) contrast = 0; if (contrast > MAX_CONTRASTSTEP) contrast = MAX_CONTRASTSTEP; serdisp_feature(dd, FEATURE_CONTRAST, contrast); return contrast; } static int drv_SD_backlight(int backlight) { if (backlight < FEATURE_NO) backlight = FEATURE_NO; if (backlight > FEATURE_YES) backlight = FEATURE_YES; serdisp_feature(dd, FEATURE_BACKLIGHT, backlight); return backlight; } static int drv_SD_reverse(int reverse) { if (reverse < FEATURE_NO) reverse = FEATURE_NO; if (reverse > FEATURE_YES) reverse = FEATURE_YES; serdisp_feature(dd, FEATURE_REVERSE, reverse); return reverse; } static int drv_SD_rotate(int rotate) { if (rotate < 0) rotate = 0; if (rotate > 3) rotate = 3; serdisp_feature(dd, FEATURE_ROTATE, rotate); return rotate; } static int drv_SD_start(const char *section) { long version; char *port, *model, *options, *s; int contrast, backlight, reverse, rotate; version = serdisp_getversioncode(); info("%s: header version %d.%d", Name, SERDISP_VERSION_MAJOR, SERDISP_VERSION_MINOR); info("%s: library version %d.%d", Name, SERDISP_VERSION_GET_MAJOR(version), SERDISP_VERSION_GET_MINOR(version)); port = cfg_get(section, "Port", NULL); if (port == NULL || *port == '\0') { error("%s: no '%s.Port' entry from %s", Name, section, cfg_source()); return -1; } /* opening the output device */ sdcd = SDCONN_open(port); if (sdcd == NULL) { error("%s: open(%s) failed: %
# Sweden - Traryd/Betås
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 714000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
T 730000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE