Separate headers (#57)

* WIP, ctb

* WIP, eiger

* WIP, gotthard

* WIP, jungfrau

* WIP, gotthard2

* WIP, mythen3

* WIP, moench

* fixed gotthard apiversioning mismatch with gotthard2
This commit is contained in:
Dhanya Thattil
2019-08-30 11:17:37 +02:00
committed by GitHub
parent 49d47e633d
commit 0d35b966ff
57 changed files with 945 additions and 564 deletions

View File

@@ -1,31 +1,37 @@
add_executable(gotthardDetectorServer
add_executable(gotthardDetectorServer_virtual
slsDetectorFunctionList.c
../slsDetectorServer/slsDetectorServer.c
../slsDetectorServer/slsDetectorServer_funcs.c
../slsDetectorServer/communication_funcs.c
../slsDetectorServer/src/slsDetectorServer.c
../slsDetectorServer/src/slsDetectorServer_funcs.c
../slsDetectorServer/src/communication_funcs.c
../slsDetectorServer/src/blackfin.c
../slsDetectorServer/src/AD9252.c
../slsDetectorServer/src/AD9257.c
../slsDetectorServer/src/LTC2620.c
../slsDetectorServer/src/common.c
../slsDetectorServer/src/commonServerFunctions.c
)
include_directories(
../slsDetectorServer/
../slsDetectorServer/include
../../slsSupportLib/include
)
target_include_directories(gotthardDetectorServer
target_include_directories(gotthardDetectorServer_virtual
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)
target_compile_definitions(gotthardDetectorServer
target_compile_definitions(gotthardDetectorServer_virtual
PUBLIC GOTTHARDD VIRTUAL STOP_SERVER
)
target_link_libraries(gotthardDetectorServer
target_link_libraries(gotthardDetectorServer_virtual
PUBLIC pthread rt
)
set_target_properties(gotthardDetectorServer PROPERTIES
set_target_properties(gotthardDetectorServer_virtual PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
install(TARGETS gotthardDetectorServer
install(TARGETS gotthardDetectorServer_virtual
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@@ -1,19 +1,20 @@
current_dir = $(shell pwd)
main_server = ../slsDetectorServer/
main_inc = ../slsDetectorServer/include/
main_src = ../slsDetectorServer/src/
support_lib = ../../slsSupportLib/include/
CROSS = bfin-uclinux-
CC = $(CROSS)gcc
CFLAGS += -Wall -DGOTTHARDD -DSTOP_SERVER -I$(main_server) -I$(support_lib) -I$(current_dir)#-DVERBOSEI #-DVERBOSE
CFLAGS += -Wall -DGOTTHARDD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir)#-DVERBOSEI #-DVERBOSE
LDLIBS += -lm
PROGS = gotthardDetectorServer
DESTDIR ?= bin
INSTMODE = 0777
SRCS = $(main_server)communication_funcs.c $(main_server)slsDetectorServer.c $(main_server)slsDetectorServer_funcs.c slsDetectorFunctionList.c
SRCS = slsDetectorFunctionList.c
SRCS += $(main_src)slsDetectorServer.c $(main_src)slsDetectorServer_funcs.c $(main_src)communication_funcs.c $(main_src)blackfin.c $(main_src)AD9252.c $(main_src)AD9257.c $(main_src)LTC2620.c $(main_src)common.c $(main_src)commonServerFunctions.c
OBJS = $(SRCS:.c=.o)
all: clean versioning $(PROGS)
boot: $(OBJS)
@@ -30,9 +31,10 @@ $(PROGS): $(OBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)
mv $(PROGS) $(DESTDIR)
rm *.gdb
rm $(main_src)*.o
clean:
rm -rf $(DESTDIR)/$(PROGS) *.o *.gdb $(main_server)*.o
rm -rf $(DESTDIR)/$(PROGS) *.o *.gdb $(main_src)*.o

View File

@@ -6,13 +6,16 @@
#include "AD9257.h" // commonServerFunctions.h, blackfin.h, ansi.h
#include "AD9252.h" // old board compatibility
#include "LTC2620.h" // dacs
#ifdef VIRTUAL
#include "blackfin.h"
#include "string.h"
#include <unistd.h> // usleep
#ifdef VIRTUAL
#include <pthread.h>
#include <time.h>
#endif
#include "string.h"
// Variables that will be exported
int phaseShift = DEFAULT_PHASE_SHIFT;
@@ -1091,7 +1094,7 @@ int getDAC(enum DACINDEX ind, int mV) {
}
int getMaxDacSteps() {
return LTC2620_MAX_STEPS;
return LTC2620_GetMaxNumSteps();
}
@@ -1377,7 +1380,7 @@ int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t
FILE_LOG(logDEBUG1, ("\tWrite back released. MultiPurpose reg: 0x%x\n", bus_r(addr)));
FILE_LOG(logDEBUG1, ("\tConfiguring MAC CONF\n"));
mac_conf *mac_conf_regs = (mac_conf*)(CSP0BASE + ENET_CONF_REG * 2); // direct write
mac_conf *mac_conf_regs = (mac_conf*)(Blackfin_getBaseAddress() + ENET_CONF_REG * 2); // direct write
mac_conf_regs->mac.mac_dest_mac1 = ((destmac >> (8 * 5)) & 0xFF);
mac_conf_regs->mac.mac_dest_mac2 = ((destmac >> (8 * 4)) & 0xFF);
mac_conf_regs->mac.mac_dest_mac3 = ((destmac >> (8 * 3)) & 0xFF);
@@ -1415,7 +1418,7 @@ int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t
mac_conf_regs->udp.udp_chksum = 0x0000;
FILE_LOG(logDEBUG1, ("\tConfiguring TSE\n"));
tse_conf *tse_conf_regs = (tse_conf*)(CSP0BASE + TSE_CONF_REG * 2); // direct write
tse_conf *tse_conf_regs = (tse_conf*)(Blackfin_getBaseAddress() + TSE_CONF_REG * 2); // direct write
tse_conf_regs->rev = 0xA00;
tse_conf_regs->scratch = 0xCCCCCCCC;
tse_conf_regs->command_config = 0xB;