fdhwlib  2.0.25
/home/kopmann/git-mirror/fdhwlib/fdhwlib/Pbus/pbuspcidma.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     pbuspcidma.h  -  description
00003 
00004     begin                : Wed Feb 16 2011
00005     copyright            : (C) 2011 by Till Bergmann
00006     email                : Till.Bergmann@kit.edu
00007     status               :
00008     test                 :
00009     history              :
00010  ***************************************************************************/
00011 
00012 #ifndef PBUSPCIDMA_H
00013 #define PBUSPCIDMA_H
00014 
00015 #include "pbusimp.h"
00016 
00017 // === Add this define in Pbus.h ===
00018 #ifdef PBUS_PCIDMA
00019 
00020 
00021 class semaphore;
00022 
00023 
00024 // === Add documentation for the access type ===
00025 
00041 class PbusPCIDMA : public PbusImp
00042 {
00043 
00044 public:
00045   PbusPCIDMA();
00046 
00047   ~PbusPCIDMA();
00048 
00049   const char *getMode();
00050 
00051   int getModeId();
00052 
00053   const char *getLibName();
00054 
00055   int get(std::string item, std::string *value);
00056 
00057   int set(std::string item, std::string value);
00058 
00059   int init(char *inifile, int host=0);
00060 
00061   int free(int host=0);
00062 
00063   void reset();
00064 
00065   unsigned long rawRead(unsigned long addr);
00066 
00067   void rawWrite(unsigned long addr, unsigned long data);
00068 
00070   void readBlock(unsigned long addr, unsigned long * data,
00071                unsigned long n, unsigned long incr=1);
00072 
00073   void writeBlock(unsigned long addr, unsigned long * data,
00074                unsigned long n, unsigned long incr=1);
00075 
00076 private:
00077 
00078   // === Add private helper functions here ===
00079   
00080 private:
00081   // === Add private members here ===  
00082   static int handle; 
00083   static int fd;
00084   static void* mp;
00085   static unsigned long ModuleID, Irq, BaseAddr, Size;
00086   
00087   
00088 };
00089 
00090 #endif  // of PBUS_PCIDMA
00091 
00092 #endif  // of PBUSPCIDMA_H
00093 
00094