![]() |
Open FFBoard
Open source force feedback firmware
|
Go to the source code of this file.
Classes | |
struct | tusb_desc_vc_itf_t |
struct | tusb_desc_vs_itf_t |
union | tusb_desc_video_itf_hdr_t |
struct | TU_ATTR_PACKED |
AUDIO Channel Cluster Descriptor (4.1) More... | |
union | tusb_desc_cs_video_fmt_t |
struct | tusb_desc_cs_video_fmt_t::TU_ATTR_PACKED |
union | tusb_desc_cs_video_frm_t |
struct | tusb_desc_cs_video_frm_t::TU_ATTR_PACKED |
Typedefs | |
typedef struct TU_ATTR_PACKED | tusb_desc_cs_video_entity_itf_t |
typedef struct TU_ATTR_PACKED | videod_streaming_interface_t |
typedef struct TU_ATTR_PACKED | videod_interface_t |
Functions | |
static uint8_t | _desc_itfnum (void const *desc) |
static uint8_t | _desc_ep_addr (void const *desc) |
static videod_streaming_interface_t * | _get_instance_streaming (uint_fast8_t ctl_idx, uint_fast8_t stm_idx) |
static tusb_desc_vc_itf_t const * | _get_desc_vc (videod_interface_t const *self) |
static tusb_desc_vs_itf_t const * | _get_desc_vs (videod_streaming_interface_t const *self) |
static void const * | _find_desc (void const *beg, void const *end, uint_fast8_t desc_type) |
static void const * | _find_desc_2_type (void const *beg, void const *end, uint_fast8_t desc_type_0, uint_fast8_t desc_type_1) |
static void const * | _find_desc_3 (void const *beg, void const *end, uint_fast8_t desc_type, uint_fast8_t element_0, uint_fast8_t element_1) |
static void const * | _next_desc_itf (void const *beg, void const *end) |
static uint8_t const * | _find_desc_itf (void const *beg, void const *end, uint_fast8_t itfnum, uint_fast8_t altnum) |
static void const * | _find_desc_ep (void const *beg, void const *end) |
static void const * | _end_of_control_descriptor (void const *desc) |
static void const * | _find_desc_entity (void const *desc, uint_fast8_t entityid) |
static void const * | _end_of_streaming_descriptor (void const *desc) |
static void const * | _find_desc_format (void const *beg, void const *end, uint_fast8_t fmtnum) |
static void const * | _find_desc_frame (void const *beg, void const *end, uint_fast8_t frmnum) |
static bool | _update_streaming_parameters (videod_streaming_interface_t const *stm, video_probe_and_commit_control_t *param) |
static bool | _negotiate_streaming_parameters (videod_streaming_interface_t const *stm, uint_fast8_t request, video_probe_and_commit_control_t *param) |
static bool | _close_vc_itf (uint8_t rhport, videod_interface_t *self) |
static bool | _open_vc_itf (uint8_t rhport, videod_interface_t *self, uint_fast8_t altnum) |
static bool | _init_vs_configuration (videod_streaming_interface_t *stm) |
static bool | _open_vs_itf (uint8_t rhport, videod_streaming_interface_t *stm, uint_fast8_t altnum) |
static uint_fast16_t | _prepare_in_payload (videod_streaming_interface_t *stm) |
static int | handle_video_ctl_std_req (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request, uint_fast8_t ctl_idx) |
static int | handle_video_ctl_cs_req (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request, uint_fast8_t ctl_idx) |
static int | handle_video_ctl_req (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request, uint_fast8_t ctl_idx) |
static int | handle_video_stm_std_req (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request, uint_fast8_t stm_idx) |
static int | handle_video_stm_cs_req (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request, uint_fast8_t stm_idx) |
static int | handle_video_stm_req (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request, uint_fast8_t stm_idx) |
bool | tud_video_n_connected (uint_fast8_t ctl_idx) |
bool | tud_video_n_streaming (uint_fast8_t ctl_idx, uint_fast8_t stm_idx) |
bool | tud_video_n_frame_xfer (uint_fast8_t ctl_idx, uint_fast8_t stm_idx, void *buffer, size_t bufsize) |
void | videod_init (void) |
bool | videod_deinit (void) |
void | videod_reset (uint8_t rhport) |
uint16_t | videod_open (uint8_t rhport, tusb_desc_interface_t const *itf_desc, uint16_t max_len) |
bool | videod_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request) |
bool | videod_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes) |
Variables | |
CFG_TUD_MEM_SECTION tu_static videod_interface_t | _videod_itf [CFG_TUD_VIDEO] |
CFG_TUD_MEM_SECTION tu_static videod_streaming_interface_t | _videod_streaming_itf [CFG_TUD_VIDEO_STREAMING] |
tu_static uint8_t const | _cap_get = 0x1u |
tu_static uint8_t const | _cap_get_set = 0x3u |
static tu_lookup_entry_t const | tu_lookup_video_request [] |
static tu_lookup_table_t const | tu_table_video_request |
static char const *const | tu_str_video_vc_control_selector [] |
static char const *const | tu_str_video_vs_control_selector [] |
typedef struct TU_ATTR_PACKED tusb_desc_cs_video_entity_itf_t |
typedef struct TU_ATTR_PACKED videod_interface_t |
typedef struct TU_ATTR_PACKED videod_streaming_interface_t |
|
static |
Close current video control interface.
[in,out] | self | Video control interface context. |
[in] | altnum | The target alternate setting number. |
Definition at line 678 of file video_device.c.
|
inlinestatic |
Get endpoint address from the endpoint descriptor
[in] | desc | endpoint descriptor |
Definition at line 215 of file video_device.c.
|
inlinestatic |
Get interface number from the interface descriptor
[in] | desc | interface descriptor |
Definition at line 206 of file video_device.c.
|
inlinestatic |
Return the end of the video control descriptor.
Definition at line 356 of file video_device.c.
|
inlinestatic |
Return the end of the video streaming descriptor.
Definition at line 386 of file video_device.c.
|
static |
Find the first descriptor of a given type
[in] | beg | The head of descriptor byte array. |
[in] | end | The tail of descriptor byte array. |
[in] | desc_type | The target descriptor type. |
end | did not found interface descriptor |
Definition at line 251 of file video_device.c.
|
static |
Find the first descriptor of two given types
[in] | beg | The head of descriptor byte array. |
[in] | end | The tail of descriptor byte array. |
[in] | desc_type_0 | The first target descriptor type. |
[in] | desc_type_1 | The second target descriptor type. |
end | did not found interface descriptor |
Definition at line 268 of file video_device.c.
|
static |
Find the first descriptor specified by the arguments
[in] | beg | The head of descriptor byte array. |
[in] | end | The tail of descriptor byte array. |
[in] | desc_type | The target descriptor type |
[in] | element_0 | The target element following the desc_type |
[in] | element_1 | The target element following the element_0 |
end | did not found interface descriptor |
Definition at line 287 of file video_device.c.
|
static |
Find the first entity descriptor with the entity ID specified by the argument belonging to the current video control descriptor.
[in] | desc | The video control interface descriptor. |
[in] | entityid | The target entity id. |
end | did not found interface descriptor |
Definition at line 370 of file video_device.c.
|
static |
Find the first endpoint descriptor belonging to the current interface descriptor.
The search range is from beg
to end
or the next interface descriptor.
[in] | beg | The head of descriptor byte array. |
[in] | end | The tail of descriptor byte array. |
end | did not found endpoint descriptor |
Definition at line 345 of file video_device.c.
|
inlinestatic |
Find the first format descriptor with the specified format number.
Definition at line 393 of file video_device.c.
|
inlinestatic |
Find the first frame descriptor with the specified format number.
Definition at line 411 of file video_device.c.
|
inlinestatic |
Find the first interface descriptor with the specified interface number and alternate setting number.
[in] | beg | The head of descriptor byte array. |
[in] | end | The tail of descriptor byte array. |
[in] | itfnum | The target interface number. |
[in] | altnum | The target alternate setting number. |
end | did not found interface descriptor |
Definition at line 331 of file video_device.c.
|
static |
Definition at line 233 of file video_device.c.
|
static |
Definition at line 237 of file video_device.c.
|
static |
Get instance of streaming interface
[in] | ctl_idx | instance number of video control |
[in] | stm_idx | index number of streaming interface |
Definition at line 225 of file video_device.c.
|
static |
Definition at line 739 of file video_device.c.
|
static |
Set the minimum, maximum, default values or resolutions to variables which need to negotiate with the host
[in] | request | GET_MAX, GET_MIN, GET_RES or GET_DEF |
[in,out] | param | Target |
Definition at line 522 of file video_device.c.
|
static |
Return the next interface descriptor which has another interface number. If there are multiple VC interfaces, there will be an IAD descriptor before the next interface descriptor. Check both the IAD descriptor and the interface descriptor. 3.1 Descriptor Layout Overview
[in] | beg | The head of descriptor byte array. |
[in] | end | The tail of descriptor byte array. |
end | did not found interface descriptor |
Definition at line 312 of file video_device.c.
|
static |
Set the alternate setting to own video control interface.
[in,out] | self | Video control interface context. |
[in] | altnum | The target alternate setting number. |
Definition at line 702 of file video_device.c.
|
static |
Set the alternate setting to own video streaming interface.
[in,out] | stm | Streaming interface context. |
[in] | altnum | The target alternate setting number. |
Definition at line 752 of file video_device.c.
|
static |
Prepare the next packet payload.
Definition at line 819 of file video_device.c.
|
static |
Set uniquely determined values to variables that have not been set
[in,out] | param | Target |
Definition at line 430 of file video_device.c.
|
static |
Definition at line 875 of file video_device.c.
|
static |
Definition at line 945 of file video_device.c.
|
static |
Handle a standard request to the video control interface.
Definition at line 840 of file video_device.c.
|
static |
Definition at line 1000 of file video_device.c.
|
static |
Definition at line 1154 of file video_device.c.
|
static |
Definition at line 968 of file video_device.c.
bool tud_video_n_connected | ( | uint_fast8_t | ctl_idx | ) |
Definition at line 1174 of file video_device.c.
bool tud_video_n_frame_xfer | ( | uint_fast8_t | ctl_idx, |
uint_fast8_t | stm_idx, | ||
void * | buffer, | ||
size_t | bufsize | ||
) |
Transfer a frame
[in] | ctl_idx | Destination control interface index |
[in] | stm_idx | Destination streaming interface index |
[in] | buffer | Frame buffer. The caller must not use this buffer until the operation is completed. |
[in] | bufsize | Byte size of the frame buffer |
Definition at line 1202 of file video_device.c.
bool tud_video_n_streaming | ( | uint_fast8_t | ctl_idx, |
uint_fast8_t | stm_idx | ||
) |
Return true if streaming
[in] | ctl_idx | Destination control interface index |
[in] | stm_idx | Destination streaming interface index |
Definition at line 1182 of file video_device.c.
bool videod_control_xfer_cb | ( | uint8_t | rhport, |
uint8_t | stage, | ||
tusb_control_request_t const * | request | ||
) |
Definition at line 1342 of file video_device.c.
bool videod_deinit | ( | void | ) |
Definition at line 1249 of file video_device.c.
void videod_init | ( | void | ) |
Definition at line 1238 of file video_device.c.
uint16_t videod_open | ( | uint8_t | rhport, |
tusb_desc_interface_t const * | itf_desc, | ||
uint16_t | max_len | ||
) |
Definition at line 1265 of file video_device.c.
void videod_reset | ( | uint8_t | rhport | ) |
Definition at line 1253 of file video_device.c.
bool videod_xfer_cb | ( | uint8_t | rhport, |
uint8_t | ep_addr, | ||
xfer_result_t | result, | ||
uint32_t | xferred_bytes | ||
) |
Definition at line 1380 of file video_device.c.
tu_static uint8_t const _cap_get = 0x1u |
Definition at line 145 of file video_device.c.
tu_static uint8_t const _cap_get_set = 0x3u |
Definition at line 146 of file video_device.c.
CFG_TUD_MEM_SECTION tu_static videod_interface_t _videod_itf[CFG_TUD_VIDEO] |
Definition at line 142 of file video_device.c.
CFG_TUD_MEM_SECTION tu_static videod_streaming_interface_t _videod_streaming_itf[CFG_TUD_VIDEO_STREAMING] |
Definition at line 143 of file video_device.c.
|
static |
Definition at line 153 of file video_device.c.
|
static |
Definition at line 176 of file video_device.c.
|
static |
Definition at line 182 of file video_device.c.
|
static |
Definition at line 171 of file video_device.c.