1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
|
/*
Function declarations for "C" to IEEE-488 interface routines.
Copyright (C) 1995, Capital Equipment Corp.
Handles both 16-bit DOS & Windows, and 32-bit Windows libraries
4/2/99 Added waitSRQDevice function for win32
2/27/02 Added IEEEFIFO feature test
*/
#ifndef __IEEE_CEC488_H
#define __IEEE_CEC488_H
/******** WIN-32 VERSION *******/
#if (defined(WIN32)||defined(__WIN32__)||defined(__WIN32))
/*
Note: "long int" is used throughout instead of just "int" to
avoid any problems with choice of default int size (16 or 32 bits).
Source code written for 16-bit versions of C with "int" decl. should
not need changes for 32-bit, as long as "int" = "long int" in
the 32-bit compiler.
*/
#ifdef __cplusplus
extern "C" {
#endif
extern void _cdecl ieee488_initialize (long int,long int);
extern long int _cdecl ieee488_transmit (char *,unsigned,long int *);
extern long int _cdecl ieee488_receive (char *,unsigned long,unsigned long *,long int *);
extern long int _cdecl ieee488_send (long int,char *,unsigned long,long int *);
extern long int _cdecl ieee488_enter (char *,unsigned long,unsigned long *,long int,long int *);
extern long int _cdecl ieee488_spoll (long int,char *,long int *);
extern void _cdecl ieee488_ppoll (char *);
extern long int _cdecl ieee488_tarray (void *,unsigned long,long int,long int *);
extern long int _cdecl ieee488_rarray (void *,unsigned long,unsigned long *,long int *);
extern char _cdecl ieee488_srq(void);
extern void _cdecl ieee488_setport (long int,unsigned);
extern void _cdecl ieee488_boardselect (long int);
extern void _cdecl ieee488_dmachannel (long int);
extern void _cdecl ieee488_settimeout (unsigned long int);
extern void _cdecl ieee488_setoutputEOS (long int,long int);
extern void _cdecl ieee488_setinputEOS (long int);
extern void _cdecl ieee488_enable_488ex(long int);
extern void _cdecl ieee488_enable_488sd(long int,long int);
extern char _cdecl ieee488_listener_present(long int);
extern char _cdecl ieee488_board_present(void);
extern long int _cdecl ieee488_feature (long int);
extern long int _cdecl ieee488_waitSRQDevice (long int,char *,long int *);
#ifdef __cplusplus
}
#endif
/*
"define"s to modify user's calls into direct calls to 488 support code
*/
#define initialize(addr,level) ieee488_initialize(addr,level)
#define transmit(cmd,status) ieee488_transmit((char *) (cmd),0xFFFF,(long int *) status)
#define receive(s,maxlen,len,status) ieee488_receive((char *) (s),maxlen,(unsigned long *) len,(long int *) status)
#define send(addr,s,status) ieee488_send(addr,(char *) (s),0xFFFF,(long int *) status)
#define enter(s,maxlen,len,addr,status) ieee488_enter((char *) (s),maxlen,(unsigned long *) len,addr,(long int *) status)
#define spoll(addr,poll,status) ieee488_spoll(addr,(char *) poll,(long int *) status)
#define ppoll(poll) ieee488_ppoll((char *) poll)
#define tarray(d,count,eoi,status) ieee488_tarray((void *) d,count,eoi,(long int *) status)
#define rarray(d,count,len,status) ieee488_rarray((void *) d,count,(unsigned long *) len,(long int *) status)
#define srq ieee488_srq
#define setport(bd,io) ieee488_setport(bd,io)
#define boardselect(bd) ieee488_boardselect(bd)
#define dmachannel(c) ieee488_dmachannel(c)
#define settimeout(t) ieee488_settimeout(t)
#define setoutputEOS(e1,e2) ieee488_setoutputEOS(e1,e2)
#define setinputEOS(e) ieee488_setinputEOS(e)
#define enable_488ex(e) ieee488_enable_488ex(e)
#define enable_488sd(e,t) ieee488_enable_488sd(e,t)
#define listener_present(a) ieee488_listener_present(a)
#define gpib_board_present ieee488_board_present
#define gpib_feature ieee488_feature
#define waitSRQDevice(addr,poll,status) ieee488_waitSRQDevice(addr,(char *)poll,(long *)status)
#else
/************* DOS or Win 3.x VERSION *******/
/*
function declarations
*/
#ifdef __cplusplus
extern "C" {
#endif
void far pascal ieee488_initialize (int,int);
int far pascal ieee488_transmit (char far *,unsigned,int far *);
int far pascal ieee488_receive (char far *,unsigned,unsigned far *,int far *);
int far pascal ieee488_send (int,char far *,unsigned,int far *);
int far pascal ieee488_enter (char far *,unsigned,unsigned far *,int,int far *);
int far pascal ieee488_spoll (int,char far *,int far *);
void far pascal ieee488_ppoll (char far *);
int far pascal ieee488_tarray (void far *,unsigned,int,int far *);
int far pascal ieee488_rarray (void far *,unsigned,unsigned far *,int far *);
char far pascal ieee488_srq(void);
void far pascal ieee488_setport (int,unsigned);
void far pascal ieee488_boardselect (int);
void far pascal ieee488_dmachannel (int);
void far pascal ieee488_settimeout (unsigned);
void far pascal ieee488_setoutputEOS (int,int);
void far pascal ieee488_setinputEOS (int);
void far pascal ieee488_enable_488ex(int);
void far pascal ieee488_enable_488sd(int,int);
char far pascal ieee488_listener_present(int);
char far pascal ieee488_board_present(void);
int far pascal ieee488_feature(int);
#ifdef __cplusplus
}
#endif
/*
"define"s to modify user's calls into direct calls to 488 support code
*/
/*** handle bug in Turbo C 3.0 handling of DOS extenders ***/
#if defined(__TURBOC__) && (__TURBOC__ < 0x0410) && !defined(_Windows)
#ifdef __cplusplus
extern "C"
#endif
void far pascal ieee488_protcheck(int);
#define initialize(addr,level) ieee488_protcheck(0); ieee488_initialize(addr,level)
#else
#define initialize(addr,level) ieee488_initialize(addr,level)
#endif
#define transmit(cmd,status) ieee488_transmit((char far *) (cmd),0xFFFF,(int far *) status)
#define receive(s,maxlen,len,status) ieee488_receive((char far *) (s),maxlen,(unsigned int far *) len,(int far *) status)
#define send(addr,s,status) ieee488_send(addr,(char far *) (s),0xFFFF,(int far *) status)
#define enter(s,maxlen,len,addr,status) ieee488_enter((char far *) (s),maxlen,(unsigned int far *) len,addr,(int far *) status)
#define spoll(addr,poll,status) ieee488_spoll(addr,(char far *) poll,(int far *) status)
#define ppoll(poll) ieee488_ppoll((char far *) poll)
#define tarray(d,count,eoi,status) ieee488_tarray((void far *) d,count,eoi,(int far *) status)
#define rarray(d,count,len,status) ieee488_rarray((void far *) d,count,(unsigned int far *) len,(int far *) status)
#define srq ieee488_srq
#define setport(bd,io) ieee488_setport(bd,io)
#define boardselect(bd) ieee488_boardselect(bd)
#define dmachannel(c) ieee488_dmachannel(c)
#define settimeout(t) ieee488_settimeout(t)
#define setoutputEOS(e1,e2) ieee488_setoutputEOS(e1,e2)
#define setinputEOS(e) ieee488_setinputEOS(e)
#define enable_488ex(e) ieee488_enable_488ex(e)
#define enable_488sd(e,t) ieee488_enable_488sd(e,t)
#define listener_present(a) ieee488_listener_present(a)
#define gpib_board_present ieee488_board_present
#define gpib_feature ieee488_feature
#endif
/*
Feature codes for CEC488 board feature inquiry routine.
*/
/* features of the hardware */
#define IEEEListener 0
#define IEEE488SD 1
#define IEEEDMA 2
#define IEEEFIFO 3
/* hardware settings */
#define IEEEIOBASE 100
/* software settings */
#define IEEETIMEOUT 200
#define IEEEINPUTEOS 201
#define IEEEOUTPUTEOS1 202
#define IEEEOUTPUTEOS2 203
#define IEEEBOARDSELECT 204
#define IEEEDMACHANNEL 205
#endif |
Partager