fdhwlib  2.0.25
/home/kopmann/git-mirror/fdhwlib/fdhwlib/katrinhw4/fltkatrin.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     fltkatrin.h          -  description
00003 
00004     begin                : Sep 21 2009
00005     copyright            : (C) 2000 by Till Bergmann
00006     email                : bergmann@ipe.fzk.de
00007  ***************************************************************************/
00008 
00009 
00010 #if defined (_MSC_VER) && (_MSC_VER >= 1000)
00011 #pragma once
00012 #endif
00013 #ifndef _HW4_FLTKATRIN_H_INCLUDED
00014 #define _HW4_FLTKATRIN_H_INCLUDED
00015 
00016 #include <stdint.h>
00017 
00018 //#include <hw4/baseregister.h>
00019 
00020 //same register as for Auger
00021 #include <hw4/fltperiphregister.h>
00022 #include <hw4/flthitrate.h>
00023 //#include <hw4/fltruncontrol.h>
00024 //#include <hw4/fltperiphstatus.h>
00025 #include <hw4/fltinterrupt.h>
00026 #include <hw4/fltversion.h>
00027 //#include <hw4/flthitratemargins.h>
00028 #include <hw4/baseboardidreg.h>
00029 //#include <hw4/fltstatus.h>
00030 
00031 #include <hw4/fltautoincram.h>
00032 
00033 //KATRIN specific registers
00034 #include <katrinhw4/fltkatrinstatus.h>
00035 #include <katrinhw4/fltkatrincontrol.h>
00036 #include <katrinhw4/fltkatrincommand.h>
00037 #include <katrinhw4/fltkatrinruncontrol.h>
00038 #include <katrinhw4/fltkatrinhitratecontrol.h>
00039 #include <katrinhw4/fltkatrinthreshold.h>
00040 #include <katrinhw4/fltkatrinperiphstatus.h>
00041 #include <katrinhw4/fltkatrinhistlastfirst.h>
00042 #include <katrinhw4/fltkatrinhistogramsettings.h>
00043 #include <hw4/fltsecondcounter.h>
00044 
00045 //#include <katrinhw4/fltkatrineventfifostatus.h>
00046 //#include <katrinhw4/fltkatrineventfifo1.h>
00047 //#include <katrinhw4/fltkatrineventfifo2.h>
00048 //#include <katrinhw4/fltkatrineventfifo3.h>
00049 //#include <katrinhw4/fltkatrineventfifo4.h>
00050 
00051 //#include <hw4/subrack.h>
00052 #include <Hw/subrackbase.h>
00053 #include <hw4/subrackboard.h>
00054 
00055 
00056 namespace hw4 {
00057 
00059 static const int kFLTKATRIN_REGS = 50;  //TODO: rename or move to fltdef.h !!! -tb-
00060 
00062 //static const int kFLT_PIXREGS = 16;//TODO: rename or move to fltdef.h !!! -tb-
00063 
00064 // --- forward declaration(s)
00065 
00066 class Subrack;
00067           //TODO: ?? -tb-
00082 
00096 class FltKatrin : public hw4::SubrackBoard
00097 {
00098 public:
00099 
00100   FltKatrin(int ID);
00101 
00102   virtual ~FltKatrin();
00103 
00104 #if 0
00105   enum Flt4Constants {   //I use this temporarily instead of the defines in fltdef.h -tb-
00106       kFLT_PAGES = 64,
00107       kFLT_PAGE_SIZE = 2000 // for unsigned shorts (for v3 this was 1000)
00108   };
00109 #endif
00110 
00113    bool checkPresence();
00114 
00116    int getVersion(int unit=0);
00117    
00118 
00126    int getHardwareModelVersion(); 
00127 
00129    int readExpectedConfig(akInifile *config);
00130 
00132     void printExpectedConfig(FILE *fout);
00133 
00135     void printConfigToInifile(FILE *fout);
00136 
00145     int checkConfig();
00146 
00147 
00159    int testMemory(FILE *fout, int ch = -1);
00160 
00173    int testTransferRate(FILE *fout, int ch = -1, int page = -1);
00174 
00175 
00182   int compareData(FILE *fout, unsigned short *data,
00183                   unsigned short *patter, int shift, int n, int output=1);
00184 
00185 
00187   int getMeanAdcValue(int ch, double *value);
00188 
00194   int setThresholdToAdc(int ch, unsigned long delta);
00195 
00196   SubrackBase* theSubrack; //-tb- was Subrack
00197 
00198   FltKatrinStatus * status;
00199   //FltStatus * status;
00200 
00201   FltKatrinControl * control;
00202         
00203   FltKatrinCommand * command;
00204 
00205   FltVersion * version;
00206   FltVersion * periphVersion;
00207   BaseBoardIdReg * boardId;
00208 
00209   FltInterrupt * interruptMask;
00210 
00211   FltInterrupt * interruptRequest;
00212 
00213   //BaseRegister * channelOnOff;
00214 
00215   BaseRegister * hitrateMeasureEnable;
00216 
00217   BaseRegister * pixelTriggerSettings;
00218 
00219   FltKatrinRunControl * runControl;
00220 
00221   FltKatrinHistogramSettings * histogramSettings;
00222 
00223   BaseRegister * accessTest;
00224 
00225   FltSecondCounter * secondCounter;
00226 
00227   FltKatrinHitrateControl * hitrateControl;
00228   
00229   BaseRegister * histMeasTime;
00230   BaseRegister * histRecTime;
00231   BaseRegister * histNofMeas;
00232   BaseRegister * postTrigTime;
00233 
00234   BaseRegister * offset;
00235   BaseRegister * gain;
00236   FltHitrate * hitrate;
00237   
00238   BaseRegister * testPattern;
00239 
00240   // The Flt FIFO is not used in the lastest firmware version 
00241   // Use instead the Slt FIFO to read event information
00242   //FltKatrinEventFIFOStatus * eventFIFOStatus;
00243   //FltKatrinEventFIFO1 * eventFIFO1;
00244   //FltKatrinEventFIFO2 * eventFIFO2;
00245   //FltKatrinEventFIFO3 * eventFIFO3;
00246   //FltKatrinEventFIFO4 * eventFIFO4;
00247 
00248   FltKatrinPeriphStatus * periphStatus;                                   
00249 
00250   BaseRegister * pageCount;
00251   BaseRegister * energy;
00252   FltKatrinHistLastFirst * histLastFirst;
00253 
00254 
00255 
00256   FltKatrinThreshold * threshold;
00257 
00258   BaseRegister * adcSettings;
00259 
00260   BaseRegister * ramData;
00261   
00262   FltAutoIncRAM * histogramData;
00263 
00265   uint64_t serialno;
00266   uint32_t vfpga;
00267   uint32_t vdoc;
00268   uint32_t vpfpga;
00269   uint32_t vpdoc;
00270   uint32_t vproject;
00271 
00272 
00273 };
00274         
00275 } // namespace hw4
00276 
00277 #endif /* _HW4_FLTKATRIN_H_INCLUDED */
00278