- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
USBHost.h
资源名称:SDK_M5661.rar [点击查看]
上传用户:hjhsjcl
上传日期:2020-09-25
资源大小:11378k
文件大小:5k
源码类别:
压缩解压
开发平台:
C++ Builder
- /*******************************************************************
- *
- * Copyright (C) 2002 ALI Corporation. All Rights Reserved.
- *
- * File: Uhc.h
- *
- * Contents: define functions in Uhc.c
- *
- * History:
- * Date By Reason
- * =========== ======= ====================
- * 12/26/2002 stonezhu development
- * 23/06/2003 Steven modified
- * 17/10/2003 Steven modified
- *******************************************************************/
- //add by tne for USB write protect
- //#define CMD_MODE_SENSE_10 0x5A
- #define NULL 0
- #ifdef _USB_HOST_H_
- #define EXTERN
- #else
- #define EXTERN extern
- #endif
- //const
- //DMA Control/Status Resigter
- #define BULK_EN 0x80
- #define BULK_DISJ 0x7F
- #define BULK_OUT 0x40
- #define BULK_INJ 0xB0
- #define HOST_STOP 0x20
- #define HOST_STOP_DISJ 0xDF
- #define FIFO_CLR_DIS 0x10
- #define FIFO_CLR_ENJ 0xEF
- #define FRC_EOT 0x08
- #define BUF_EMPTY 0x04
- // usb Host Enable/Disable interupt
- #define ENABLE_USB_CONNECTION 0x01
- #define ENABLE_USB_RESET 0x02
- #define ENABLE_USB_SUSPEND 0x04
- #define ENABLE_USB_PORT_ERROR 0x08
- #define ENABLE_USB_SOF 0x10
- #define ENABLE_USB_DMA_FINISH 0x20
- #define ENABLE_EPC_FINISH_ERROR 0x01
- #define ENABLE_EPB_FINISH_ERROR 0x02
- #define ENABLE_EPA_FINISH_ERROR 0x04
- #define ENABLE_EP0_FINISH_ERROR 0x08
- #define ENABLE_EPC_FINISH_OK 0x10
- #define ENABLE_EPB_FINISH_OK 0x20
- #define ENABLE_EPA_FINISH_OK 0x40
- #define ENABLE_EP0_FINISH_OK 0x80
- #define DISABLE_USB_CONNECTION 0xFE
- #define DISABLE_USB_RESET 0xFD
- #define DISABLE_USB_SUSPEND 0xFB
- #define DISABLE_USB_PORT_ERROR 0xF7
- #define DISABLE_USB_SOF 0xEF
- #define DISABLE_USB_DMA_FINISH 0xDF
- #define DISABLE_EPC_FINISH_ERROR 0xFE
- #define DISABLE_EPB_FINISH_ERROR 0xFD
- #define DISABLE_EPA_FINISH_ERROR 0xFB
- #define DISABLE_EP0_FINISH_ERROR 0xF7
- #define DISABLE_EPC_FINISH_OK 0xEF
- #define DISABLE_EPB_FINISH_OK 0xDF
- #define DISABLE_EPA_FINISH_OK 0xBF
- #define DISABLE_EP0_FINISH_OK 0x7F
- // Endpoint Fifo Control Register
- #define EP0_FIFO_EMPTY 0x80
- #define EP0_FIFO_FULL 0x40
- #define EP0_FIFO_FORCE_SEND 0x20
- #define EP0_FIFO_CLEAR 0x10
- #define EP0_FIFO_NORMAL 0xEF
- #define EP0_FIFO_PID_SETUP 0x00
- #define EP0_FIFO_PID_OUT 0x01
- #define EP0_FIFO_PID_IN 0x02
- #define EP0_FIFO_PID_CLEAR 0xFC
- #define EPA_FIFO_EMPTY 0x80
- #define EPA_FIFO_FULL 0x40
- #define EPA_FIFO_FORCE_SEND 0x20
- #define EPA_FIFO_CLEAR 0x10
- #define EPA_FIFO_NORMAL 0xEF
- #define EPB_FIFO_EMPTY 0x80
- #define EPB_FIFO_FULL 0x40
- #define EPB_FIFO_FORCE_IN 0x20
- #define EPB_FIFO_CLEAR 0x10
- #define EPB_FIFO_NORMAL 0xEF
- // Usb setup packet bRequest
- #define CLEAR_FEATURE 0x01
- #define GET_CONFIGURATION 0x08
- #define GET_DESCRIPTOR 0x06
- #define GET_INTERFACE 10
- #define GET_STATUS 0
- #define SET_ADDRESS 5
- #define SET_CONFIGURATION 9
- #define SET_FEATURE 3
- #define SET_INTERFACE 11
- #define SYNCH_FRAME 12
- // Usb endpoint type
- #define BULK_ENDPOINT 0x02
- #define CONTROL_ENDPOINT 0x00
- #define ISO_ENDPOINT 0x01
- #define INT_ENDPOINT 0x03
- #define EP0 0x00
- #define EPA 0x01
- #define EPB 0x02
- #define EPC 0x03
- // Usb descriptor type
- #define DEVICE 1
- #define CONFIGURATION 2
- #define STRING 3
- #define INTERFACE 4
- #define ENDPOINT 5
- #define OTG 9
- #define MASS_STORAGE_CLASS 8
- #define BULK_ONLY 0x50
- #define CBI 0x00
- #define CB 0x01
- // Usb descriptor length
- #define DEVICE_LENGTH 0x12
- #define CONFIGURATION_LENGTH 0x9
- #define INTERFACE_LENGTH 0x9
- #define ENDPOINT_LENGTH 0x7
- /*==========================================================================
- Copyright (c) 2004 ALi Corporation. All Rights Reserved
- File: Host.h
- content:
- History: Created by Ideal Xiong 2004/07/05
- ==========================================================================*/
- /*******************************************************************
- *
- * Copyright (C) 2002 ALI Corporation. All Rights Reserved.
- *
- * File: UsbHost.h
- *
- * Contents: define m5637 some error number
- *
- * History:
- * Date By Reason
- * =========== ======= ====================
- * 23/06/2003 Steven Development
- * 17/10/2003 Steven modified
- * 07/2005 Allen devolepment for 5661
- *******************************************************************/
- //functions
- API void UmsRequestSense(void) large;
- API BYTE UmsSendPIOCmd(BYTE Cmd) large;
- #if(_HOST_API_INIT_)
- EXTERN API bit UsbHostInit(void) large; //050105 050710
- #endif
- #if(_HOST_COMMON_)
- EXTERN API bit UsbHostRead(void) large; //050105
- EXTERN API bit UsbHostWrite(void) large; //050105
- #endif
- #if(_HOST_COPY_&&_HOST_COMMON_) //050919
- EXTERN API bit UsbHostCopyRw(bit Readflag,BYTE bType) large; //050710
- #endif
- #undef EXTERN
- #undef _AT_