Rev 307 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
61 | f9daq | 1 | #ifndef _WUSBVME_DLL_H |
2 | #define _WUSBVME_DLL_H |
||
3 | |||
100 | f9daq | 4 | #ifdef _CVI_ |
61 | f9daq | 5 | #include <ansi_c.h> |
6 | #include <windows.h> |
||
7 | #include <cvidef.h> |
||
8 | #include <ivi.h> |
||
100 | f9daq | 9 | #include "usb.h" |
10 | #else |
||
11 | #include "/usr/include/usb.h" |
||
12 | #endif |
||
61 | f9daq | 13 | |
138 | f9daq | 14 | |
15 | #ifdef XXDLL |
||
61 | f9daq | 16 | #include "xxusb_dll.h" |
138 | f9daq | 17 | #else |
18 | #include "libxxusb.h" |
||
19 | #endif |
||
61 | f9daq | 20 | |
82 | f9daq | 21 | #define CMD_WRITE 0x000 |
22 | #define CMD_READ 0x100 |
||
23 | #define CMD_A24 0x039 |
||
24 | #define CMD_A32 0x009 |
||
25 | #define CMD_HM 0x80000 |
||
26 | #define CMD_HD 0x20000 |
||
27 | #define CMD_MRK 0x2000 |
||
28 | #define CMD_DLY 0x8000 |
||
29 | #define CMD_BLT 0xFF000000 |
||
61 | f9daq | 30 | |
82 | f9daq | 31 | #define CMD_D16 1 |
32 | #define CMD_D32 0 |
||
33 | |||
34 | |||
35 | #define MAXSTACKSIZE 100000 |
||
36 | |||
37 | int WIENER_VMUSB_StackInit(); |
||
38 | void WIENER_VMUSB_StackClear(); |
||
39 | |||
40 | |||
264 | f9daq | 41 | #define WIENER_VMUSB_StackReadA24D16( ADDR ) WIENER_VMUSB_StackAppend(CMD_READ | CMD_A24 , CMD_D16 | (ADDR) ) |
42 | #define WIENER_VMUSB_StackReadA24D32( ADDR ) WIENER_VMUSB_StackAppend(CMD_READ | CMD_A24 , CMD_D32 | (ADDR) ) |
||
43 | #define WIENER_VMUSB_StackReadA32D16( ADDR ) WIENER_VMUSB_StackAppend(CMD_READ | CMD_A32 , CMD_D16 | (ADDR) ) |
||
44 | #define WIENER_VMUSB_StackReadA32D32( ADDR ) WIENER_VMUSB_StackAppend(CMD_READ | CMD_A32 , CMD_D32 | (ADDR) ) |
||
82 | f9daq | 45 | |
46 | #define WIENER_VMUSB_StackWriteA24D16( ADDR, DATA) WIENER_VMUSB_StackAppendData(CMD_WRITE | CMD_A24,CMD_D16 | (ADDR), (DATA)) |
||
47 | #define WIENER_VMUSB_StackWriteA24D32( ADDR, DATA) WIENER_VMUSB_StackAppendData(CMD_WRITE | CMD_A24,CMD_D32 | (ADDR), (DATA)) |
||
48 | #define WIENER_VMUSB_StackWriteA32D16( ADDR, DATA) WIENER_VMUSB_StackAppendData(CMD_WRITE | CMD_A32,CMD_D16 | (ADDR), (DATA)) |
||
49 | #define WIENER_VMUSB_StackWriteA32D32( ADDR, DATA) WIENER_VMUSB_StackAppendData(CMD_WRITE | CMD_A32,CMD_D32 | (ADDR), (DATA)) |
||
50 | |||
51 | #define WIENER_VMUSB_StackMarker(MRK) WIENER_VMUSB_StackAppend(CMD_MRK, (MRK)) |
||
52 | |||
138 | f9daq | 53 | int WIENER_VMUSB_StackAppend(int cmd, uint32_t addr); |
54 | int WIENER_VMUSB_StackAppendData(int cmd, uint32_t addr, uint32_t data); |
||
82 | f9daq | 55 | |
138 | f9daq | 56 | void WIENER_VMUSB_StackConditionalRead(int am ,int d16d32,uint32_t addr, uint32_t data); |
57 | void WIENER_VMUSB_StackMultiRead(int addr_modifier,int d16d32, uint32_t baseaddr, int n,uint32_t increment); |
||
82 | f9daq | 58 | void WIENER_VMUSB_StackMultiWrite(int addr_modifier,int d16d32,uint32_t baseaddr, int n, uint32_t increment, uint32_t data); |
59 | |||
307 | f9daq | 60 | int WIENER_VMUSB_StackGetUInt32(int maxn, uint32_t *stack); |
61 | int WIENER_VMUSB_StackGetUInt16(int maxn, uint16_t *stack); |
||
82 | f9daq | 62 | void WIENER_VMUSB_StackPrint(); |
63 | |||
328 | f9daq | 64 | short WIENER_VMUSB_VME_DGG(unsigned short channel, unsigned short trigger,unsigned short output, |
65 | long delay, unsigned short gate, unsigned short invert, unsigned short latch); |
||
66 | short WIENER_VMUSB_VME_Output_settings( unsigned short channel, unsigned short code, unsigned short invert, unsigned short latch ); |
||
67 | short WIENER_VMUSB_register_write( short RegAddr, long RegData); |
||
82 | f9daq | 68 | |
328 | f9daq | 69 | |
100 | f9daq | 70 | void _VI_FUNC WIENER_VMUSB_load (const char *module_path); |
71 | void _VI_FUNC WIENER_VMUSB_open (const char *serial); |
||
82 | f9daq | 72 | void _VI_FUNC WIENER_VMUSB_close (void); |
264 | f9daq | 73 | extern usb_dev_handle *WUSB_udev; |
82 | f9daq | 74 | |
75 | #define WIENER_VMUSB_VME_START(NODE) WIENER_VMUSB_load(NULL);WIENER_VMUSB_open((NODE)); |
||
76 | #define WIENER_VMUSB_VME_STOP() WIENER_VMUSB_close() |
||
61 | f9daq | 77 | //#define VME_RESET() WIENVME_reset() |
78 | //#define VME_A24D8_R(VME,DATA) WIENVME_read8(hHandle24, 1, (VME), (DATA)) |
||
82 | f9daq | 79 | #define WIENER_VMUSB_VME_A24D16_R(VME,DATA) VME_read_16(WUSB_udev, Std_NoPriv_Data, (VME), (DATA)) |
80 | #define WIENER_VMUSB_VME_A24D32_R(VME,DATA) VME_read_32(WUSB_udev, Std_NoPriv_Data, (VME), (DATA)) |
||
61 | f9daq | 81 | //#define VME_A24D8_W(VME,DATA) WIENVME_write8(hHandle24, 1, (VME), (DATA)) |
82 | f9daq | 82 | #define WIENER_VMUSB_VME_A24D16_W(VME,DATA) VME_write_16(WUSB_udev, Std_NoPriv_Data, (VME), (DATA)) |
83 | #define WIENER_VMUSB_VME_A24D32_W(VME,DATA) VME_write_32(WUSB_udev, Std_NoPriv_Data, (VME), (DATA)) |
||
61 | f9daq | 84 | //#define VME_A32D8_R(VME,DATA) WIENVME_read8(hHandle32, 1, (VME), (DATA)) |
82 | f9daq | 85 | #define WIENER_VMUSB_VME_A32D16_R(VME,DATA) VME_read_16(WUSB_udev, Ext_NoPriv_Data, (VME), (DATA)) |
86 | #define WIENER_VMUSB_VME_A32D32_R(VME,DATA) VME_read_32(WUSB_udev, Ext_NoPriv_Data, (VME), (DATA)) |
||
61 | f9daq | 87 | //#define VME_A32D8_W(VME,DATA) WIENVME_write8(hHandle32, 1, (VME), (DATA)) |
82 | f9daq | 88 | #define WIENER_VMUSB_VME_A32D16_W(VME,DATA) VME_write_16(WUSB_udev, Ext_NoPriv_Data, (VME), (DATA)) |
89 | #define WIENER_VMUSB_VME_A32D32_W(VME,DATA) VME_write_32(WUSB_udev, Ext_NoPriv_Data, (VME), (DATA)) |
||
61 | f9daq | 90 | |
82 | f9daq | 91 | |
100 | f9daq | 92 | extern short __stdcall WIENER_VMUSB_VME_R( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data); |
82 | f9daq | 93 | |
100 | f9daq | 94 | extern short __stdcall WIENER_VMUSB_VME_W( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data); |
82 | f9daq | 95 | |
100 | f9daq | 96 | extern short __stdcall WIENER_VMUSB_VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data); |
97 | extern short __stdcall WIENER_VMUSB_VME_MWRST( void ); |
||
98 | extern short __stdcall WIENER_VMUSB_VME_MWEXEC( void ); |
||
82 | f9daq | 99 | |
100 | f9daq | 100 | extern short __stdcall WIENER_VMUSB_VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data); |
101 | extern short __stdcall WIENER_VMUSB_VME_MRRST( void ); |
||
102 | extern short __stdcall WIENER_VMUSB_VME_MREXEC( uint32_t *Data ); |
||
82 | f9daq | 103 | |
61 | f9daq | 104 | #endif |
105 |