fdhwlib  2.0.25
/home/kopmann/git-mirror/fdhwlib/fdhwlib/Pbus/pbusmicroenable.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     pbusmicroenable.h  -  description
00003 
00004     begin                : Tue Oct 28 2003
00005     copyright            : (C) 2003 by A Kopmann
00006     email                : kopmann@ipe.fzk.de
00007     status               :
00008     test                 :
00009     history              :
00010  ***************************************************************************/
00011 
00012 #ifndef PBUSMICROENABLE_H
00013 #define PBUSMICROENABLE_H
00014 
00015 #include <string>
00016 
00017 #include "pbusimp.h"
00018 
00019 #ifdef PBUS_TEST
00020 #include "pbussim.h"
00021 #endif
00022 
00023 #ifdef USE_ME
00024 
00025 
00026 
00036 #ifdef PBUS_TEST
00037 
00038 class PbusMicroEnable : public PbusSim
00039 
00040 #else
00041 
00042 class PbusMicroEnable : public PbusImp
00043 
00044 #endif
00045 {
00046 
00047 public:
00048   PbusMicroEnable();
00049 
00050   ~PbusMicroEnable();
00051 
00052   const char *getMode();
00053 
00054   int getModeId();
00055 
00056   const char *getLibName();
00057   
00058   int get(std::string item, std::string *value);
00059 
00060   int init(char *inifile, int host=0);
00061 
00062   int free(int host=0);
00063 
00064   void reset();
00065 
00066   unsigned long getState();
00067 
00068   int waitForIR(int timeout);
00069 
00070   int checkIR();
00071 
00072   unsigned long getIRvector();
00073 
00074 #ifndef PBUS_TEST
00075   unsigned long rawRead(unsigned long addr);
00076 
00077   void rawWrite(unsigned long addr, unsigned long data);
00078 
00079   void readBlock(unsigned long addr, unsigned long * data,
00080                unsigned long n, unsigned long incr=1);
00081 #endif
00082 
00083 private:
00084 
00104   static void initMicroEnable(char *inifile);
00105 
00107   static void initPbus();
00108 
00109 
00110 private: // Members
00111 
00114   static microenable * board;
00115 
00119   static fpga_design * design;
00120 
00122   static unsigned long * reg;
00123 
00124   static bool menableMounted;
00125 
00126   static bool menableLoaded;
00127 
00128 
00129 #ifdef PBUS_TEST
00130 
00131 //  static unsigned long maxAddr;
00132 #endif
00133 
00135   static int timing;
00136 
00138   static int IRpolling;
00139 
00140 };
00141 
00142 #endif  // of PBUS_ME
00143 
00144 #endif