Skip to content

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

VD1943 Image Sensor Driver

Low-level driver for the ST VD1943 global-shutter image sensor family.

This driver is an implementation of the img-sensor low-level API (ll_img_sensor.h).

Supported Sensors

Part number Variant
VD5943 Monochrome
VD1943 RGB-NIR

The optical revision (CFA) is auto-detected by the driver.

Supported Features

  • Resolution: Native 2564×1984 (or any sub-selection)
  • Pixel Depth: 8, 10 or 12 bits per pixel (config dependent)
  • Shutter: Global Shutter or Rolling Shutter, selectable per stream
  • Timing: Configurable line length and frame length
  • Exposure & gain: Manual exposure with analog and digital gains
  • Orientation Control: Horizontal and Vertical flip
  • MIPI tuning: Configurable inter-packet delay

Streams

The driver exposes the following streams:

Stream Type Description
IMG LL_IMG_SENSOR_STREAM_TYPE_IMG Image data
ISL LL_IMG_SENSOR_STREAM_TYPE_ISL Intelligent Status Line — embedded sensor metadata

The histogram stream is reserved for a future implementation.

Up to 4 concurrent contexts (ROI A/B/C/D) are supported through the on-chip context-switch sequencer.

Dependencies

  • mcu-img-sensor — Image sensor abstraction layer (img_sensor.h, ll_img_sensor.h, img_sensor_type.h)

Quickstart

#include "img_sensor.h"
#include "img_sensor_type.h"
#include "interface_device_is.h"
#include "vd1943.h"

extern I2C_HandleTypeDef hi2c1;

// Caller-allocated contexts (no malloc in the driver)
ll_img_sensor_vd1943_ctx_t vd1943_ll_ctx;
img_sensor_ctx_t vd1943;
img_sensor_hw_config_t vd1943_hw_config;
img_sensor_io_t io_ctrl;

// Wire the VD1943 vtable
vd1943_new(&vd1943, &vd1943_ll_ctx);

// Assign IO functions (provided by the platform)
io_ctrl = (img_sensor_io_t){
    .control_pin = interface_device_control_pin,
    .read = interface_device_read,
    .write = interface_device_write,
    .delay = interface_device_delay,
};

// VD1943 hardware configuration
vd1943_hw_config = (img_sensor_hw_config_t){
    .comm.i2c.address = 0x20,
    .comm.i2c.address_size = 2,
    .comm.bus = BUS_TYPE_I2C,
    .comm.bus_handler = &hi2c1,
    .ext_clock = 25000000U,
    .mipi = {
        .lane_count = 2,
        .clock_lane = { .phys_id = 0, .swap_polarity = true },
        .data_lanes = {
            { .phys_id = 1, .swap_polarity = true },
            { .phys_id = 2, .swap_polarity = true },
        },
        .bitrate = 2400000000,
    },
};

// Initialise
img_sensor_init(&vd1943, &vd1943_hw_config, &io_ctrl);

// Configure: ROI, frame rate and manual exposure / gains
img_sensor_set_frame_size(&vd1943, 2400, 1440);
img_sensor_set_frame_rate(&vd1943, 30.0f);
img_sensor_set_exposure_gain(&vd1943, 3.0f, 1.0f, 5000, IMG_SENSOR_EXPOSURE_MODE_MANUAL);

// Start streaming
img_sensor_start(&vd1943);

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages