ccd.h

Go to the documentation of this file.
00001 /* Gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Copyright (C) 1999,2000,2001 Percy Zahl
00006  *
00007  * Authors: Percy Zahl <zahl@users.sf.net>
00008  * additional features: Andreas Klust <klust@users.sf.net>
00009  * WWW Home: http://gxsm.sf.net
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00024  */
00025 
00026 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 8 c-style: "K&R" -*- */
00027 /* ccd.h 
00028  * Kernel Module
00029  * (C) 2000 by Percy Zahl
00030  */
00031 
00032 #ifndef __CCDMOD_H
00033 #define __CCDMOD_H
00034 
00035 
00036 #define CCD_MAJOR       240
00037 #define CCD_DEVFS_DIR   "pcdsps"
00038 #define CCD_DEVICE_NAME "ccd"
00039 #define MODNAME "ccd: "
00040 #define MODID   CCD_MODID_01
00041 
00042 #define CCD_DEVICE_NAME "ccd"
00043 
00044 /*
00045  * ============================================================
00046  * PARPORT I/O used for CCD control
00047  * ============================================================
00048  */
00049 #define LPT1_BASE       0x378           /* LPT1 Basis Portnummer */
00050 #define LPT2_BASE       0x278           /* LPT2 Basis Portnummer */
00051 #define LPT3_BASE       0x3bc           /* LPT3 Basis Portnummer */
00052 
00053 typedef struct {
00054     unsigned long base;     /* base address */
00055     unsigned long basehi;   /* basehi address (ECP), usually base+0x400 */
00056     short save_status;
00057     char  save_mode;
00058     char  save_ecmode; 
00059 } ccd_parport;
00060 
00061 #define PARP_DATA(p)         (p->base+0x0)
00062 #define PARP_STATUS(p)       (p->base+0x1)
00063 #define PARP_CONTROL(p)      (p->base+0x2)
00064 #define PARP_ECPCONTROL(p)   (p->basehi+0x2)
00065 
00066 /*  Steuerleitungsbelegung:
00067  **********************************
00068  *  CCD  Pin  =   LPT:     Pin Bit
00069  *  MD   1    =   -Strobe  1   0
00070  *  GO   2    =   -AutoFD  14  1
00071  *  PIC  3    =   Init     16  2
00072  *  HRD  4    =   -SLCT_IN 17  3   
00073  **********************************
00074  */
00075 
00076 #define CCD_MinWait 40
00077 
00078 #define LPT_XOR (1 | 2 | 8)
00079 /*                                  1     2     4     8    0x20 
00080  *                                 /MD    GO  /PIC   HRD   READ 
00081  */
00082 #define CCD_Monitoring(p)  outb_p((  1  |  2  |  4  |  8  | 0x20  )^LPT_XOR, PARP_CONTROL(p))
00083 #define CCD_Move2Mem(p)    outb_p((  0  |  0  |  4  |  8  | 0x20  )^LPT_XOR, PARP_CONTROL(p))
00084 #define CCD_Sammeln(p)     outb_p((  0  |  2  |  4  |  8  | 0x20  )^LPT_XOR, PARP_CONTROL(p))
00085 #define CCD_Lesen(p)       outb_p((  1  |  0  |  0  |  8  | 0x20  )^LPT_XOR, PARP_CONTROL(p))
00086 #define CCD_Next(p)        outb_p((  1  |  0  |  0  |  0  | 0x20  )^LPT_XOR, PARP_CONTROL(p))
00087 
00088 #define CCD_PixWert(p)     inb_p(PARP_DATA(p))
00089 
00090 /* CCD Daten */
00091 #define CCD_Xpixel 193  // Anzahl Pixel in X
00092 #define CCD_Ypixel 167  // Anzahl Pixel in Y
00093 #define CCD_dT 20       // 20ms Zeiteinheit
00094 
00095 /* CCD Cmds */
00096 
00097 #define CCD_CMD_MONITORENABLE  1  // Monitor enable
00098 #define CCD_CMD_CLEAR          2  // clear ccd
00099 #define CCD_CMD_EXPOSURE       3  // do exposure cycle
00100 #define CCD_CMD_INITLESEN      4  // read pixelvalue and skip to next
00101 #define CCD_CMD_GETPIXEL       5  // read pixelvalue and skip to next
00102 
00103 
00104 #endif

Generated on Sat Apr 1 09:04:16 2006 for GXSM by  doxygen 1.4.6