mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 15:20:02 +02:00
gotthard server updated, yet to run
This commit is contained in:
parent
923a7e8936
commit
45b00c4e7d
@ -1,12 +1,7 @@
|
|||||||
# $Id: Makefile,v 1.1.1.1 2006/02/04 03:35:01 freza Exp $
|
|
||||||
# first compile
|
|
||||||
# make cris-axis-linux-gnu
|
|
||||||
|
|
||||||
|
|
||||||
CROSS = bfin-uclinux-
|
CROSS = bfin-uclinux-
|
||||||
CC = $(CROSS)gcc
|
CC = $(CROSS)gcc
|
||||||
|
|
||||||
CFLAGS += -Wall -DGOTTHARDD -DMCB_FUNCS -DDEBUG # -DVERBOSE #-DVERYVERBOSE #-DVIRTUAL #-DDACS_INT_CSERVER
|
CFLAGS += -Wall -DGOTTHARDD -DDEBUG # -DVERBOSE #-DVERYVERBOSE #-DVIRTUAL
|
||||||
|
|
||||||
|
|
||||||
PROGS= gotthardDetectorServer
|
PROGS= gotthardDetectorServer
|
||||||
@ -16,7 +11,7 @@ INSTMODE= 0777
|
|||||||
|
|
||||||
|
|
||||||
BINS = testlib_sharedlibc
|
BINS = testlib_sharedlibc
|
||||||
SRCS = server.c firmware_funcs.c server_funcs.c communication_funcs.c mcb_funcs.c
|
SRCS = server.c firmware_funcs.c server_funcs.c communication_funcs.c
|
||||||
OBJS = $(SRCS:%.c=%.o)
|
OBJS = $(SRCS:%.c=%.o)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
DESTDIR ?= ./
|
DESTDIR ?= ./
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS += -Wall -DGOTTHARDD -DMCB_FUNCS -DDEBUG -DVIRTUAL
|
CFLAGS += -Wall -DGOTTHARDD -DVIRTUAL
|
||||||
|
|
||||||
|
|
||||||
PROGS= $(DESTDIR)/gotthardDetectorServer_virtual
|
PROGS= $(DESTDIR)/gotthardDetectorServer_virtual
|
||||||
|
|
||||||
|
|
||||||
SRCS = server.c server_funcs.c communication_funcs.c firmware_funcs.c mcb_funcs.c
|
SRCS = server.c server_funcs.c communication_funcs.c firmware_funcs.c
|
||||||
OBJS = $(SRCS:%.c=%.o)
|
OBJS = $(SRCS:%.c=%.o)
|
||||||
|
|
||||||
gotthardVirtualServer = $(PROGS)
|
gotthardVirtualServer = $(PROGS)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -12,74 +12,54 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
//#include <asm/page.h>
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
|
|
||||||
int mapCSP0(void);
|
int mapCSP0(void);
|
||||||
|
|
||||||
u_int16_t bus_r16(u_int32_t offset);
|
u_int16_t bus_r16(u_int32_t offset);
|
||||||
u_int16_t bus_w16(u_int32_t offset, u_int16_t data);//aldos function
|
u_int16_t bus_w16(u_int32_t offset, u_int16_t data);//aldos function
|
||||||
u_int32_t bus_w(u_int32_t offset, u_int32_t data);
|
u_int32_t bus_w(u_int32_t offset, u_int32_t data);
|
||||||
u_int32_t bus_r(u_int32_t offset);
|
u_int32_t bus_r(u_int32_t offset);
|
||||||
|
|
||||||
|
int initDetector();
|
||||||
|
int setDefaultDacs();
|
||||||
void setMasterSlaveConfiguration();
|
void setMasterSlaveConfiguration();
|
||||||
|
int configureADC();
|
||||||
int setPhaseShiftOnce();
|
int setPhaseShiftOnce();
|
||||||
int setPhaseShift(int numphaseshift);
|
int setPhaseShift(int numphaseshift);
|
||||||
int cleanFifo();
|
int cleanFifo();
|
||||||
int setDAQRegister();
|
int setDAQRegister();
|
||||||
|
u_int32_t putout(char *s);
|
||||||
|
int setConfigurationRegister(int d);
|
||||||
|
int sendviaUDP(int d);
|
||||||
|
int setDACRegister(int idac, int val);
|
||||||
|
|
||||||
u_int32_t putout(char *s, int modnum);
|
|
||||||
u_int32_t readin(int modnum);
|
|
||||||
u_int32_t setClockDivider(int d);
|
|
||||||
u_int32_t getClockDivider();
|
|
||||||
u_int32_t setSetLength(int d);
|
|
||||||
u_int32_t getSetLength();
|
|
||||||
u_int32_t setWaitStates(int d);
|
|
||||||
u_int32_t getWaitStates();
|
|
||||||
u_int32_t setTotClockDivider(int d);
|
|
||||||
u_int32_t getTotClockDivider();
|
|
||||||
u_int32_t setTotDutyCycle(int d);
|
|
||||||
u_int32_t getTotDutyCycle();
|
|
||||||
|
|
||||||
u_int32_t setExtSignal(enum externalSignalFlag mode);
|
u_int32_t setExtSignal(enum externalSignalFlag mode);
|
||||||
int getExtSignal();
|
int getExtSignal();
|
||||||
|
|
||||||
u_int32_t setFPGASignal(enum externalSignalFlag mode);
|
u_int32_t setFPGASignal(enum externalSignalFlag mode);
|
||||||
int getFPGASignal();
|
int getFPGASignal();
|
||||||
|
|
||||||
int setTiming(int t);
|
int setTiming(int t);
|
||||||
|
|
||||||
|
u_int64_t getDetectorNumber();
|
||||||
|
u_int32_t getFirmwareVersion();
|
||||||
|
u_int32_t getFirmwareSVNVersion();
|
||||||
|
|
||||||
int setConfigurationRegister(int d);
|
u_int32_t testFpga(void);
|
||||||
int setToT(int d);
|
int testBus(void);
|
||||||
int setContinousReadOut(int d);
|
|
||||||
int startReceiver(int d);
|
|
||||||
|
|
||||||
int setDACRegister(int idac, int val, int imod);
|
|
||||||
|
|
||||||
int getTemperature(int tempSensor,int imod);
|
|
||||||
int initHighVoltage(int val,int imod);
|
|
||||||
int initConfGain(int isettings,int val,int imod);
|
|
||||||
|
|
||||||
|
int initHighVoltage(int val);
|
||||||
|
int getTemperature(int tempSensor);
|
||||||
|
int setSettings(int i);
|
||||||
|
int initConfGain(int isettings,int val);
|
||||||
|
ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret);
|
||||||
int setADC(int adc);
|
int setADC(int adc);
|
||||||
int configureMAC(int ipad, long long int macad, long long int detectormacadd, int detipad, int ival, int udpport);
|
int configureMAC(int ipad, long long int macad, long long int detectormacadd, int detipad, int ival, int udpport);
|
||||||
int getAdcConfigured();
|
int getAdcConfigured();
|
||||||
|
|
||||||
|
|
||||||
u_int64_t getDetectorNumber();
|
|
||||||
u_int32_t getFirmwareVersion();
|
|
||||||
u_int32_t getFirmwareSVNVersion();
|
|
||||||
int testFifos(void);
|
|
||||||
u_int32_t testFpga(void);
|
|
||||||
int testBus(void);
|
|
||||||
int setDigitalTestBit(int ival);
|
|
||||||
|
|
||||||
int64_t set64BitReg(int64_t value, int aLSB, int aMSB);
|
int64_t set64BitReg(int64_t value, int aLSB, int aMSB);
|
||||||
int64_t get64BitReg(int aLSB, int aMSB);
|
int64_t get64BitReg(int aLSB, int aMSB);
|
||||||
|
|
||||||
@ -92,88 +72,49 @@ int64_t getExposureTime();
|
|||||||
int64_t setGates(int64_t value);
|
int64_t setGates(int64_t value);
|
||||||
int64_t getGates();
|
int64_t getGates();
|
||||||
|
|
||||||
int64_t setDelay(int64_t value);
|
|
||||||
int64_t getDelay();
|
|
||||||
|
|
||||||
int64_t setPeriod(int64_t value);
|
int64_t setPeriod(int64_t value);
|
||||||
int64_t getPeriod();
|
int64_t getPeriod();
|
||||||
|
|
||||||
|
int64_t setDelay(int64_t value);
|
||||||
|
int64_t getDelay();
|
||||||
|
|
||||||
int64_t setTrains(int64_t value);
|
int64_t setTrains(int64_t value);
|
||||||
int64_t getTrains();
|
int64_t getTrains();
|
||||||
|
|
||||||
int64_t setProbes(int64_t value);
|
|
||||||
int64_t getProbes();
|
|
||||||
|
|
||||||
int64_t getProgress();
|
|
||||||
int64_t setProgress();
|
|
||||||
|
|
||||||
int64_t getActualTime();
|
int64_t getActualTime();
|
||||||
int64_t getMeasurementTime();
|
int64_t getMeasurementTime();
|
||||||
|
|
||||||
|
u_int32_t fifoReadStatus();
|
||||||
|
u_int32_t fifo_full(void);
|
||||||
u_int32_t runBusy(void);
|
u_int32_t runBusy(void);
|
||||||
u_int32_t runState(void);
|
u_int32_t runState(void);
|
||||||
u_int32_t dataPresent(void);
|
|
||||||
|
|
||||||
|
|
||||||
int startStateMachine();
|
int startStateMachine();
|
||||||
int stopStateMachine();
|
int stopStateMachine();
|
||||||
int startReadOut();
|
int startReadOut();
|
||||||
u_int32_t fifoReset(void);
|
|
||||||
u_int32_t fifoReadCounter(int fifonum);
|
|
||||||
u_int32_t fifoReadStatus();
|
|
||||||
|
|
||||||
|
|
||||||
u_int32_t fifo_full(void);
|
|
||||||
|
|
||||||
|
|
||||||
void waitForAcquisitionFinish();
|
void waitForAcquisitionFinish();
|
||||||
|
int getStatus();
|
||||||
u_int32_t* decode_data(int* datain);
|
|
||||||
//u_int32_t move_data(u_int64_t* datain, u_int64_t* dataout);
|
|
||||||
int setDynamicRange(int dr);
|
|
||||||
int getDynamicRange();
|
|
||||||
int getNModBoard();
|
|
||||||
int setNMod(int n);
|
|
||||||
int setStoreInRAM(int b);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int setMaster(int f);
|
|
||||||
int setSynchronization(int s);
|
|
||||||
|
|
||||||
int loadImage(int index, short int ImageVals[]);
|
int loadImage(int index, short int ImageVals[]);
|
||||||
int readCounterBlock(int startACQ, short int CounterVals[]);
|
int readCounterBlock(int startACQ, short int CounterVals[]);
|
||||||
int resetCounterBlock(int startACQ);
|
int resetCounterBlock(int startACQ);
|
||||||
|
|
||||||
int calibratePedestal(int frames);
|
int copyModule(sls_detector_module *destMod, sls_detector_module *srcMod);
|
||||||
|
|
||||||
|
int setDAC(int ind,int val,int mV, int retval[]);
|
||||||
|
int getDAC(int ind);
|
||||||
|
|
||||||
|
int setModule(sls_detector_module);
|
||||||
|
void getModule(sls_detector_module*);
|
||||||
|
|
||||||
|
void initDACs(int* v);
|
||||||
|
void initDAC(int dac_addr, int value);
|
||||||
|
void clearDACSregister();
|
||||||
|
void nextDAC();
|
||||||
|
void program_one_dac(int addr, int value);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
u_int32_t setNBits(u_int32_t);
|
|
||||||
u_int32_t getNBits();
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
//move to mcb_funcs?
|
|
||||||
|
|
||||||
int readOutChan(int *val);
|
|
||||||
u_int32_t getModuleNumber(int modnum);
|
|
||||||
int testShiftIn(int imod);
|
|
||||||
int testShiftOut(int imod);
|
|
||||||
int testShiftStSel(int imod);
|
|
||||||
int testDataInOut(int num, int imod);
|
|
||||||
int testExtPulse(int imod);
|
|
||||||
int testExtPulseMux(int imod, int ow);
|
|
||||||
int testDataInOutMux(int imod, int ow, int num);
|
|
||||||
int testOutMux(int imod);
|
|
||||||
int testFpgaMux(int imod);
|
|
||||||
int calibration_sensor(int num, int *values, int *dacs) ;
|
|
||||||
int calibration_chip(int num, int *values, int *dacs);
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer
|
Path: slsDetectorPackage/slsDetectorSoftware/slsDetectorServers/gotthardDetectorServer
|
||||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||||
Repsitory UUID: c52025dd7c4b44b93e64353a22997d971996ab18
|
Repsitory UUID: 923a7e8936cbfe32a8781554de32c66be2f78035
|
||||||
Revision: 237
|
Revision: 2
|
||||||
Branch: developer
|
Branch: refactor
|
||||||
Last Changed Author: Gemma_Tinti
|
Last Changed Author: Dhanya_Thattil
|
||||||
Last Changed Rev: 3999
|
Last Changed Rev: 4068
|
||||||
Last Changed Date: 2018-09-28 16:10:41.000000002 +0200 ./server_funcs.c
|
Last Changed Date: 2018-10-09 09:15:04.000000002 +0200 ./firmware_funcs.c
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||||
#define GITREPUUID "c52025dd7c4b44b93e64353a22997d971996ab18"
|
#define GITREPUUID "923a7e8936cbfe32a8781554de32c66be2f78035"
|
||||||
#define GITAUTH "Gemma_Tinti"
|
#define GITAUTH "Dhanya_Thattil"
|
||||||
#define GITREV 0x3999
|
#define GITREV 0x4068
|
||||||
#define GITDATE 0x20180928
|
#define GITDATE 0x20181009
|
||||||
#define GITBRANCH "developer"
|
#define GITBRANCH "refactor"
|
||||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,183 +0,0 @@
|
|||||||
#ifdef MCB_FUNCS
|
|
||||||
|
|
||||||
#ifndef MCB_FUNCS_H
|
|
||||||
#define MCB_FUNCS_H
|
|
||||||
|
|
||||||
#include "sls_detector_defs.h"
|
|
||||||
|
|
||||||
#define RGPRVALS {100,50,200}
|
|
||||||
#define RGSH1VALS {300,200,400}
|
|
||||||
#define RGSH2VALS {260,300,260}
|
|
||||||
|
|
||||||
// high,dynamic,low,medium,very high
|
|
||||||
#define CONF_GAIN {0,0, 0, 8, 6, 2, 1}//dynamic gain confgain yet to be figured out-probably 8 or 16
|
|
||||||
|
|
||||||
|
|
||||||
#define DEFAULTGAIN {11.66,9.32,14.99}
|
|
||||||
#define DEFAULTOFFSET {817.5,828.6,804.2}
|
|
||||||
|
|
||||||
// DAC definitions
|
|
||||||
enum dacsVal{VREF_DS, VCASCN_PB, VCASCP_PB, VOUT_CM, VCASC_OUT, VIN_CM, VREF_COMP, IB_TESTC,HIGH_VOLTAGE, CONFGAIN};
|
|
||||||
#define DEFAULT_DAC_VALS { \
|
|
||||||
660, /* VREF_DS */ \
|
|
||||||
650, /* VCASCN_PB */ \
|
|
||||||
1480, /* VCASCP_PB */ \
|
|
||||||
1520, /* VOUT_CM */ \
|
|
||||||
1320, /* VCASC_OUT */ \
|
|
||||||
1350, /* VIN_CM */ \
|
|
||||||
350, /* VREF_COMP */ \
|
|
||||||
2001 /* IB_TESTC */ \
|
|
||||||
};
|
|
||||||
|
|
||||||
/* DAC adresses */
|
|
||||||
#define DACCS {0,0,1,1,2,2,3,3,4,4,5,5,6,6}
|
|
||||||
#define DACADDR {0,1,0,1,0,1,0,1,0,1,0,1,0,1}
|
|
||||||
|
|
||||||
//Register Definitions for temp,hv,dac gain
|
|
||||||
enum adcVals{TEMP_FPGA, TEMP_ADC};
|
|
||||||
|
|
||||||
//dynamic range
|
|
||||||
/*
|
|
||||||
#define MAX5523 commented out by dhanya
|
|
||||||
#ifndef MAX5523
|
|
||||||
#define MAX5533
|
|
||||||
#endif
|
|
||||||
#ifdef MAX5533
|
|
||||||
#define DAC_DR 4096
|
|
||||||
#endif
|
|
||||||
#ifdef MAX5523
|
|
||||||
*/
|
|
||||||
#define DAC_DR 1024
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
|
|
||||||
//reference voltage
|
|
||||||
#define DAC_REFOUT1
|
|
||||||
#ifdef DAC_REFOUT2
|
|
||||||
#define DAC_MAX 2.425
|
|
||||||
#define DAC_REFOUT 2
|
|
||||||
#define DAC_REFOUT1
|
|
||||||
#endif
|
|
||||||
#ifdef DAC_REFOUT3
|
|
||||||
#define DAC_MAX 3.885
|
|
||||||
#define DAC_REFOUT 3
|
|
||||||
#define DAC_REFOUT1
|
|
||||||
#endif
|
|
||||||
#ifdef DAC_REFOUT0
|
|
||||||
#define DAC_MAX 1.214
|
|
||||||
#define DAC_REFOUT 0
|
|
||||||
#endif
|
|
||||||
#ifdef DAC_REFOUT1
|
|
||||||
#define DAC_MAX 1.940
|
|
||||||
#define DAC_REFOUT 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* dac calibration constants */
|
|
||||||
|
|
||||||
#define VA 1.11
|
|
||||||
|
|
||||||
#define CVTRIM 52.430851
|
|
||||||
#define BVTRIM -0.102022
|
|
||||||
#define AVTRIM 0.000050
|
|
||||||
|
|
||||||
#define PARTREF {100,1.55,-2.5,-2.5,0,-2.5}
|
|
||||||
#define PARTR1 {78,10,10,10,10,10}
|
|
||||||
#define PARTR2 {0,4.7,27,47,22,47}
|
|
||||||
|
|
||||||
|
|
||||||
//chip shiftin register meaning
|
|
||||||
#define OUTMUX_OFFSET 20
|
|
||||||
#define PROBES_OFFSET 4
|
|
||||||
#define OUTBUF_OFFSET 0
|
|
||||||
|
|
||||||
|
|
||||||
void showbits(int h);
|
|
||||||
|
|
||||||
int initDetector();
|
|
||||||
int setDefaultDacs();
|
|
||||||
int copyChannel(sls_detector_channel *destChan, sls_detector_channel *srcChan);
|
|
||||||
int copyChip(sls_detector_chip *destChip, sls_detector_chip *srcChip);
|
|
||||||
int copyModule(sls_detector_module *destMod, sls_detector_module *srcMod);
|
|
||||||
|
|
||||||
/* Register commands */
|
|
||||||
int clearDACSregister(int imod );
|
|
||||||
int nextDAC(int imod );
|
|
||||||
int clearCSregister(int imod );
|
|
||||||
int setCSregister(int imod );
|
|
||||||
int nextChip(int imod );
|
|
||||||
int firstChip(int imod );
|
|
||||||
int clearSSregister(int imod );
|
|
||||||
int setSSregister(int imod );
|
|
||||||
int nextStrip(int imod );
|
|
||||||
int selChannel(int strip,int imod );
|
|
||||||
int selChip(int chip,int imod );
|
|
||||||
int selMod(int mod,int imod );
|
|
||||||
|
|
||||||
/* DACs routines */
|
|
||||||
int program_one_dac(int addr, int value,int imod );
|
|
||||||
int set_one_dac(int imod);
|
|
||||||
int initDAC(int dac_addr, int value,int imod );
|
|
||||||
int initDACs(int* v,int imod );
|
|
||||||
int setSettings(int i,int imod);
|
|
||||||
int initDACbyIndex(int ind,int val, int imod);
|
|
||||||
int initDACbyIndexDACU(int ind,int val, int imod, int mV, int retval[]);
|
|
||||||
int getDACbyIndexDACU(int ind, int imod);
|
|
||||||
|
|
||||||
/* Other DAC index routines*/
|
|
||||||
int getTemperatureByModule(int tempSensor, int imod);
|
|
||||||
int initHighVoltageByModule(int val, int imod);
|
|
||||||
int initConfGainByModule(int isettings,int val,int imod);
|
|
||||||
|
|
||||||
/* Initialization*/
|
|
||||||
int initChannel(int ft,int cae, int ae, int coe, int ocoe, int counts,int imod );
|
|
||||||
int initChannelbyNumber(sls_detector_channel myChan);
|
|
||||||
int getChannelbyNumber(sls_detector_channel*);
|
|
||||||
|
|
||||||
int getTrimbit(int imod, int ichip, int ichan);
|
|
||||||
|
|
||||||
int initChip(int obe, int ow,int imod );
|
|
||||||
|
|
||||||
int initChipWithProbes(int obe, int ow,int nprobes, int imod);
|
|
||||||
//int getNProbes();
|
|
||||||
|
|
||||||
int initChipbyNumber(sls_detector_chip myChip);
|
|
||||||
int getChipbyNumber(sls_detector_chip*);
|
|
||||||
int initMCBregisters(int cm,int imod );
|
|
||||||
int initModulebyNumber(sls_detector_module);
|
|
||||||
int getModulebyNumber(sls_detector_module*);
|
|
||||||
|
|
||||||
/* To chips */
|
|
||||||
int clearCounter(int imod );
|
|
||||||
int clearOutReg(int imod);
|
|
||||||
int setOutReg(int imod );
|
|
||||||
int extPulse(int ncal,int imod );
|
|
||||||
int calPulse(int ncal,int imod );
|
|
||||||
int counterClear(int imod );
|
|
||||||
int countEnable(int imod );
|
|
||||||
int counterSet(int imod );
|
|
||||||
|
|
||||||
|
|
||||||
/* moved from firmware_funcs */
|
|
||||||
|
|
||||||
int readOutChan(int *val);
|
|
||||||
|
|
||||||
int getModuleNumber(int modnum);
|
|
||||||
int testShiftIn(int imod);
|
|
||||||
int testShiftOut(int imod);
|
|
||||||
int testShiftStSel(int imod);
|
|
||||||
int testDataInOut(int num, int imod);
|
|
||||||
int testExtPulse(int imod);
|
|
||||||
int testExtPulseMux(int imod, int ow);
|
|
||||||
int testDataInOutMux(int imod, int ow, int num);
|
|
||||||
int testOutMux(int imod);
|
|
||||||
int testFpgaMux(int imod);
|
|
||||||
int calibration_sensor(int num, int *values, int *dacs) ;
|
|
||||||
int calibration_chip(int num, int *values, int *dacs);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@ -7,42 +7,27 @@
|
|||||||
|
|
||||||
|
|
||||||
// Hardware definitions
|
// Hardware definitions
|
||||||
|
|
||||||
#define NCHAN 128
|
#define NCHAN 128
|
||||||
#define NCHIP 10
|
#define NCHIP 10
|
||||||
#define NMAXMODX 1
|
|
||||||
#define NMAXMODY 1
|
|
||||||
#define NMAXMOD NMAXMODX*NMAXMODY
|
|
||||||
#define NDAC 8
|
#define NDAC 8
|
||||||
#define NADC 5
|
#define NADC 5
|
||||||
|
#define NCHANS NCHAN*NCHIP
|
||||||
#define NCHANS NCHAN*NCHIP*NMAXMOD
|
#define NDACS NDAC
|
||||||
#define NDACS NDAC*NMAXMOD
|
|
||||||
|
|
||||||
#define NTRIMBITS 6
|
|
||||||
#define NCOUNTBITS 24
|
|
||||||
|
|
||||||
#define NCHIPS_PER_ADC 2
|
#define NCHIPS_PER_ADC 2
|
||||||
|
|
||||||
|
#define DYNAMIC_RANGE 16
|
||||||
|
#define DATA_BYTES (NCHIP*NCHAN*2)
|
||||||
|
|
||||||
// for 25 um
|
// for 25 um
|
||||||
#define CONFIG_FILE "config.txt"
|
#define CONFIG_FILE "config.txt"
|
||||||
|
|
||||||
|
|
||||||
//#define TRIM_DR ((2**NTRIMBITS)-1)
|
|
||||||
//#define COUNT_DR ((2**NCOUNTBITS)-1)
|
|
||||||
#define TRIM_DR (((int)pow(2,NTRIMBITS))-1)
|
|
||||||
#define COUNT_DR (((int)pow(2,NCOUNTBITS))-1)
|
|
||||||
|
|
||||||
|
#define ADCSYNC_VAL 0x32214
|
||||||
#define ALLMOD 0xffff
|
#define TOKEN_RESTART_DELAY 0x88000000
|
||||||
#define ALLFIFO 0xffff
|
#define TOKEN_RESTART_DELAY_ROI 0x1b000000
|
||||||
|
#define TOKEN_TIMING_REV1 0x1f16
|
||||||
|
#define TOKEN_TIMING_REV2 0x1f0f
|
||||||
#define ADCSYNC_VAL 0x32214
|
|
||||||
#define TOKEN_RESTART_DELAY 0x88000000
|
|
||||||
#define TOKEN_RESTART_DELAY_ROI 0x1b000000
|
|
||||||
#define TOKEN_TIMING_REV1 0x1f16
|
|
||||||
#define TOKEN_TIMING_REV2 0x1f0f
|
|
||||||
|
|
||||||
#define DEFAULT_PHASE_SHIFT 120
|
#define DEFAULT_PHASE_SHIFT 120
|
||||||
#define DEFAULT_IP_PACKETSIZE 0x0522
|
#define DEFAULT_IP_PACKETSIZE 0x0522
|
||||||
@ -50,11 +35,35 @@
|
|||||||
#define ADC1_IP_PACKETSIZE (256*2+14+20)
|
#define ADC1_IP_PACKETSIZE (256*2+14+20)
|
||||||
#define ADC1_UDP_PACKETSIZE (256*2+4+8+2)
|
#define ADC1_UDP_PACKETSIZE (256*2+4+8+2)
|
||||||
|
|
||||||
#ifdef VIRTUAL
|
|
||||||
#define DEBUGOUT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CLK_FREQ 32.007729
|
#define CLK_FREQ 32.007729
|
||||||
|
|
||||||
|
#define DAC_DR 1024
|
||||||
|
#define CONF_GAIN { \
|
||||||
|
0, /*standard gain*/ \
|
||||||
|
0, /*fast gain*/ \
|
||||||
|
0, /*high gain*/ \
|
||||||
|
8, /*dynamic gain*/ \
|
||||||
|
6, /*low gain*/ \
|
||||||
|
2, /*medium gain*/ \
|
||||||
|
1 /*very high gain*/ \
|
||||||
|
};
|
||||||
|
//dynamic gain confgain yet to be figured out-probably 8 or 16
|
||||||
|
|
||||||
|
// DAC definitions
|
||||||
|
enum dacsVal{VREF_DS, VCASCN_PB, VCASCP_PB, VOUT_CM, VCASC_OUT, VIN_CM, VREF_COMP, IB_TESTC,HIGH_VOLTAGE, CONFGAIN};
|
||||||
|
#define DEFAULT_DAC_VALS { \
|
||||||
|
660, /* VREF_DS */ \
|
||||||
|
650, /* VCASCN_PB */ \
|
||||||
|
1480, /* VCASCP_PB */ \
|
||||||
|
1520, /* VOUT_CM */ \
|
||||||
|
1320, /* VCASC_OUT */ \
|
||||||
|
1350, /* VIN_CM */ \
|
||||||
|
350, /* VREF_COMP */ \
|
||||||
|
2001 /* IB_TESTC */ \
|
||||||
|
};
|
||||||
|
|
||||||
|
//Register Definitions for temp,hv,dac gain
|
||||||
|
enum adcVals{TEMP_FPGA, TEMP_ADC};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -21,79 +21,50 @@
|
|||||||
int sockfd;
|
int sockfd;
|
||||||
|
|
||||||
int function_table();
|
int function_table();
|
||||||
|
|
||||||
int decode_function(int);
|
int decode_function(int);
|
||||||
int init_detector(int);
|
int init_detector(int);
|
||||||
|
|
||||||
int M_nofunc(int);
|
int M_nofunc(int);
|
||||||
int exit_server(int);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// General purpose functions
|
// General purpose functions
|
||||||
int get_detector_type(int);
|
|
||||||
int set_number_of_modules(int);
|
|
||||||
int get_max_number_of_modules(int);
|
|
||||||
|
|
||||||
|
|
||||||
int exec_command(int);
|
int exec_command(int);
|
||||||
|
int get_detector_type(int);
|
||||||
int set_external_signal_flag(int);
|
int set_external_signal_flag(int);
|
||||||
int set_external_communication_mode(int);
|
int set_external_communication_mode(int);
|
||||||
int get_id(int);
|
int get_id(int);
|
||||||
int digital_test(int);
|
int digital_test(int);
|
||||||
int write_register(int);
|
|
||||||
int read_register(int);
|
|
||||||
int set_dac(int);
|
int set_dac(int);
|
||||||
int get_adc(int);
|
int get_adc(int);
|
||||||
int set_channel(int);
|
int write_register(int);
|
||||||
int set_chip(int);
|
int read_register(int);
|
||||||
int set_module(int);
|
int set_module(int);
|
||||||
int get_channel(int);
|
|
||||||
int get_chip(int);
|
|
||||||
int get_module(int);
|
int get_module(int);
|
||||||
|
|
||||||
int get_threshold_energy(int);
|
|
||||||
int set_threshold_energy(int);
|
|
||||||
int set_settings(int);
|
int set_settings(int);
|
||||||
int start_acquisition(int);
|
int start_acquisition(int);
|
||||||
int stop_acquisition(int);
|
int stop_acquisition(int);
|
||||||
int start_readout(int);
|
int start_readout(int);
|
||||||
int get_run_status(int);
|
int get_run_status(int);
|
||||||
int read_frame(int);
|
|
||||||
int read_all(int);
|
|
||||||
int start_and_read_all(int);
|
int start_and_read_all(int);
|
||||||
|
int read_all(int);
|
||||||
int set_timer(int);
|
int set_timer(int);
|
||||||
int get_time_left(int);
|
int get_time_left(int);
|
||||||
int set_dynamic_range(int);
|
int set_dynamic_range(int);
|
||||||
int set_roi(int);
|
|
||||||
int get_roi(int);
|
|
||||||
int set_speed(int);
|
|
||||||
void configureADC();
|
|
||||||
int set_readout_flags(int);
|
int set_readout_flags(int);
|
||||||
int execute_trimming(int);
|
int set_roi(int);
|
||||||
|
int set_speed(int);
|
||||||
|
int exit_server(int);
|
||||||
int lock_server(int);
|
int lock_server(int);
|
||||||
int set_port(int);
|
|
||||||
int get_last_client_ip(int);
|
int get_last_client_ip(int);
|
||||||
int set_master(int);
|
int set_port(int);
|
||||||
int set_synchronization(int);
|
|
||||||
|
|
||||||
int update_client(int);
|
|
||||||
int send_update(int);
|
int send_update(int);
|
||||||
|
int update_client(int);
|
||||||
int configure_mac(int);
|
int configure_mac(int);
|
||||||
|
|
||||||
int load_image(int);
|
int load_image(int);
|
||||||
int read_counter_block(int);
|
int read_counter_block(int);
|
||||||
int reset_counter_block(int);
|
int reset_counter_block(int);
|
||||||
|
|
||||||
int start_receiver(int);
|
|
||||||
int stop_receiver(int);
|
|
||||||
|
|
||||||
|
|
||||||
int calibrate_pedestal(int);
|
|
||||||
|
|
||||||
int set_roi(int);
|
|
||||||
|
|
||||||
int write_adc_register(int);
|
int write_adc_register(int);
|
||||||
int check_version(int);
|
int check_version(int);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user