Commit 4f937f92 authored by Andrey Filippov's avatar Andrey Filippov

merged with framepars - added re-trigger mode

parents b83755b7 6e54d11c
......@@ -1628,6 +1628,7 @@ loff_t framepars_lseek(struct file * file, loff_t offset, int orig)
break;
case LSEEK_DMA_INIT: // initialize ETRAX DMA (normally done in sensor_common.c at driver init
dev_dbg(g_devfp_ptr, "LSEEK_DMA_INIT\n");
trigger_restart (); // LSEEK_DMA_INIT is unused
//x313_dma_init();
break;
case LSEEK_DMA_STOP: // stop DMA
......
......@@ -365,6 +365,11 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number (
///< @return OK - 0, <0 - error
{
x393_camsync_mode_t camsync_mode = {.d32=0};
x393_camsync_io_t camsync_src = {.d32=0x55555}; // all disabled (use internal)
x393_camsync_io_t camsync_dst = {.d32=0x55555}; // all disable - nothing to output
// Setting trigger input, output and preriod to off
int was_sensor_freq = 0; // 90000000; // getClockFreq(1);
int qperiod;
int i2cbytes;
......@@ -411,6 +416,14 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number (
// camsync_mode.ext_set = 1;
x393_camsync_mode (camsync_mode);
// Set inactive state to all I/O) and period:
x393_camsync_trig_src(camsync_src);
x393_camsync_trig_dst(camsync_dst);
set_x393_camsync_trig_period(0);
// dev_dbg(g_dev_ptr,"trying MT9P001\n");
// mt9x001_pgm_detectsensor(sensor_port, sensor, thispars, prevpars, frame16); // try Micron 5.0 Mpixel - should return sensor type
......
......@@ -996,6 +996,18 @@ void sensor_interrupts (int on, ///< 0 -interrupt disable, 1 - interrupt enabl
x393_cmdframeseq_ctrl(cmdframeseq_mode, chn);
}
/** Recover from waiting trigger - internal FPGA or external by re-writing current period to the register in immediate mode
* If the period was 0 (stopped), use 1 (single) */
void trigger_restart(void)
{
u32 period = get_x393_camsync_trig_period();
if (!period) period = 1;
set_x393_camsync_trig_period(period);
dev_dbg(g_dev_ptr, "Reset trigger period in immediate mode = %d (0x%x)\n", (int) period, (int) period);
}
int sequencer_stop_run_reset(int chn, ///< Sensor port
int cmd) ///< Command: SEQ_CMD_STOP=0 - stop, SEQ_CMD_RUN=1 - run, SEQ_CMD_RESET=2 - reset
///< @return always 0
......
......@@ -52,6 +52,8 @@ int init_compressor_dma(int chn_mask, int reset);
void reset_compressor(unsigned int chn);
void compressor_interrupts (int on, int chn);
void sensor_interrupts (int on, int chn);
void trigger_restart (void);
int sequencer_stop_run_reset(int chn, int cmd);
struct sensorproc_t * copy_sensorproc (int sensor_port, struct sensorproc_t * copy);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment