/* * File Name : hrt.h * * This is a device driver for the High Resolution Technologies * Pixelsmart 512-8 frame grabber. * This file contains structures, constants, and ioctl numbers in * the driver that a user program might wish to use. * Copyright (C) 2003, Florida State University * * This is free software; you can redistribute it and/or modify it under * terms of the GNU General Public License as published by the Free Soft- * ware Foundation, Version 2. This software is distributed in the hope * that it will be useful, but WITH OUT 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 distributed with this * software; see file COPYING. If not, write to the Free Software Foundation, * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include /** * Card specific constants */ #define HRT_VENDOR_ID 0x0004 #define HRT_DEVICE_ID_GRAY 0x0404 #define HRT_DEVICE_ID_COLOR 0x0408 #define HRT_DEVICES 2 const int HRT_DEVICE_IDS[] = { HRT_DEVICE_ID_COLOR, HRT_DEVICE_ID_GRAY }; #define HRT_NUM_OF_ADDRESSES 9 #define HRT_MAX_BPP 2 //Max bits per pixel const int HRT_ADDRESSES[] = { 0, //filled in by PnP address 0xC0000, 0xC4000, 0xC8000, 0xCC000, 0xD0000, 0xD4000, 0xD8000, 0xDC000 }; #define HRT_CONTROL_REG 0x2000 #define HRT_Y_LOW_REG 0x2002 #define HRT_Y_HIGH_REG 0x2003 #define HRT_INTERRUPT_ENABLE 0x2005 /* The unique I2C bus address of the SAA7110 (A/D) device */ #define HRT_AD_DEVICE_ID (128+16+8+4) /* NTSC 8-bit greyscale */ #define HRT_WIDTH 512 #define HRT_HEIGHT 480 #define HRT_BYTES_PER_PIXEL 1 #define HRT_BYTES_PER_LINE (HRT_WIDTH * HRT_BYTES_PER_PIXEL) #define HRT_FRAMESIZE (HRT_WIDTH * HRT_HEIGHT * HRT_BYTES_PER_PIXEL) /* Number of bytes of the device's memory that we ioremap() */ #define BYTES_NEEDED 0x4000 /* * The commands for freeze, live, etc. */ #define HRT_FIELD_MASK 0x01 #define HRT_LIVE_CMD 0x91 #define HRT_FREEZE_IMM_CMD 0x5B #define HRT_FREEZE_NEXT_CMD 0x99 /* A/D registers */ #define HRT_BRIGHTNESS_REG 0x19 #define HRT_CONTRAST_REG 0x13 #define HRT_VID_TYPE (VID_TYPE_CAPTURE | VID_TYPE_MONOCHROME) /* Maximum number of buffers for streaming */ #define MAX_CAPTURE_BUFFERS 16 #define HRT_MAGIC_MMAP_OFFSET (PAGE_SIZE*100) typedef struct hrt_wnd { int rs; int re; int cs; int ce; }hrt_wnd; #define HRT_MAGIC 'x' #define HRT_START_STREAM _IO(HRT_MAGIC, 0) #define HRT_STOP_STREAM _IO(HRT_MAGIC, 1) #define HRT_SET_WND _IOW(HRT_MAGIC, 2, struct hrt_wnd) #define HRT_GET_WND _IOR(HRT_MAGIC, 3, struct hrt_wnd) #define HRT_DOWN_USER_COUNT _IO(HRT_MAGIC, 4) #define HRT_DB_ON _IO(HRT_MAGIC, 5) //Double Buffering ON #define HRT_DB_OFF _IO(HRT_MAGIC, 6) //Double Buffering OFF #define HRT_SET_CAPTURE_MODE _IOW(HRT_MAGIC, 7, int) #define HRT_GET_CAPTURE_MODE _IOR(HRT_MAGIC, 8, int)