mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
gotthard2: server fix enum for onchip dac
This commit is contained in:
Binary file not shown.
@ -438,7 +438,7 @@ int readConfigFile() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE_LOG(logDEBUG1, ("Command to process: (size:%d) %s\n", strlen(line), line));
|
FILE_LOG(logDEBUG1, ("Command to process: (size:%d) %.*s\n", strlen(line), strlen(line) -1, line));
|
||||||
memset(command, 0, LZ);
|
memset(command, 0, LZ);
|
||||||
|
|
||||||
// vchip command
|
// vchip command
|
||||||
@ -648,7 +648,6 @@ int setOnChipDAC(enum ONCHIP_DACINDEX ind, int chipIndex, int val) {
|
|||||||
}
|
}
|
||||||
FILE_LOG(logINFO, ("Setting on chip dac[%d - %s]: 0x%x\n", (int)ind, names[ind], val));
|
FILE_LOG(logINFO, ("Setting on chip dac[%d - %s]: 0x%x\n", (int)ind, names[ind], val));
|
||||||
|
|
||||||
|
|
||||||
char buffer[2];
|
char buffer[2];
|
||||||
buffer[1] = ((val & 0xF) << 4) | (((int)ind) & 0xF); // LSB (4 bits) + ADDR (4 bits)
|
buffer[1] = ((val & 0xF) << 4) | (((int)ind) & 0xF); // LSB (4 bits) + ADDR (4 bits)
|
||||||
buffer[0] = (val >> 4) & 0x3F; // MSB (6 bits)
|
buffer[0] = (val >> 4) & 0x3F; // MSB (6 bits)
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#define NCHAN (128)
|
#define NCHAN (128)
|
||||||
#define NCHIP (10)
|
#define NCHIP (10)
|
||||||
#define NDAC (16)
|
#define NDAC (16)
|
||||||
#define ONCHIP_NDAC (6)
|
#define ONCHIP_NDAC (7)
|
||||||
#define DYNAMIC_RANGE (16)
|
#define DYNAMIC_RANGE (16)
|
||||||
#define HV_SOFT_MAX_VOLTAGE (200)
|
#define HV_SOFT_MAX_VOLTAGE (200)
|
||||||
#define HV_HARD_MAX_VOLTAGE (530)
|
#define HV_HARD_MAX_VOLTAGE (530)
|
||||||
@ -66,10 +66,11 @@ enum ONCHIP_DACINDEX {G2_VCHIP_COMP_FE, /* 0 */ \
|
|||||||
G2_VCHIP_OPA_1ST, /* 1 */ \
|
G2_VCHIP_OPA_1ST, /* 1 */ \
|
||||||
G2_VCHIP_OPA_FD, /* 2 */ \
|
G2_VCHIP_OPA_FD, /* 2 */ \
|
||||||
G2_VCHIP_COMP_ADC, /* 3 */ \
|
G2_VCHIP_COMP_ADC, /* 3 */ \
|
||||||
G2_VCHIP_REF_COMP_FE, /* 4 */ \
|
G2_VCHIP_UNUSED, /* 4 */ \
|
||||||
G2_VCHIP_CS /* 5 */ \
|
G2_VCHIP_REF_COMP_FE, /* 5 */ \
|
||||||
|
G2_VCHIP_CS /* 6 */ \
|
||||||
};
|
};
|
||||||
#define ONCHIP_DAC_NAMES "vchip_comp_fe", "vchip_opa_1st", "vchip_opa_fd", "vchip_comp_adc", "vchip_ref_comp_fe", "vchip_cs"
|
#define ONCHIP_DAC_NAMES "vchip_comp_fe", "vchip_opa_1st", "vchip_opa_fd", "vchip_comp_adc", "vchip_unused", "vchip_ref_comp_fe", "vchip_cs"
|
||||||
|
|
||||||
|
|
||||||
enum CLKINDEX {READOUT_C0, READOUT_C1, SYSTEM_C0, SYSTEM_C1, SYSTEM_C2, SYSTEM_C3, NUM_CLOCKS};
|
enum CLKINDEX {READOUT_C0, READOUT_C1, SYSTEM_C0, SYSTEM_C1, SYSTEM_C2, SYSTEM_C3, NUM_CLOCKS};
|
||||||
|
@ -32,14 +32,19 @@ int ASIC_Driver_Set (int index, int length, char* buffer) {
|
|||||||
{
|
{
|
||||||
char printbuffer[2 * length + 15];
|
char printbuffer[2 * length + 15];
|
||||||
memset(printbuffer, 0, 2 * length);
|
memset(printbuffer, 0, 2 * length);
|
||||||
strcpy(printbuffer, "\t values: [");
|
strcpy(printbuffer, "\t[values: ");
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < length; ++i) {
|
for (i = 0; i < length; ++i) {
|
||||||
char bytes[10]="";
|
char bytes[10]="";
|
||||||
sprintf(bytes, "\t0x%02hhx", buffer[i]);
|
sprintf(bytes, "0x%02hhx", buffer[i]);
|
||||||
strcat(printbuffer, bytes);
|
strcat(printbuffer, bytes);
|
||||||
|
if (i < length - 1) {
|
||||||
|
strcat(printbuffer, "\t");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
strcat(printbuffer, "]");
|
int len = strlen(printbuffer);
|
||||||
|
printbuffer[len - 1] = ']';
|
||||||
|
printbuffer[len] = '\0';
|
||||||
FILE_LOG(logDEBUG1, ("%s\n", printbuffer));
|
FILE_LOG(logDEBUG1, ("%s\n", printbuffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,5 +8,5 @@
|
|||||||
#define APIGOTTHARD 0x191111
|
#define APIGOTTHARD 0x191111
|
||||||
#define APIJUNGFRAU 0x191111
|
#define APIJUNGFRAU 0x191111
|
||||||
#define APIEIGER 0x191111
|
#define APIEIGER 0x191111
|
||||||
#define APIGOTTHARD2 0x191111
|
|
||||||
#define APIMYTHEN3 0x191111
|
#define APIMYTHEN3 0x191111
|
||||||
|
#define APIGOTTHARD2 0x191112
|
||||||
|
Reference in New Issue
Block a user