VSF Documented
vsf_usbd_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_USBD_UVC_H__
19#define __VSF_USBD_UVC_H__
20
21/*============================ INCLUDES ======================================*/
22
24
25#if VSF_USE_USB_DEVICE == ENABLED && VSF_USBD_USE_UVC == ENABLED
26
27#include "../../../common/class/UVC/vsf_usb_UVC.h"
28#include "component/av/vsf_av.h"
29
30#if defined(__VSF_USBD_UVC_CLASS_IMPLEMENT)
31# undef __VSF_USBD_UVC_CLASS_IMPLEMENT
32# define __VSF_CLASS_IMPLEMENT__
33#endif
34#include "utilities/ooc_class.h"
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40/*============================ MACROS ========================================*/
41
42#if VSF_USE_VIDEO != ENABLED
43# error "VSF_USE_VIDEO MUST be enabled to use uvc"
44#endif
45
46/*============================ MACROFIED FUNCTIONS ===========================*/
47/*============================ TYPES =========================================*/
48
50
54
58
59 void (*on_set)(vk_usbd_uvc_control_t *control);
61
62typedef struct vk_usbd_uvc_control_t {
66
67typedef struct vk_usbd_uvc_entity_t {
72
74
75 public_member(
76 uint8_t ep_in;
77 uint16_t control_num;
78
79 uint8_t entity_num;
81
82 vk_usbd_desc_t *desc;
83// vsf_stream_t *video_stream;
84 )
85
86 private_member(
87 vk_usbd_trans_t trans_in;
88 vk_usbd_dev_t *dev;
89 vk_usbd_ifs_t *ifs;
90#if VSF_USBD_UVC_CFG_TRACE_EN == ENABLED
91 uint_fast32_t cur_size;
92#endif
93 )
94};
95
96/*============================ GLOBAL VARIABLES ==============================*/
97
98extern const vk_usbd_class_op_t vk_usbd_uvc_control_class;
99extern const vk_usbd_class_op_t vk_usbd_uvc_stream_class;
100
101/*============================ PROTOTYPES ====================================*/
102
104
105#ifdef __cplusplus
106}
107#endif
108
109#endif // VSF_USE_USB_DEVICE && VSF_USBD_USE_UVC
110#endif // __VSF_USBD_UVC_H__
vsf_err_t
Definition __type.h:42
Definition vsf_usbd.h:402
Definition vsf_usbd_UVC.h:73
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned short uint16_t
Definition stdint.h:7
unsigned int uint_fast32_t
Definition stdint.h:27
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_av.h:54
Definition vsf_usbd.h:379
Definition vsf_usbd_UVC.h:51
uint8_t selector
Definition vsf_usbd_UVC.h:52
uint16_t size
Definition vsf_usbd_UVC.h:53
vk_av_control_value_t def
Definition vsf_usbd_UVC.h:57
vk_av_control_value_t min
Definition vsf_usbd_UVC.h:55
vk_av_control_value_t max
Definition vsf_usbd_UVC.h:56
void(* on_set)(vk_usbd_uvc_control_t *control)
Definition vsf_usbd_UVC.h:59
Definition vsf_usbd_UVC.h:62
const vk_usbd_uvc_control_info_t * info
Definition vsf_usbd_UVC.h:63
vk_av_control_value_t cur
Definition vsf_usbd_UVC.h:64
Definition vsf_usbd_UVC.h:67
uint8_t id
Definition vsf_usbd_UVC.h:68
uint8_t control_num
Definition vsf_usbd_UVC.h:69
vk_usbd_uvc_control_t * control
Definition vsf_usbd_UVC.h:70
uint32_t size
Definition vsf_memfs.h:50
vsf_err_t vk_usbd_uvc_send_packet(vk_usbd_uvc_t *uvc, uint8_t *buffer, uint_fast32_t size)
const vk_usbd_class_op_t vk_usbd_uvc_control_class
const vk_usbd_class_op_t vk_usbd_uvc_stream_class