/alps/ipecamera

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to base.c

  • Committer: Suren A. Chilingaryan
  • Date: 2017-08-16 20:41:23 UTC
  • Revision ID: csa@suren.me-20170816204123-rahgc2euzxhrc4op
Support HighFlex-based ipecamera

Show diffs side-by-side

added added

removed removed

Lines of Context:
290
290
        pcilib_warning("Reset procedure is not implemented");
291
291
    }
292
292
 
293
 
        // Set default parameters
294
 
    err = pcilib_write_register_by_id(pcilib, control, IPECAMERA_IDLE);
295
 
    if (err) {
296
 
        UNLOCK(run);
297
 
        pcilib_error("Error bringing FPGA in default mode");
298
 
        return err;
299
 
    }
300
 
 
301
293
    usleep(10000);
302
294
 
303
295
 
362
354
     case IPECAMERA_FIRMWARE_UFO5:
363
355
        ctx->dim.width = CMOSIS_WIDTH;
364
356
        ctx->dim.height = CMOSIS_MAX_LINES;
 
357
 
 
358
        ctx->data_line_size = (1 + CMOSIS_PIXELS_PER_CHANNEL) * 32; 
365
359
        break;
366
360
     case IPECAMERA_FIRMWARE_CMOSIS20:
367
361
        ctx->dim.width = CMOSIS20_WIDTH;
368
362
        ctx->dim.height = CMOSIS20_MAX_LINES;
369
 
        ctx->cmosis_outputs = CMOSIS20_MAX_CHANNELS;
 
363
 
 
364
        ctx->data_line_size = (2 + CMOSIS20_PIXELS_PER_CHANNEL) * 32;
370
365
        break;
371
366
     default:
372
367
        UNLOCK(run);
374
369
        return PCILIB_ERROR_INVALID_REQUEST;
375
370
    }
376
371
 
377
 
    if (ctx->firmware == IPECAMERA_FIRMWARE_UFO5) {
 
372
    if ((1)||(ctx->firmware == IPECAMERA_FIRMWARE_UFO5)) {
378
373
        GET_REG(output_mode_reg, value);
379
374
        switch (value) {
380
375
         case IPECAMERA_MODE_16_CHAN_IO:
388
383
            pcilib_error("IPECamera reporting invalid output_mode 0x%lx", value);
389
384
            return PCILIB_ERROR_INVALID_STATE;
390
385
        }
391
 
    }
 
386
    } 
392
387
 
393
388
        // We should be careful here (currently firmware matches format, but this may not be the case in future)
394
389
    ipecamera_compute_buffer_size(ctx, ctx->firmware, CMOSIS_FRAME_HEADER_SIZE, ctx->dim.height);