/* $Id: drv_Sample.c 975 2009-01-18 11:16:20Z michael $ * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_Sample.c $ * * Shuttle SG33G5M VFD lcd4linux driver * * Copyright (C) 2009 Matthieu Crapet * based on the USBLCD driver. * * Shuttle SG33G5M VFD (20x1 character display. Each character cell is 5x8 pixels) * - The display is driven by Princeton Technologies PT6314 VFD controller * - Cypress CY7C63723C (receives USB commands and talk to VFD controller) * * LCD "prococol" : each message has a length of 8 bytes * - 1 nibble: command (0x1, 0x3, 0x7, 0x9, 0xD) * - 0x1 : clear text and icons (len=1) * - 0x7 : icons (len=4) * - 0x9 : text (len=7) * - 0xD : set clock data (len=7) * - 0x3 : display clock (internal feature) (len=1) * - 1 nibble: message length (0-7) * - 7 bytes : message data * * 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_ShuttleVFD * */ #include "config.h" #include #include #include #include #include #ifdef HAVE_USB_H #include #else #error "ShuttleVFD: libusb required" #endif #include "debug.h" #include "cfg.h" #include "qprintf.h" #include "udelay.h" #include "plugin.h" #include "widget.h" #include "widget_text.h" #include "widget_bar.h" // for DIRECTION #include "drv.h" #include "drv_generic_text.h" #include "drv_generic_gpio.h" /* * Some hardware definitions */ // VFD USB properties #define SHUTTLE_VFD_VENDOR_ID 0x051C #define SHUTTLE_VFD_PRODUCT_ID1 0x0003 #define SHUTTLE_VFD_PRODUCT_ID2 0x0005 // IR-receiver included #define SHUTTLE_VFD_INTERFACE_NUM 1 // VFD physical dimensions #define SHUTTLE_VFD_WIDTH 20 #define SHUTTLE_VFD_HEIGHT 1 // VFD USB control message #define SHUTTLE_VFD_PACKET_SIZE 8 #define SHUTTLE_VFD_DATA_SIZE (SHUTTLE_VFD_PACKET_SIZE-1) #define SHUTTLE_VFD_SUCCESS_SLEEP_USEC 25600 /* Global static data */ static char Name[] = "ShuttleVFD"; static usb_dev_handle *lcd; static unsigned char buffer[SHUTTLE_VFD_PACKET_SIZE]; /* Issues with the display module: * - Can't set cursor position. Must save full buffer here. * - Can't get icons status (on or off). Must save status here. * - Clear command also clear text AND icons. */ static unsigned char fb[SHUTTLE_VFD_WIDTH * SHUTTLE_VFD_HEIGHT]; static unsigned icons; /****************************************/ /*** hardware dependant functions ***/ /****************************************/ /* look for device on USB bus */ static int drv_ShuttleVFD_open(void) { struct usb_bus *bus; struct usb_device *dev; int vendor_id = SHUTTLE_VFD_VENDOR_ID; int interface = SHUTTLE_VFD_INTERFACE_NUM; lcd = NULL; usb_init(); usb_find_busses(); usb_find_devices(); for (bus = usb_get_busses(); bus != NULL; bus = bus->next) { for (dev = bus->devices; dev != NULL; dev = dev->next) { if (dev->descriptor.idVendor == vendor_id && ((dev->descriptor.idProduct == SHUTTLE_VFD_PRODUCT_ID1) || (dev->descriptor.idProduct == SHUTTLE_VFD_PRODUCT_ID2))) { unsigned int v = dev->descriptor.bcdDevice; info("%s: found ShuttleVFD V%1d%1d.%1d%1d on bus %s device %s", Name, (v & 0xF000) >> 12, (v & 0xF00) >> 8, (v & 0xF0) >> 4, (v & 0xF), bus->dirname, dev->filename); lcd = usb_open(dev); } } } if (lcd != NULL) { if (usb_claim_interface(lcd, interface) < 0) { usb_close(lcd); error("%s: usb_claim_interface() failed!", Name); error("%s: root permissions maybe required?", Name); return -1; } } else { error("%s: could not find ShuttleVFD", Name); return -1; } return 0; } static int drv_ShuttleVFD_close(void) { int interface = SHUTTLE_VFD_INTERFACE_NUM; usb_release_interface(lcd, interface); usb_close(lcd); return 0; } static void drv_ShuttleVFD_send(unsigned char packet[SHUTTLE_VFD_PACKET_SIZE]) { if (usb_control_msg(lcd, 0x21, // requesttype 0x09, // request 0x0200, // value 0x0001, // index (char *) packet, SHUTTLE_VFD_PACKET_SIZE, 100) == SHUTTLE_VFD_PACKET_SIZE) { udelay(SHUTTLE_VFD_SUCCESS_SLEEP_USEC); } else { debug("usb_control_msg failed"); } } /* Clear full display and icons. */ static void drv_ShuttleVFD_clear(void) { // Update local framebuffer mirror memset(fb, ' ', SHUTTLE_VFD_HEIGHT * SHUTTLE_VFD_WIDTH); buffer[0] = (1 << 4) + 1; buffer[1] = 0x1; drv_ShuttleVFD_send(buffer); } static void drv_ShuttleVFD_reset_cursor(void) { buffer[0] = (1 << 4) + 1; buffer[1] = 0x2; drv_ShuttleVFD_send(buffer); } /* text mode displays only */ static void drv_ShuttleVFD_write(const int row, const int col, const char *data, int len) { unsigned char *p; int i; // Update local framebuffer mirror memcpy(fb + (row * SHUTTLE_VFD_WIDTH) + col, data, len); p = fb; len = SHUTTLE_VFD_WIDTH; drv_ShuttleVFD_reset_cursor(); while (len > 0) { if (len > 7) buffer[0] = (9 << 4) + 7; else
# DVB-T Lugo (Centro emisor Paramo) - Rev. 1.2 - 11.12.05

[TVE 1, TVE 2, 24H TVE, CLAN/50 TVE, RNE1, RNE CLASICA, RNE3]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 778000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 2/3
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/4
	HIERARCHY = NONE
	INVERSION = AUTO

[TVG, GALICIA TV AMERICA, RADIO GALEGA, R.GALEGA MUSICA, SON GALICIA RADIO, PROBAS RETEGAL]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 810000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 2/3
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/4
	HIERARCHY = NONE
	INVERSION = AUTO

[TELEDEPORTE, VEO TV, VEO 2, NET TV]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 834000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 2/3
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/4
	HIERARCHY = NONE
	INVERSION = AUTO

[CUATRO, CNN+, 40 LATINO, LA SEXTA 1]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 842000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 2/3
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/4
	HIERARCHY = NONE
	INVERSION = AUTO

[TELECINCO, T5 ESTRELLAS, T5 SPORT, FLYMUSIC]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 850000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 2/3
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/4
	HIERARCHY = NONE
	INVERSION = AUTO

[ANTENA 3, ANTENA.NEOX, ANTENA.NOVA, LA SEXTA 2]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 858000000
	BANDWIDTH_HZ = 8000000
	CODE_RATE_HP = 2/3
	CODE_RATE_LP = NONE
	MODULATION = QAM/64
	TRANSMISSION_MODE = 8K
	GUARD_INTERVAL = 1/4
	HIERARCHY = NONE
	INVERSION = AUTO