diff --git a/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.11 b/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.12 similarity index 51% rename from slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.11 rename to slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.12 index 577b642b2..4664a3ecc 100755 Binary files a/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.11 and b/slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.12 differ diff --git a/slsDetectorSoftware/slsDetectorServer/commonServerFunctions.h b/slsDetectorSoftware/slsDetectorServer/commonServerFunctions.h index e201bef17..4122fb7cf 100755 --- a/slsDetectorSoftware/slsDetectorServer/commonServerFunctions.h +++ b/slsDetectorSoftware/slsDetectorServer/commonServerFunctions.h @@ -6,7 +6,7 @@ #endif /* global variables */ -void serializeToSPI(u_int32_t addr, u_int32_t val, u_int16_t csmask, int numbitstosend, u_int16_t clkmask, u_int16_t digoutmask, int digofset) { +void serializeToSPI(u_int32_t addr, u_int32_t val, u_int32_t csmask, int numbitstosend, u_int32_t clkmask, u_int32_t digoutmask, int digofset) { #ifdef VERBOSE if (numbitstosend == 16) printf("Writing to SPI Register: 0x%04x\n",val); @@ -14,15 +14,15 @@ void serializeToSPI(u_int32_t addr, u_int32_t val, u_int16_t csmask, int numbits printf("Writing to SPI Register: 0x%08x\n", val); #endif - u_int16_t valw; + u_int32_t valw; // start point - valw = 0xffff; /**todo testwith old board 0xff for adc_spi */ // old board compatibility (not using specific bits) - bus_w16 (addr, valw); + valw = 0xffffffff; // old board compatibility (not using specific bits) + bus_w (addr, valw); // chip sel bar down - valw &= ~csmask; /* todo with test: done a bit different, not with previous value */ - bus_w16 (addr, valw); + valw &= ~csmask; /* todo with test: done a bit different, not with previous value */ + bus_w (addr, valw); { int i = 0; @@ -30,30 +30,30 @@ void serializeToSPI(u_int32_t addr, u_int32_t val, u_int16_t csmask, int numbits // clk down valw &= ~clkmask; - bus_w16 (addr, valw); + bus_w (addr, valw); // write data (i) valw = ((valw & ~digoutmask) + // unset bit (((val >> (numbitstosend - 1 - i)) & 0x1) << digofset)); // each bit from val starting from msb - bus_w16 (addr, valw); + bus_w (addr, valw); // clk up valw |= clkmask ; - bus_w16 (addr, valw); + bus_w (addr, valw); } } // chip sel bar up valw |= csmask; /* todo with test: not done for spi */ - bus_w16 (addr, valw); + bus_w (addr, valw); //clk down valw &= ~clkmask; - bus_w16 (addr, valw); + bus_w (addr, valw); // stop point = start point of course - valw = 0xffff; /**todo testwith old board 0xff for adc_spi */ // old board compatibility (not using specific bits) - bus_w16 (addr, valw); + valw = 0xffffffff; // old board compatibility (not using specific bits) + bus_w (addr, valw); } diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorFunctionList.h b/slsDetectorSoftware/slsDetectorServer/slsDetectorFunctionList.h index 683086e68..4da4a3d8b 100644 --- a/slsDetectorSoftware/slsDetectorServer/slsDetectorFunctionList.h +++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorFunctionList.h @@ -124,7 +124,7 @@ int setThresholdEnergy(int ev, int imod); // parameters - dac, adc, hv #ifdef JUNGFRAUD -void serializeToSPI(u_int32_t addr, u_int32_t val, u_int16_t csmask, int numbitstosend, u_int16_t clkmask, u_int16_t digoutmask, int digofset); +void serializeToSPI(u_int32_t addr, u_int32_t val, u_int32_t csmask, int numbitstosend, u_int32_t clkmask, u_int32_t digoutmask, int digofset); void initDac(int dacnum); extern void setAdc(int addr, int val); // AD9257.h int voltageToDac(int value);