Subversion Repositories f9daq

Rev

Rev 5 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 f9daq 1
/********************\
2
  VMEModule.hh
3
 
4
  update: 04/01/28
5
 
6
\********************/
7
 
8
#ifndef VMEMODULE_HH
9
#define VMEMODULE_HH
10
 
11
 
12
 
13
#include <stdio.h>
14
#include <sys/types.h>
15
#include "pcivme_ni.h"
16
 
17
#define VMEA24 (unsigned short)0x39
18
#define VMEA32 (unsigned short)0x09 
19
#define VMEA16 (unsigned short)0x29 
20
class VMEModule {
21
protected:
22
  int m_fd;
23
  int m_vmeptr;
24
  caddr_t m_vmeaddr;
25
  size_t m_size;
26
  unsigned long m_baseaddress;
27
public:
28
  VMEModule(int device, caddr_t vmeaddr, size_t size);
29
  ~VMEModule();
30
  unsigned long getBaseAddress() { return (unsigned long) m_baseaddress; }
31
  caddr_t   getVmeAddress() { return  m_vmeaddr; }
32
  void  write32(unsigned long address, unsigned long value);
33
  unsigned long read32(unsigned long address);
34
 
35
  void  write16(unsigned long address, unsigned short value);
36
  unsigned short read16(unsigned long address);
37
};
38
 
39
#endif