?? usbdriver.h
字號:
/****************************************Copyright (c)**************************************************
** Guangzou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name: USBDriver.h
** Last modified Date: 2005-8-6
** Last Version: V1.0
** Descriptions: LPC214x USB 應用層
** LPC214x USB Application Layer
**------------------------------------------------------------------------------------------------------
** Created by: 鄭明遠 MingYuan Zheng
** Created date: 2005-8-6
** Version: V1.0
** Descriptions: 初始版本 The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/
#ifndef __USBDRIVER_H__
#define __USBDRIVER_H__
/**************** 定義 USB 收發錯誤碼 ***************************/
#define USB_NO_ERR 0x00 /* 正確 */
#define USB_ERR_NO_CONFIG 0x01 /* USB總線未配置完成錯誤 */
#define USB_ERR_BUFF_INVALID 0x02 /* 接收或發送緩沖區錯誤 */
#define USB_ERR_WR_TIMEOUT 0x03 /* 接收或發送超時錯誤 */
#define USB_ERR_READ_CHIPID 0x10 /* 讀芯片ID號錯誤 */
/*************************************************************
*
* 下面為向用戶開放的 API 函數
*
**************************************************************/
/***********************************************************************************************************************
** 函數名稱 : USB_Initialize() Name : USB_Initialize()
** 功能描述 : 初始化 USB 設備控制器 Function : Initialize the USB device controller
** 輸 入 : 無 Input : NULL
** 輸 出 : 0: 初始化成功 >0: 初始化失敗(錯誤碼) Output : 0: Initialize sucessfully >0: Initialize fail(error code)
***********************************************************************************************************************/
extern INT8U USB_Initialize(void);
/*******************************************************************************************************************************
** 函數名稱: INT8U ReadPort1() Name: INT8U ReadPort1()
** 功能描述: 從端口 1 接收len個字節 Function: receive len Bytes from Port1
** 輸 入: INT32U len: 要接收的字節數 Input: INT32U len: numbers will be receive
(取值范圍為0x00000001 ~ 0xFFFFFFFF) (range: 0x00000001 ~ 0xFFFFFFFF)
INT8U recbuff: 接收緩沖區指針 INT8U recbuff: receive buffer
INT16U timeout: 超時等待時間, 等于0表示無限等待 INT16U timeout: timeout of receiving,0 indicates limitless waiting
** 輸 出: 0: 接收成功 > 0: 接收失敗(錯誤碼) Output: 0: sucessfully >0 fail (error code)
*******************************************************************************************************************************/
extern INT8U USB_ReadPort1(INT32U len, INT8U *recbuff, INT16U timeout);
/*******************************************************************************************************************************
** 函數名稱: INT8U ReadPort2() Name: INT8U ReadPort2()
** 功能描述: 從端口 2 接收len個字節 Function: receive len Bytes from Port2
** 輸 入: INT32U len: 要接收的字節數 Input: INT32U len: numbers will be receive
(取值范圍為0x00000001 ~ 0xFFFFFFFF) (range: 0x00000001 ~ 0xFFFFFFFF)
INT8U recbuff: 接收緩沖區指針 INT8U sendbuff: receive buffer
INT16U timeout: 超時等待時間, 等于0表示無限等待 INT16U timeout: timeout of receiving,0 indicates limitless waiting
** 輸 出: 0: 接收成功 > 0: 接收失敗(錯誤碼) Output: 0: sucessfully >0 fail (error code)
*******************************************************************************************************************************/
extern INT8U USB_ReadPort2(INT32U len, INT8U *recbuff, INT16U timeout);
/*******************************************************************************************************************************
** 函數名稱: INT8U ReadPort3() Name: INT8U ReadPort3()
** 功能描述: 從端口 3 接收len個字節 Function: receive len Bytes from Port3
** 輸 入: INT32U len: 要接收的字節數 Input: INT32U len: numbers will be receive
(取值范圍為0x00000001 ~ 0xFFFFFFFF) (range: 0x00000001 ~ 0xFFFFFFFF)
INT8U recbuff: 接收緩沖區指針 INT8U sendbuff: receive buffer
INT16U timeout: 超時等待時間, 等于0表示無限等待 INT16U timeout: timeout of receiving,0 indicates limitless waiting
** 輸 出: 0: 接收成功 > 0: 接收失敗(錯誤碼) Output: 0: sucessfully >0 fail (error code)
*******************************************************************************************************************************/
extern INT8U USB_ReadPort3(INT32U len, INT8U *recbuff, INT16U timeout);
/*******************************************************************************************************************************
** 函數名稱: INT8U WritePort1() Name: INT8U WritePort1()
** 功能描述: 用端口 1 發送len個字節 Function: Send len Bytes via Port1
** 輸 入: INT32U len: 發送的字節數 Input: INT32U len: numbers will be send
(取值范圍為0x00000001 ~ 0xFFFFFFFF) (range: 0x00000001 ~ 0xFFFFFFFF)
INT8U sendbuff: 發送緩沖區指針 INT8U sendbuff: send buffer
INT16U timeout: 超時等待時間, 等于0表示無限等待 INT16U timeout: timeout of transmitting,0 indicates limitless waiting
** 輸 出: 0: 發送成功 > 0: 發送失敗(錯誤碼) Output: 0: sucessfully >0 fail (error code)
*******************************************************************************************************************************/
extern INT8U USB_WritePort1(INT32U len, INT8U *sendbuff, INT16U timeout);
/*******************************************************************************************************************************
** 函數名稱: INT8U WritePort2() Name: INT8U WritePort2()
** 功能描述: 用端口 2 發送len個字節 Function: Send len Bytes via Port2
** 輸 入: INT32U len: 發送的字節數 Input: INT32U len: numbers will be send
(取值范圍為0x00000001 ~ 0xFFFFFFFF) (range: 0x00000001 ~ 0xFFFFFFFF)
INT8U sendbuff: 發送緩沖區指針 INT8U sendbuff: send buffer
INT16U timeout: 超時等待時間, 等于0表示無限等待 INT16U timeout: timeout of transmitting,0 indicates limitless waiting
** 輸 出: 0: 發送成功 > 0: 發送失敗(錯誤碼) Output: 0: sucessfully >0 fail (error code)
*******************************************************************************************************************************/
extern INT8U USB_WritePort2(INT32U len,INT8U *sendbuff,INT16U timeout);
/*******************************************************************************************************************************
** 函數名稱: INT8U WritePort3() Name: INT8U WritePort3()
** 功能描述: 用端口 3 發送len個字節 Function: Send len Bytes via Port3
** 輸 入: INT32U len: 發送的字節數 Input: INT32U len: numbers will be send
(取值范圍為0x00000001 ~ 0xFFFFFFFF) (range: 0x00000001 ~ 0xFFFFFFFF)
INT8U sendbuff: 發送緩沖區指針 INT8U sendbuff: send buffer
INT16U timeout: 超時等待時間, 等于0表示無限等待 INT16U timeout: timeout of transmitting,0 indicates limitless waiting
** 輸 出: 0: 發送成功 > 0: 發送失敗(錯誤碼) Output: 0: sucessfully >0 fail (error code)
*******************************************************************************************************************************/
extern INT8U USB_WritePort3(INT32U len,INT8U *sendbuff,INT16U timeout);
/**************************************************************************************************************
** 函數名稱: Get_ZLG_USBD13Ver
** 功能描述: 得到 ZLG/USBD13 軟件包版本號
** 輸 入: 無
** 輸 出: ZLG/USBD13 軟件包版本號
***************************************************************************************************************/
extern INT16U Get_ZLG_USBD13Ver(void);
#endif
/*******************************************************************************************************
** End Of File
********************************************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -