108
108
GET_REG(firmware_version_reg, value);
110
case IPECAMERA_FIRMWARE_UFO5:
111
111
ctx->firmware = value;
112
112
err = pcilib_add_registers(pcilib, 0, cmosis_registers);
114
case IPECAMERA_FIRMWARE_CMOSIS20:
115
115
ctx->firmware = value;
116
116
err = pcilib_add_registers(pcilib, 0, cmosis20000_registers);
119
ctx->firmware = IPECAMERA_FIRMWARE_UNKNOWN;
120
120
pcilib_warning("Unsupported version of firmware (%lu)", value);
294
294
ctx->buffer_pos = 0;
295
295
ctx->parse_data = (flags&PCILIB_EVENT_FLAG_RAW_DATA_ONLY)?0:1;
296
296
ctx->cur_size = 0;
298
ctx->dim.width = IPECAMERA_WIDTH;
299
ctx->dim.height = IPECAMERA_MAX_LINES;
300
// GET_REG(n_lines_reg, ctx->dim.height);
302
GET_REG(output_mode_reg, value);
304
case IPECAMERA_MODE_16_CHAN_IO:
305
ctx->cmosis_outputs = 16;
307
case IPECAMERA_MODE_4_CHAN_IO:
308
ctx->cmosis_outputs = 4;
298
switch (ctx->firmware) {
299
case IPECAMERA_FIRMWARE_UFO5:
300
ctx->dim.width = CMOSIS_WIDTH;
301
ctx->dim.height = CMOSIS_MAX_LINES;
303
case IPECAMERA_FIRMWARE_CMOSIS20:
304
ctx->dim.width = CMOSIS20_WIDTH;
305
ctx->dim.height = CMOSIS20_MAX_LINES;
306
ctx->cmosis_outputs = CMOSIS20_MAX_CHANNELS;
311
pcilib_error("IPECamera reporting invalid output_mode 0x%lx", value);
312
return PCILIB_ERROR_INVALID_STATE;
315
ipecamera_compute_buffer_size(ctx, ctx->dim.height);
309
pcilib_error("Can't start undefined version (%lu) of IPECamera", ctx->firmware);
310
return PCILIB_ERROR_INVALID_REQUEST;
313
if (ctx->firmware == IPECAMERA_FIRMWARE_UFO5) {
314
GET_REG(output_mode_reg, value);
316
case IPECAMERA_MODE_16_CHAN_IO:
317
ctx->cmosis_outputs = 16;
319
case IPECAMERA_MODE_4_CHAN_IO:
320
ctx->cmosis_outputs = 4;
323
pcilib_error("IPECamera reporting invalid output_mode 0x%lx", value);
324
return PCILIB_ERROR_INVALID_STATE;
328
// We should be careful here (currently firmware matches format, but this may not be the case in future)
329
ipecamera_compute_buffer_size(ctx, ctx->firmware, CMOSIS_FRAME_HEADER_SIZE, ctx->dim.height);
317
331
ctx->raw_size = ctx->roi_raw_size;
318
332
ctx->padded_size = ctx->roi_padded_size;
628
642
return PCILIB_ERROR_BUSY;
631
GET_REG(control_reg, value);
645
GET_REG(control_reg, value);
632
646
SET_REG(control_reg, value|IPECAMERA_FRAME_REQUEST);
633
647
usleep(IPECAMERA_TRIGGER_DELAY);
634
648
SET_REG(control_reg, value);