/* $Id$ * $URL$ * * sample lcd4linux driver * * Copyright (C) 2005 Michael Reinelt * Copyright (C) 2005, 2006, 2007 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_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 char *matrix) { char cmd[10]; int i; /* call the 'define character' function */ /* assume 0x03 to be the 'defchar' command */ cmd[0] = 0x03; cmd[1] = ascii; /* send bitmap to the display */ for (i = 0; i < 8; i++) { cmd[i + 2] = *matrix++; } drv_Sample_send(cmd, 10); } /* for graphic displays only */ static void drv_Sample_blit(const int row, const int col, const int height, const int width) { int r, c; for (r = row; r < row + height; r++) { for (c = col; c < col + width; c++) { /* drv_generic_graphic_black() returns 1 if pixel is black */ /* drv_generic_graphic_gray() returns a gray value 0..255 */ /* drv_generic_graphic_rgb() returns a RGB color */ if (drv_generic_graphic_black(r, c)) { /* set bit */ } else { /* clear bit */ } } } } /* remove unless you have GPO's */ static int drv_Sample_GPO(const int num, const int val) { char cmd[4]; /* assume 0x42 to be the 'GPO' command */ cmd[0] = 0x4
# Channel table for PirajuĂ­ - SP - Brazil
# Source: http://www.portalbsd.com.br/terrestres_channels.php?channels=2938

# Physical channel 21
[Rede Vida]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 515142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0

# Physical channel 24
[SBT Central]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 533142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0

# Physical channel 27
[Record TV Paulista]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 551142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0
ame = Name, .list = drv_Sample_list, .init = drv_Sample_init2, .quit = drv_Sample_quit2, };