00001 /*----------------------------------------------------------------------------- 00002 * Copyright (c) 1996 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 : Header file for Macro support to the LeCroy 1151 00011 * VME 16 channels scalers 00012 * 00013 * Author: Pierre-Andre Amaudruz Data Acquisition Group 00014 * 00015 $Id: lrs1151.h 2753 2005-10-07 14:55:31Z ritt $ 00016 00017 * Revision 1.0 1996/ Pierre Initial revision 00018 * 00019 * VME_CLEAR_1151 (base); Clear all 16 channels 00020 * VME_READ_1151 (base, d, r); Read r channels starting from channel 0 00021 *---------------------------------------------------------------------------*/ 00022 #ifndef _vme_h_ 00023 #define _vme_h_ 00024 #include "vxWorks.h" 00025 #include "vme.h" 00026 #endif 00027 00028 #define A32D24 0xf0000000 /* A32D16 access */ 00029 00030 /*------------------------------------------------------------------------------------*/ 00031 #define VME_CLEAR_1151(_vmebase){\ 00032 {\ 00033 static DWORD _ll, _dummy, *_local, __r=16;\ 00034 _ll = _vmebase;\ 00035 _local =(DWORD *)( ((_ll << 8) | 0x40) | A32D24);\ 00036 while (__r > 0) {\ 00037 _dummy = *_local;\ 00038 _local++;\ 00039 __r--;}\ 00040 }\ 00041 } 00042 00043 #define VME_READ_1151(_vmebase,_d,_r){\ 00044 {\ 00045 DWORD _ll, *_local, __r;\ 00046 _ll = _vmebase;\ 00047 _local = (DWORD *) (((_ll << 8) | 0x80) | A32D24);\ 00048 __r =_r;\ 00049 if (__r > 16) __r = 16;\ 00050 while (__r > 0) {\ 00051 *_d++ = *_local++;\ 00052 __r--;}\ 00053 }\ 00054 } 00055 /*------------------------------------------------------------------------------------*/