fp=(structinterframe_params_t*)&circbuf_priv[chn].buf_ptr[X393_BUFFSUB32(p,8,chn)];// 32 bytes before the frame pointer, may roll-over to the end of ccam_dma_buf
if((orig!=SEEK_END)&&(file->f_pos==CCAM_DMA_SIZE))file->f_pos=0;// only for lseek(fd,0,SEEK_END) the result will be file size, others will roll to 0
if((orig!=SEEK_END)&&(file->f_pos==circbuf_priv[chn].buf_size))file->f_pos=0;// only for lseek(fd,0,SEEK_END) the result will be file size, others will roll to 0
#define FRAMEPARS_DRIVER_DESCRIPTION "Elphel (R) Model 393 Frame Parameters device driver"
#define FRAMEPARS_DRIVER_DESCRIPTION "Elphel (R) Model 393 Frame Parameters device driver"
staticinthardware_initialized=0;
/* 393: sFrameParsAll is an array of 4per-port structures */
/* 393: sFrameParsAll is an array of 4per-port structures */
staticstructframepars_all_tsFrameParsAll[SENSOR_PORTS]__attribute__((aligned(PAGE_SIZE)));///< Sensor Parameters, currently 16 pages all and 2048 pages some, static struct
staticstructframepars_all_tsFrameParsAll[SENSOR_PORTS]__attribute__((aligned(PAGE_SIZE)));///< Sensor Parameters, currently 16 pages all and 2048 pages some, static struct
unsignedintframeParsInitialized[SENSOR_PORTS];// set to 0 at startup, 1 after initialization that is triggered by setParsAtomic()
unsignedintframeParsInitialized[SENSOR_PORTS];// set to 0 at startup, 1 after initialization that is triggered by setParsAtomic()
///TODO: init framepars (zero parameters) before initscripts (not when detecting the sensors) - then initscript will be able to overwrite some
///TODO: init framepars (zero parameters) before initscripts (not when detecting the sensors) - then initscript will be able to overwrite some
voidinit_framepars_ptr(intsensor_port);
voidinit_framepars_ptr(intsensor_port);
voidinitSequencers(intsensor_port);///Move to sensorcommon? currently it is used through frameparsall file (lseek)
intinitSequencers(intsensor_port);///Move to sensorcommon? currently it is used through frameparsall file (lseek)
voidinitGlobalPars(intsensor_port);/// resets all global parameters but debug mask (if ELPHEL_DEBUG)
voidinitGlobalPars(intsensor_port);/// resets all global parameters but debug mask (if ELPHEL_DEBUG)
intinitMultiPars(intsensor_port);/// initialize structures for individual per-sensor parameters. Now only works for sensor registers using G_MULTI_REGSM. Should be called aftre/during sensor detection
intinitMultiPars(intsensor_port);/// initialize structures for individual per-sensor parameters. Now only works for sensor registers using G_MULTI_REGSM. Should be called aftre/during sensor detection
voidinitFramePars(intsensor_port);///initialize all parameters, set thisFrameNumber to frame8 (read from hardware, usually 0 after resetting i2c and cmd_seq)
voidinitFramePars(intsensor_port);///initialize all parameters, set thisFrameNumber to frame8 (read from hardware, usually 0 after resetting i2c and cmd_seq)
//#define DEV393_EXIF_TIME ("exif_time", "exif_elphel", 125, 4, "0666", "c") ///< write today/tomorrow date (YYYY:MM:DD) and number of seconds at today/tomorrow