From 39d9ae8b7b10c74e8c38fcd5f990d5932872fc6a Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Tue, 22 Nov 2011 15:08:48 +0000 Subject: [PATCH] gotthard:highvoltage done git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@57 951219d9-93cf-4727-9268-0efd64621fa3 --- .../gotthardDetectorServer/firmware_funcs.c | 45 +++++++++--- .../gotthardDetectorServer/firmware_funcs.h | 1 + .../gotthardDetectorServer/mcb_funcs.c | 39 +++++++++- .../gotthardDetectorServer/mcb_funcs.h | 11 ++- .../gotthardDetectorServer/registers_g.h | 15 ++-- .../gotthardDetectorServer/server_funcs.c | 73 ++++++++++--------- 6 files changed, 129 insertions(+), 55 deletions(-) diff --git a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c index 71a089ffe..3f4ff6c8f 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c +++ b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c @@ -852,8 +852,7 @@ int setDACRegister(int idac, int val, int imod) { } -float getTemperature(int tempSensor, int imod) -{ +float getTemperature(int tempSensor, int imod){ float val; char cTempSensor[2][100]={"ADCs/ASICs","VRs/FPGAs"}; imod=0;//ignoring more than 1 mod for now @@ -863,31 +862,59 @@ float getTemperature(int tempSensor, int imod) #ifdef VERBOSE printf("Getting Temperature of module:%d for the %s\n",imod,cTempSensor[tempSensor]); #endif - bus_w(TEMP_SPI_IN,(T1_CLK_BIT)|(T1_CS_BIT)|(T2_CLK_BIT)|(T2_CS_BIT));//standby - bus_w(TEMP_SPI_IN,(T1_CLK_BIT)&~(T1_CS_BIT)|(T2_CLK_BIT));//high clk low cs + bus_w(TEMP_IN_REG,(T1_CLK_BIT)|(T1_CS_BIT)|(T2_CLK_BIT)|(T2_CS_BIT));//standby + bus_w(TEMP_IN_REG,(T1_CLK_BIT)&~(T1_CS_BIT)|(T2_CLK_BIT));//high clk low cs for(k=0;k<2;k++){ for(i=0;i=0 && imod=0 && imod=getNModBoard()) @@ -852,51 +852,52 @@ int set_dac(int fnum) { case TEMPERATURE_FPGA: itemp=TEMP_FPGA; break; + case HV_POT: + itemp=HIGH_VOLTAGE; + break; default: - printf("Unknown DAC/POT/TEMP index %d\n",ind); - sprintf(mess,"Unknown DAC/POT/TEMP index %d\n",ind); + printf("Unknown DAC/TEMP/HV index %d\n",ind); + sprintf(mess,"Unknown DAC/TEMP/HV index %d\n",ind); ret=FAIL; } if (ret==OK) { - if(itemp!=-1) { - if (imod>=0 && imod