DVP_CAMERA APIs
重要
The DVP_CAMERA API v1.0 is the lastest stable DVP_CAMERA APIs. All new applications should use DVP_CAMERA API v1.0.
DVP_CAMERA Interface
Current software version support two types dvp sensor: gc0328c and hm1055. they are comunicate by i2c with chip. gc0328c have 20pins interface, hm1055 have 24pins interface.
gc0328c support different image resolution and frame rate: 1. WQVGA(480*272) 2. QVGA(320*240) 3. VGA(640*480) frame rate: 5fps/10fps/20fps/25fps
hm1055 only support 720p(1280*720) image resolution, and different frame rates: 5fps/15fps/20fps
DVP_CAMERA API Categories
Most of DVP_CAMERA APIs can be categoried as:
DVP_CAMERA APIs
The common APIs are prefixed with bk_camera, e.g. bk_camera_driver_init() etc.
- DVP_CAMERA APIs:
bk_dvp_camera_driver_init()
- init dvp camera(power on sensor, begin to sample image)bk_dvp_camera_driver_deinit()
- deinit dvp camera(power off sensor)bk_dvp_camera_get_device()
- get current dvp dendor configbk_dvp_camera_encode_config()
- change encode image upper and lower size or close auto encodedvp_camera_i2c_read_uint8()
- master read dvp senor register value by bytedvp_camera_i2c_read_uint16()
- master read dvp senor register value by double bytedvp_camera_i2c_read_uint8()
- master write dvp senor register value by bytedvp_camera_i2c_write_uint16()
- master write dvp senor register value by double byte
API Reference
Header File
Functions
-
bk_err_t bk_dvp_camera_driver_init(dvp_camera_config_t *config)
Init the camera.
This API will auto detect dvp sensor, and init sensor, jpeg module, i2c module, psram, dma, ect.
1. you need make sure upper module exist.
- 参数
config – process for sensor data
- 返回
kNoErr: succeed
others: other errors.
-
bk_err_t bk_dvp_camera_driver_deinit(void)
Deinit the camera.
This API will deinit sensor, jpeg module, i2c module, psram, dma, ect.
- 返回
kNoErr: succeed
others: other errors.
-
dvp_camera_device_t *bk_dvp_camera_get_device(void)
Get current use camera.
This API will called after bk_dvp_camera_driver_init
- 返回
dvp_camera_device_t *: succeed
NULL: current no sensor work.
-
bk_err_t bk_dvp_camera_power_enable(uint8_t enable)
dvp power on
This API called by user, before calling bk_dvp_driver_init, you should power on dvp
1. This api config ctrl by marco VIDEO_GPIO_CTRL_LDO_ENABLE
- 参数
enable – power up/down:1/0
- 返回
BK_OK: succeed
others: other errors.
-
const dvp_sensor_config_t *bk_dvp_get_sensor_auto_detect(void)
auto detect dvp camera
This API called by user, before use dvp camera
1. This api return a pointer for dvp camera sensor config
- 返回
get current dvp config(type)
return NULL
API Typedefs
Header File
Structures
-
struct dvp_camera_config_t
dvp_camera config
Public Members
-
media_ppi_t ppi
sensor image resolution
-
media_camera_type_t type
sensor output mode yuv/jpeg
-
int (*fb_jpeg_init)(media_ppi_t max_ppi)
init jpeg psram buffer
-
int (*fb_jpeg_deinit)(void)
deinit jpeg psram buffer
-
int (*fb_display_init)(media_ppi_t max_ppi)
init yuv psram buffer
-
int (*fb_display_deinit)(void)
deinit yuv psram buffer
-
void (*fb_jpeg_complete)(frame_buffer_t *buffer)
dvp notify upper layer a complete frame ready
-
frame_buffer_t *(*fb_jpeg_malloc)(void)
malloc jpeg psram buffer
-
frame_buffer_t *(*fb_display_malloc)(void)
malloc yuv psram buffer
-
void (*drop_frame)(uint8_t index)
jpeg module drop dvp source frame according to index
-
media_ppi_t ppi
-
struct dvp_sensor_config_t
dvp sensor configure
Public Members
-
char *name
sensor name
-
media_ppi_t def_ppi
sensor default resolution
-
sensor_fps_t def_fps
sensor default fps
-
jpeg_clk_t clk
sensor work clk in config fps and ppi
-
pixel_format_t fmt
sensor input data format
-
jpeg_sync_level_t vsync
sensor vsync active level
-
jpeg_sync_level_t hsync
sensor hsync active level
-
uint16_t id
sensor type, sensor_id_t
-
uint16_t address
sensor write register address by i2c
-
uint16_t fps_cap
sensor support fps
-
uint16_t ppi_cap
sensor support resoultions
-
bool (*detect)(void)
auto detect used dvp sensor
-
int (*init)(void)
init dvp sensor
-
int (*set_ppi)(media_ppi_t ppi)
set resolution of sensor
-
int (*set_fps)(sensor_fps_t fps)
set fps of sensor
-
int (*power_down)(void)
power down or reset of sensor
-
int (*dump_register)(media_ppi_t ppi)
dump sensor register
-
void (*read_register)(bool enable)
read sensor register when write
-
char *name
-
struct dvp_camera_device_t
current used camera config
Public Members
-
media_ppi_t ppi
sensor image resolution
-
sensor_fps_t fps
sensor fps
-
char *name
sensor name
-
uint16_t id
sensor type, sensor_id_t
-
uint16_t fps_cap
sensor support fps
-
uint16_t ppi_cap
sensor support resoultions
-
uint32_t pixel_size
sensor output image width
-
media_camera_type_t type
dvp camera work type
-
media_ppi_t ppi
Macros
-
GC_QVGA_USE_SUBSAMPLE
Enumerations
-
enum sensor_id_t
dvp sensor id type
Values:
-
enumerator ID_UNKNOW
-
enumerator ID_PAS6329
-
enumerator ID_OV7670
-
enumerator ID_PAS6375
-
enumerator ID_GC0328C
-
enumerator ID_BF2013
-
enumerator ID_GC0308C
-
enumerator ID_HM1055
-
enumerator ID_GC2145
-
enumerator ID_OV2640
-
enumerator ID_GC0308
-
enumerator ID_TVP5150
-
enumerator ID_UNKNOW