/********************************************************************* Name: v792.c Created by: Pierre-Andre Amaudruz Contents: V792 32ch. QDC $Id:$ *********************************************************************/ #include #include #include #include #include "vmicvme.h" #include "caenv792.h" /*****************************************************************/ int v792_EventRead(DWORD *pbase, DWORD *pdest, int *nentry) { DWORD hdata; *nentry = 0; if (v792_DataReady((WORD *)pbase)) { do { hdata = *pbase; } while (!(hdata & 0x02000000)); // skip up to the header pdest[*nentry] = hdata; *nentry += 1; do { pdest[*nentry] = *pbase; *nentry += 1; } while (!(pdest[*nentry-1] & 0x04000000)); // copy until the trailer nentry--; } return *nentry; } /*****************************************************************/ int v792_DataRead(DWORD *pbase, DWORD *pdest, int *nentry) { int k; *nentry = 0; if (v792_DataReady((WORD *)pbase)) { for (k=0 ; k<32 ; k++) { pdest[k] = pbase[k]; *nentry += 1; } } return *nentry; } /*****************************************************************/ int v792_ThresholdWrite(WORD *pbase, WORD *threshold, int *nitems) { int k; for (k=0; k