Subversion Repositories f9daq

Rev

Rev 97 | Rev 122 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 97 Rev 100
Line 5... Line 5...
5
 
5
 
6
#include <CAENVMElib.h>
6
#include <CAENVMElib.h>
7
#include <CAENVMEoslib.h>
7
#include <CAENVMEoslib.h>
8
#include <CAENVMEtypes.h>
8
#include <CAENVMEtypes.h>
9
 
9
 
-
 
10
#ifndef _CVI_
-
 
11
#define __stdcall
-
 
12
#define UCHAR unsigned char
-
 
13
#define  _VI_FUNC
-
 
14
#endif
10
 
15
 
11
#include "CAENV1718.h"
16
#include "CAENV1718.h"
-
 
17
 
-
 
18
 
12
 
19
 
13
int32_t CAEN_udev;
20
int32_t CAEN_udev;
14
 
21
 
15
int VMEerrors;
22
int VMEerrors;
16
 
23
 
Line 21... Line 28...
21
  if (result != cvSuccess) {
28
  if (result != cvSuccess) {
22
    printf("CAEN1718 Init %s\n", CAENVME_DecodeError(result));
29
    printf("CAEN1718 Init %s\n", CAENVME_DecodeError(result));
23
    printf(" Check usb cable, usb udev permissions and restart!  Exiting .....\n");
30
    printf(" Check usb cable, usb udev permissions and restart!  Exiting .....\n");
24
    return (-1);
31
    return (-1);
25
  }
32
  }
26
  if (serial == NULL) serial = malloc(100*sizeof(char));
33
  if (serial == NULL) serial = (char *) malloc(100*sizeof(char));
27
  CAENVME_BoardFWRelease(CAEN_udev, serial);
34
  CAENVME_BoardFWRelease(CAEN_udev, serial);
28
 
35
 
29
  return result;
36
  return result;
30
}
37
}
31
 
38
 
Line 185... Line 192...
185
 return  WStackNCycles;
192
 return  WStackNCycles;
186
}
193
}
187
 
194
 
188
 
195
 
189
short __stdcall CAEN_VME_R( uint16_t AddressModifier, uint16_t DataWidth,  uint32_t VME_Address, uint32_t *Data){
196
short __stdcall CAEN_VME_R( uint16_t AddressModifier, uint16_t DataWidth,  uint32_t VME_Address, uint32_t *Data){
190
         return CAEN_VME_read( CAEN_udev,   VME_Address, (void *)Data,  AddressModifier, DataWidth);
197
         return CAEN_VME_read( CAEN_udev,   VME_Address, (void *)Data,  (CVAddressModifier) AddressModifier, (CVDataWidth) DataWidth);
191
}
198
}
192
 
199
 
193
short __stdcall CAEN_VME_W( uint16_t AddressModifier, uint16_t DataWidth,  uint32_t VME_Address, uint32_t Data){
200
short __stdcall CAEN_VME_W( uint16_t AddressModifier, uint16_t DataWidth,  uint32_t VME_Address, uint32_t Data){
194
         return CAEN_VME_write( CAEN_udev,   VME_Address, &Data,  AddressModifier, DataWidth);
201
         return CAEN_VME_write( CAEN_udev,   VME_Address, &Data,  (CVAddressModifier) AddressModifier, (CVDataWidth) DataWidth);
195
}
202
}
196
 
203
 
197
short __stdcall CAEN_VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data){
204
short __stdcall CAEN_VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data){
198
 
205
 
199
  return CAEN_VME_appendwrite(  VME_Address, &Data ,AM , DW) ;
206
  return CAEN_VME_appendwrite(  VME_Address, &Data ,(CVAddressModifier) AM , (CVDataWidth) DW) ;
200
 
207
 
201
}
208
}
202
short __stdcall CAEN_VME_MWRST( void ){
209
short __stdcall CAEN_VME_MWRST( void ){
203
 
210
 
204
  return CAEN_VME_MultiWriteReset();
211
  return CAEN_VME_MultiWriteReset();
Line 210... Line 217...
210
 
217
 
211
}
218
}
212
 
219
 
213
short __stdcall CAEN_VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data){
220
short __stdcall CAEN_VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data){
214
 
221
 
215
  return   CAEN_VME_appendread(  VME_Address, Data ,AM , DW) ;
222
  return   CAEN_VME_appendread(  VME_Address, Data ,(CVAddressModifier) AM , (CVDataWidth) DW) ;
216
 
223
 
217
}
224
}
218
short __stdcall CAEN_VME_MRRST( void ){
225
short __stdcall CAEN_VME_MRRST( void ){
219
 
226
 
220
  return CAEN_VME_MultiReadReset();
227
  return CAEN_VME_MultiReadReset();