Low-level driver for the ST VD56G3 global-shutter image sensor family.
This driver is an implementation of the img-sensor low-level
API (ll_img_sensor.h).
| Part number | Variant |
|---|---|
| VD56G3 | Monochrome |
| VD66GY | Bayer GRBG |
| VD16GZ | RGB-NIR |
The optical revision is auto-detected by the driver.
- Resolution: Native 1120×1364 (or any sub-selection)
- Pixel Depth: 8 or 10 bits per pixel
- Timing: Configurable frame rate (up to 88fps at native resolution)
- Exposure & gain: Auto exposure or Manual exposure and gains (analog and digital)
- Orientation Control: Horizontal and Vertical flip
- Optical-Flow: On-chip motion vector generation with configurable parameters
The driver exposes 3 concurrent 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 |
| OF | LL_IMG_SENSOR_STREAM_TYPE_OF |
On-chip optical-flow (motion vectors) |
- 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 "vd56g3.h"
extern I2C_HandleTypeDef hi2c1;
// Caller-allocated contexts (no malloc in the driver)
static img_sensor_ctx_t vd56g3;
static ll_img_sensor_vd56g3_ctx_t vd56g3_data;
// Wire the VD56G3 vtable
vd56g3_new(&vd56g3, &vd56g3_data);
// Initialise
img_sensor_hw_config_t hw_config = {
.comm.i2c.address = 0x20,
.comm.i2c.address_size = 2,
.comm.bus = BUS_TYPE_I2C,
.comm.bus_handler = &hi2c1,
.ext_clock = 12000000U,
.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 = 1608000000
},
};
img_sensor_io_t io = {
.control_pin = interface_device_control_pin,
.read = interface_device_read,
.write = interface_device_write,
.delay = interface_device_delay,
};
img_sensor_init(&vd56g3, &hw_config, &io);
// Configure and stream
img_sensor_set_frame_size(&vd56g3, 640, 480);
img_sensor_set_frame_rate(&vd56g3, 60);
img_sensor_start(&vd56g3);