some changes with anna. more to come

This commit is contained in:
Dhanya Maliakal 2016-02-04 12:57:07 +01:00
parent 6cc22a350d
commit 35631c0abb
5 changed files with 29 additions and 38 deletions

View File

@ -64,11 +64,8 @@ struct timeval tss,tse,tsss; //for timing
//for memory mapping
#ifdef JUNGFRAU_DHANYA
u_int32_t CSP0BASE;
#else
u_int64_t CSP0BASE;
#endif
FILE *debugfp, *datafp;
@ -1127,16 +1124,17 @@ u_int32_t testFpga(void) {
// for fpga test
u_int32_t testRAM(void) {
int result=OK;
#ifdef JUNGFRAU_DHANYA
cprintf(RED,"TestRAM not implemented for Jungfrau\n");
#else
int i=0;
printf("TestRAM not implemented\n");
/* int i=0;
allocateRAM();
// while(i<100000) {
memcpy(ram_values, values, dataBytes);
printf ("Testing RAM:\t%d: copied fifo %x to memory %x size %d\n",i++, (unsigned int)(values), (unsigned int)(ram_values), dataBytes);
// }
#endif
*
*/
return result;
}
@ -1411,9 +1409,12 @@ ROI *setROI(int nroi,ROI* arg,int *retvalsize, int *ret) {
int loadImage(int index, short int ImageVals[]){
#ifdef JUNGFRAU_DHANYA
cprintf(RED,"loadImage Not implemented for Jungfrau yet\n"); //compiler warnings on 1st argument of memcpy(ptr,ImageVals ,dataBytes);
#else
index;
Imagevals;
printf("loadImage Not implemented yet\n");
/*
u_int32_t address;
switch (index) {
case DARK_IMAGE :
@ -1434,7 +1435,8 @@ int loadImage(int index, short int ImageVals[]){
#ifdef VERBOSE
printf("\nLoaded x%08x address with image of index %d\n",(unsigned int)(ptr),index);
#endif
#endif
*/
return OK;
}
@ -1717,11 +1719,7 @@ ip.ip_destip = destip;
bus_w(RX_UDPMACL_AREG,(destmac)&0xFFFFFFFF);//rx_udpmacL_AReg_c
bus_w(DETECTORMACH_AREG,(sourcemac>>32)&0xFFFFFFFF);//detectormacH_AReg_c
bus_w(DETECTORMACL_AREG,(sourcemac)&0xFFFFFFFF);//detectormacL_AReg_c
#ifdef JUNGFRAU_DHANYA
bus_w(UDPPORTS_AREG,((sourceport&0xFFFF)<<16)+(destport&0xFFFF));//udpports_AReg_c
#else
bus_w(UDPPORTS_AREG,((destport&0xFFFF)<<16)+(sourceport&0xFFFF));//udpports_AReg_c
#endif
bus_w(IPCHKSUM_AREG,(checksum&0xFFFF));//ipchksum_AReg_c
bus_w(CONTROL_REG,GB10_RESET_BIT);
@ -2579,11 +2577,9 @@ int prepareADC(){
bus_w(ADC_OFFSET_REG,0xbbbbbbbb);
// bus_w(ADC_INVERSION_REG,0x1f6170c6);
#ifndef JUNGFRAU_DHANYA
return;
#else
return OK;
#endif
}

View File

@ -69,9 +69,8 @@ int setContinousReadOut(int d);
int startReceiver(int d);
int setDACRegister(int idac, int val, int imod);
#ifdef JUNGFRAU_DHANYA
int getDacRegister(int dacnum);
#endif
int getTemperature(int tempSensor,int imod);
int initHighVoltage(int val,int imod);
@ -85,9 +84,8 @@ int getAdcConfigured();
u_int64_t getDetectorNumber();
u_int32_t getFirmwareVersion();
#ifdef JUNGFRAU_DHANYA
u_int32_t getFirmwareSVNVersion();
#endif
int testFifos(void);
u_int32_t testFpga(void);
u_int32_t testRAM(void);
@ -150,16 +148,15 @@ int setDynamicRange(int dr);
int getDynamicRange();
int getNModBoard();
int setNMod(int n);
#ifdef JUNGFRAU_DHANYA
int getNMod();
#endif
int setStoreInRAM(int b);
int allocateRAM();
#ifdef JUNGFRAU_DHANYA
int writeADC(int addr, int val);
int prepareADC();
#endif
int clearRAM();

View File

@ -110,9 +110,9 @@ int selMod(int mod,int imod );
/* int getThresholdEnergy(); */
/* int setThresholdEnergy(int ethr); */
#ifdef JUNGFRAU_DHANYA
int setSettings(int i,int imod);
#endif
/* Other DAC index routines*/
int getTemperatureByModule(int tempSensor, int imod);

View File

@ -26,15 +26,16 @@
#define ADCREG3 0x4
#define ADCREG4 0x5
#define ADCREG_VREFS 0x18
#define ADC_INVERSION_REG 0x43<<11
#define ADC_PIPELINE_REG 0x42<<11
#define ADC_PIPELINE_REG 0x42<<11 // adc_offset_reg
#define DBIT_PIPELINE_REG 0x59<<11
#define MEM_MACHINE_FIFOS_REG 0x4f<<11
#define CONFGAIN_REG 0x5d<<11 /** was actually GAIN_REG which seems to be set to 0 later in this file*/
#else
#define ADC_INVERSION_REG 67<<11 /** picked up from after ADC_OFFSET_REG*/
#endif
#define ADC_INVERSION_REG 67<<11 /** picked up from after ADC_OFFSET_REG*/
/* constant FPGAVersionReg_c : integer:= 0; */
/* constant FixedPatternReg_c : integer:= 1; */

View File

@ -69,9 +69,6 @@ int set_dynamic_range(int);
int set_roi(int);
int get_roi(int);
int set_speed(int);
#ifndef JUNGFRAU_DHANYA
void prepareADC(void);
#endif
int set_readout_flags(int);
int execute_trimming(int);
int lock_server(int);