constunsignedshortboson640_ahead_tab[]=// copied from mt9x001
{/// function ASAP C,S C,NS, A,S A,NS NOL
onchange_recalcseq,0,0,0,0,0,0,/// recalculate sequences/latencies, according to P_SKIP, P_TRIG
onchange_detectsensor,1,0,0,0,0,0,/// detect sensor type, sets sensor structure (capabilities), function pointers
onchange_sensorphase,1,0,0,0,0,0,/// program sensor clock/phase (do immediately)
onchange_i2c,0,0,0,0,0,0,/// program i2c
onchange_initsensor,1,0,0,0,0,0,/// resets sensor, reads sensor registers, schedules "secret" manufacturer's corrections to the registers (stops/re-enables hardware i2c)
onchange_afterinit,0,0,0,0,0,0,/// restore image size, decimation,... after sensor reset or set them according to sensor capabilities if none were specified
onchange_multisens,0,2,1,1,1,0,/// chnages related to multiplexed sensors
onchange_window,0,2,1,1,1,0,/// program sensor WOI and mirroring (flipping) - NOTE: 1 bad frame to skip
onchange_window_safe,0,1,1,1,1,0,/// program sensor WOI and mirroring (flipping) - NOTE: no bad frames
onchange_exposure,0,2,1,1,1,0,/// program exposure
onchange_gains,0,1,1,1,1,0,/// program analog gains
onchange_triggermode,0,2,1,1,1,0,/// program sensor trigger mode TODO: does it have any sense here?
onchange_sensorin,0,0,0,0,0,0,/// program sensor input in FPGA (Bayer, 8/16 bits, ??), stop sensor (if needed)
onchange_sensorstop,0,0,0,0,0,0,/// Stop acquisition from the sensor to the FPGA (start has latency of 2)
onchange_sensorrun,0,1,1,1,1,0,/// Start/single acquisition from the sensor to the FPGA (stop has latency of 1)
onchange_gamma,0,1,1,1,1,0,/// program gamma table - make sure table is calculated, maybe send all but last word)
onchange_hist,0,0,0,0,0,0,/// program histogram window TODO: fix FPGA - (now pos_top will be read too early - will use previous ) and add latency
onchange_aexp,0,0,0,0,0,0,/// program autoexposure mode TODO: look what exactly is changed here
onchange_quality,0,0,0,0,0,0,/// program quantization table(s)
onchange_memsensor,0,0,0,0,0,0,/// program memory channels 0 (sensor->memory) and 1 (memory->FPN)
onchange_memcompressor,0,0,0,0,0,0,/// program memory channel 2 (memory->compressor) (delays programming until onchange_comprestart if needed)
/// For Micron sensors limitfps should have the same latency as changing window height, otherwise when WOI_HEIGHT 0x3c0->0x790 and next frame VBLANK 0x13e->0x284
/// sensor waits till the counter overflows (>10 seconds) without any frame sync pulses
onchange_limitfps,0,2,1,1,1,0,/// check compressor will keep up, limit sensor FPS if needed
onchange_compmode,0,0,0,0,0,0,/// program compressor modes
onchange_focusmode,1,0,0,0,0,0,/// program focus modes (through writing the tables, so no sequencer)
onchange_trigseq,0,2,1,1,1,0,/// NC393: OK to program through the sequencer (full 32 bits)
onchange_irq,0,0,0,0,0,0,/// program smart IRQ mode
onchange_comprestart,0,0,0,0,0,0,/// restart after changing geometry (recognizes ASAP and programs memory channel 2 then)
// onchange_compstop should have the same latency as onchange_window
dev_dbg(g_dev_ptr,"{%d} copied %d bytes of sensor static parameters\n",sensor_port,sizeof(boson640));
add_sensor_proc(sensor_port,onchange_detectsensor,&boson640_pgm_detectsensor);// detect sensor type, sets sensor structure (capabilities), function pointers NOTE: will be called directly, not through pointers
add_sensor_proc(sensor_port,onchange_initsensor,&boson640_pgm_initsensor);// resets sensor, reads sensor registers, schedules "secret" manufacturer's corrections to the registers (stops/re-enables hardware i2c)
add_sensor_proc(sensor_port,onchange_sensorin,&boson640_pgm_sensorin);// see mt9f002
add_sensor_proc(sensor_port,onchange_exposure,&boson640_pgm_exposure);// program exposure
add_sensor_proc(sensor_port,onchange_window,&boson640_pgm_window);// program sensor WOI and mirroring (flipping)
add_sensor_proc(sensor_port,onchange_window_safe,&boson640_pgm_window_safe);// program sensor WOI and mirroring (flipping) - now - only flipping? with lower latency
add_sensor_proc(sensor_port,onchange_limitfps,&boson640_pgm_limitfps);// check compressor will keep up, limit sensor FPS if needed
add_sensor_proc(sensor_port,onchange_gains,&boson640_pgm_gains);// program analog gains
add_sensor_proc(sensor_port,onchange_triggermode,&boson640_pgm_triggermode);// program sensor trigger mode
add_sensor_proc(sensor_port,onchange_sensorregs,&boson640_pgm_sensorregs);// write sensor registers (only changed from outside the driver as they may have different latencies)?
setFramePar(sensor_port,thispars,P_SENSOR,sensor->sensorType);// should cause other actions - delay for Boson?
if(nupdate)setFramePars(sensor_port,thispars,nupdate,pars_to_update);// save changes to sensor register shadows
return0;
}
/** Check if compressor can keep up, limit sensor FPS if needed
* FPS is limited by increasing verical blanking, it can not be be made too big, so this method does not work to make time lapse rate. horisontal blanking
* is kept at minimum (to reduce ERS effect) if not specified. If it is specified (>minimal) - it will be used instead.
* calculate line period.
*
* FIXME - uses P_VIRTUAL_WIDTH w/o decreasing it when changing image size? Replace VIRT_WIDTH with HOR_BANK?
* Or require always set them to zero when chnaging WOI?
* FIXME for multisensor - needs per-sensor individual parameters. This uses sensor registers, not the general parameters (i.e. height) */
intboson640_pgm_limitfps(intsensor_port,///< sensor port number (0..3)
#define P_BOSON_TELEMETRY 23 ///< Set the telemetry state to Enabled or Disabled
#define P_BOSON_TELEMETRY_LOCATION 24 ///< Set the telemetry to before(top) or after(bottom) the image
#define P_BOSON_TELEMETRY_PACKING 25 ///< Sets the type of packing that the telemetry data is preseneted - 16 Bit, Color or 8 -Bit
#define P_BOSON_BOSON_RUN_FFC 26 ///< Performs an FFC operation *** No matching read !! ***
#define P_BOSON_BOSON_SET_FFC_TEMP 27 ///< Sets the temperature threshold (in degC*10) for the FFC desired flag
#define P_BOSON_BOSON_SET_FFC_FRAME 28 ///< Sets the time threshold (in seconds) for the FFC desired flag
#define P_BOSON_BOSON_FFC_MODE 29 ///< Sets the mode of the camera's FFC operation (0 - manual, 1 - auto, 2 - external, 3- shutter test...)
#define P_BOSON_BOSON_GAIN_MODE 30 ///< Sets the mode of the camera's temperature compensation operation (0 - high, 1 - low, 2 - auto, ...)
#define P_BOSON_BOSON_FFC_WARN_TIME 31 ///< Sets the amount of time in 10ths of a second before the occurrence of FFC that the warn time symbol ...
#define P_BOSON_BOSON_OVER_TEMP_TIME 32 ///< Sets the time is seconds that we want to wait before setting the camera in low power state after an overTemp event
#define P_BOSON_BOSON_FFC_QUICK_TIME 33 ///< Sets the number of seconds after startup that FFC trigger params are 'reduced' to produce FFC events more often
#define P_BOSON_BOSON_EXT_SYNC_MODE 34 ///< Set the external sync mode for the camera
#define P_BOSON_DVO_DISPLAY_MODE 35 ///< Sets the display mode to continuous (0) or one shot (1)
#define P_BOSON_SCNR_TH_COL_SUM 37 ///< Set the threshold that determines if a column should increment or decrement by 1
#define P_BOSON_SCNR_TH_PIXEL 38 ///< Set the (base) threshold that determines if a neighboring pixel is within range to affect the correction of the center
#define P_BOSON_SCNR_MAX_CORR 39 ///< Set the (base) maximum correction amount that will be applied
#define P_BOSON_SCNR_TH_PIXEL_SAFE 40 ///< Set the (base) threshold (for Safe Mode) that determines if a neighboring pixel is within range to correct the center
#define P_BOSON_SCNR_MAX_CORR_SAFE 41 ///< Set the (base) maximum correction amount (for Safe Mode) that will be applied
#define P_BOSON_TF_DELTA_NF 43 ///< Sets the Delta NF value. The delta_nf modifies the filter behavior by scaling the index into the table of weights
#define P_BOSON_TF_TH_DELTA_MOTION 44 ///< Sets the Delta Motion threshold to determine if there was motion in the scene enough to trigger the SPNR algorithm
#define P_BOSON_TF_MOTION_THRESHOLD 45 ///< Sets the motion detection threshold - the number of pixels in a frame moved to trigger SPNR execution