voidgamma_encode_fpga(unsignedshort*gamma_in,unsignedlong*gamma_out);///Hardware-dependent encoding of the FPGA "gamma" table. Converts unsigned short array of 257 16-bit values (only 10 msb-s are used) to 256 unsigned long words to be written to FPGA
voidgamma_encode_fpga(unsignedshort*gamma_in,unsignedlong*gamma_out);///Hardware-dependent encoding of the FPGA "gamma" table. Converts unsigned short array of 257 16-bit values (only 10 msb-s are used) to 256 unsigned long words to be written to FPGA
// #define GAMMA_MODE_HARDWARE 4 // the table is needed to program FPGA: fpga-encoded table will be calculated (if not yet), node will be locked for specified
// #define GAMMA_MODE_HARDWARE 4 // the table is needed to program FPGA: fpga-encoded table will be calculated (if not yet), node will be locked for specified
/// first three letters - sentence to log (letters after "$GP"). next "n"/"b" (up to 24 total) - "n" number (will be encoded 4 digits/byte, follwed by "0xF"
/// "b" - byte - all but last will have MSB 0 (& 0x7f), the last one - with MSB set (| 0x80). If there are no characters in the field 0xff will be output
//printk("imu opened in R/W mode, (numBytesWritten=0x%x, numBytesRead=0x%x\n", numBytesWritten, numBytesRead);
}else{// read mode, use file pointer as read pointer, start from the latest data
filp->f_pos=numBytesWritten;// there is still a chance to lseek to an earlier position - reopening at the position of the total number of bytes written to the buffer
//printk("imu opened in RDONLY mode, (numBytesWritten=0x%x, numBytesRead=0x%x\n", numBytesWritten, numBytesRead);
}
}
break;
}
default:return-EINVAL;
}
// minors[p]=p;
// filp->private_data = &minors[p];
filp->private_data=(int*)p;// store just minor there
printk(KERN_NOTICE"Closing IMU device, numBytesWritten=0x%llx, numBytesRead=0x%llx (only global pointer, does not include files opened in read mode)\n",numBytesWritten,numBytesRead);
// if(d[2] == 0x01) - MT9T001 chip rev 01 - color gains had a bug
// if(d[2] == 0x01) - MT9T001 chip rev 01 - color gains had a bug
...
@@ -785,7 +785,7 @@ int mt9x001_pgm_detectsensor (int sensor_port, ///< sensor port
...
@@ -785,7 +785,7 @@ int mt9x001_pgm_detectsensor (int sensor_port, ///< sensor port
add_sensor_proc(onchange_triggermode,&mt9x001_pgm_triggermode);// program sensor trigger mode
add_sensor_proc(onchange_triggermode,&mt9x001_pgm_triggermode);// program sensor trigger mode
add_sensor_proc(onchange_sensorregs,&mt9x001_pgm_sensorregs);// write sensor registers (only changed from outside the driver as they may have different latencies)?
add_sensor_proc(onchange_sensorregs,&mt9x001_pgm_sensorregs);// write sensor registers (only changed from outside the driver as they may have different latencies)?
if(nupdate)setFramePars(sensor_port,thispars,nupdate,pars_to_update);// save changes to sensor register shadows
if(nupdate)setFramePars(sensor_port,thispars,nupdate,pars_to_update);// save changes to sensor register shadows
return-1;
return-1;
}
}
#endif
rslt=multisensor_set_freq(1,thispars);// first time (1)
rslt=multisensor_set_freq(sensor_port,1,thispars);// first time (1)
if(rslt>0)printk("10359A sensor clock set to %d\n",rslt);
if(rslt>0)printk("10359A sensor clock set to %d\n",rslt);
elseif(rslt==0)printk("10359A sensors are using 10353 system clock, as set in configuration\n");
elseif(rslt==0)printk("10359A sensors are using 10353 system clock, as set in configuration\n");
elseprintk("10359 sensor clock failure, will use system clock from 10353 board\n");
elseprintk("10359 sensor clock failure, will use system clock from 10353 board\n");
...
@@ -1031,21 +1039,21 @@ int multisensor_pgm_detectsensor (int sensor_port, ///< sensor p
...
@@ -1031,21 +1039,21 @@ int multisensor_pgm_detectsensor (int sensor_port, ///< sensor p
GLOBALPARS(sensor_port,G_SENS_AVAIL)&=(1<<(GLOBALPARS(sensor_port,G_SENS_AVAIL)))-1;// remove flag used to indicate sensor detection functions that they need to initialize multisesnor registers
GLOBALPARS(sensor_port,G_SENS_AVAIL)&=(1<<(GLOBALPARS(sensor_port,G_SENS_AVAIL)))-1;// remove flag used to indicate sensor detection functions that they need to initialize multisesnor registers
if(GLOBALPARS(sensor_port,G_SENS_AVAIL)==0){
if(GLOBALPARS(sensor_port,G_SENS_AVAIL)==0){
printk("No supported sensors connected to 10359A board\n");
printk("No supported sensors connected to 10359A board\n");
printk("%s:%d:%s ",__FILE__,__LINE__,__FUNCTION__);printk("WARNING: ((thispars->pars[P_CLK_SENSOR] == prevpars->pars[P_CLK_SENSOR])) but multi_phases_initialized is not yet set (re-init?)\n");
printk("%s:%d:%s ",__FILE__,__LINE__,__FUNCTION__);printk("WARNING: ((thispars->pars[P_CLK_SENSOR] == prevpars->pars[P_CLK_SENSOR])) but multi_phases_initialized is not yet set (re-init?)\n");
}
}
multisensor_set_freq(0,thispars);// not the first time. Assuming no clock chip if clock4 is not set
multisensor_set_freq(sensor_port,0,thispars);// not the first time. Assuming no clock chip if clock4 is not set
reset=1;
reset=1;
// TODO: put here calculation of the sensor phases in 10359 from bitstream data and clock rate
// TODO: put here calculation of the sensor phases in 10359 from bitstream data and clock rate
clk_period=1000000000000.0/thispars->pars[P_CLK_SENSOR];// period in ps
// clk_period= 1000000000000.0f/thispars->pars[P_CLK_SENSOR]; // period in ps