Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

DummyVmeInterface.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 // 24/04/2002  V 1.1 PM - First implementation
00009 //             
00010 
00011 #ifndef SCTPIXELROD_DUMMY_VMEINTERFACE_H
00012 #define SCTPIXELROD_DUMMY_VMEINTERFACE_H
00013 
00014 #include <vector>
00015 
00016 #include "VmeInterface.h"
00017 #include "VmePort.h"
00018 
00019 
00020 namespace SctPixelRod {
00021 
00022 class DummyVmeInterface : public VmeInterface {
00023 public:
00025   DummyVmeInterface();
00027   ~DummyVmeInterface();                                                                  
00028 
00030   virtual void declareInterruptHandler(VmeInterruptHandler &handler);
00032   virtual void removeInterruptHandler(VmeInterruptHandler &handler);
00034   virtual void cleanInterruptHandlers();
00036   virtual inline void activateSoftVector(unsigned char vect, unsigned char subvect) {
00037     if (subvect>0 && subvect<=32) {
00038       m_softVectMask |= 1 << (subvect-1);
00039     }
00040   };
00042   virtual void reEnableInterrupt() { }; 
00044   virtual void blockInterruptNotification(); 
00046   virtual void resumeInterruptNotification(); 
00048   virtual void setInterruptData(long data) {
00049     m_interruptData = data;
00050   };
00052   virtual long getInterruptData() {
00053     return m_interruptData;
00054   };
00055   
00057   virtual long getBusErrors();
00059   virtual void busErrorReport();
00060   virtual void busErrorReport(const unsigned long handle);
00061   virtual void busErrorReport(VmePort &port);
00063   virtual long getLastErrcode() { return 0; }
00065   virtual std::string getErrorMessage(const long errcode);
00066 
00068   virtual unsigned char read8  (const unsigned long handle, const unsigned long offset);  
00069   // Word read (automatic mapping)
00070   virtual unsigned short read16 (const unsigned long handle, const unsigned long offset);  
00072   virtual unsigned long read32 (const unsigned long handle, const unsigned long offset);  
00074   virtual void write8 (const unsigned long handle, const unsigned long offset, const unsigned char value);   
00076   virtual void write16(const unsigned long handle, const unsigned long offset, const unsigned short value);    
00078   virtual void write32(const unsigned long handle, const unsigned long offset, const unsigned long value);   
00079 
00081   virtual void blockRead32 (VmePort &port, const unsigned long offset, unsigned long *buf, const long len);  
00083   virtual void blockRead64 (VmePort &port, const unsigned long offset, unsigned long *buf, const long len);   
00085   virtual void blockWrite32(VmePort &port, const unsigned long offset, const unsigned long *buf, const long len);  
00087   virtual void blockWrite64(VmePort &port, const unsigned long offset, const unsigned long *buf, const long len);   
00088 
00090   virtual unsigned long registerPort(VmePort &port);         
00092   virtual void deletePort(VmePort &port);
00094   virtual void *getPortMap(const unsigned long handle);
00095 
00096 private:
00097   std::vector<VmePort *> m_ports;
00098   sigset_t m_sigMask;                 // Mask for blocking signals
00099 
00100   static unsigned char m_softVectMask;                  // Interrupt subvector array
00101   static long m_interruptData;                          // Interrupt data word
00102   static DummyVmeInterface *m_if;                       // Static pointer to THE interface
00103   static std::vector<VmeInterruptHandler *> m_hardIH;        // Vector of basic IH (always executed)
00104   static std::vector<VmeInterruptHandler *> m_softIH[32];    // Vector of slaves IH (executed when the subvector mask set
00105                                                         // by the basic IH equals the one defined in the slave IH
00106 
00108   static void m_interruptHandler(int signum);
00109 };                                             // End of RCCVmeInterface declaration
00110 
00111 } // End namespace SctPixelRod
00112 
00113 #endif // SCTPIXELROD_RCCVMEINTERFACE_H

Generated on Mon Dec 15 19:36:00 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3