]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
function ...getEndOfData added. Others modified. W. Koenig
authorhadaq <hadaq>
Thu, 23 May 2002 16:55:13 +0000 (16:55 +0000)
committerhadaq <hadaq>
Thu, 23 May 2002 16:55:13 +0000 (16:55 +0000)
hadaq/hwship.h

index 341ec0a1974d2c77c0e041e1901d3ebaed6a5f39..599212d447796c52d9def70a807d3efa1e215849 100644 (file)
@@ -4,12 +4,13 @@
 #include <lvme.h>
 
 #include <allParam.h>
+#include "ipc_basis.h"
 
 typedef struct HwShipS {
   char name[12];
   LVme *lvme;
   int currAddr;
-  unsigned trigNr;
+  int endOfData;
   int bankRequested;
 } HwShip;
 
@@ -18,8 +19,27 @@ int conHwShip(HwShip *my, const char *name, const Param *param);
 void desHwShip(HwShip *my);
 
 void HwShip_requestBuffer(HwShip *my);
-int HwShip_isBusy(HwShip *my);
-int HwShip_isEmpty(HwShip *my);
+
+static int bankConfirmed(HwShip *my) {
+       return LVme_tstBitL(my->lvme, LVL2_ACCESS_VMEREG, 7);
+}
+
+static void HwShip_getEndOfData(HwShip *my) {
+       my->endOfData = LVme_getL(my->lvme, LVL2_OFFSET) - 2 + LVL2_OFFSET;
+}
+
+static int HwShip_isBusy(HwShip *my) {
+  return my->bankRequested != bankConfirmed(my);
+}
+
+static int HwShip_isEmpty(HwShip *my) {
+  return my->currAddr >= my->endOfData;
+}
+
+static int HwShip_isBufRequested(HwShip *my) {
+  return my->endOfData == 0;
+}
+
 int HwShip_readSubEvt(HwShip *my, void *subEvt);
 
 #endif