innovative_dsp_hwi.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,2002,2003 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 #ifndef __INNOVATIVE_DSP_HWI_H
00029 #define __INNOVATIVE_DSP_HWI_H
00030 
00031 
00032 #include "include/dsp-pci32/xsm/dpramdef.h"
00033 #include "FB_spm_dataexchange.h" // SRanger data exchange structs and consts
00034 
00035 
00036 
00037 /*
00038  * DSP Objekt für Steuerung über device /dev/pci32 kernelmodul
00039  * ============================================================
00040  */
00041 class innovative_dsp_hwi_dev : public XSM_Hardware{
00042 public: 
00043   innovative_dsp_hwi_dev(int ver=1);
00044   virtual ~innovative_dsp_hwi_dev();
00045 
00046   virtual void StoreParameter(void){;};
00047   virtual void RestoreParameter(void){;};
00048   virtual void ExecCmd(int Cmd);
00049   virtual int  WaitExec(int data);
00050 
00051   /* Parameter  */
00052   virtual long GetMaxPointsPerLine(){ return max_points_per_line; };
00053   virtual long GetMaxLines(){ return -1L; };
00054   virtual long GetMaxChannels(){ return 1L; };
00055 
00056   virtual void SetParameter(PARAMETER_SET &hps, int scanflg=FALSE); /* universelle Parameterübergabe */
00057   virtual void GetParameter(PARAMETER_SET &hps); /* universelle Parameterübergabe */
00058   virtual size_t ReadData(void *buf, size_t count);
00059   virtual int ReadScanData(int y_index, int num_srcs, Mem2d *m[MAX_SRCS_CHANNELS]);
00060   virtual int ReadProbeData(int nsrcs, int nprobe, int kx, int ky, Mem2d *m, double scale=1.);
00061   virtual gchar* get_info(){ return get_DSP_softinfo();  };
00062 
00063 protected:
00064   int ScanningFlg;
00065   gchar* get_DSP_softinfo();
00066   static void Evchk();
00067   static void NoEvchk();
00068   void EventCheckOn(){ EventCheck = Evchk; };
00069   void EventCheckOff(){ EventCheck = NoEvchk; };
00070   void (*EventCheck)();
00071   int KillFlg;
00072 
00073  private:
00074   void wait_dsp(){};
00075   void lock_dsp(){ ++in_use_count; };
00076   void release_dsp(){ --in_use_count; };
00077   int dsp_cmd, dsp_usr, dsp_data;
00078   int in_use_count;
00079 
00080   PROBE_DATA_MODE prb_data_mode;
00081   SCAN_DATA_MODE scan_data_mode;
00082   long max_points_per_line;
00083 };
00084 
00085 /* SPM Hardware auf /dev/dspdev -- xafm.out running on dsp 
00086  * used by AFM, STM, SARLS
00087  */
00088 
00089 class innovative_dsp_hwi_spm : public innovative_dsp_hwi_dev{
00090  public:
00091   innovative_dsp_hwi_spm();
00092   virtual ~innovative_dsp_hwi_spm();
00093 
00094   virtual void PutParameter(void *src, int grp=0); /* universelle Parameterübergabe */
00095 
00096   virtual void SetDxDy(int dx, int dy);
00097   virtual void SetOffset(long x, long y);
00098   virtual void SetNx(long nx);
00099   virtual void SetAlpha(double alpha);
00100 
00101   virtual void MovetoXY (long x, long y);
00102   virtual void StartScan2D();
00103   virtual void ScanLineM(int yindex, int xdir, int muxmode, Mem2d *Mob[MAX_SRCS_CHANNELS], int ix0=0 );
00104   virtual void EndScan2D();
00105   virtual void PauseScan2D();
00106   virtual void ResumeScan2D();
00107   virtual void KillScan2D(){ KillFlg=TRUE; };
00108 
00109  private:
00110   DSP_Param dspPar;
00111 
00112   void DSP_FbWerte();
00113   void DSP_SetTransferFkt();
00114   void DSP_SetRotParam();
00115   void DSP_SetMoveParam();
00116   void DSP_SetAppWerte();
00117 };
00118 
00119 /* SPA-LEED Hardware auf /dev/dspdev -- spa.out running on dsp */
00120 
00121 class innovative_dsp_hwi_spa : public innovative_dsp_hwi_dev{
00122  public:
00123   innovative_dsp_hwi_spa();
00124   virtual ~innovative_dsp_hwi_spa();
00125 
00126   virtual void StoreParameter(void);
00127   virtual void RestoreParameter(void);
00128   virtual void PutParameter(void *src, int grp=0); /* universelle Parameterübergabe */
00129 
00130   virtual long GetMaxPointsPerLine(){ return (long)(DSP_DATA_REG_LEN<<2); };
00131   virtual void SetDxDy(int dx, int dy);
00132   virtual void SetOffset(long x, long y);
00133   virtual void SetNx(long nx);
00134   virtual void SetAlpha(double alpha);
00135 
00136   virtual void MovetoXY(long x, long y);
00137   virtual void StartScan2D();
00138   virtual void ScanLineM(int yindex, int xdir, int muxmode, Mem2d *Mob[MAX_SRCS_CHANNELS], int ix0=0 );
00139   virtual void EndScan2D();
00140   virtual void KillScan2D(){ KillFlg=TRUE; };
00141 
00142  private:
00143   DSP_Param dspPar;
00144 
00145   void DSP_SpaWerte(int flg=FALSE);
00146 };
00147 
00148 #endif
00149 

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