/[VMELinux]/vmeutils/vmelib.h
ViewVC logotype

Contents of /vmeutils/vmelib.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Mon Jun 18 14:57:44 2001 UTC (18 years, 11 months ago) by astro
Branch: MAIN
CVS Tags: vmelinux-1_1_2, Linux2_4_x
Changes since 1.1: +2 -6 lines
File MIME type: text/plain
Changed the device number from 70 to 221 as assigned by the Linux authorities.
1 //------------------------------------------------------------------------------
2 //title: VMEBus Library for Universe Driver
3 //version: Linux 0.0
4 //programmer: Michael Wyrick
5 //project: VMELinux Project in association with Chesapeake Research
6 //------------------------------------------------------------------------------
7 // Purpose:
8 // Docs:
9 //------------------------------------------------------------------------------
10 // $Id: vmelib.h,v 1.2 2001/06/18 14:57:44 astro Exp $
11 //------------------------------------------------------------------------------
12 #ifndef VMELIB_H
13 #define VMELIB_H
14
15 #define VME_CR_CSR 0x00
16 #define VME_A16 0x01
17 #define VME_A24 0x02
18 #define VME_A32 0x03
19
20 #define VME_PRG_DATA 0x04
21 #define VME_SUP_USR 0x08
22
23 #define VME_CYCLE 0x10
24
25 #define VME_SIZE 0x60
26 #define VME_SIZE_8 0x00
27 #define VME_SIZE_16 0x20
28 #define VME_SIZE_32 0x40
29 #define VME_SIZE_64 0x60
30
31 #define MODE_PROGRAMMED 0x01
32 #define MODE_DMA 0x02
33
34 //----------------------------------------------------------------------------
35 // Prototypes
36 //----------------------------------------------------------------------------
37 class VMEBus {
38 private:
39 int iSwapEndian;
40 int vme_handle;
41 int uni_handle;
42 int vme_space;
43 int ctl;
44 unsigned int pci_base_addr;
45 unsigned int pci_bound_addr;
46 unsigned int vme_base_addr;
47
48 int lasterror;
49
50 public:
51 VMEBus();
52 VMEBus(int image, unsigned int addr, int count, char space);
53 ~VMEBus();
54
55 unsigned int ReadUniReg(int reg);
56 void WriteUniReg(int reg, unsigned int v);
57
58 int VMEerror();
59
60 unsigned char ReadByte(int);
61 unsigned short ReadWord(int);
62 unsigned int ReadLong(int);
63
64 void WriteByte(int, unsigned char);
65 void WriteWord(int, unsigned short v);
66 void WriteLong(int, unsigned int v);
67
68 unsigned short ReadWord_wa(int);
69 void WriteWord_wa(int, unsigned short v);
70
71 unsigned long ReadLong_la(int);
72 void WriteLong_la(int, unsigned long v);
73
74 int ReadBlock(int, int, unsigned char *);
75 int WriteBlock(int, int, unsigned char *);
76 };
77
78 #endif // VMELIB_H

  ViewVC Help
Powered by ViewVC 1.2-dev