Subversion Repositories f9daq

Rev

Rev 5 | Details | Compare with Previous | Last modification | View Log | RSS feed

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