UVC_CAMERA APIs
Important
The UVC_CAMERA API v1.0 is the lastest stable UVC_CAMERA APIs. All new applications should use UVC_CAMERA API v1.0.
UVC_CAMERA Interface
UVC camera only support full speed type
UVC_CAMERA API Categories
Most of UVC_CAMERA APIs can be categoried as:
UVC_CAMERA APIs
The common APIs are prefixed with bk_uvc, e.g. bk_uvc_init() etc.
- UVC_CAMERA APIs:
bk_uvc_camera_driver_init()
- init uvc camera(open uvc device)bk_uvc_camera_driver_deinit()
- deinit uvc camera(close uvc device)bk_uvc_camera_power_on()
- power on uvcbk_uvc_camera_get_config()
- set uvc camera pps(image resolution) and fps(frame rate)bk_uvc_camera_set_config()
- set uvc camera pps(image resolution) and fps(frame rate)bk_uvc_camera_driver_start()
- start uvc, start simple image informationbk_uvc_camera_driver_stop()
- stop uvc, stop simple image informationbk_uvc_camera_get_device()
- get current working uvc device
API Reference
Header File
Functions
-
bk_err_t bk_uvc_camera_driver_init(uvc_camera_config_t *config)
Init the uvc.
This API init psram, dma, uvc param, and open uvc
- Parameters
data – configure for camera
- Returns
kNoErr: succeed
others: other errors.
-
bk_err_t bk_uvc_camera_driver_deinit(void)
Deinit the uvc.
This API deinit dma and close uvc
: called after bk_uvc_camera_driver_init
- Returns
kNoErr: succeed
others: other errors.
-
bk_err_t bk_uvc_camera_power_enable(uint8_t enable)
uvc power on
This API called by user, before calling bk_uvc_camera_driver_init, you should power on uvc
1. This api config different gpio and different active level
- Parameters
enable – power up/down:1/0
- Returns
kNoErr: succeed
others: other errors.
-
bk_err_t bk_uvc_camera_get_config(uvc_camera_device_t *param, uint16_t count)
Get uvc config.
This API called by user, get uvc support fps and resolutions
- Parameters
param – the memory user malloc for save uvc support config
count – the param1 malloc size, the count config of uvc support
- Returns
BK_OK: succeed
others: other errors.
-
bk_err_t bk_uvc_camera_start(void)
Set uvc config.
This API called by user, Set uvc support fps and resolutions
This API called by user, Set uvc start transfer
1. this api called must after uvc have been init and have stopped
- Parameters
mode – the uvc work type, reference
media_camera_type_t
config – the uvc need support param the user set
- Returns
kNoErr: succeed
others: other errors. Set uvc start
- Returns
kNoErr: succeed
others: other errors.
-
bk_err_t bk_uvc_camera_stop(void)
Stop uvc start.
This API called by user, Set uvc stop transfer
1. this api called must after uvc have been init and have start
- Returns
kNoErr: succeed
others: other errors.
-
media_camera_device_t *bk_uvc_camera_get_device(void)
Get current uvc device.
This API called by user, get currnet uvc device in working
1. if no uvc work, the return will be NULL
- Returns
uvc_camera_device_t *: current working uvc device ptr
NULL: no uvc device working