mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
moduleid for eiger m3 and g2, but set only for g2
This commit is contained in:
@ -40,3 +40,4 @@ install(TARGETS gotthard2DetectorServer_virtual
|
||||
)
|
||||
|
||||
configure_file(config_gotthard2.txt ${CMAKE_BINARY_DIR}/bin/config_gotthard2.txt COPYONLY)
|
||||
configure_file(detid_gotthard2.txt ${CMAKE_BINARY_DIR}/bin/detid_gotthard2.txt COPYONLY)
|
||||
|
@ -33,6 +33,7 @@ $(PROGS): $(OBJS)
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)
|
||||
mv $(PROGS) $(DESTDIR)
|
||||
cp config_gotthard2.txt $(DESTDIR)
|
||||
cp detid_gotthard2.txt $s(DESTDIR)
|
||||
rm $(main_src)*.o
|
||||
|
||||
clean:
|
||||
|
@ -127,7 +127,6 @@
|
||||
|
||||
#define MOD_ID_OFST (0)
|
||||
#define MOD_ID_MSK (0x0000FFFF << MOD_ID_OFST)
|
||||
#define MOD_MAX_VAL (0xFFFF)
|
||||
|
||||
/* ASIC registers --------------------------------------------------*/
|
||||
|
||||
|
@ -287,16 +287,19 @@ u_int32_t getDetectorNumber() {
|
||||
return bus_r(MCB_SERIAL_NO_REG);
|
||||
}
|
||||
|
||||
int getModuleId() { return ((bus_r(MOD_ID_REG) & MOD_ID_MSK) >> MOD_ID_OFST); }
|
||||
int getModuleId(int *ret, char *mess) {
|
||||
return getModuleIdInFile(ret, mess, ID_FILE);
|
||||
}
|
||||
|
||||
void setModuleId(int arg) {
|
||||
LOG(logINFOBLUE, ("Setting Module Id to 0x%x\n", arg));
|
||||
void setModuleId(int *ret, char *mess, int arg) {
|
||||
*ret = setModuleIdInFile(mess, arg, ID_FILE);
|
||||
if (*ret == FAIL) {
|
||||
return;
|
||||
}
|
||||
bus_w(MOD_ID_REG, bus_r(MOD_ID_REG) & ~MOD_ID_MSK);
|
||||
bus_w(MOD_ID_REG, bus_r(MOD_ID_REG) | ((arg << MOD_ID_OFST) & MOD_ID_MSK));
|
||||
}
|
||||
|
||||
int getMaxModuleId() { return MOD_MAX_VAL; }
|
||||
|
||||
u_int64_t getDetectorMAC() {
|
||||
#ifdef VIRTUAL
|
||||
return 0;
|
||||
@ -419,7 +422,10 @@ void setupDetector() {
|
||||
sharedMemory_setStatus(IDLE);
|
||||
setupUDPCommParameters();
|
||||
#endif
|
||||
|
||||
getModuleIdInFile(&initError, initErrorMessage, ID_FILE);
|
||||
if (initError == FAIL) {
|
||||
return;
|
||||
}
|
||||
// pll defines
|
||||
ALTERA_PLL_C10_SetDefines(REG_OFFSET, BASE_READOUT_PLL, BASE_SYSTEM_PLL,
|
||||
PLL_RESET_REG, PLL_RESET_READOUT_MSK,
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#define REQRD_FRMWRE_VRSN (0x210527)
|
||||
#define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020"
|
||||
#define ID_FILE "detid_gotthard2.txt"
|
||||
|
||||
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
||||
|
||||
|
Reference in New Issue
Block a user