mikroSDK Reference Manual
video_device.h
1/*
2 * The MIT License (MIT)
3 *
4 * Copyright (c) 2019 Ha Thach (tinyusb.org)
5 * Copyright (c) 2021 Koji KITAYAMA
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE.
24 *
25 * This file is part of the TinyUSB stack.
26 */
27
28#ifndef TUSB_VIDEO_DEVICE_H_
29#define TUSB_VIDEO_DEVICE_H_
30
31#include "common/tusb_common.h"
32#include "video.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38//--------------------------------------------------------------------+
39// Application API (Multiple Ports)
40// CFG_TUD_VIDEO > 1
41//--------------------------------------------------------------------+
42
47bool tud_video_n_streaming(uint_fast8_t ctl_idx, uint_fast8_t stm_idx);
48
55bool tud_video_n_frame_xfer(uint_fast8_t ctl_idx, uint_fast8_t stm_idx, void *buffer, size_t bufsize);
56
57/*------------- Optional callbacks -------------*/
62TU_ATTR_WEAK void tud_video_frame_xfer_complete_cb(uint_fast8_t ctl_idx, uint_fast8_t stm_idx);
63
64//--------------------------------------------------------------------+
65// Application Callback API (weak is optional)
66//--------------------------------------------------------------------+
67
73TU_ATTR_WEAK int tud_video_power_mode_cb(uint_fast8_t ctl_idx, uint8_t power_mod);
74
81TU_ATTR_WEAK int tud_video_commit_cb(uint_fast8_t ctl_idx, uint_fast8_t stm_idx,
82 video_probe_and_commit_control_t const *parameters);
83
84//--------------------------------------------------------------------+
85// INTERNAL USBD-CLASS DRIVER API
86//--------------------------------------------------------------------+
87void videod_init (void);
88void videod_reset (uint8_t rhport);
89uint16_t videod_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
90bool videod_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
91bool videod_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
92
93#ifdef __cplusplus
94 }
95#endif
96
97#endif
AUDIO Channel Cluster Descriptor (4.1)
Definition audio.h:647