/* $Id: drv_Sample.c,v 1.3 2006/01/05 18:56:57 reinelt Exp $ * * sample lcd4linux driver * * 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_Sample.c,v $ * Revision 1.3 2006/01/05 18:56:57 reinelt * more GPO stuff * * Revision 1.2 2005/12/19 05:08:31 reinelt * GPO's added to the Sample driver * * Revision 1.1 2005/11/04 14:10:38 reinelt * drv_Sample and drv_LPH7508 * */ /* * * exported fuctions: * * struct DRIVER drv_Sample * */ #include "config.h" #include #include #include #include #include #include "debug.h" #include "cfg.h" #include "qprintf.h" #include "udelay.h" #include "plugin.h" #include "widget.h" #include "widget_text.h" #include "widget_icon.h" #include "widget_bar.h" #include "drv.h" /* text mode display? */ #include "drv_generic_text.h" /* graphic display? */ #include "drv_generic_graphic.h" /* GPO's? */ #include "drv_generic_gpio.h" /* serial port? */ #include "drv_generic_serial.h" /* parallel port? */ #include "drv_generic_parport.h" /* i2c bus? */ #ifdef WITH_I2C #include "drv_generic_i2c.h" #endif static char Name[] = "Sample"; /* for parallel port displays only */ /* use whatever lines you need */ static unsigned char SIGNAL_RS; static unsigned char SIGNAL_EX; /****************************************/ /*** hardware dependant functions ***/ /****************************************/ /* low-level parallel port stuff */ /* example for sending one byte over the wire */ static void drv_Sample_bang(const unsigned int data) { /* put data on DB1..DB8 */ drv_generic_parport_data(data & 0xff); /* set/clear some signals */ drv_generic_parport_control(SIGNAL_RS, SIGNAL_RS); /* data setup time (e.g. 200 ns) */ ndelay(200); /* send byte */ /* signal pulse width 500ns */ drv_generic_parport_toggle(SIGNAL_EX, 1, 500); /* wait for command completion (e.g. 100 us) */ udelay(100); } static int drv_Sample_open(const char *section) { /* open serial port */ /* don't mind about device, speed and stuff, this function will take care of */ if (drv_generic_serial_open(section, Name, 0) < 0) return -1; /* opening the parallel port is a bit more tricky: */ /* you have to do all the bit-banging yourself... */ if (drv_generic_parport_open(section, Name) != 0) { error("%s: could not initialize parallel port!", Name); return -1; } /* read the wiring from config */ if ((SIGNAL_EX = drv_generic_parport_wire_ctrl("EX", "STROBE")) == 0xff) return -1; if ((SIGNAL_RS = drv_generic_parport_wire_ctrl("RS", "INIT")) == 0xff) return -1; /* clear all signals */ drv_generic_parport_control(SIGNAL_EX | SIGNAL_RS, 0); /* set direction: write */ drv_generic_parport_direction(0); return 0; } static int drv_Sample_close(void) { /* close whatever port you've opened */ drv_generic_parport_close(); drv_generic_serial_close(); return 0; } /* dummy function that sends something to the display */ static void drv_Sample_send(const char *data, const unsigned int len) { unsigned int i; /* send data to the serial port is easy... */ drv_generic_serial_write(data, len); /* sending data to the parallel port is a bit more tricky... */ for (i = 0; i < len; i++) { drv_Sample_bang(*data++); } } /* text mode displays only */ static void drv_Sample_clear(void) { char cmd[1]; /* do whatever is necessary to clear the display */ /* assume 0x01 to be a 'clear display' command */ cmd[0] = 0x01; drv_Sample_send(cmd, 1); } /* text mode displays only */ static void drv_Sample_write(const int row, const int col, const char *data, int len) { char cmd[3]; /* do the cursor positioning here */ /* assume 0x02 to be a 'Goto' command */ cmd[0] = 0x02; cmd[1] = row; cmd[2] = col; drv_Sample_send(cmd, 3); /* send string to the display */ drv_Sample_send(data, len); } /* text mode displays only */ static void drv_Sample_defchar(const int ascii, const unsigned cha
# Warsaw (Masowian), Poland
#
# Channels info: http://sat-charts.eu/dvb-t.php
#
[Raszyn/PKiN MUX-3]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 522000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 3/4
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/8
	HIERARCHY = NONE
	INVERSION = AUTO

[Raszyn/PKiN MUX-8 (TVNHD)]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 730000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 5/6
	CODE_RATE_LP = NONE
	MODULATION = QAM/16
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/32
	HIERARCHY = NONE
	INVERSION = AUTO

[Raszyn/PKiN MUX-1]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 770000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 3/4
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/8
	HIERARCHY = NONE
	INVERSION = AUTO

[Raszyn/PKiN MUX-2]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 690000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 3/4
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/8
	HIERARCHY = NONE
	INVERSION = AUTO

[PKiN MUX-8]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 191500000
	BANDWIDTH_HZ = 7000000
	CODE_RATE_HP = 5/6
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/4
	HIERARCHY = NONE
	INVERSION = AUTO
init2(const char *section, const int quiet) { WIDGET_CLASS wc; int ret; /* real worker functions */ drv_generic_graphic_real_blit = drv_Sample_blit; /* remove unless you have GPO's */ drv_generic_gpio_real_set = drv_Sample_GPO; /* start display */ if ((ret = drv_Sample_start2(section)) != 0) return ret; /* initialize generic graphic driver */ if ((ret = drv_generic_graphic_init(section, Name)) != 0) return ret; if (!quiet) { char buffer[40]; qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); if (drv_generic_graphic_greet(buffer, NULL)) { sleep(3); drv_generic_graphic_clear(); } } /* register text widget */ wc = Widget_Text; wc.draw = drv_generic_graphic_draw; widget_register(&wc); /* register icon widget */ wc = Widget_Icon; wc.draw = drv_generic_graphic_icon_draw; widget_register(&wc); /* register bar widget */ wc = Widget_Bar; wc.draw = drv_generic_graphic_bar_draw; widget_register(&wc); /* register plugins */ AddFunction("LCD::contrast", 1, plugin_contrast); return 0; } /* close driver & display */ /* use this function for a text display */ int drv_Sample_quit(const int quiet) { info("%s: shutting down.", Name); drv_generic_text_quit(); /* remove unless you have GPO's */ drv_generic_gpio_quit(); /* clear display */ drv_Sample_clear(); /* say goodbye... */ if (!quiet) { drv_generic_text_greet("goodbye!", NULL); } debug("closing connection"); drv_Sample_close(); return (0); } /* close driver & display */ /* use this function for a graphic display */ int drv_Sample_quit2(const int quiet) { info("%s: shutting down.", Name); /* clear display */ drv_generic_graphic_clear(); /* remove unless you have GPO's */ drv_generic_gpio_quit(); /* say goodbye... */ if (!quiet) { drv_generic_graphic_greet("goodbye!", NULL); } drv_generic_graphic_quit(); debug("closing connection"); drv_Sample_close(); return (0); } /* use this one for a text display */ DRIVER drv_Sample = { name:Name, list:drv_Sample_list, init:drv_Sample_init, quit:drv_Sample_quit, }; /* use this one for a graphic display */ DRIVER drv_Sample2 = { name:Name, list:drv_Sample_list, init:drv_Sample_init2, quit:drv_Sample_quit2, };