Subversion Repositories f9daq

Rev

Rev 170 | 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
170 f9daq 15
#define SIS3153_USB  3
76 f9daq 16
 
17
 
327 f9daq 18
short WIENER_VMUSB_VME_DGG(unsigned short channel, unsigned short trigger,unsigned short output,
19
                    long delay, unsigned short gate, unsigned short invert, unsigned short latch);
20
short WIENER_VMUSB_VME_Output_settings( unsigned short channel, unsigned short code, unsigned short invert, unsigned short latch );
21
short WIENER_VMUSB_register_write( short RegAddr, long RegData);
22
 
76 f9daq 23
short VME_START( int interface );
87 f9daq 24
int VME_GetInterface();
76 f9daq 25
short VME_STOP();
26
int VME_CONNECTED();
27
 
28
#define VME_A16 0x29
29
#define VME_A24 0x39
30
#define VME_A32 0x9
31
 
32
#define VME_D8  0x1
33
#define VME_D16 0x2
34
#define VME_D32 0x4
35
 
36
#define VME_A16D8_R(VME,DATA)  VME_R( VME_A16, VME_D8  , (VME), (DATA) ) 
37
#define VME_A16D16_R(VME,DATA) VME_R( VME_A16, VME_D16 , (VME), (DATA) )
38
#define VME_A16D32_R(VME,DATA) VME_R( VME_A16, VME_D32 , (VME), (DATA) )
39
 
40
#define VME_A24D8_R(VME,DATA)  VME_R( VME_A24, VME_D8  , (VME), (DATA) ) 
41
#define VME_A24D16_R(VME,DATA) VME_R( VME_A24, VME_D16 , (VME), (DATA) )
42
#define VME_A24D32_R(VME,DATA) VME_R( VME_A24, VME_D32 , (VME), (DATA) )
43
 
44
#define VME_A32D8_R(VME,DATA)  VME_R( VME_A32, VME_D8  , (VME), (DATA) ) 
45
#define VME_A32D16_R(VME,DATA) VME_R( VME_A32, VME_D16 , (VME), (DATA) )
46
#define VME_A32D32_R(VME,DATA) VME_R( VME_A32, VME_D32 , (VME), (DATA) )
47
 
48
#define VME_A16D8_W(VME,DATA)  VME_W( VME_A16, VME_D8  , (VME), (DATA) ) 
49
#define VME_A16D16_W(VME,DATA) VME_W( VME_A16, VME_D16 , (VME), (DATA) )
50
#define VME_A16D32_W(VME,DATA) VME_W( VME_A16, VME_D32 , (VME), (DATA) )
51
 
52
#define VME_A24D8_W(VME,DATA)  VME_W( VME_A24, VME_D8  , (VME), (DATA) ) 
53
#define VME_A24D16_W(VME,DATA) VME_W( VME_A24, VME_D16 , (VME), (DATA) )
54
#define VME_A24D32_W(VME,DATA) VME_W( VME_A24, VME_D32 , (VME), (DATA) )
55
 
56
#define VME_A32D8_W(VME,DATA)  VME_W( VME_A32, VME_D8  , (VME), (DATA) ) 
57
#define VME_A32D16_W(VME,DATA) VME_W( VME_A32, VME_D16 , (VME), (DATA) )
58
#define VME_A32D32_W(VME,DATA) VME_W( VME_A32, VME_D32 , (VME), (DATA) )
59
 
60
 
61
#define  VME_R         (*VME_R_Ptr)
62
#define  VME_W         (*VME_W_Ptr)
170 f9daq 63
 
64
#define  VME_MWRST     (*VME_MWRST_Ptr)
76 f9daq 65
#define  VME_MW        (*VME_MW_Ptr) 
66
#define  VME_MWEXEC    (*VME_MWEXEC_Ptr)
67
 
170 f9daq 68
#define  VME_MRRST     (*VME_MRRST_Ptr)
76 f9daq 69
#define  VME_MR        (*VME_MR_Ptr) 
70
#define  VME_MREXEC    (*VME_MREXEC_Ptr)
71
 
72
 
170 f9daq 73
extern short __stdcall VME_R( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data);
100 f9daq 74
extern short __stdcall VME_W( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data);
76 f9daq 75
 
170 f9daq 76
extern short __stdcall VME_MWRST( void );
100 f9daq 77
extern short __stdcall VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data);
78
extern short __stdcall VME_MWEXEC( void );
76 f9daq 79
 
170 f9daq 80
extern short __stdcall VME_MRRST( void );
100 f9daq 81
extern short __stdcall VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data);
170 f9daq 82
extern short __stdcall VME_MREXEC( uint32_t *Data  );
76 f9daq 83
 
84
#endif
85