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).
| Part number | Variant |
|---|---|
| VD5943 | Monochrome |
| VD1943 | RGB-NIR |
The optical revision (CFA) is auto-detected by the driver.
- 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
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.
- mcu-img-sensor — Image sensor abstraction layer (
img_sensor.h,ll_img_sensor.h,img_sensor_type.h)
#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);