00001 /*----------------------------------------------------------------------------- 00002 * Copyright (c) 1998 TRIUMF Data Acquistion Group 00003 * Please leave this header in any reproduction of that distribution 00004 * 00005 * TRIUMF Data Acquisition Group, 4004 Wesbrook Mall, Vancouver, B.C. V6T 2A3 00006 * Email: online@triumf.ca Tel: (604) 222-1047 Fax: (604) 222-1074 00007 * amaudruz@triumf.ca 00008 * ----------------------------------------------------------------------------- 00009 * 00010 * Description : Midas Camac Standard calls. 00011 * Requires : 00012 * Application : Used in any camac driver 00013 * Author: Pierre-Andre Amaudruz Data Acquisition Group 00014 * 00015 * $Id:$ 00016 *---------------------------------------------------------------------------*/ 00017 00018 /**dox***************************************************************/ 00019 /** @file mcstd.h 00020 The Midas CAMAC include file 00021 */ 00022 00023 /** @defgroup mcstdinclude Midas CAMAC standard 00024 */ 00025 /** @defgroup mcstdfunctionh Camac Functions (camxxx) 00026 */ 00027 00028 /**dox***************************************************************/ 00029 /** @addtogroup mcstdinclude 00030 * 00031 * @{ */ 00032 00033 /**dox***************************************************************/ 00034 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00035 00036 #ifndef INLINE 00037 #if defined( _MSC_VER ) 00038 #define INLINE __inline 00039 #elif defined(__GNUC__) 00040 #define INLINE __inline__ 00041 #else 00042 #define INLINE 00043 #endif 00044 #endif 00045 00046 /* make functions under WinNT dll exportable */ 00047 #if defined(_MSC_VER) && defined(MIDAS_DLL) 00048 #define EXPRT __declspec(dllexport) 00049 #else 00050 #define EXPRT 00051 #endif 00052 00053 #define EXTERNAL extern 00054 00055 #ifndef MIDAS_TYPE_DEFINED 00056 #define MIDAS_TYPE_DEFINED 00057 00058 typedef unsigned char BYTE; 00059 typedef unsigned short int WORD; 00060 00061 #ifdef __alpha 00062 typedef unsigned int DWORD; 00063 #else 00064 typedef unsigned long int DWORD; 00065 #endif 00066 00067 #define SUCCESS 1 00068 00069 #endif /* MIDAS_TYPE_DEFINED */ 00070 00071 00072 /*------------------------------------------------------------------*/ 00073 00074 /* make functions callable from a C++ program */ 00075 #ifdef __cplusplus 00076 extern "C" { 00077 #endif 00078 00079 EXTERNAL INLINE void EXPRT cam8i(const int c, const int n, const int a, const int f, 00080 BYTE * d); 00081 EXTERNAL INLINE void EXPRT cam8i_r(const int c, const int n, const int a, const int f, 00082 BYTE ** d, const int r); 00083 00084 /**dox***************************************************************/ 00085 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00086 00087 /**dox***************************************************************/ 00088 /** @addtogroup mcstdfunctionh 00089 * 00090 * @{ */ 00091 00092 /********************************************************************/ 00093 /** 00094 16 bits input. 00095 @param c crate number (0..) 00096 @param n station number (0..30) 00097 @param a sub-address (0..15) 00098 @param f function (0..7) 00099 @param d data read out data 00100 @return void 00101 */ 00102 EXTERNAL INLINE void EXPRT cam16i(const int c, const int n, const int a, const int f, 00103 WORD * d); 00104 00105 /********************************************************************/ 00106 /** 00107 24 bits input. 00108 @param c crate number (0..) 00109 @param n station number (0..30) 00110 @param a sub-address (0..15) 00111 @param f function (0..7) 00112 @param d data read out data 00113 @return void 00114 */ 00115 EXTERNAL INLINE void EXPRT cam24i(const int c, const int n, const int a, const int f, 00116 DWORD * d); 00117 00118 /********************************************************************/ 00119 /** 00120 8 bits input with Q response. 00121 @param c crate number (0..) 00122 @param n station number (0..30) 00123 @param a sub-address (0..15) 00124 @param f function (0..7) 00125 @param d data read out data 00126 @param x X response (0:failed,1:success) 00127 @param q Q resonpse (0:no Q, 1: Q) 00128 @return void 00129 */ 00130 EXTERNAL INLINE void EXPRT cam8i_q(const int c, const int n, const int a, const int f, 00131 BYTE * d, int *x, int *q); 00132 00133 /********************************************************************/ 00134 /** 00135 16 bits input with Q response. 00136 @param c crate number (0..) 00137 @param n station number (0..30) 00138 @param a sub-address (0..15) 00139 @param f function (0..7) 00140 @param d data read out data 00141 @param x X response (0:failed,1:success) 00142 @param q Q resonpse (0:no Q, 1: Q) 00143 @return void 00144 */ 00145 EXTERNAL INLINE void EXPRT cam16i_q(const int c, const int n, const int a, const int f, 00146 WORD * d, int *x, int *q); 00147 00148 /********************************************************************/ 00149 /** 00150 24 bits input with Q response. 00151 @param c crate number (0..) 00152 @param n station number (0..30) 00153 @param a sub-address (0..15) 00154 @param f function (0..7) 00155 @param d data read out data 00156 @param x X response (0:failed,1:success) 00157 @param q Q resonpse (0:no Q, 1: Q) 00158 @return void 00159 */ 00160 EXTERNAL INLINE void EXPRT cam24i_q(const int c, const int n, const int a, const int f, 00161 DWORD * d, int *x, int *q); 00162 00163 00164 /********************************************************************/ 00165 /** 00166 Repeat 16 bits input. 00167 @param c crate number (0..) 00168 @param n station number (0..30) 00169 @param a sub-address (0..15) 00170 @param f function (0..7) 00171 @param d data read out data 00172 @param r repeat time 00173 @return void 00174 */ 00175 EXTERNAL INLINE void EXPRT cam16i_r(const int c, const int n, const int a, const int f, 00176 WORD ** d, const int r); 00177 00178 /********************************************************************/ 00179 /** 00180 Repeat 24 bits input. 00181 @param c crate number (0..) 00182 @param n station number (0..30) 00183 @param a sub-address (0..15) 00184 @param f function (0..7) 00185 @param d data read out 00186 @param r repeat time 00187 @return void 00188 */ 00189 EXTERNAL INLINE void EXPRT cam24i_r(const int c, const int n, const int a, const int f, 00190 DWORD ** d, const int r); 00191 00192 /********************************************************************/ 00193 /** 00194 Repeat 8 bits input with Q stop. 00195 @param c crate number (0..) 00196 @param n station number (0..30) 00197 @param a sub-address (0..15) 00198 @param f function (0..7) 00199 @param d pointer to data read out 00200 @param r repeat time 00201 @return void 00202 */ 00203 EXTERNAL INLINE void EXPRT cam8i_rq(const int c, const int n, const int a, const int f, 00204 BYTE ** d, const int r); 00205 00206 /********************************************************************/ 00207 /** 00208 Repeat 16 bits input with Q stop. 00209 @param c crate number (0..) 00210 @param n station number (0..30) 00211 @param a sub-address (0..15) 00212 @param f function (0..7) 00213 @param d pointer to data read out 00214 @param r repeat time 00215 @return void 00216 */ 00217 EXTERNAL INLINE void EXPRT cam16i_rq(const int c, const int n, const int a, 00218 const int f, WORD ** d, const int r); 00219 00220 /********************************************************************/ 00221 /** 00222 Repeat 24 bits input with Q stop. 00223 @param c crate number (0..) 00224 @param n station number (0..30) 00225 @param a sub-address (0..15) 00226 @param f function (0..7) 00227 @param d pointer to data read out 00228 @param r repeat time 00229 @return void 00230 */ 00231 EXTERNAL INLINE void EXPRT cam24i_rq(const int c, const int n, const int a, 00232 const int f, DWORD ** d, const int r); 00233 00234 /********************************************************************/ 00235 /** 00236 Read the given CAMAC address and increment the sub-address by one. Repeat r times. 00237 00238 \code 00239 BYTE pbkdat[4]; 00240 cam8i_sa(crate, 5, 0, 2, &pbkdat, 4); 00241 \endcode 00242 equivalent to : 00243 \code 00244 cam8i(crate, 5, 0, 2, &pbkdat[0]); 00245 cam8i(crate, 5, 1, 2, &pbkdat[1]); 00246 cam8i(crate, 5, 2, 2, &pbkdat[2]); 00247 cam8i(crate, 5, 3, 2, &pbkdat[3]); 00248 \endcode 00249 @param c crate number (0..) 00250 @param n station number (0..30) 00251 @param a sub-address (0..15) 00252 @param f function (0..7) 00253 @param d pointer to data read out 00254 @param r number of consecutive sub-address to read 00255 @return void 00256 */ 00257 EXTERNAL INLINE void EXPRT cam8i_sa(const int c, const int n, const int a, const int f, 00258 BYTE ** d, const int r); 00259 00260 /********************************************************************/ 00261 /** 00262 Read the given CAMAC address and increment the sub-address by one. Repeat r times. 00263 00264 \code 00265 WORD pbkdat[4]; 00266 cam16i_sa(crate, 5, 0, 2, &pbkdat, 4); 00267 \endcode equivalent to : 00268 \code 00269 cam16i(crate, 5, 0, 2, &pbkdat[0]); 00270 cam16i(crate, 5, 1, 2, &pbkdat[1]); 00271 cam16i(crate, 5, 2, 2, &pbkdat[2]); 00272 cam16i(crate, 5, 3, 2, &pbkdat[3]); 00273 \endcode 00274 @param c crate number (0..) 00275 @param n station number (0..30) 00276 @param a sub-address (0..15) 00277 @param f function (0..7) 00278 @param d pointer to data read out 00279 @param r number of consecutive sub-address to read 00280 @return void 00281 */ 00282 EXTERNAL INLINE void EXPRT cam16i_sa(const int c, const int n, const int a, 00283 const int f, WORD ** d, const int r); 00284 00285 /********************************************************************/ 00286 /** 00287 Read the given CAMAC address and increment the sub-address by one. Repeat r times. 00288 00289 \code 00290 DWORD pbkdat[8]; 00291 cam24i_sa(crate, 5, 0, 2, &pbkdat, 8); 00292 \endcode 00293 equivalent to 00294 \code 00295 cam24i(crate, 5, 0, 2, &pbkdat[0]); 00296 cam24i(crate, 6, 0, 2, &pbkdat[1]); 00297 cam24i(crate, 7, 0, 2, &pbkdat[2]); 00298 cam24i(crate, 8, 0, 2, &pbkdat[3]); 00299 \endcode 00300 @param c crate number (0..) 00301 @param n station number (0..30) 00302 @param a sub-address (0..15) 00303 @param f function (0..7) 00304 @param d pointer to data read out 00305 @param r number of consecutive sub-address to read 00306 @return void 00307 */ 00308 EXTERNAL INLINE void EXPRT cam24i_sa(const int c, const int n, const int a, 00309 const int f, DWORD ** d, const int r); 00310 00311 /********************************************************************/ 00312 /** 00313 Read the given CAMAC address and increment the station number by one. Repeat r times. 00314 00315 \code 00316 BYTE pbkdat[4]; 00317 cam8i_sa(crate, 5, 0, 2, &pbkdat, 4); 00318 \endcode 00319 equivalent to : 00320 \code 00321 cam8i(crate, 5, 0, 2, &pbkdat[0]); 00322 cam8i(crate, 6, 0, 2, &pbkdat[1]); 00323 cam8i(crate, 7, 0, 2, &pbkdat[2]); 00324 cam8i(crate, 8, 0, 2, &pbkdat[3]); 00325 \endcode 00326 @param c crate number (0..) 00327 @param n station number (0..30) 00328 @param a sub-address (0..15) 00329 @param f function (0..7) 00330 @param d pointer to data read out 00331 @param r number of consecutive station to read 00332 @return void 00333 */ 00334 EXTERNAL INLINE void EXPRT cam8i_sn(const int c, const int n, const int a, const int f, 00335 BYTE ** d, const int r); 00336 00337 /********************************************************************/ 00338 /** 00339 Read the given CAMAC address and increment the station number by one. Repeat r times. 00340 00341 \code 00342 WORD pbkdat[4]; 00343 cam16i_sa(crate, 5, 0, 2, &pbkdat, 4); 00344 \endcode 00345 equivalent to : 00346 \code 00347 cam16i(crate, 5, 0, 2, &pbkdat[0]); 00348 cam16i(crate, 6, 0, 2, &pbkdat[1]); 00349 cam16i(crate, 7, 0, 2, &pbkdat[2]); 00350 cam16i(crate, 8, 0, 2, &pbkdat[3]); 00351 \endcode 00352 @param c crate number (0..) 00353 @param n station number (0..30) 00354 @param a sub-address (0..15) 00355 @param f function (0..7) 00356 @param d pointer to data read out 00357 @param r number of consecutive station to read 00358 @return void 00359 */ 00360 EXTERNAL INLINE void EXPRT cam16i_sn(const int c, const int n, const int a, 00361 const int f, WORD ** d, const int r); 00362 00363 /********************************************************************/ 00364 /** 00365 Read the given CAMAC address and increment the station number by one. Repeat r times. 00366 00367 \code 00368 DWORD pbkdat[4]; 00369 cam24i_sa(crate, 5, 0, 2, &pbkdat, 4); 00370 \endcode 00371 equivalent to : 00372 \code 00373 cam24i(crate, 5, 0, 2, &pbkdat[0]); 00374 cam24i(crate, 6, 0, 2, &pbkdat[1]); 00375 cam24i(crate, 7, 0, 2, &pbkdat[2]); 00376 cam24i(crate, 8, 0, 2, &pbkdat[3]); 00377 \endcode 00378 @param c crate number (0..) 00379 @param n station number (0..30) 00380 @param a sub-address (0..15) 00381 @param f function (0..7) 00382 @param d pointer to data read out 00383 @param r number of consecutive station to read 00384 @return void 00385 */ 00386 EXTERNAL INLINE void EXPRT cam24i_sn(const int c, const int n, const int a, 00387 const int f, DWORD ** d, const int r); 00388 /********************************************************************/ 00389 00390 /** 00391 Same as cam16i() 00392 */ 00393 EXTERNAL INLINE void EXPRT cami(const int c, const int n, const int a, const int f, 00394 WORD * d); 00395 00396 /********************************************************************/ 00397 /** 00398 Write data to given CAMAC address. 00399 @param c crate number (0..) 00400 @param n station number (0..30) 00401 @param a sub-address (0..15) 00402 @param f function (16..31) 00403 @param d data to be written to CAMAC 00404 @return void 00405 */ 00406 EXTERNAL INLINE void EXPRT cam8o(const int c, const int n, const int a, const int f, 00407 BYTE d); 00408 00409 /********************************************************************/ 00410 /** 00411 Write data to given CAMAC address. 00412 @param c crate number (0..) 00413 @param n station number (0..30) 00414 @param a sub-address (0..15) 00415 @param f function (16..31) 00416 @param d data to be written to CAMAC 00417 @return void 00418 */ 00419 EXTERNAL INLINE void EXPRT cam16o(const int c, const int n, const int a, const int f, 00420 WORD d); 00421 00422 /********************************************************************/ 00423 /** 00424 Write data to given CAMAC address. 00425 @param c crate number (0..) 00426 @param n station number (0..30) 00427 @param a sub-address (0..15) 00428 @param f function (16..31) 00429 @param d data to be written to CAMAC 00430 @return void 00431 */ 00432 EXTERNAL INLINE void EXPRT cam24o(const int c, const int n, const int a, const int f, 00433 DWORD d); 00434 00435 /********************************************************************/ 00436 /** 00437 Write data to given CAMAC address with Q response. 00438 @param c crate number (0..) 00439 @param n station number (0..30) 00440 @param a sub-address (0..15) 00441 @param f function (16..31) 00442 @param d data to be written to CAMAC 00443 @param x X response (0:failed,1:success) 00444 @param q Q resonpse (0:no Q, 1: Q) 00445 @return void 00446 */ 00447 EXTERNAL INLINE void EXPRT cam8o_q(const int c, const int n, const int a, const int f, 00448 BYTE d, int *x, int *q); 00449 00450 /********************************************************************/ 00451 /** 00452 Write data to given CAMAC address with Q response. 00453 @param c crate number (0..) 00454 @param n station number (0..30) 00455 @param a sub-address (0..15) 00456 @param f function (16..31) 00457 @param d data to be written to CAMAC 00458 @param x X response (0:failed,1:success) 00459 @param q Q resonpse (0:no Q, 1: Q) 00460 @return void 00461 */ 00462 EXTERNAL INLINE void EXPRT cam16o_q(const int c, const int n, const int a, const int f, 00463 WORD d, int *x, int *q); 00464 00465 /********************************************************************/ 00466 /** 00467 Write data to given CAMAC address with Q response. 00468 @param c crate number (0..) 00469 @param n station number (0..30) 00470 @param a sub-address (0..15) 00471 @param f function (16..31) 00472 @param d data to be written to CAMAC 00473 @param x X response (0:failed,1:success) 00474 @param q Q response (0:no Q, 1: Q) 00475 @return void 00476 */ 00477 EXTERNAL INLINE void EXPRT cam24o_q(const int c, const int n, const int a, const int f, 00478 DWORD d, int *x, int *q); 00479 00480 /********************************************************************/ 00481 /** 00482 Repeat write data to given CAMAC address r times. 00483 @param c crate number (0..) 00484 @param n station number (0..30) 00485 @param a sub-address (0..15) 00486 @param f function (16..31) 00487 @param d data to be written to CAMAC 00488 @param r number of repeatition 00489 @return void 00490 */ 00491 EXTERNAL INLINE void EXPRT cam8o_r(const int c, const int n, const int a, const int f, 00492 BYTE * d, const int r); 00493 00494 /********************************************************************/ 00495 /** 00496 Repeat write data to given CAMAC address r times. 00497 @param c crate number (0..) 00498 @param n station number (0..30) 00499 @param a sub-address (0..15) 00500 @param f function (16..31) 00501 @param d data to be written to CAMAC 00502 @param r number of repeatition 00503 @return void 00504 */ 00505 EXTERNAL INLINE void EXPRT cam16o_r(const int c, const int n, const int a, const int f, 00506 WORD * d, const int r); 00507 00508 /********************************************************************/ 00509 /** 00510 Repeat write data to given CAMAC address r times. 00511 @param c crate number (0..) 00512 @param n station number (0..30) 00513 @param a sub-address (0..15) 00514 @param f function (16..31) 00515 @param d data to be written to CAMAC 00516 @param r number of repeatition 00517 @return void 00518 */ 00519 EXTERNAL INLINE void EXPRT cam24o_r(const int c, const int n, const int a, const int f, 00520 DWORD * d, const int r); 00521 00522 /********************************************************************/ 00523 /** 00524 Same as cam16o() 00525 */ 00526 EXTERNAL INLINE void EXPRT camo(const int c, const int n, const int a, const int f, 00527 WORD d); 00528 00529 /********************************************************************/ 00530 /** 00531 Crate presence check. 00532 @param c crate number (0..) 00533 @return 0:Success, -1:No CAMAC response 00534 */ 00535 EXTERNAL INLINE int EXPRT camc_chk(const int c); 00536 00537 /********************************************************************/ 00538 /** 00539 CAMAC command (no data). 00540 @param c crate number (0..) 00541 @param n station number (0..30) 00542 @param a sub-address (0..15) 00543 @param f function (8..15, 24..31) 00544 @return void 00545 */ 00546 EXTERNAL INLINE void EXPRT camc(const int c, const int n, const int a, const int f); 00547 00548 /********************************************************************/ 00549 /** 00550 CAMAC command with Q response (no data). 00551 @param c crate number (0..) 00552 @param n station number (0..30) 00553 @param a sub-address (0..15) 00554 @param f function (8..15, 24..31) 00555 @param q Q response (0:no Q, 1:Q) 00556 @return void 00557 */ 00558 EXTERNAL INLINE void EXPRT camc_q(const int c, const int n, const int a, const int f, 00559 int *q); 00560 00561 /********************************************************************/ 00562 /** 00563 Scan CAMAC command on sub-address. 00564 @param c crate number (0..) 00565 @param n station number (0..30) 00566 @param a sub-address (0..15) 00567 @param f function (8..15, 24..31) 00568 @param r number of consecutive sub-address to read 00569 @return void 00570 */ 00571 EXTERNAL INLINE void EXPRT camc_sa(const int c, const int n, const int a, const int f, 00572 const int r); 00573 00574 /********************************************************************/ 00575 /** 00576 Scan CAMAC command on station. 00577 @param c crate number (0..) 00578 @param n station number (0..30) 00579 @param a sub-address (0..15) 00580 @param f function (8..15, 24..31) 00581 @param r number of consecutive station to read 00582 @return void 00583 */ 00584 EXTERNAL INLINE void EXPRT camc_sn(const int c, const int n, const int a, const int f, 00585 const int r); 00586 00587 /********************************************************************/ 00588 /** 00589 Initialize CAMAC access. 00590 @return 1: success 00591 */ 00592 EXTERNAL INLINE int EXPRT cam_init(void); 00593 00594 /********************************************************************/ 00595 /** 00596 Initialize CAMAC access for rpc calls 00597 @internal 00598 @param host_name Midas host to contact 00599 @param exp_name Midas experiment to contact 00600 @param fe_name frontend application name to contact 00601 @param client_name RPC host name 00602 @param rpc_server RPC server name 00603 @return 1: success 00604 */ 00605 EXTERNAL INLINE int EXPRT cam_init_rpc(char *host_name, char *exp_name, char *fe_name, 00606 char *client_name, char *rpc_server); 00607 00608 /********************************************************************/ 00609 /** 00610 Close CAMAC accesss. 00611 */ 00612 EXTERNAL INLINE void EXPRT cam_exit(void); 00613 00614 /********************************************************************/ 00615 /** 00616 Set Crate inhibit. 00617 @param c crate number (0..) 00618 @return void 00619 */ 00620 EXTERNAL INLINE void EXPRT cam_inhibit_set(const int c); 00621 00622 /********************************************************************/ 00623 /** 00624 Clear Crate inhibit. 00625 @param c crate number (0..) 00626 @return void 00627 */ 00628 EXTERNAL INLINE void EXPRT cam_inhibit_clear(const int c); 00629 00630 /********************************************************************/ 00631 /** 00632 Test Crate Inhibit. 00633 @param c crate number (0..) 00634 @return 1 for set, 0 for cleared 00635 */ 00636 EXTERNAL INLINE int EXPRT cam_inhibit_test(const int c); 00637 00638 /********************************************************************/ 00639 /** 00640 Issue CLEAR to crate. 00641 @param c crate number (0..) 00642 @return void 00643 */ 00644 EXTERNAL INLINE void EXPRT cam_crate_clear(const int c); 00645 00646 /********************************************************************/ 00647 /** 00648 Issue Z to crate. 00649 @param c crate number (0..) 00650 @return void 00651 */ 00652 EXTERNAL INLINE void EXPRT cam_crate_zinit(const int c); 00653 00654 /********************************************************************/ 00655 /** 00656 Enable LAM generation for given station to the Crate controller. 00657 It doesn't enable the LAM of the actual station itself. 00658 @param c crate number (0..) 00659 @param n LAM station 00660 @return void 00661 */ 00662 EXTERNAL INLINE void EXPRT cam_lam_enable(const int c, const int n); 00663 00664 /********************************************************************/ 00665 /** 00666 Disable LAM generation for given station to the Crate controller. 00667 It doesn't disable the LAM of the actual station itself. 00668 @param c crate number (0..) 00669 @param n LAM station 00670 @return void 00671 */ 00672 EXTERNAL INLINE void EXPRT cam_lam_disable(const int c, const int n); 00673 00674 /********************************************************************/ 00675 /** 00676 Reads in lam the lam pattern of the entire crate. 00677 @param c crate number (0..) 00678 @param lam LAM pattern of the crate 00679 @return void 00680 */ 00681 EXTERNAL INLINE void EXPRT cam_lam_read(const int c, DWORD * lam); 00682 00683 /********************************************************************/ 00684 /** 00685 Clear the LAM register of the crate controller. 00686 It doesn't clear the LAM of the particular station. 00687 @param c crate number (0..) 00688 @param n LAM station 00689 @return void 00690 */ 00691 EXTERNAL INLINE void EXPRT cam_lam_clear(const int c, const int n); 00692 00693 /********************************************************************/ 00694 /** 00695 Wait for a LAM to occur with a certain timeout. Return 00696 crate and station if LAM occurs. 00697 @param c crate number (0..) 00698 @param n LAM station 00699 @param millisec If there is no LAM after this timeout, the routine returns 00700 @return 1 if LAM occured, 0 else 00701 */ 00702 EXTERNAL INLINE int EXPRT cam_lam_wait(int *c, DWORD * n, const int millisec); 00703 00704 /********************************************************************/ 00705 /** 00706 Enable interrupts in specific crate 00707 @param c crate number (0..) 00708 @return void 00709 */ 00710 EXTERNAL INLINE void EXPRT cam_interrupt_enable(const int c); 00711 00712 /********************************************************************/ 00713 /** 00714 Disables interrupts in specific crate 00715 @param c crate number (0..) 00716 @return void 00717 */ 00718 EXTERNAL INLINE void EXPRT cam_interrupt_disable(const int c); 00719 00720 /********************************************************************/ 00721 /** 00722 Test Crate Interrupt. 00723 @param c crate number (0..) 00724 @return 1 for set, 0 for cleared 00725 */ 00726 EXTERNAL INLINE int EXPRT cam_interrupt_test(const int c); 00727 00728 /********************************************************************/ 00729 /** 00730 Attach service routine to LAM of specific crate and station. 00731 @param c crate number (0..) 00732 @param n station number 00733 @param (*isr) Function pointer to attach to the LAM 00734 @return void 00735 */ 00736 EXTERNAL INLINE void EXPRT cam_interrupt_attach(const int c, const int n, 00737 void (*isr) (void)); 00738 00739 /********************************************************************/ 00740 /** 00741 Detach service routine from LAM. 00742 @param c crate number (0..) 00743 @param n station number 00744 @return void 00745 */ 00746 EXTERNAL INLINE void EXPRT cam_interrupt_detach(const int c, const int n); 00747 00748 #ifdef __cplusplus 00749 } 00750 #endif 00751 00752 /**dox***************************************************************/ 00753 /** @} */ /* end of mcstdfunctinoh */ 00754 /**dox***************************************************************/ 00755 /** @} */ /* end of mcstdinclude */