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 
00028 /* ccd.h 
00029  * Kernel Module
00030  * (C) 2000 by Percy Zahl
00031  */
00032 
00033 #ifndef __CCDMOD_H
00034 #define __CCDMOD_H
00035 
00036 #define MODNAME "ccd: "
00037 #define MODID   CCD_MODID_01
00038 
00039 #define CCD_DEVICE_NAME "/dev/ccd"
00040 
00041 /*
00042  * ============================================================
00043  * PARPORT I/O used for CCD control
00044  * ============================================================
00045  */
00046 #define LPT1_BASE       0x378           /* LPT1 Basis Portnummer */
00047 #define LPT2_BASE       0x278           /* LPT2 Basis Portnummer */
00048 #define LPT3_BASE       0x3bc           /* LPT3 Basis Portnummer */
00049 
00050 typedef struct {
00051     unsigned long base;     /* base address */
00052     unsigned long basehi;   /* basehi address (ECP), usually base+0x400 */
00053     short save_status;
00054     char  save_mode;
00055     char  save_ecmode; 
00056 } ccd_parport;
00057 
00058 #define PARP_DATA(p)         (p->base+0x0)
00059 #define PARP_STATUS(p)       (p->base+0x1)
00060 #define PARP_CONTROL(p)      (p->base+0x2)
00061 #define PARP_ECPCONTROL(p)   (p->basehi+0x2)
00062 
00063 /*  Steuerleitungsbelegung:
00064  **********************************
00065  *  CCD  Pin  =   LPT:     Pin Bit
00066  *  MD   1    =   -Strobe  1   0
00067  *  GO   2    =   -AutoFD  14  1
00068  *  PIC  3    =   Init     16  2
00069  *  HRD  4    =   -SLCT_IN 17  3   
00070  **********************************
00071  */
00072 
00073 #define CCD_MinWait 40
00074 
00075 #define LPT_XOR (1 | 2 | 8)
00076 /*                                  1     2     4     8    0x20 
00077  *                                 /MD    GO  /PIC   HRD   READ 
00078  */
00079 #define CCD_Monitoring(p)  outb_p((  1  |  2  |  4  |  8  | 0x20  )^LPT_XOR, PARP_CONTROL(p))
00080 #define CCD_Move2Mem(p)    outb_p((  0  |  0  |  4  |  8  | 0x20  )^LPT_XOR, PARP_CONTROL(p))
00081 #define CCD_Sammeln(p)     outb_p((  0  |  2  |  4  |  8  | 0x20  )^LPT_XOR, PARP_CONTROL(p))
00082 #define CCD_Lesen(p)       outb_p((  1  |  0  |  0  |  8  | 0x20  )^LPT_XOR, PARP_CONTROL(p))
00083 #define CCD_Next(p)        outb_p((  1  |  0  |  0  |  0  | 0x20  )^LPT_XOR, PARP_CONTROL(p))
00084 
00085 #define CCD_PixWert(p)     inb_p(PARP_DATA(p))
00086 
00087 /* CCD Daten */
00088 #define CCD_Xpixel 193  // Anzahl Pixel in X
00089 #define CCD_Ypixel 167  // Anzahl Pixel in Y
00090 #define CCD_dT 20       // 20ms Zeiteinheit
00091 
00092 /* CCD Cmds */
00093 
00094 #define CCD_CMD_MONITORENABLE  1  // Monitor enable
00095 #define CCD_CMD_CLEAR          2  // clear ccd
00096 #define CCD_CMD_EXPOSURE       3  // do exposure cycle
00097 #define CCD_CMD_INITLESEN      4  // read pixelvalue and skip to next
00098 #define CCD_CMD_GETPIXEL       5  // read pixelvalue and skip to next
00099 
00100 
00101 #endif

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