Subversion Repositories f9daq

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21 f9daq 1
#ifndef __VPCIC32D_H__
2
#define __VPCIC32D_H__
3
//-------------------------------------------------------------------------
4
// WIN95 driver for PCICC32 CAMAC interface from ARW Elektronik, Germany --
5
//
6
// vpcic32d.h - the general header file to share information between driver
7
// and application
8
//
9
// (c) 2000,2001 ARW Elektronik
10
//
11
// this source code is published under GPL (Open Source). You can use, redistrubute and 
12
// modify it unless this header   is not modified or deleted. No warranty is given that 
13
// this software will work like expected.
14
// This product is not authorized for use as critical component in life support systems
15
// without the express written approval of ARW Elektronik Germany.
16
//
17
// Please announce changes and hints to ARW Elektronik
18
//
19
// what                                            who          when
20
// first steps                                     AR           07.03.2000
21
// added AUTOREAD                                  AR           17.03.2001
22
// added VPCIC32_ACCESS_LCR                        AR           30.03.2001
23
//
24
 
25
// the action codes for ioctl calls
26
#define VPCIC32_ATTACH_CC32        0x00220000  // METHOD_BUFFERED + FILE_ANY_ACCESS +
27
#define VPCIC32_DETACH_CC32        0x00220004  // FILE_DEVICE_UNKNOWN
28
#define VPCIC32_GET_STATUS         0x00220008
29
#define VPCIC32_CLEAR_STATUS       0x0022000C
30
#define VPCIC32_SET_ACCESS_PARA    0x00220010
31
#define VPCIC32_CONTROL_INTERRUPTS 0x00220014
32
#define VPCIC32_INSTALL_IRQ_HANDLER 0x00220018
33
#define VPCIC32_ACCESS_LCR             0x00220020  // access tp PLX LCR space
34
 
35
// switches for VPCIC32_ACCESS_COMMAND.wAccessType
36
#define WORD_ACCESS (UCHAR)2   //            word
37
#define LONG_ACCESS (UCHAR)4   //            long
38
 
39
// VPCIC32_ACCESS_LCR access constants
40
#define LCR_READ       0       // read only access
41
#define LCR_WRITE      1       // write and read back access
42
#define LCR_OR         2       // read, bitwise 'or' content and read back access
43
#define LCR_AND        3       // read, bitwise 'and' content and read back access
44
#define LCR_WRITE_ONLY 4       // do not read back after write
45
 
46
// define bits for VPCIC32D_ACCESS_COMMAND.wBlockTransfer 
47
#define UNTIL_NOT_Q         0x0001      // read/write unttil 'not Q' switch
48
#define AUTOREAD            0x0002      // PCIADA data pipelining access tuner switch
49
 
50
// mask bits for interrupt status provided by the user interrupt handler
51
#define LAM_IRQ             0x00FFFFFF  // LAM was responsible for interrupt
52
#define CONNECTION_TIMEOUT  0x08000000  // irq raised through a connection timeout
53
#define LAM_BUS_OR          0x10000000  // a LAM-BUS-OR is pending
54
#define LAM_NOT_OR          0x20000000  // a LAM-NOT-OR is pending
55
#define LAM_AND_OR          0x40000000  // a LAM-AND-OR is pending
56
#define LAM_FF              0x80000000  // the LAM-Flip-Flop was set
57
 
58
// this structure is input in all ioctl calls except VPCIC32_SET_ACCESS_PARA
59
typedef struct
60
{
61
        DWORD dwInterface;          // CC32 module number
62
} VPCIC32D_DEVICE;
63
 
64
// this structure is output from VPCIC32_ATTACH_CC32 call
65
typedef struct
66
{
67
        DWORD dwInterface;          // CC32 module number
68
        void  *pvWindowBase;        // the base address into the 32 kbyte Window of CC32
69
} VPCIC32D_WINDOW;
70
 
71
// this structure is output from VPCIC32_GET_STATUS call
72
typedef struct
73
{
74
        DWORD dwInterface;          // CC32 module number
75
        WORD  bTimeout;             // denotes PCIADA timeout
76
        WORD  bInterrupt;           // denotes a pending LAM interrupt
77
} VPCIC32D_STATUS;    
78
 
79
// this structure is input to the VPCIC32_SET_ACCESS_PARA call
80
typedef struct
81
{
82
        DWORD dwInterface;         // CC32 module number
83
        WORD  wAccessType;                 // set the current access type , for compatibilty to NT, not used @ WIN95/98
84
        WORD  wBlockTransfer;      // set to AUTOREAD or 0
85
} VPCIC32D_ACCESS_COMMAND;
86
 
87
// this structure is used to control the interrupts
88
typedef struct
89
{
90
        DWORD  dwInterface;        // CC32 module number
91
        WORD   wEnable;            // a 1 allows, a 0 inhibits interrupt requests
92
} VPCIC32D_IRQ_CONTROL;
93
 
94
// this structure is used to (de)install a irqhandler to a interface
95
typedef struct
96
{
97
        DWORD  dwInterface;        // CC32 module number
98
        DWORD  dwIrqHandler;       // void (*IrqHandler)(DWORD)
99
} VPCIC32D_IRQ_HANLDER;
100
 
101
// structure to access the local configuration space of PLX chip (test / debug only) with VPCIC32_ACCESS_LCR
102
typedef struct
103
{
104
  DWORD  dwInterface;         // CC32 module number
105
  DWORD  dwContent;           // content to write, and, or
106
  WORD   wRegisterAddress;    // address offset of LCR register
107
  UCHAR  bAccessMode;         // LCR_READ, write, or, and
108
  UCHAR  bBytesLane;          // the data access width
109
} VPCIC32D_LCR_ACCESS;
110
 
111
#endif // __VPCIC32D_H__