VSF Documented
vsf_usbh_uvc.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_USBH_UVC_H__
19#define __VSF_USBH_UVC_H__
20
21
22/*============================ INCLUDES ======================================*/
23
25
26#if VSF_USE_USB_HOST == ENABLED && VSF_USBH_USE_UVC == ENABLED
27
29
30#undef PUBLIC_CONST
31#if defined(__VSF_USBH_UVC_CLASS_IMPLEMENT)
32# undef __VSF_USBH_UVC_CLASS_IMPLEMENT
33# define __VSF_CLASS_IMPLEMENT__
34# define PUBLIC_CONST
35#else
36# define PUBLIC_CONST const
37#endif
38#include "utilities/ooc_class.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44/*============================ MACROS ========================================*/
45
46// for some hcd, one urb will take 2ms(eg. ohci), so need 2 urbs to implement 1ms interval transaction
47#ifndef VSF_USBH_UVC_CFG_URB_NUM_PER_STREAM
48# define VSF_USBH_UVC_CFG_URB_NUM_PER_STREAM 1
49#endif
50#if VSF_USBH_UVC_CFG_URB_NUM_PER_STREAM > 8
51# error VSF_USBH_UVC_CFG_URB_NUM_PER_STREAM MUST be <= 8
52#endif
53
54#if VSF_USE_SIMPLE_STREAM != ENABLED
55# error VSF_USE_SIMPLE_STREAM is needed for USBH UVC driver
56#endif
57
58/*============================ MACROFIED FUNCTIONS ===========================*/
59/*============================ TYPES =========================================*/
60/*============================ GLOBAL VARIABLES ==============================*/
61
63
64/*============================ PROTOTYPES ====================================*/
65
66extern int16_t vsf_usbh_uvc_get_desc(uint8_t *buf, uint_fast16_t size, uint_fast8_t subtype, void **ptr);
67extern usb_uvc_format_desc_t * vsf_usbh_uvc_get_format(void *param, uint_fast8_t format_idx);
68extern vsf_err_t vsf_usbh_uvc_connect_stream(void *param, uint_fast8_t format_idx, uint_fast8_t frame_idx, vsf_stream_t *stream);
69extern void vsf_usbh_uvc_disconnect_stream(void *param);
70extern vsf_err_t __vsf_usbh_uvc_submit_req(void *uvc_ptr, void *data, struct usb_ctrlrequest_t *req);
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif
77#endif
vsf_err_t
Definition __type.h:42
Definition vsf_usbh.h:268
Definition vsf_simple_stream.h:254
struct ieee80211_ext_chansw_ie data
Definition ieee80211.h:80
unsigned char uint_fast8_t
Definition stdint.h:23
short int16_t
Definition stdint.h:6
unsigned short uint_fast16_t
Definition stdint.h:25
unsigned char uint8_t
Definition stdint.h:5
Definition usb_common.h:85
Definition vsf_usb_UVC.h:90
uint32_t size
Definition vsf_memfs.h:50
int16_t vsf_usbh_uvc_get_desc(uint8_t *buf, uint_fast16_t size, uint_fast8_t subtype, void **ptr)
Definition vsf_usbh_uvc.c:132
void vsf_usbh_uvc_disconnect_stream(void *param)
Definition vsf_usbh_uvc.c:196
vsf_err_t __vsf_usbh_uvc_submit_req(void *uvc_ptr, void *data, struct usb_ctrlrequest_t *req)
Definition vsf_usbh_uvc.c:163
usb_uvc_format_desc_t * vsf_usbh_uvc_get_format(void *param, uint_fast8_t format_idx)
Definition vsf_usbh_uvc.c:155
const vk_usbh_class_drv_t vk_usbh_uvc_drv
Definition vsf_usbh_uvc.c:122
vsf_err_t vsf_usbh_uvc_connect_stream(void *param, uint_fast8_t format_idx, uint_fast8_t frame_idx, vsf_stream_t *stream)
Definition vsf_usbh_uvc.c:178