From 5577a41dcb7d1f40be07801b2005ffeb070e9dd3 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 2 Sep 1999 09:24:30 +0000 Subject: [PATCH] *** empty log message *** --- hadaq/Makefile | 2 +- hadaq/hwtof.c | 34 ++++++++++- hadaq/hwv775.c | 4 +- hadaq/hwv775.h | 1 + hadaq/param.tcl | 152 ++++++++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 184 insertions(+), 9 deletions(-) diff --git a/hadaq/Makefile b/hadaq/Makefile index 3065fe4..bb39334 100644 --- a/hadaq/Makefile +++ b/hadaq/Makefile @@ -28,7 +28,7 @@ DEFINES = -UNDEBUG -DHADESSTD_NEXITSTAT -DHADESSTD_NGETOPT -DNOATM CFLAGS = -g $(INCLUDES) $(DEFINES) -HW_OBJS = hwtof.o hwv775.o +HW_OBJS = hwtof.o hwv775.o hwv878.o #HW_OBJS = hwrich.o hwrace.o rc.o #HW_OBJS = hwsoft.o diff --git a/hadaq/hwtof.c b/hadaq/hwtof.c index 47d144b..a5fd2cf 100644 --- a/hadaq/hwtof.c +++ b/hadaq/hwtof.c @@ -1,4 +1,4 @@ -static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwtof.c,v 1.2 1999-09-02 08:58:50 hades Exp $"; +static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwtof.c,v 1.3 1999-09-02 09:24:30 hades Exp $"; #define _POSIX_C_SOURCE 199309L #include @@ -11,6 +11,7 @@ static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/had #include "param.h" #include "subevt.h" #include "hwv775.h" +#include "hwv878.h" struct HardwareS { size_t maxSubEvtSize; @@ -20,9 +21,11 @@ struct HardwareS { #include "hardware.h" #define NV775S 1 +#define NV878S 1 typedef struct ModulesS { HwV775 *v775[NV775S]; + HwV878 *v878[NV878S]; } Modules; size_t Hardware_maxSubEvtSize(const Hardware *my) @@ -40,6 +43,7 @@ Hardware *newHardware(void) Hardware *my; Param paramS, *param = ¶mS; HwV775 *v775[NV775S]; + HwV878 *v878[NV878S]; int i; if (0 > conParam(param, "param.tcl")) { @@ -49,7 +53,9 @@ Hardware *newHardware(void) my = allocMem(sizeof(Hardware)); my->specific = allocMem(sizeof(Modules)); - my->maxSubEvtSize = SubEvt_hdrSize() + (NV775S * 34 * sizeof(UInt4)); + my->maxSubEvtSize = SubEvt_hdrSize() + + (NV775S * 34 * sizeof(UInt4)) + + (NV878S * 34 * sizeof(UInt4)); for (i = 0; i < NV775S; i++) { char buf[16]; @@ -62,6 +68,17 @@ Hardware *newHardware(void) } ((Modules *) my->specific)->v775[i] = v775[i]; } + for (i = 0; i < NV878S; i++) { + char buf[16]; + + v878[i] = allocMem(sizeof(HwV878)); + sprintf(buf, "tdc%d", i + 4); + if (0 > conHwV878(v878[i], buf, param)) { + msglog(LOG_DEBUG, "%s:%d:%s\n", __FILE__, __LINE__, strerror(errno)); + return NULL; + } + ((Modules *) my->specific)->v878[i] = v878[i]; + } desParam(param); @@ -72,7 +89,12 @@ void deleteHardware(Hardware *my) { int i; HwV775 **v775 = ((Modules *) my->specific)->v775; + HwV878 **v878 = ((Modules *) my->specific)->v878; + for (i = 0; i < NV878S; i++) { + desHwV878(v878[i]); + freeMem(v878[i]); + } for (i = 0; i < NV775S; i++) { desHwV775(v775[i]); freeMem(v775[i]); @@ -102,6 +124,7 @@ void Hardware_readout(const Hardware *my, void *subEvt) { int i; HwV775 **v775 = ((Modules *) my->specific)->v775; + HwV878 **v878 = ((Modules *) my->specific)->v878; void *currSubEvt; for ( @@ -111,4 +134,11 @@ void Hardware_readout(const Hardware *my, void *subEvt) ) { HwV775_readSubEvt(v775[i], currSubEvt); } + for ( + i = 0, currSubEvt = subEvt; + i < NV878S; + i++, currSubEvt = SubEvt_end(subEvt) + ) { + HwV878_readSubEvt(v878[i], currSubEvt); + } } diff --git a/hadaq/hwv775.c b/hadaq/hwv775.c index 5ebd1f6..303a9ad 100644 --- a/hadaq/hwv775.c +++ b/hadaq/hwv775.c @@ -1,4 +1,4 @@ -static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwv775.c,v 1.2 1999-09-02 09:00:04 hades Exp $"; +static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwv775.c,v 1.3 1999-09-02 09:24:30 hades Exp $"; #define _POSIX_C_SOURCE 199309L #include @@ -29,7 +29,7 @@ int conHwV775(HwV775 * my, const char *name, const Param *param) cardBase = Param_getVal(param, my->name, "cardbase"); my->lvme = allocMem(sizeof(LVme)); - if (0 > conLVme(my->lvme, cardBase, 0x10000, 0x09, 0x04, 4)) { + if (0 > conLVme(my->lvme, cardBase, 0x10000, 0x09, V775_GEO_ADDR, 4)) { msglog(LOG_DEBUG, "%s:%d:%s\n", __FILE__, __LINE__, strerror(errno)); return -1; } diff --git a/hadaq/hwv775.h b/hadaq/hwv775.h index 3287d1e..a6658f9 100644 --- a/hadaq/hwv775.h +++ b/hadaq/hwv775.h @@ -15,6 +15,7 @@ typedef struct HwV775S { } HwV775; #define V775_OUT_BUF 0x00 +#define V775_GEO_ADDR 0x04 #define V775_BIT_SET_1 0x06 #define V775_BIT_CLR_1 0x08 #define V775_STAT_REG_1 0x0e diff --git a/hadaq/param.tcl b/hadaq/param.tcl index 31edc07..85cda89 100644 --- a/hadaq/param.tcl +++ b/hadaq/param.tcl @@ -151,10 +151,154 @@ set tdc3(range) 255 set tdc3(vset) 254 set tdc3(voff) 0 -set tdc4(cardbase) 2097408 ;# 0x200100 -set tdc4(lowThreshold) 1 -set tdc4(highThreshold) 198 -set tdc4(range) 192 ;# 0 = 90ns, 224 = 770ns +set tdc4(cardbase) 3993370624 ;# 0xee000000 +set tdc4(threshold00) 0 +set tdc4(threshold01) 0 +set tdc4(threshold02) 0 +set tdc4(threshold03) 0 +set tdc4(threshold04) 0 +set tdc4(threshold05) 0 +set tdc4(threshold06) 0 +set tdc4(threshold07) 0 +set tdc4(threshold08) 0 +set tdc4(threshold09) 0 +set tdc4(threshold10) 0 +set tdc4(threshold11) 0 +set tdc4(threshold12) 0 +set tdc4(threshold13) 0 +set tdc4(threshold14) 0 +set tdc4(threshold15) 0 +set tdc4(threshold16) 0 +set tdc4(threshold17) 0 +set tdc4(threshold18) 0 +set tdc4(threshold19) 0 +set tdc4(threshold20) 0 +set tdc4(threshold21) 0 +set tdc4(threshold22) 0 +set tdc4(threshold23) 0 +set tdc4(threshold24) 0 +set tdc4(threshold25) 0 +set tdc4(threshold26) 0 +set tdc4(threshold27) 0 +set tdc4(threshold28) 0 +set tdc4(threshold29) 0 +set tdc4(threshold30) 0 +set tdc4(threshold31) 0 +set tdc4(vset) 254 +set tdc4(voff) 0 + +set tdc5(cardbase) 3993370624 ;# 0xee000000 +set tdc5(threshold00) 0 +set tdc5(threshold01) 0 +set tdc5(threshold02) 0 +set tdc5(threshold03) 0 +set tdc5(threshold04) 0 +set tdc5(threshold05) 0 +set tdc5(threshold06) 0 +set tdc5(threshold07) 0 +set tdc5(threshold08) 0 +set tdc5(threshold09) 0 +set tdc5(threshold10) 0 +set tdc5(threshold11) 0 +set tdc5(threshold12) 0 +set tdc5(threshold13) 0 +set tdc5(threshold14) 0 +set tdc5(threshold15) 0 +set tdc5(threshold16) 0 +set tdc5(threshold17) 0 +set tdc5(threshold18) 0 +set tdc5(threshold19) 0 +set tdc5(threshold20) 0 +set tdc5(threshold21) 0 +set tdc5(threshold22) 0 +set tdc5(threshold23) 0 +set tdc5(threshold24) 0 +set tdc5(threshold25) 0 +set tdc5(threshold26) 0 +set tdc5(threshold27) 0 +set tdc5(threshold28) 0 +set tdc5(threshold29) 0 +set tdc5(threshold30) 0 +set tdc5(threshold31) 0 +set tdc5(vset) 254 +set tdc5(voff) 0 + +set tdc6(cardbase) 3993370624 ;# 0xee000000 +set tdc6(threshold00) 0 +set tdc6(threshold01) 0 +set tdc6(threshold02) 0 +set tdc6(threshold03) 0 +set tdc6(threshold04) 0 +set tdc6(threshold05) 0 +set tdc6(threshold06) 0 +set tdc6(threshold07) 0 +set tdc6(threshold08) 0 +set tdc6(threshold09) 0 +set tdc6(threshold10) 0 +set tdc6(threshold11) 0 +set tdc6(threshold12) 0 +set tdc6(threshold13) 0 +set tdc6(threshold14) 0 +set tdc6(threshold15) 0 +set tdc6(threshold16) 0 +set tdc6(threshold17) 0 +set tdc6(threshold18) 0 +set tdc6(threshold19) 0 +set tdc6(threshold20) 0 +set tdc6(threshold21) 0 +set tdc6(threshold22) 0 +set tdc6(threshold23) 0 +set tdc6(threshold24) 0 +set tdc6(threshold25) 0 +set tdc6(threshold26) 0 +set tdc6(threshold27) 0 +set tdc6(threshold28) 0 +set tdc6(threshold29) 0 +set tdc6(threshold30) 0 +set tdc6(threshold31) 0 +set tdc6(vset) 254 +set tdc6(voff) 0 + +set tdc7(cardbase) 3993370624 ;# 0xee000000 +set tdc7(threshold00) 0 +set tdc7(threshold01) 0 +set tdc7(threshold02) 0 +set tdc7(threshold03) 0 +set tdc7(threshold04) 0 +set tdc7(threshold05) 0 +set tdc7(threshold06) 0 +set tdc7(threshold07) 0 +set tdc7(threshold08) 0 +set tdc7(threshold09) 0 +set tdc7(threshold10) 0 +set tdc7(threshold11) 0 +set tdc7(threshold12) 0 +set tdc7(threshold13) 0 +set tdc7(threshold14) 0 +set tdc7(threshold15) 0 +set tdc7(threshold16) 0 +set tdc7(threshold17) 0 +set tdc7(threshold18) 0 +set tdc7(threshold19) 0 +set tdc7(threshold20) 0 +set tdc7(threshold21) 0 +set tdc7(threshold22) 0 +set tdc7(threshold23) 0 +set tdc7(threshold24) 0 +set tdc7(threshold25) 0 +set tdc7(threshold26) 0 +set tdc7(threshold27) 0 +set tdc7(threshold28) 0 +set tdc7(threshold29) 0 +set tdc7(threshold30) 0 +set tdc7(threshold31) 0 +set tdc7(vset) 254 +set tdc7(voff) 0 + +set tdc8(cardbase) 2097408 ;# 0x200100 +set tdc8(lowThreshold) 1 +set tdc8(highThreshold) 198 +set tdc8(range) 192 ;# 0 = 90ns, 224 = 770ns set adc0(cardbase) 0 ;# 0 set adc0(lowThreshold) 8 -- 2.43.0