Subversion Repositories f9daq

Rev

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

Rev Author Line No. Line
76 f9daq 1
#ifndef _VME_H_
2
#define _VME_H_
3
 
4
#include <stdint.h>
5
 
100 f9daq 6
#ifndef _CVI_
7
#define __stdcall
8
#define UCHAR unsigned char
9
#define  _VI_FUNC
10
#endif
11
 
76 f9daq 12
#define CAEN_V1718   0
13
#define WIENER_VMEMM 1
14
#define WIENER_VMUSB 2
15
 
16
 
17
short VME_START( int interface );
87 f9daq 18
int VME_GetInterface();
76 f9daq 19
short VME_STOP();
20
int VME_CONNECTED();
21
 
22
#define VME_A16 0x29
23
#define VME_A24 0x39
24
#define VME_A32 0x9
25
 
26
#define VME_D8  0x1
27
#define VME_D16 0x2
28
#define VME_D32 0x4
29
 
30
#define VME_A16D8_R(VME,DATA)  VME_R( VME_A16, VME_D8  , (VME), (DATA) ) 
31
#define VME_A16D16_R(VME,DATA) VME_R( VME_A16, VME_D16 , (VME), (DATA) )
32
#define VME_A16D32_R(VME,DATA) VME_R( VME_A16, VME_D32 , (VME), (DATA) )
33
 
34
#define VME_A24D8_R(VME,DATA)  VME_R( VME_A24, VME_D8  , (VME), (DATA) ) 
35
#define VME_A24D16_R(VME,DATA) VME_R( VME_A24, VME_D16 , (VME), (DATA) )
36
#define VME_A24D32_R(VME,DATA) VME_R( VME_A24, VME_D32 , (VME), (DATA) )
37
 
38
#define VME_A32D8_R(VME,DATA)  VME_R( VME_A32, VME_D8  , (VME), (DATA) ) 
39
#define VME_A32D16_R(VME,DATA) VME_R( VME_A32, VME_D16 , (VME), (DATA) )
40
#define VME_A32D32_R(VME,DATA) VME_R( VME_A32, VME_D32 , (VME), (DATA) )
41
 
42
#define VME_A16D8_W(VME,DATA)  VME_W( VME_A16, VME_D8  , (VME), (DATA) ) 
43
#define VME_A16D16_W(VME,DATA) VME_W( VME_A16, VME_D16 , (VME), (DATA) )
44
#define VME_A16D32_W(VME,DATA) VME_W( VME_A16, VME_D32 , (VME), (DATA) )
45
 
46
#define VME_A24D8_W(VME,DATA)  VME_W( VME_A24, VME_D8  , (VME), (DATA) ) 
47
#define VME_A24D16_W(VME,DATA) VME_W( VME_A24, VME_D16 , (VME), (DATA) )
48
#define VME_A24D32_W(VME,DATA) VME_W( VME_A24, VME_D32 , (VME), (DATA) )
49
 
50
#define VME_A32D8_W(VME,DATA)  VME_W( VME_A32, VME_D8  , (VME), (DATA) ) 
51
#define VME_A32D16_W(VME,DATA) VME_W( VME_A32, VME_D16 , (VME), (DATA) )
52
#define VME_A32D32_W(VME,DATA) VME_W( VME_A32, VME_D32 , (VME), (DATA) )
53
 
54
 
55
#define  VME_R         (*VME_R_Ptr)
56
#define  VME_W         (*VME_W_Ptr)
57
#define  VME_MW        (*VME_MW_Ptr) 
58
#define  VME_MWRST     (*VME_MWRST_Ptr)
59
#define  VME_MWEXEC    (*VME_MWEXEC_Ptr)
60
 
61
#define  VME_MR        (*VME_MR_Ptr) 
62
#define  VME_MRRST     (*VME_MRRST_Ptr)
63
#define  VME_MREXEC    (*VME_MREXEC_Ptr)
64
 
65
 
100 f9daq 66
extern short __stdcall VME_R( uint16_t AM, uint16_t DW,  uint32_t VME_Address, uint32_t *Data);
76 f9daq 67
 
100 f9daq 68
extern short __stdcall VME_W( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data);
76 f9daq 69
 
100 f9daq 70
extern short __stdcall VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data);
71
extern short __stdcall VME_MWRST( void );
72
extern short __stdcall VME_MWEXEC( void );
76 f9daq 73
 
100 f9daq 74
extern short __stdcall VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data);
75
extern short __stdcall VME_MRRST( void );
76
extern short __stdcall VME_MREXEC(  uint32_t *Data  );
76 f9daq 77
 
78
#endif
79