Subversion Repositories f9daq

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
141 f9daq 1
#define EXPORT extern "C" _declspec(dllexport)
2
 
3
#define XXUSB_WIENER_VENDOR_ID  0x16DC   /* Wiener, Plein & Baus */
4
#define XXUSB_VMUSB_PRODUCT_ID  0x000B   /* VM-USB */
5
#define XXUSB_CCUSB_PRODUCT_ID  0x0001   /* CC-USB */
6
#define XXUSB_ENDPOINT_OUT      2  /* Endpoint 2 Out*/
7
#define XXUSB_ENDPOINT_IN    0x86  /* Endpoint 6 In */
8
#define XXUSB_FIRMWARE_REGISTER 0
9
#define XXUSB_GLOBAL_REGISTER 1
10
#define XXUSB_ACTION_REGISTER 10
11
#define XXUSB_DELAYS_REGISTER 2
12
#define XXUSB_WATCHDOG_REGISTER 3
13
#define XXUSB_SELLEDA_REGISTER 6
14
#define XXUSB_SELNIM_REGISTER 7
15
#define XXUSB_SELLEDB_REGISTER 4
16
#define XXUSB_SERIAL_REGISTER 15
17
#define XXUSB_LAMMASK_REGISTER 8
18
#define XXUSB_LAM_REGISTER 12
19
#define XXUSB_READOUT_STACK 2
20
#define XXUSB_SCALER_STACK 3
21
#define XXUSB_NAF_DIRECT 12
22
 
23
struct XXUSB_STACK
24
{
25
long Data;
26
short Hit;
27
short APatt;
28
short Num;
29
short HitMask;
30
};
31
 
32
struct XXUSB_CC_COMMAND_TYPE
33
{
34
short Crate;
35
short F;
36
short A;
37
short N;
38
long Data;
39
short NoS2;
40
short LongD;
41
short HitPatt;
42
short QStop;
43
short LAMMode;
44
short UseHit;
45
short Repeat;
46
short AddrScan;
47
short FastCam;
48
short NumMod;
49
short AddrPatt;
50
long HitMask[4];
51
long Num;
52
};
53
 
54
struct xxusb_device_typ
55
{
56
  struct usb_device *usbdev;
57
  char SerialString[7];
58
};
59
 
60
typedef struct xxusb_device_typ xxusb_device_type;
61
typedef unsigned char UCHAR;
62
typedef struct usb_bus usb_busx;
63
 
64
int __stdcall ccusb_longstack_execute(usb_dev_handle *hDev, void *DataBuffer, int lDataLen, int timeout);
65
int __stdcall xxusb_longstack_execute(usb_dev_handle *hDev, void *DataBuffer, int lDataLen, int timeout);
66
int __stdcall xxusb_bulk_read(usb_dev_handle *hDev, void *DataBuffer, int lDataLen, int timeout);
67
int __stdcall xxusb_bulk_write(usb_dev_handle *hDev, void *DataBuffer, int lDataLen, int timeout);
68
int __stdcall xxusb_usbfifo_read(usb_dev_handle *hDev, int *DataBuffer, int lDataLen, int timeout);
69
 
70
short __stdcall xxusb_register_read(usb_dev_handle *hDev, short RegAddr, long *RegData);
71
short __stdcall xxusb_stack_read(usb_dev_handle *hDev, short StackAddr, long *StackData);
72
short __stdcall xxusb_stack_write(usb_dev_handle *hDev, short StackAddr, long *StackData);
73
short __stdcall xxusb_stack_execute(usb_dev_handle *hDev, long *StackData);
74
short __stdcall xxusb_register_write(usb_dev_handle *hDev, short RegAddr, long RegData);
75
short __stdcall xxusb_reset_toggle(usb_dev_handle *hDev);
76
 
77
void __stdcall xxusb_init();
78
short __stdcall xxusb_devices_find(xxusb_device_type *xxusbDev);
79
short __stdcall xxusb_device_close(usb_dev_handle *hDev);
80
usb_dev_handle* __stdcall xxusb_device_open(struct usb_device *dev);
81
short __stdcall xxusb_flash_program(usb_dev_handle *hDev, char *config, short nsect);
82
short __stdcall xxusb_flashblock_program(usb_dev_handle *hDev, UCHAR *config);
83
usb_dev_handle* __stdcall xxusb_serial_open(char *SerialString);
84
 
85
short __stdcall VME_register_write(usb_dev_handle *hdev, long VME_Address, long Data);
86
short __stdcall VME_register_read(usb_dev_handle *hdev, long VME_Address, long *Data);
87
short __stdcall VME_LED_settings(usb_dev_handle *hdev, int LED, int code, int invert, int latch);
88
short __stdcall VME_DGG(usb_dev_handle *hdev, unsigned short channel, unsigned short trigger,unsigned short output, long delay, unsigned short gate, unsigned short invert, unsigned short latch);
89
short __stdcall VME_scaler_settings(usb_dev_handle *hdev, short channel, short trigger, int enable, int reset);
90
short __stdcall VME_Output_settings(usb_dev_handle *hdev, int Channel, int code, int invert, int latch);
91
 
92
short __stdcall VME_read_8(usb_dev_handle *hdev,short Address_Modifier, long VME_Address, long *Data);
93
short __stdcall VME_read_16(usb_dev_handle *hdev,short Address_Modifier, long VME_Address, long *Data);
94
short __stdcall VME_read_32(usb_dev_handle *hdev, short Address_Modifier, long VME_Address, long *Data);
95
short __stdcall VME_BLT_read_32(usb_dev_handle *hdev, short Address_Modifier, int count, long VME_Address, long Data[]);
96
short __stdcall VME_write_16(usb_dev_handle *hdev, short Address_Modifier, long VME_Address, long Data);
97
short __stdcall VME_write_32(usb_dev_handle *hdev, short Address_Modifier, long VME_Address, long Data);
98
 
99
short __stdcall CAMAC_DGG(usb_dev_handle *hdev, short channel, short trigger, short output, int delay, int gate, short invert, short latch);
100
short __stdcall CAMAC_register_read(usb_dev_handle *hdev, int A, long *Data);
101
short __stdcall CAMAC_register_write(usb_dev_handle *hdev, int A, long Data);
102
short __stdcall CAMAC_LED_settings(usb_dev_handle *hdev, int LED, int code, int invert, int latch);
103
short __stdcall CAMAC_Output_settings(usb_dev_handle *hdev, int Channel, int code, int invert, int latch);
104
short __stdcall CAMAC_read_LAM_mask(usb_dev_handle *hdev, long *Data);
105
short __stdcall CAMAC_write_LAM_mask(usb_dev_handle *hdev, long Data);
106
short __stdcall CAMAC_scaler_settings(usb_dev_handle *hdev, short channel, short trigger, int enable, int reset);
107
 
108
short __stdcall CAMAC_write(usb_dev_handle *hdev, int N, int A, int F, long Data, int *Q, int *X);
109
short __stdcall CAMAC_read(usb_dev_handle *hdev, int N, int A, int F, long *Data, int *Q, int *X);
110
short __stdcall CAMAC_Z(usb_dev_handle *hdev);
111
short __stdcall CAMAC_C(usb_dev_handle *hdev);
112
short __stdcall CAMAC_I(usb_dev_handle *hdev, int inhibit);
113
short __stdcall CAMAC_blockread16(usb_dev_handle *hdev, int N, int A, int F, int loops, int *Data);
114