mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-07 18:38:41 +01:00
Dev/server/separate list header (#1373)
* xilinx, ctb and eiger server: detangled list.h to its own detector file * detangled list.h from all the detectors servers
This commit is contained in:
Binary file not shown.
210
slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.h
Normal file
210
slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.h
Normal file
@@ -0,0 +1,210 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#include "sls/sls_detector_defs.h"
|
||||
#include "slsDetectorServer_defs.h" // DAC_INDEX, ADC_INDEX, also include RegisterDefs.h
|
||||
|
||||
#include "AD9257.h" // commonServerFunctions.h, blackfin.h, ansi.h
|
||||
#include "blackfin.h"
|
||||
#include "programViaBlackfin.h"
|
||||
|
||||
#include <stdio.h> // FILE
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/****************************************************
|
||||
This functions are used by the slsDetectroServer_funcs interface.
|
||||
Here are the definitions, but the actual implementation should be done for each
|
||||
single detector.
|
||||
|
||||
****************************************************/
|
||||
|
||||
enum interfaceType { OUTER, INNER };
|
||||
typedef struct udpStruct_s {
|
||||
uint16_t srcport;
|
||||
uint16_t srcport2;
|
||||
uint16_t dstport;
|
||||
uint16_t dstport2;
|
||||
uint64_t srcmac;
|
||||
uint64_t srcmac2;
|
||||
uint64_t dstmac;
|
||||
uint64_t dstmac2;
|
||||
uint32_t srcip;
|
||||
uint32_t srcip2;
|
||||
uint32_t dstip;
|
||||
uint32_t dstip2;
|
||||
} udpStruct;
|
||||
#define MAC_ADDRESS_SIZE 18
|
||||
|
||||
// basic tests
|
||||
int isInitCheckDone();
|
||||
int getInitResult(char **mess);
|
||||
void basictests();
|
||||
int checkType();
|
||||
int testFpga();
|
||||
int testBus();
|
||||
|
||||
// Ids
|
||||
void getServerVersion(char *version);
|
||||
u_int64_t getFirmwareVersion();
|
||||
u_int64_t getFirmwareAPIVersion();
|
||||
void getHardwareVersion(char *version);
|
||||
u_int16_t getHardwareVersionNumber();
|
||||
u_int16_t getHardwareSerialNumber();
|
||||
int isHardwareVersion_1_0();
|
||||
u_int32_t getDetectorNumber();
|
||||
u_int64_t getDetectorMAC();
|
||||
u_int32_t getDetectorIP();
|
||||
int enableBlackfinAMCExternalAccessExtension(char *mess);
|
||||
|
||||
// initialization
|
||||
void initControlServer();
|
||||
void initStopServer();
|
||||
|
||||
// set up detector
|
||||
void setupDetector();
|
||||
int updateDatabytesandAllocateRAM();
|
||||
void updateDataBytes();
|
||||
|
||||
// firmware functions (resets)
|
||||
void cleanFifos();
|
||||
void resetCore();
|
||||
void resetPeripheral();
|
||||
|
||||
// parameters - dr, roi
|
||||
int setDynamicRange(int dr);
|
||||
int getDynamicRange(int *retval);
|
||||
|
||||
int setADCEnableMask(uint32_t mask);
|
||||
uint32_t getADCEnableMask();
|
||||
void setADCEnableMask_10G(uint32_t mask);
|
||||
uint32_t getADCEnableMask_10G();
|
||||
int setTransceiverEnableMask(uint32_t mask);
|
||||
uint32_t getTransceiverEnableMask();
|
||||
void setADCInvertRegister(uint32_t val);
|
||||
uint32_t getADCInvertRegister();
|
||||
|
||||
int setExternalSamplingSource(int val);
|
||||
int setExternalSampling(int val);
|
||||
|
||||
// parameters - readout
|
||||
int setReadoutMode(enum readoutMode mode);
|
||||
int getReadoutMode();
|
||||
|
||||
// parameters - timer
|
||||
int setNextFrameNumber(uint64_t value);
|
||||
int getNextFrameNumber(uint64_t *value);
|
||||
void setNumFrames(int64_t val);
|
||||
int64_t getNumFrames();
|
||||
void setNumTriggers(int64_t val);
|
||||
int64_t getNumTriggers();
|
||||
int setExpTime(int64_t val);
|
||||
int64_t getExpTime();
|
||||
int setPeriod(int64_t val);
|
||||
int64_t getPeriod();
|
||||
int setNumAnalogSamples(int val);
|
||||
int getNumAnalogSamples();
|
||||
int setNumDigitalSamples(int val);
|
||||
int getNumDigitalSamples();
|
||||
int setNumTransceiverSamples(int val);
|
||||
int getNumTransceiverSamples();
|
||||
|
||||
int64_t getNumFramesLeft();
|
||||
int64_t getNumTriggersLeft();
|
||||
int setDelayAfterTrigger(int64_t val);
|
||||
int64_t getDelayAfterTrigger();
|
||||
int64_t getDelayAfterTriggerLeft();
|
||||
int64_t getPeriodLeft();
|
||||
int64_t getFramesFromStart();
|
||||
int64_t getActualTime();
|
||||
int64_t getMeasurementTime();
|
||||
|
||||
// parameters - module, settings
|
||||
enum detectorSettings getSettings();
|
||||
|
||||
// parameters - threshold
|
||||
// parameters - dac, adc, hv
|
||||
|
||||
void setDAC(enum DACINDEX ind, int val, int mV);
|
||||
int getDAC(enum DACINDEX ind, int mV);
|
||||
int getMaxDacSteps();
|
||||
int dacToVoltage(int dac);
|
||||
int checkVLimitCompliant(int mV);
|
||||
int checkVLimitDacCompliant(int dac);
|
||||
int getVLimit();
|
||||
void setVLimit(int l);
|
||||
|
||||
int isVchipValid(int val);
|
||||
int getVchip();
|
||||
void setVchip(int val);
|
||||
int getVChipToSet(enum DACINDEX ind, int val);
|
||||
int getDACIndexFromADCIndex(enum ADCINDEX ind);
|
||||
int getADCIndexFromDACIndex(enum DACINDEX ind);
|
||||
int isPowerValid(enum DACINDEX ind, int val);
|
||||
int getPower();
|
||||
void setPower(enum DACINDEX ind, int val);
|
||||
void powerOff();
|
||||
|
||||
int getADC(enum ADCINDEX ind);
|
||||
int getSlowADC(int ichan);
|
||||
int getSlowADCTemperature();
|
||||
int setHighVoltage(int val);
|
||||
|
||||
// parameters - timing, extsig
|
||||
|
||||
void setTiming(enum timingMode arg);
|
||||
enum timingMode getTiming();
|
||||
|
||||
// configure mac
|
||||
int getNumberofUDPInterfaces();
|
||||
void calcChecksum(udp_header *udp);
|
||||
|
||||
int configureMAC();
|
||||
int setDetectorPosition(int pos[]);
|
||||
int *getDetectorPosition();
|
||||
|
||||
int enableTenGigabitEthernet(int val);
|
||||
|
||||
// very detector specific
|
||||
|
||||
// chip test board specific - configure frequency, phase, pll,
|
||||
// flashing firmware
|
||||
int setPhase(enum CLKINDEX ind, int val, int degrees);
|
||||
int getPhase(enum CLKINDEX ind, int degrees);
|
||||
int getMaxPhase(enum CLKINDEX ind);
|
||||
int validatePhaseinDegrees(enum CLKINDEX ind, int val, int retval);
|
||||
void configureSyncFrequency(enum CLKINDEX ind);
|
||||
void setADCPipeline(int val);
|
||||
int getADCPipeline();
|
||||
void setDBITPipeline(int val);
|
||||
int getDBITPipeline();
|
||||
int setLEDEnable(int enable);
|
||||
void setDigitalIODelay(uint64_t pinMask, int delay);
|
||||
|
||||
int setFrequency(enum CLKINDEX ind, int val);
|
||||
int getFrequency(enum CLKINDEX ind);
|
||||
|
||||
// aquisition
|
||||
int startStateMachine();
|
||||
#ifdef VIRTUAL
|
||||
void *start_timer(void *arg);
|
||||
#endif
|
||||
int stopStateMachine();
|
||||
int startReadOut();
|
||||
enum runStatus getRunStatus();
|
||||
void waitForAcquisitionEnd();
|
||||
int validateUDPSocket();
|
||||
void readandSendUDPFrames();
|
||||
void unsetFifoReadStrobes();
|
||||
int readSample(int ns);
|
||||
uint32_t checkDataInFifo();
|
||||
int checkFifoForEndOfAcquisition();
|
||||
int readFrameFromFifo();
|
||||
u_int32_t runBusy();
|
||||
|
||||
// common
|
||||
int calculateDataBytes();
|
||||
int getTotalNumberOfChannels();
|
||||
void getNumberOfChannels(int *nchanx, int *nchany);
|
||||
int getNumberOfChips();
|
||||
int getNumberOfDACs();
|
||||
int getNumberOfChannelsPerChip();
|
||||
Reference in New Issue
Block a user