Subversion Repositories f9daq

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
61 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
#define LIBUSB_PATH_MAX 512
23
#define XXUSB_CC_NUMSEC 512
24
#define XXUSB_VM_NUMSEC 830
25
 
26
struct usb_dev_handle;
27
typedef struct usb_dev_handle usb_dev_handle;
28
 
29
struct usb_device_descriptor {
30
  unsigned char  bLength;
31
  unsigned char  bDescriptorType;
32
  unsigned short bcdUSB;
33
  unsigned char  bDeviceClass;
34
  unsigned char  bDeviceSubClass;
35
  unsigned char  bDeviceProtocol;
36
  unsigned char  bMaxPacketSize0;
37
  unsigned short idVendor;
38
  unsigned short idProduct;
39
  unsigned short bcdDevice;
40
  unsigned char  iManufacturer;
41
  unsigned char  iProduct;
42
  unsigned char  iSerialNumber;
43
  unsigned char  bNumConfigurations;
44
};
45
 
46
struct usb_device {
47
  struct usb_device *next, *prev;
48
 
49
  char filename[LIBUSB_PATH_MAX];
50
 
51
  struct usb_bus *bus;
52
 
53
  struct usb_device_descriptor descriptor;
54
  struct usb_config_descriptor *config;
55
 
56
  void *dev;            /* Darwin support */
57
 
58
  unsigned char devnum;
59
 
60
  unsigned char num_children;
61
  struct usb_device **children;
62
};
63
 
64
struct xxusb_device_typ
65
{
66
  struct usb_device *usbdev;
67
  char SerialString[7];
68
};
69
 
70
 
71
typedef struct xxusb_device_typ xxusb_device_type;
72
 
73
typedef struct usb_bus usb_busx;
74
typedef unsigned char UCHAR;
75
 
76
short __stdcall xxusb_register_read(usb_dev_handle *hDev, short RegAddr, long *RegData);
77
short __stdcall xxusb_stack_read(usb_dev_handle *hDev, short StackAddr, long *StackData);
78
short __stdcall xxusb_stack_write(usb_dev_handle *hDev, short StackAddr, long *StackData);
79
short __stdcall xxusb_stack_execute(usb_dev_handle *hDev, long *StackData);
80
short __stdcall xxusb_register_write(usb_dev_handle *hDev, short RegAddr, long RegData);
81
short __stdcall xxusb_usbfifo_read(usb_dev_handle *hDev, long *DataBuffer, short lDataLen, int timeout);
82
short __stdcall xxusb_bulk_read(usb_dev_handle *hDev, char *DataBuffer, short lDataLen, int timeout);
83
short __stdcall xxusb_bulk_write(usb_dev_handle *hDev, char *DataBuffer, short lDataLen, int timeout);
84
short __stdcall xxusb_reset_toggle(usb_dev_handle *hDev);
85
 
86
short __stdcall xxusb_devices_find(xxusb_device_type *xxusbDev);
87
short __stdcall xxusb_device_close(usb_dev_handle *hDev);
88
usb_dev_handle* __stdcall xxusb_device_open(struct usb_device *dev);
89
short __stdcall xxusb_flash_program(usb_dev_handle *hDev, char *config, short nsect);
90
short __stdcall xxusb_flashblock_program(usb_dev_handle *hDev, UCHAR *config);
91
usb_dev_handle* __stdcall xxusb_serial_open(char *SerialString);
92
 
93
short __stdcall VME_register_write(usb_dev_handle *hdev, long VME_Address, long Data);
94
short __stdcall VME_register_read(usb_dev_handle *hdev, long VME_Address, long *Data);
95
short __stdcall VME_LED_settings(usb_dev_handle *hdev, int LED, int code, int invert, int latch);
96
 
97
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);
98
 
99
short __stdcall VME_Output_settings(usb_dev_handle *hdev, int Channel, int code, int invert, int latch);
100
 
101
short __stdcall VME_read_16(usb_dev_handle *hdev,short Address_Modifier, long VME_Address, long *Data);
102
short __stdcall VME_read_32(usb_dev_handle *hdev, short Address_Modifier, long VME_Address, long *Data);
103
short __stdcall VME_BLT_read_32(usb_dev_handle *hdev, short Address_Modifier, int count, long VME_Address, long Data[]);
104
short __stdcall VME_write_16(usb_dev_handle *hdev, short Address_Modifier, long VME_Address, long Data);
105
short __stdcall VME_write_32(usb_dev_handle *hdev, short Address_Modifier, long VME_Address, long Data);
106
 
107
short __stdcall CAMAC_DGG(usb_dev_handle *hdev, short channel, short trigger, short output, int delay, int gate, short invert, short latch);
108
short __stdcall CAMAC_register_read(usb_dev_handle *hdev, int A, long *Data);
109
short __stdcall CAMAC_register_write(usb_dev_handle *hdev, int A, long Data);
110
short __stdcall CAMAC_LED_settings(usb_dev_handle *hdev, int LED, int code, int invert, int latch);
111
short __stdcall CAMAC_Output_settings(usb_dev_handle *hdev, int Channel, int code, int invert, int latch);
112
short __stdcall CAMAC_read_LAM_mask(usb_dev_handle *hdev, long *Data);
113
short __stdcall CAMAC_write_LAM_mask(usb_dev_handle *hdev, long Data);
114
 
115
short __stdcall CAMAC_write(usb_dev_handle *hdev, int N, int A, int F, long Data, int *Q, int *X);
116
short __stdcall CAMAC_read(usb_dev_handle *hdev, int N, int A, int F, long *Data, int *Q, int *X);
117
short __stdcall CAMAC_Z(usb_dev_handle *hdev);
118
short __stdcall CAMAC_C(usb_dev_handle *hdev);
119
short __stdcall CAMAC_I(usb_dev_handle *hdev, int inhibit);