rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | /***************************************************************************** |
| 2 | * Copyright Statement: |
| 3 | * -------------------- |
| 4 | * This software is protected by Copyright and the information contained |
| 5 | * herein is confidential. The software may not be copied and the information |
| 6 | * contained herein may not be used or disclosed except with the written |
| 7 | * permission of MediaTek Inc. (C) 2005 |
| 8 | * |
| 9 | * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 10 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| 11 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| 12 | * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| 13 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 14 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 15 | * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 16 | * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 17 | * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| 18 | * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| 19 | * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| 20 | * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| 21 | * |
| 22 | * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| 23 | * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 24 | * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| 25 | * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| 26 | * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 27 | * |
| 28 | * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| 29 | * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| 30 | * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| 31 | * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| 32 | * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| 33 | * |
| 34 | *****************************************************************************/ |
| 35 | |
| 36 | /***************************************************************************** |
| 37 | * |
| 38 | * Filename: |
| 39 | * --------- |
| 40 | * usbd.h |
| 41 | * |
| 42 | * Project: |
| 43 | * -------- |
| 44 | * Maui_Software |
| 45 | * |
| 46 | * Description: |
| 47 | * ------------ |
| 48 | * This file intends for usb1.1 host definitions. |
| 49 | * |
| 50 | * Author: |
| 51 | * ------- |
| 52 | * ------- |
| 53 | * |
| 54 | *============================================================================ |
| 55 | * HISTORY |
| 56 | * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 57 | *------------------------------------------------------------------------------ |
| 58 | * removed! |
| 59 | * removed! |
| 60 | * removed! |
| 61 | * |
| 62 | * removed! |
| 63 | * removed! |
| 64 | * removed! |
| 65 | * |
| 66 | * removed! |
| 67 | * removed! |
| 68 | * removed! |
| 69 | * |
| 70 | * removed! |
| 71 | * removed! |
| 72 | * removed! |
| 73 | * |
| 74 | * removed! |
| 75 | * removed! |
| 76 | * removed! |
| 77 | * |
| 78 | * removed! |
| 79 | * removed! |
| 80 | * removed! |
| 81 | * |
| 82 | * removed! |
| 83 | * removed! |
| 84 | * removed! |
| 85 | * |
| 86 | * removed! |
| 87 | * removed! |
| 88 | * removed! |
| 89 | * |
| 90 | * removed! |
| 91 | * removed! |
| 92 | * removed! |
| 93 | * |
| 94 | * removed! |
| 95 | * removed! |
| 96 | * removed! |
| 97 | * |
| 98 | * removed! |
| 99 | * removed! |
| 100 | * removed! |
| 101 | * |
| 102 | * removed! |
| 103 | * removed! |
| 104 | * removed! |
| 105 | * |
| 106 | * removed! |
| 107 | * removed! |
| 108 | * removed! |
| 109 | * |
| 110 | * removed! |
| 111 | * removed! |
| 112 | * removed! |
| 113 | * |
| 114 | * removed! |
| 115 | * removed! |
| 116 | * removed! |
| 117 | * |
| 118 | * removed! |
| 119 | * removed! |
| 120 | * removed! |
| 121 | * |
| 122 | * removed! |
| 123 | * removed! |
| 124 | * removed! |
| 125 | * |
| 126 | * removed! |
| 127 | * removed! |
| 128 | * removed! |
| 129 | * |
| 130 | * removed! |
| 131 | * removed! |
| 132 | * removed! |
| 133 | * removed! |
| 134 | * removed! |
| 135 | * removed! |
| 136 | * |
| 137 | *------------------------------------------------------------------------------ |
| 138 | * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! |
| 139 | *============================================================================ |
| 140 | ****************************************************************************/ |
| 141 | |
| 142 | #ifndef USBD_H |
| 143 | #define USBD_H |
| 144 | |
| 145 | //#include "usb_hcd.h" |
| 146 | #include "dcl.h" |
| 147 | //#include "kal_non_specific_general_types.h" |
| 148 | #include "usb.h" |
| 149 | #include "usb_drv.h" |
| 150 | #include "usb_custom_def.h" |
| 151 | |
| 152 | |
| 153 | #define USBD_MAX_CFG_NUM 8 |
| 154 | #define USBD_MAX_IF_PER_CFG 4 |
| 155 | #define USBD_MAX_INTERFACE_NUM (USBD_MAX_CFG_NUM * USBD_MAX_IF_PER_CFG) |
| 156 | #define USBD_MAX_EP_PER_IF 3 |
| 157 | #define USBD_MAX_EP_NUM (USBD_MAX_INTERFACE_NUM * USBD_MAX_EP_PER_IF) |
| 158 | #define USBD_MAX_CLASS_DRIVER 2 |
| 159 | |
| 160 | #define USBD_EP0_MAX_PKT_SIZE 64 |
| 161 | |
| 162 | #define USBD_ERROR_DELAY 35 /* 10ms unit*/ |
| 163 | |
| 164 | #define USBD_SET_ADDRESS_RECOVERY_DELAY 1 |
| 165 | |
| 166 | #define USBD_TEST_MODE_DELAY 1500 |
| 167 | //#define USBD_TEST_MODE_DELAY 300 |
| 168 | |
| 169 | |
| 170 | #ifdef __OTG_ENABLE__ |
| 171 | #define USB_EXT_HOST_NUM 1 |
| 172 | #else |
| 173 | #define USB_EXT_HOST_NUM 0 |
| 174 | #endif |
| 175 | |
| 176 | #ifdef __IC_USB_ENABLE__ |
| 177 | #define USB_INT_HOST_NUM 1 |
| 178 | #else |
| 179 | #define USB_INT_HOST_NUM 0 |
| 180 | #endif |
| 181 | |
| 182 | |
| 183 | #define USB_HOST_NUM (USB_EXT_HOST_NUM + USB_INT_HOST_NUM) |
| 184 | |
| 185 | |
| 186 | /* USBD test mode */ |
| 187 | #define USBD_TEST_SE0_NAK 0x0101 |
| 188 | #define USBD_TEST_J 0x0102 |
| 189 | #define USBD_TEST_K 0x0103 |
| 190 | #define USBD_TEST_PACKET 0x0104 |
| 191 | #define USBD_TEST_HS_HOST_PORT_SUSPEND_RESUME 0x0106 |
| 192 | #define USBD_TEST_SINGLE_STEP_GET_DEV_DESC 0x0107 |
| 193 | #define USBD_TEST_SINGLE_STEP_SET_FEATURE 0x0108 |
| 194 | #define USBD_TEST_UNSUPPORTED_DEVICE 0xBADD |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | #define EVENT_USBD_EP0_DONE ((kal_uint32)0x00000001) |
| 200 | #define EVENT_USBD_EP0_DETACH ((kal_uint32)0x00000002) |
| 201 | #define EVENT_USBD_EP0_ENUMERATION ((kal_uint32)0x00000004) |
| 202 | #define EVENT_USBD_RESUME_DONE ((kal_uint32)0x00000008) |
| 203 | |
| 204 | typedef enum |
| 205 | { |
| 206 | USBD_CH9_START, |
| 207 | USBD_CH9_STOP, |
| 208 | USBD_CH9_DELAY_SET_ADDR, |
| 209 | USBD_CH9_SET_ADDR, |
| 210 | USBD_CH9_GET_DEV_DESC_8, |
| 211 | USBD_CH9_GET_DEV_DESC, |
| 212 | USBD_CH9_GET_CONF_DESC_9, |
| 213 | USBD_CH9_GET_CONF_DESC, |
| 214 | USBD_CH9_SET_CONF, |
| 215 | USBD_CH9_SET_HNP_ENABLE, |
| 216 | USBD_CH9_ENUM_OK, |
| 217 | USBD_CH9_ENUM_FAIL |
| 218 | }USBD_CH9_STATE; |
| 219 | |
| 220 | |
| 221 | typedef enum |
| 222 | { |
| 223 | USBD_EP0_SETUP, |
| 224 | USBD_EP0_DATA, |
| 225 | USBD_EP0_STATUS, |
| 226 | USBD_EP0_NONE |
| 227 | }USBD_EP0_STATE; |
| 228 | |
| 229 | |
| 230 | typedef enum |
| 231 | { |
| 232 | USBD_EP0_DATA_RECV, |
| 233 | USBD_EP0_DATA_SEND, |
| 234 | USBD_EP0_DATA_NULL /* no data phase is needed */ |
| 235 | }USBD_EP0_DATA_DIR; |
| 236 | |
| 237 | |
| 238 | typedef enum |
| 239 | { |
| 240 | USBD_HNP_NOT_SUPPORT, |
| 241 | USBD_HNP_SUPPORT, |
| 242 | USBD_HNP_ENABLE_STALL |
| 243 | }USBD_HNP_SUPPORT_TYPE; |
| 244 | |
| 245 | |
| 246 | typedef enum |
| 247 | { |
| 248 | USBD_TEST_MODE_NONE = 0, |
| 249 | USBD_TEST_MODE_TYPE_SE0, |
| 250 | USBD_TEST_MODE_TYPE_J, |
| 251 | USBD_TEST_MODE_TYPE_K, |
| 252 | USBD_TEST_MODE_TYPE_TEST_PACKET, |
| 253 | USBD_TEST_MODE_TYPE_HS_HOST_PORT_SUSPEND_RESUME, |
| 254 | USBD_TEST_MODE_TYPE_SINGLE_STEP_GET_DEV_DESC, |
| 255 | USBD_TEST_MODE_TYPE_SINGLE_STEP_SET_FEATURE, |
| 256 | USBD_TEST_MODE_TYPE_UNSUPPORTED_DEVICE |
| 257 | }USBD_TEST_MODE_TYPE; |
| 258 | |
| 259 | |
| 260 | /* EP0 status */ |
| 261 | typedef struct |
| 262 | { |
| 263 | kal_uint8 device_addr; /* new function address */ |
| 264 | // kal_uint8 max_packet_size; |
| 265 | Usb_Command setup_cmd; /* setup packet address */ |
| 266 | kal_uint8 *data_ptr; /* data packet address */ |
| 267 | USBD_EP0_DATA_DIR ep0_data_dir; /* data phase direction */ |
| 268 | kal_uint32 sofar; /* number of bytes sent/recv'd so far */ |
| 269 | kal_uint32 todo; /* number of bytes to send/recv */ |
| 270 | }USBD_EP0_Status; |
| 271 | |
| 272 | |
| 273 | /* Bulk IN endpoint status */ |
| 274 | typedef struct |
| 275 | { |
| 276 | kal_uint8 max_packet_size; |
| 277 | kal_uint8 *data_ptr; /* data packet address */ |
| 278 | kal_uint32 sofar; /* number of bytes sent/recv'd so far */ |
| 279 | kal_uint32 todo; /* number of bytes to send/recv */ |
| 280 | }USBD_EPIN_Status; |
| 281 | |
| 282 | |
| 283 | /* Bulk OUT endpoint status */ |
| 284 | typedef struct |
| 285 | { |
| 286 | kal_uint8 max_packet_size; |
| 287 | kal_uint8 *data_ptr; /* data packet address */ |
| 288 | kal_uint32 sofar; /* number of bytes sent/recv'd so far */ |
| 289 | kal_uint32 todo; /* number of bytes to send/recv */ |
| 290 | }USBD_EPOUT_Status; |
| 291 | |
| 292 | /* endpoint information, including endpoint status */ |
| 293 | typedef struct |
| 294 | { |
| 295 | Usb_Ep_Dscr *p_stdep; /* ep descriptor */ |
| 296 | union |
| 297 | { |
| 298 | USBD_EPIN_Status epin_status; |
| 299 | USBD_EPOUT_Status epout_status; |
| 300 | }ep_status; |
| 301 | }USBD_EP_Info; |
| 302 | |
| 303 | |
| 304 | typedef struct |
| 305 | { |
| 306 | Usb_If_Dscr *p_interface_desc; |
| 307 | USBD_EP_Info *p_ep_info[USBD_MAX_EP_PER_IF]; |
| 308 | kal_uint8 ep_number; |
| 309 | }USBD_IF_Info; |
| 310 | |
| 311 | |
| 312 | typedef struct |
| 313 | { |
| 314 | Usb_Cfg_Dscr *p_cfg_desc; |
| 315 | USBD_IF_Info *p_interface_info[USBD_MAX_IF_PER_CFG]; |
| 316 | kal_uint8 match_class_driver_index[USBD_MAX_IF_PER_CFG]; /* To store the class driver index for each interface */ |
| 317 | kal_uint8 match_class_driver_point; /* To store the weighting of class driver index for each configuration */ |
| 318 | kal_uint8 active_if_index_map; /* the index mapping that the active interface */ |
| 319 | kal_uint8 interface_number; |
| 320 | kal_uint8 match_class_num; /* the number that match class drivers, exclude default driver */ |
| 321 | }USBD_CFG_Info; |
| 322 | |
| 323 | |
| 324 | typedef struct |
| 325 | { |
| 326 | Usb_Dev_Dscr dev_desc; |
| 327 | USBD_CFG_Info cfg_info[USBD_MAX_CFG_NUM]; |
| 328 | // Usb_IAD_Dscr *iad_desc; |
| 329 | USBD_IF_Info interface_info[USBD_MAX_INTERFACE_NUM]; |
| 330 | USBD_EP_Info ep_info[USBD_MAX_EP_NUM]; |
| 331 | Usb_String_Dscr *string_desc; |
| 332 | Usb_Otg_Dscr *p_otg_desc[USBD_MAX_CFG_NUM]; |
| 333 | Usb_Dev_Qual_Dscr *dev_qual_dscr; |
| 334 | Usb_Other_Speed_Cfg_Dscr *other_speed_cfg_dscr; |
| 335 | // Usb_OS_String_Dscr *os_string_desc; |
| 336 | // Usb_Ext_Compat_ID_OS_Feature_Dscr *os_feature_desc; |
| 337 | kal_uint8 *p_conf_data[USBD_MAX_CFG_NUM]; |
| 338 | kal_uint8 cfg_number; |
| 339 | }USBD_Desc_Info; |
| 340 | |
| 341 | |
| 342 | typedef struct |
| 343 | { |
| 344 | kal_bool (* match)(kal_uint8 usb_ip_port, USBD_Desc_Info *p_desc_info, kal_uint32 cfg_num, kal_uint32 if_num); |
| 345 | void (* startup)(kal_uint8 usb_ip_port, USBD_Desc_Info *p_desc_info, kal_uint32 cfg_num, kal_uint32 if_num); |
| 346 | void (* detach)(kal_uint8 usb_ip_port); |
| 347 | void (* suspend)(kal_uint8 usb_ip_port); |
| 348 | void (* resume)(kal_uint8 usb_ip_port); |
| 349 | }USBD_ClassDriver_Struct; |
| 350 | |
| 351 | |
| 352 | typedef void (*usbd_ep0_callback)(kal_uint8 usb_ip_port, USB_HCD_STATUS result, kal_uint32 param); |
| 353 | |
| 354 | |
| 355 | typedef struct |
| 356 | { |
| 357 | USBD_Desc_Info desc_info; |
| 358 | USBD_EP0_STATE ep0_state; //states machine |
| 359 | USBD_EP0_Status ep0_status; |
| 360 | USBD_CH9_STATE ch9_state; |
| 361 | USBD_ClassDriver_Struct *class_driver_ptr[USBD_MAX_CLASS_DRIVER]; |
| 362 | usbd_ep0_callback ep0_callback; |
| 363 | kal_uint8 ch9_error_count; |
| 364 | USBD_HNP_SUPPORT_TYPE support_hnp; |
| 365 | kal_uint8 default_class_driver_index; |
| 366 | kal_bool b_is_match_hub; |
| 367 | kal_uint32 gpt_handle; /*GPT handle*/ |
| 368 | kal_mutexid usbd_ep0_mutex_id; /* mutex used to protect ep0 setup command. */ |
| 369 | kal_mutexid usbd_resume_mutex_id; /* mutex used to protect ep0 setup command. */ |
| 370 | kal_eventgrpid usbd_ep0_event_id; /* event used for ep0 command */ |
| 371 | kal_eventgrpid usbd_resume_event_id; /* event used for ep0 command */ |
| 372 | kal_bool b_suspend_mode; |
| 373 | kal_uint8 set_cfg_number; |
| 374 | kal_uint8 usb_ip_port; |
| 375 | }USBD_Struct; |
| 376 | |
| 377 | |
| 378 | typedef struct |
| 379 | { |
| 380 | kal_mutexid usbd_com_ep0_mutex_id; /* mutex used to let multiple IPs can be enumerated one by one*/ |
| 381 | kal_eventgrpid usbd_com_ep0_event_id; /* event used for waiting enumeration done */ |
| 382 | /* Customizable variables */ |
| 383 | const USB_HOST_MATCH_PARAM *host_match_param; |
| 384 | }USBD_Common_Struct; |
| 385 | |
| 386 | |
| 387 | |
| 388 | //extern void USBD_Deregister_Port_Info(kal_uint8 *usb_ip_port_ptr); |
| 389 | extern void USBD_Init_Status(kal_uint8 usb_ip_port); |
| 390 | extern void USBD_Init(kal_uint8 usb_ip_port); |
| 391 | extern void USBD_Release_Status(kal_uint8 usb_ip_port); |
| 392 | extern void USBD_Release(kal_uint8 usb_ip_port); |
| 393 | extern void USBD_Attatch_Hdlr(kal_uint8 usb_ip_port, USB_HCD_STATUS result, kal_uint32 param); |
| 394 | extern void USBD_Detach_Hdlr(kal_uint8 usb_ip_port, USB_HCD_STATUS result, kal_uint32 param); |
| 395 | extern void USBD_Suspend_Hdlr(kal_uint8 usb_ip_port, USB_HCD_STATUS result, kal_uint32 param); |
| 396 | extern USBD_HNP_SUPPORT_TYPE USBD_Get_HNP_Support(kal_uint8 usb_ip_port); |
| 397 | extern kal_bool USBD_Is_Match_Hub(kal_uint8 usb_ip_port); |
| 398 | extern void ICUSB_Drv_Init(void); |
| 399 | extern void USBD_Register_Port_Info(kal_uint8 usb_ip_port, kal_bool b_is_ext_ip); |
| 400 | |
| 401 | // Class layer usage API |
| 402 | extern void USBD_Clear_Feature(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str,kal_bool b_is_from_class_drv, usbd_ep0_callback callback); |
| 403 | extern void USBD_Start_Setup_Cmd(USBH_Common_Struct common_str, Usb_Command *usbd_cmd, kal_uint8* data_ptr, USBD_EP0_DATA_DIR direction, kal_uint32 length, kal_bool b_is_from_class_drv, usbd_ep0_callback callback); |
| 404 | extern kal_bool USBD_Send_Req(USBH_Common_Struct common_str,USBH_EP_Struct ep_str, kal_uint16 nBytes, void *pSrc); |
| 405 | extern kal_bool USBD_Recv_Req(USBH_Common_Struct common_str,USBH_EP_Struct ep_str, kal_uint16 nBytes, void *pDst); |
| 406 | extern void USBD_Suspend_Req(USBH_Common_Struct common_str); |
| 407 | extern void USBD_Reset_Req(USBH_Common_Struct common_str); |
| 408 | extern void USBD_Register_Drv_Info(USBH_Common_Struct common_str,USB_HCD_HDLR_TYPE type, USBH_EP_Struct usb_ep_str, usb_hcd_intr_handler_ptr hdlr); |
| 409 | extern kal_uint8 USBD_HW_Mapping_EP(USBH_Common_Struct common_str,USB_EP_DIRECTION direction); |
| 410 | extern void USBD_Dis_Attach(USBH_Common_Struct common_str); |
| 411 | extern void USBD_En_Attach(USBH_Common_Struct common_str); |
| 412 | extern void USBD_Config_TxEP_Type(USBH_Common_Struct common_str,USBH_EP_Struct ep_str,kal_bool b_is_switch_to_dma); |
| 413 | extern void USBD_Config_RxEP_Type(USBH_Common_Struct common_str,USBH_EP_Struct ep_str,kal_bool b_is_switch_to_dma); |
| 414 | extern void USBD_EP_Interval(USBH_Common_Struct common_str,USBH_EP_Struct ep_str,kal_uint8 interval); |
| 415 | extern void USBD_RxEPInit(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str); |
| 416 | extern void USBD_TxEPInit(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str); |
| 417 | extern void USBD_RxEPEn(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str, kal_uint8 interval, kal_bool bDMA); |
| 418 | extern void USBD_TxEPEn(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str, kal_uint8 interval, kal_bool bDMA); |
| 419 | extern void USBD_TxEPDis(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str, kal_bool bDMA); |
| 420 | extern void USBD_RxEPDis(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str, kal_bool bDMA); |
| 421 | extern void USBD_EPFIFORead(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str, kal_uint16 nBytes, void *pDst); |
| 422 | extern void USBD_EPFIFOWrite(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str, kal_uint16 nBytes, void *pDst); |
| 423 | extern kal_uint16 USBD_EP0_Data_Length(USBH_Common_Struct common_str); |
| 424 | extern kal_uint32 USBD_EP_Rx_Pkt_Len(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str); |
| 425 | extern void USBD_Clear_Data01(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str); |
| 426 | extern void USBD_Get_DMA_Channel(USBH_Common_Struct common_str,USBH_EP_Struct usb_tx_str, USBH_EP_Struct usb_rx_str, USB_EP_DIRECTION direction, kal_bool same_chan); |
| 427 | extern void USBD_Free_DMA_Channel(USBH_Common_Struct common_str,USBH_EP_Struct usb_tx_str, USBH_EP_Struct usb_rx_str, USB_EP_DIRECTION direction, kal_bool same_chan); |
| 428 | extern void USBD_DMA_Setup(USBH_Common_Struct common_str,USBH_EP_Struct ep_str,kal_uint32 addr, kal_uint32 length,usb_dma_callback callback,kal_bool callback_upd_run, kal_bool known_size, USB_DMA_TYPE dma_type); |
| 429 | extern void USBD_Set_EP_Max_Pkt(USBH_Common_Struct common_str,USBH_EP_Struct usb_ep_str); |
| 430 | extern kal_bool USBD_Get_UnMask_Irq(USBH_Common_Struct common_str); |
| 431 | extern kal_bool USBD_Is_High_Speed(USBH_Common_Struct common_str); |
| 432 | extern void USBD_VBusEnable(USBH_Common_Struct common_str,kal_bool enable); |
| 433 | extern kal_bool USBD_Bootup_Mode(void); |
| 434 | |
| 435 | |
| 436 | #endif /* USBD_H*/ |
| 437 | |