cesmacros.h File Reference

#include <camacmap.h>

Go to the source code of this file.

Defines

#define camread16(b, c, n, a, f)   (CAMRD16(CBDPTR((b),(c),(n),(a),(f),CAM16)))
#define camread24(b, c, n, a, f)   (CAMRD24(CBDPTR((b),(c),(n),(a),(f), CAM24)))
#define camwrite16(b, c, n, a, f, d)   (CAMWR16(CBDPTR((b),(c),(n),(a),(f),CAM16),d))
#define camwrite24(b, c, n, a, f, d)   (CAMWR24(CBDPTR((b),(c),(n),(a),(f),CAM24),d))
#define camctl(b, c, n, a, f)   CAMCTL(CBDPTR((b), (c), (n), (a), (f), CAM16))
#define inhibit(b, c)   camctl(b,c,30,9,26);
#define uninhibit(b, c)   camctl(b,c,30,9,24);
#define qtst(b)   (camread16((b),0,29,0,0) < 0)
#define xtst(b)   ((camread16((b),0,29,0,0) & 0X4000) != 0)
#define branchinit(b)
#define crateinit(b, c)
#define BEGINLAM(br, cr)
#define ENDLAM   }
#define NEEDLAM(b, c, n)   _lammsk[b][c-1] |= (1 << (n-1))
#define IFTIMEOUT(maxloop)
#define LAMREAD(b, c)   camread24((b), (c), 30, 0, 0)

Functions

void CESBranchAccess (int nBranch)


Define Documentation

#define BEGINLAM ( br,
cr   ) 

Value:

{                                         \
                          UINT16 _b,_c;                                  \
                          INT16 _timout;                                 \
                          UINT32 _lammsk[br][cr];                        \
                          UINT16 MAXBR = br;                             \
                          UINT16 MAXCR = cr;                             \
                                                                         \
                          for(_b = 0; _b<br; _b++)                        \
                            for(_c = 0; _c < cr; _c++) _lammsk[_b][_c] = 0;

Definition at line 78 of file cesmacros.h.

#define branchinit (  ) 

Value:

CESBranchAccess(b); \
                     camwrite16(b,0,29,0,0, MNOX| MTO | MLAM | MIT2 | MIT4);\
                     camwrite16(b,0,29,0,4, 0);                        \
                     camwrite16(b,0,29,0,9, 0);                        \
                     sleep(2)

Definition at line 61 of file cesmacros.h.

#define camctl ( b,
c,
n,
a,
 )     CAMCTL(CBDPTR((b), (c), (n), (a), (f), CAM16))

Definition at line 48 of file cesmacros.h.

#define camread16 ( b,
c,
n,
a,
 )     (CAMRD16(CBDPTR((b),(c),(n),(a),(f),CAM16)))

Definition at line 43 of file cesmacros.h.

#define camread24 ( b,
c,
n,
a,
 )     (CAMRD24(CBDPTR((b),(c),(n),(a),(f), CAM24)))

Definition at line 44 of file cesmacros.h.

#define camwrite16 ( b,
c,
n,
a,
f,
 )     (CAMWR16(CBDPTR((b),(c),(n),(a),(f),CAM16),d))

Definition at line 46 of file cesmacros.h.

#define camwrite24 ( b,
c,
n,
a,
f,
 )     (CAMWR24(CBDPTR((b),(c),(n),(a),(f),CAM24),d))

Definition at line 47 of file cesmacros.h.

#define crateinit ( b,
 ) 

Value:

while((camread16(b,0,29,0,9) & (1 << c)) == 0)        \
                        {                                                     \
                          fprintf(stderr, "Branch %d Crate %d is offline\n",  \
                                   b,c);                                      \
                          sleep(5);                                           \
                        }                                                     \
                        camctl(b,c,28,9,26);                                  \
                        camctl(b,c,28,8,26);                                  \
                        camctl(b,c,30,9,24)

Definition at line 67 of file cesmacros.h.

#define ENDLAM   }

Definition at line 88 of file cesmacros.h.

#define IFTIMEOUT ( maxloop   ) 

Value:

_timout = maxloop;     /* maxloop in ~10us */      \
                           _b = 0; _c = 0;                                    \
                           while(_timout >= 0)                                \
                           {                                                  \
                             if(_lammsk[_b][_c] == 0)                          \
                             {                                                \
                               _c++;                                          \
                               if(_c >= MAXCR)                                \
                               {                                              \
                                 _c = 0;                                      \
                                 _b++;                                        \
                                 if(_b >= MAXBR) break;                       \
                               }                                              \
                              } else                                          \
                                {                                             \
                                  _timout--;                                   \
                                  _lammsk[_b][_c] &= ~(_lammsk[_b][_c] &      \
                                                   camread24(_b,_c+1,30,0,0));\
                                }                                             \
                           }                                                  \
                           if(_timout < 0)

Definition at line 92 of file cesmacros.h.

#define inhibit ( b,
 )     camctl(b,c,30,9,26);

Definition at line 50 of file cesmacros.h.

#define LAMREAD ( b,
 )     camread24((b), (c), 30, 0, 0)

Definition at line 114 of file cesmacros.h.

#define NEEDLAM ( b,
c,
 )     _lammsk[b][c-1] |= (1 << (n-1))

Definition at line 90 of file cesmacros.h.

#define qtst (  )     (camread16((b),0,29,0,0) < 0)

Definition at line 55 of file cesmacros.h.

#define uninhibit ( b,
 )     camctl(b,c,30,9,24);

Definition at line 51 of file cesmacros.h.

#define xtst (  )     ((camread16((b),0,29,0,0) & 0X4000) != 0)

Definition at line 56 of file cesmacros.h.


Function Documentation

void CESBranchAccess ( int  nBranch  ) 

Definition at line 261 of file camacmap.cpp.

References BRANCHESINCRATE, CAMB, pBranchBases, VMECRATES, and vmeFds.


Generated on Wed Sep 17 08:38:10 2008 for NSCL Device support. by  doxygen 1.5.1