VSF Documented
vsf_libusb_hcd.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#ifndef __VSF_LIBUSB_HCD_H___
18#define __VSF_LIBUSB_HCD_H___
19
20/*============================ INCLUDES ======================================*/
21
23
24#if VSF_USE_USB_HOST == ENABLED && VSF_USBH_USE_HCD_LIBUSB == ENABLED
25
28#include "hal/vsf_hal.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/*============================ MACROS ========================================*/
35
36#if VSF_USBH_CFG_ENABLE_ROOT_HUB == ENABLED
37# error "libusb_hcd does not support root hub"
38#endif
39#if VSF_USBH_USE_HUB == ENABLED
40# error "libusb_hcd does not support hub"
41#endif
42#if !defined(__WIN__) && !defined(__LINUX__) && !defined(__MACOS__)
43# error "libusb_hcd ONLY support win/linux/macos"
44#endif
45
46/* Detach a device when one of its URBs fails fatally (LIBUSB_ERROR_IO on the
47 * 1.0 backend; -1/-4/-5 on the libusb-win32 0.1 backend). In polling mode
48 * (no hotplug) this is the ONLY way a gone device is noticed: without it the
49 * device slot stays occupied forever and a re-enumerating device (e.g. one
50 * rebooting after a firmware download) is never re-detected. */
51#ifndef VSF_LIBUSB_HCD_CFG_REMOVE_ON_ERROR
52# define VSF_LIBUSB_HCD_CFG_REMOVE_ON_ERROR ENABLED
53#endif
54
55/*============================ MACROFIED FUNCTIONS ===========================*/
56/*============================ TYPES =========================================*/
57
61
62/*============================ GLOBAL VARIABLES ==============================*/
63
65
66/*============================ PROTOTYPES ====================================*/
67
68#ifdef __cplusplus
69}
70#endif
71
72#endif
73#endif // __VSF_LIBUSB_HCD_H___
Definition vsf_usbh.h:322
vsf_arch_prio_t
Definition cortex_a_generic.h:85
Definition vsf_libusb_hcd.h:58
vsf_arch_prio_t priority
Definition vsf_libusb_hcd.h:59
const vk_usbh_hcd_drv_t vk_libusb_hcd_drv
Definition vsf_libusb_hcd.c:683
struct vk_libusb_hcd_param_t vk_libusb_hcd_param_t
Generated from commit: vsfteam/vsf@5de27dd