Subversion Repositories f9daq

Rev

Rev 100 | Rev 134 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
76 f9daq 1
#include "vme.h"
2
 
100 f9daq 3
 
4
short __stdcall VME_R( uint16_t AM, uint16_t DW,  uint32_t VME_Address, uint32_t *Data);
5
 
6
short __stdcall VME_W( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data);
7
 
8
short __stdcall VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data);
9
short __stdcall VME_MWRST( void );
10
short __stdcall VME_MWEXEC( void );
11
 
12
short __stdcall VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data);
13
short __stdcall VME_MRRST( void );
14
short __stdcall VME_MREXEC(  uint32_t *Data  );
15
 
76 f9daq 16
/*
17
#ifdef _CVI_
18
#include "c:\home\CVI\instr\WIENVME_DLL\wienvme_dll.h"
19
#else
20
#include "wienvme_dll.h"
21
#endif
22
*/
23
 
24
#include "CAENV1718.h"
25
#include "wusbvme_dll.h"
123 f9daq 26
#include "wienvme_dll.h"
76 f9daq 27
 
28
static int VME_interface= -1;
123 f9daq 29
int VME_GetInterface() {
30
  return VME_interface;
31
}
32
int VME_CONNECTED() {
76 f9daq 33
 
123 f9daq 34
  return  VME_interface;
76 f9daq 35
}
36
 
123 f9daq 37
short  __stdcall VME_START (int interface) {
38
 
39
 
40
  VME_interface=interface;
41
  switch (VME_interface) {
42
    case CAEN_V1718:
43
      CAEN_VME_START (NULL);
44
      VME_R_Ptr  =  CAEN_VME_R;
45
      VME_W_Ptr  =  CAEN_VME_W;
46
 
47
      VME_MW_Ptr =  CAEN_VME_MW;
48
      VME_MR_Ptr =  CAEN_VME_MR;
49
 
50
      VME_MW_Ptr =  CAEN_VME_MW;
51
      VME_MR_Ptr =  CAEN_VME_MR;
52
 
53
      VME_MWEXEC_Ptr =  CAEN_VME_MWEXEC;
54
      VME_MREXEC_Ptr =  CAEN_VME_MREXEC;
55
 
56
      VME_MWRST_Ptr =  CAEN_VME_MWRST;
57
      VME_MRRST_Ptr =  CAEN_VME_MRRST;
58
 
59
 
60
      break;
61
 
62
    case WIENER_VMEMM:
63
      WIENVME_VME_START(NULL);
64
      VME_R_Ptr  =  WIENVME_VME_R;
65
      VME_W_Ptr  =  WIENVME_VME_W;
66
 
67
      VME_MW_Ptr =  WIENVME_VME_MW;
68
      VME_MR_Ptr =  WIENVME_VME_MR;
69
 
70
      VME_MW_Ptr =  WIENVME_VME_MW;
71
      VME_MR_Ptr =  WIENVME_VME_MR;
72
 
73
      VME_MWEXEC_Ptr =  WIENVME_VME_MWEXEC;
74
      VME_MREXEC_Ptr =  WIENVME_VME_MREXEC;
75
 
76
      VME_MWRST_Ptr =  WIENVME_VME_MWRST;
77
      VME_MRRST_Ptr =  WIENVME_VME_MRRST;
78
      break;
79
    case WIENER_VMUSB:
80
      WIENER_VMUSB_VME_START("VM0120");
81
      VME_R_Ptr  =  WIENER_VMUSB_VME_R;
82
      VME_W_Ptr  =  WIENER_VMUSB_VME_W;
83
 
84
      VME_MW_Ptr =  WIENER_VMUSB_VME_MW;
85
      VME_MR_Ptr =  WIENER_VMUSB_VME_MR;
86
 
87
      VME_MW_Ptr =  WIENER_VMUSB_VME_MW;
88
      VME_MR_Ptr =  WIENER_VMUSB_VME_MR;
89
 
90
      VME_MWEXEC_Ptr =  WIENER_VMUSB_VME_MWEXEC;
91
      VME_MREXEC_Ptr =  WIENER_VMUSB_VME_MREXEC;
92
 
93
      VME_MWRST_Ptr =  WIENER_VMUSB_VME_MWRST;
94
      VME_MRRST_Ptr =  WIENER_VMUSB_VME_MRRST;
95
      break;
96
 
97
  }
98
 
99
  return 0;
76 f9daq 100
}
101
 
123 f9daq 102
short   __stdcall VME_STOP () {
103
  switch (VME_interface) {
104
    case CAEN_V1718:
105
 
106
      CAEN_VME_STOP( );
107
      break;
108
 
109
    case WIENER_VMEMM:
110
 
111
      break;
112
    case WIENER_VMUSB:
113
      WIENER_VMUSB_VME_STOP( );
114
      break;
115
    default:
116
 
117
      break;
118
 
119
  }
120
 
121
  VME_interface = -1;
122
  return 0;
76 f9daq 123
}