divers/lrs1151.c File Reference

Go to the source code of this file.

Defines

#define A32D24_1151   0xf0000000
#define INLINE
#define EXTERNAL   extern
#define LRS1151_READ(_vmebase, _d, _r)
#define LRS115_CLEAR(_vmebase)

Typedefs

typedef unsigned short int WORD
typedef unsigned long int DWORD

Functions

INLINE void lrs1151_read (DWORD vmeBase, DWORD **d, int r)
INLINE void lrs1151_clear (DWORD vmeBase)
void lrs1151 (void)
void rd1151 (DWORD vmeBase)
void clr1151 (DWORD vmeBase)


Define Documentation

#define A32D24_1151   0xf0000000

Definition at line 30 of file divers/lrs1151.c.

Referenced by lrs1151_clear(), and lrs1151_read().

#define EXTERNAL   extern

Definition at line 41 of file divers/lrs1151.c.

#define INLINE

Definition at line 38 of file divers/lrs1151.c.

#define LRS1151_READ ( _vmebase,
_d,
_r   ) 

Value:

{\
  {\
     volatile DWORD _ll, *_local, __r;\
        _ll = _vmebase;\
        _local = (DWORD *) (((_ll << 8) | 0x80) | A32D24_1151);\
        __r =_r;\
        if (__r > 16) __r = 16;\
        while (__r > 0) {\
                   *_d++ = *_local++;\
                   __r--;}\
        }\
  }

Definition at line 57 of file divers/lrs1151.c.

#define LRS115_CLEAR ( _vmebase   ) 

Value:

{\
  {\
     volatile DWORD _ll, _dummy, *_local, __r=16;\
        _ll = _vmebase;\
        _local =(DWORD *)( ((_ll << 8) | 0x40) | A32D24_1151);\
        while (__r > 0) {\
                   _dummy = *_local;\
                   _local++;\
                   __r--;}\
        }\
  }

Definition at line 70 of file divers/lrs1151.c.


Typedef Documentation

typedef unsigned long int DWORD

Definition at line 51 of file divers/lrs1151.c.

typedef unsigned short int WORD

Definition at line 46 of file divers/lrs1151.c.


Function Documentation

void clr1151 ( DWORD  vmeBase  ) 

Definition at line 130 of file divers/lrs1151.c.

00131 {
00132    lrs1151_clear(vmeBase);
00133 }

void lrs1151 ( void   ) 

Definition at line 108 of file divers/lrs1151.c.

00109 {
00110    printf("\n---> LeCroy 1151 16ch. NIM/ECL scalers <---\n");
00111    printf("Macro  : LRS1151_READ (DWORD base, DWORD *data, int repeat);\n");
00112    printf("Macro  : LRS1151_CLEAR (DWORD base);\n");
00113    printf("Inline : lrs1151_read  (DWORD base, DWORD *data, int repeat);\n");
00114    printf("Inline : lrs1151_clear (DWORD base);\n");
00115    printf("Test   : rd1151   (0x7a00)    <--- read    VME scaler\n");
00116    printf("Test   : clr1151  (0x7a00)    <--- clear   VME scaler\n");
00117 }

INLINE void lrs1151_clear ( DWORD  vmeBase  ) 

Definition at line 98 of file divers/lrs1151.c.

Referenced by clr1151().

00099 {
00100    volatile DWORD *local, dummy, r;
00101 
00102    local = (DWORD *) (((vmeBase << 8) | 0x40) | A32D24_1151);
00103    for (r = 0; r < 16; r++) {
00104       dummy = *local++;
00105    }
00106 }

INLINE void lrs1151_read ( DWORD  vmeBase,
DWORD **  d,
int  r 
)

Definition at line 83 of file divers/lrs1151.c.

Referenced by rd1151().

00084 {
00085    volatile DWORD *local;
00086 
00087    if (r > 16)
00088       r = 16;
00089    local = (DWORD *) (((vmeBase << 8) | 0x80) | A32D24_1151);
00090    while (r > 0) {
00091       *((*d)++) = *((DWORD *) local);
00092       local++;
00093       r--;
00094    }
00095 }

void rd1151 ( DWORD  vmeBase  ) 

Definition at line 119 of file divers/lrs1151.c.

00120 {
00121    DWORD i, dd[16], *pdd;
00122    for (i = 0; i < 16; i++)
00123       dd[i] = 0;
00124    pdd = &dd[0];
00125    lrs1151_read(vmeBase, &pdd, 16);
00126    for (i = 0; i < 16; i++)
00127       printf("%i-> %8.8x\n", i, dd[i]);
00128 }


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