#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;
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