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

Midas DOC Version 1.9.5 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel - Doxygen - Peter Green - Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Rudi Meier - Glenn Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou - Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk