mcstd.h

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

Midas DOC Version 1.9.3 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Suzannah Daviel - Doxygen - Peter Green - Greg Hackman - Gertjan Hofman - Paul Knowles - Rudi Meier - Glenn Moloney - Dave Morris - Konstantin Olchanski - Renee Poutissou - Andreas Suter - Piotr Adam Zolnierczuk