diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-07-24 23:15:47 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-07-24 23:15:47 +0200 |
commit | 94051a28c0cd484e47b115f4251fa42d0edba7e5 (patch) | |
tree | 318dcfac5f232058e3a019018301abbed23eeae7 /ipecamera/ipecamera.c | |
parent | 587863fb5bc46f225c3b192ca4c2f63e0be8613b (diff) | |
download | ipecamera-94051a28c0cd484e47b115f4251fa42d0edba7e5.tar.gz ipecamera-94051a28c0cd484e47b115f4251fa42d0edba7e5.tar.bz2 ipecamera-94051a28c0cd484e47b115f4251fa42d0edba7e5.tar.xz ipecamera-94051a28c0cd484e47b115f4251fa42d0edba7e5.zip |
Support 12-bit modes
Diffstat (limited to 'ipecamera/ipecamera.c')
-rw-r--r-- | ipecamera/ipecamera.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ipecamera/ipecamera.c b/ipecamera/ipecamera.c index 9b7482a..4ed2c5f 100644 --- a/ipecamera/ipecamera.c +++ b/ipecamera/ipecamera.c @@ -102,6 +102,9 @@ pcilib_context_t *ipecamera_init(pcilib_t *pcilib) { FIND_REG(line_reg, "cmosis", "start1"); FIND_REG(exposure_reg, "cmosis", "exp_time"); FIND_REG(flip_reg, "cmosis", "image_flipping"); + + FIND_REG(adc_resolution_reg, "fpga", "adc_resolution"); + FIND_REG(output_mode_reg, "fpga", "output_mode"); ctx->rdma = PCILIB_DMA_ENGINE_INVALID; ctx->wdma = PCILIB_DMA_ENGINE_INVALID; @@ -272,6 +275,19 @@ int ipecamera_start(pcilib_context_t *vctx, pcilib_event_t event_mask, pcilib_ev ctx->dim.width = IPECAMERA_WIDTH; GET_REG(n_lines_reg, ctx->dim.height); + GET_REG(output_mode_reg, value); + switch (value) { + case IPECAMERA_MODE_16_CHAN_IO: + ctx->cmosis_outputs = 16; + break; + case IPECAMERA_MODE_4_CHAN_IO: + ctx->cmosis_outputs = 4; + break; + default: + pcilib_error("IPECamera reporting invalid output_mode 0x%lx", value); + return PCILIB_ERROR_INVALID_STATE; + } + ipecamera_compute_buffer_size(ctx, ctx->dim.height); ctx->raw_size = ctx->cur_raw_size; |