VSF Documented
usbhd_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
18#ifndef __VSF_HAL_DRIVER_WCH_HC32F10X_USBHD_HCD_H__
19#define __VSF_HAL_DRIVER_WCH_HC32F10X_USBHD_HCD_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "hal/vsf_hal_cfg.h"
24
25#if VSF_USE_USB_HOST == ENABLED
26
28#include "kernel/vsf_kernel.h"
29#include "hal/vsf_hal.h"
30
32//#include "../../io/io.h"
33//#include "../../pm/pm.h"
34
36
37#if defined(CH32F10X_USBHD_HCD_CLASS_IMPLEMENT)
38# define __VSF_CLASS_IMPLEMENT__
39# undef CH32F10X_USBHD_HCD_CLASS_IMPLEMENT
40#elif defined(CH32F10X_USBHD_HCD_CLASS_INHERIT)
41# define __VSF_CLASS_INHERIT__
42# undef CH32F10X_USBHD_HCD_CLASS_INHERIT
43#endif
44#include "utilities/ooc_class.h"
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50/*============================ MACROS ========================================*/
51
52#undef USB_HDC_HAS_CONST
53#if !defined(USB_HDC_IRQN) || !defined(USB_DC_REG_BASE)
54# define USB_HDC_HAS_CONST
55#endif
56
57/*============================ MACROFIED FUNCTIONS ===========================*/
58/*============================ TYPES =========================================*/
59
60#ifdef USB_HDC_HAS_CONST
62 // information from device.h
63#ifndef USB_HDC_IRQN
65#endif
66#ifndef USB_HDC_REG_BASE
67 void *reg;
68#endif
69};
71#endif
72
78};
80
82 public_member(
84 const hc32f10x_usbhd_const_t *param;
85#endif
86 vsf_arch_prio_t priority;
87 )
88
89 private_member(
90 vsf_dlist_t urb_list;
91 void *urb_cur;
92 vsf_teda_t teda;
93 vk_usbh_hcd_t *hcd;
94 vk_usbh_dev_t *dev;
96 uint8_t cur_size;
97 bool is_transacting;
98 void *cur_buffer;
99 uint8_t ep_buffer[64] VSF_CAL_ALIGN(4);
100 )
101};
103
104/*============================ GLOBAL VARIABLES ==============================*/
105
107
108/*============================ INCLUDES ======================================*/
109/*============================ PROTOTYPES ====================================*/
110
111#ifdef __cplusplus
112}
113#endif
114
115#endif // VSF_USE_USB_HOST
116#endif // __VSF_HAL_DRIVER_WCH_HC32F10X_USBHD_HCD_H__
117/* EOF */
#define VSF_CAL_ALIGN(__N)
Definition __compiler.h:179
Definition usbhd_hcd.h:81
Definition vsf_usbh.h:478
Definition vsf_usbh.h:322
Definition vsf_usbh.h:347
Definition vsf_eda.h:834
vsf_arch_prio_t
Definition cortex_a_generic.h:88
enum IRQn IRQn_Type
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned char uint8_t
Definition stdint.h:5
Definition usbhd_hcd.h:61
IRQn_Type irq
Definition usbhd_hcd.h:64
void * reg
Definition usbhd_hcd.h:67
Definition vsf_list.h:883
#define USB_HDC_HAS_CONST
include the infrastructure
Definition usbhd_hcd.h:54
const vk_usbh_hcd_drv_t hc32f10x_usbhd_hcd_drv
Definition usbhd_hcd.c:181
hc32f10x_usbhd_hcd_state_t
Definition usbhd_hcd.h:73
@ HC32F10X_HCD_STATE_WAIT_RESET_CLEAR
Definition usbhd_hcd.h:76
@ HC32F10X_HCD_STATE_CONNECTED
Definition usbhd_hcd.h:77
@ HC32F10X_HCD_STATE_WAIT_RESET
Definition usbhd_hcd.h:75
@ HC32F10X_HCD_STATE_WAIT_CONNECT
Definition usbhd_hcd.h:74
uint8_t state
Definition vsf_msg_tree.h:247