Subversion Repositories f9daq

Rev

Rev 87 | Rev 123 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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