pit_driver.h

Go to the documentation of this file.
00001 #ifndef PIT_DRIVER_H
00002 #define PIT_DRIVER_H
00003 
00004 #include <dis.hxx>
00005 #include <log4cpp/BasicConfigurator.hh>
00006 #include <log4cpp/Category.hh>
00007 #include <sstream>
00008 
00009 #include "pit_def.h"
00010 #include "pit_comm.h"
00011 #include "pit_driver_cmd_def.h"
00012 #include "pit_driver_optinBoard.h"
00013 #include "pit_configuration.h"
00014 #include "pit_driver_procFpga.h"
00015 
00016 # define PIT_BRAIN_CARD_FIRMWARE_ADDRESS        0x0
00017 using namespace std;
00018 
00019 
00021 class pit_driver
00022 {
00023     unsigned int fpgaFirmwareVersion;  // brain FPGA firmware version
00024     bool statusSIULink;                // is SIU connected ?
00025     log4cpp::Category *logDriver;      // log instance
00026 
00027     pit_driver_optinBoard *optinBoard[NUMBER_OPTIN];
00028     
00030     pit_driver_procFpga * procFPGA;
00031     
00033     DimService *serviceCmdAnswer;
00035 
00039     DimService *serviceCmdStatus;
00041     DimCommand *commandGenericCmd;
00043     int cmdReturn;
00044     
00045         
00047 
00048     pit_driver_optinBoard & getOptinBoardFromStream(stringstream &inStr);
00050 
00051     pit_driver_opticalLink & getLinkFromStream(stringstream &inStr);
00053 
00054     pit_driver_foChannel & getFoChannelFromStream(stringstream & inStr);
00055     
00056     
00057 public:    
00059                 /* \param dataBlock address of the first element
00060                  * \param size the number of elements to change          */
00061     static void initializeWithRandom(UInt32 *dataBlock, unsigned int size);
00062     
00064 
00071     static UInt32  chekBitErrorsNumber(UInt32 data1, UInt32 data2, unsigned int posErrorHist[]);
00072 
00073 
00074                 // for the moment this is left as public 
00075     pit_comm *commFEE;  // communication engine
00076     
00078     pit_driver_optinBoard & getOptinBoard(unsigned int optinBoardNumber);
00079     
00081 
00083     int executeCommand(const char * inString);
00085     int checkDimCommands();
00086     
00087     pit_driver(void);                      // constructor
00088     ~pit_driver(void);                     // destuctor
00089     bool checkSIULink(void);               // check if SIU is connected
00090    
00092     unsigned int readFpgaFirmwareVersion(void);
00093     
00094     inline unsigned int getFpgaFirmwareVersion(void) { return fpgaFirmwareVersion; } // reads the 'fpgaFirmwareVersion' variable (FPGA firware version)
00095 
00097 
00106     unsigned int pitMemoryAccessTest(   unsigned int blockLength,
00107                                                                         unsigned int initialAddress, 
00108                                                                         unsigned int finalAddress,
00109                                                                         unsigned int repetitions,
00110                                                                         unsigned int addressIncrement=0);
00111        
00112     
00113     int refresh();
00114 
00115 }; 
00116 
00117 
00118 #endif

Generated on Sat Mar 29 22:55:54 2008 for pixelTrigger by  doxygen 1.5.0