UVC_CAMERA APIs

[English]

重要

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:

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

参数

data – configure for camera

返回

  • 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

返回

  • 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

参数

enable – power up/down:1/0

返回

  • 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

参数
  • param – the memory user malloc for save uvc support config

  • count – the param1 malloc size, the count config of uvc support

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_uvc_camera_set_config(media_camera_type_t type, uvc_camera_device_t *config)

Set uvc config.

This API called by user, Set uvc support fps and resolutions

参数
  • mode – the uvc work type, reference media_camera_type_t

  • config – the uvc need support param the user set

返回

  • kNoErr: succeed

  • others: other errors.

bk_err_t bk_uvc_camera_start(void)

Set uvc start.

This API called by user, Set uvc start transfer

1. this api called must after uvc have been init and have stopped

返回

  • 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

返回

  • kNoErr: succeed

  • others: other errors.

uvc_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

返回

  • uvc_camera_device_t *: current working uvc device ptr

  • NULL: no uvc device working

void bk_uvc_camera_drop_frame(uint8_t number)

drop first number frame

This API called by user, before uvc start work

1. this function must called before bk_uvc_camera_driver_init

返回

  • NULL

bk_err_t bk_uvc_camera_set_type(media_camera_type_t type)
bk_err_t bk_uvc_camera_init(uvc_config_t *config)
bk_err_t bk_uvc_camera_deinit()

API Typedefs