⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usbd11.h

📁 usb driver, sample for usb driver develop. rised for reference
💻 H
字号:
/***************************************************************************
* C Source Header File:  USBD11.H
*
* Copyright 2001 DeVaSys
* All rights are reserved.
* No part of this document may be reproduced, stored, or transmitted in any
* form or by any means without the prior written permission of DeVaSys
*
* Description:
*
* This header contains declarations and defines to support the USBD11.C
* source module.
*
* ........................ Revision History ................................
*
* Creation date: 02/22/2001 - Michael A. DeVault, DeVaSys
*
* Revision History Summary:
*
* Rev 1.0   22 February 2001 12:00:00   mad
*   Initial revision.
*
***************************************************************************/
/* following ifndef is for skipping double includes of this header file */
#if !defined(__USBD11_H)
	#define __USBD11_H

#include "portable.h"

#define D11_CMD_POR_INIT			0xD0
#define D11_CMD_SET_ADDRESS		0xD1
#define D11_CMD_SET_EPEN			0xD8
#define D11_CMD_SET_MODE			0xF3
#define D11_CMD_GET_IRQ				0xF4
#define D11_CMD_GET_LTSTAT		0x40
#define D11_CMD_GET_EPSTAT		0x80
#define D11_CMD_SET_EPSTAT		0x40
#define D11_CMD_SEND_RESUME		0xF6
#define D11_CMD_GET_FRAME			0xF5

#define D11_CMD_ACK_SETUP			0xF1
#define D11_CMD_CLEAR_BUF			0xF2
#define D11_CMD_VALID_BUF			0xFA
#define D11_CMD_READ_BUF			0xF0
#define D11_CMD_WRITE_BUF			0xF0
#define D11_CMD_EP_SELECT			0x00

#define D11_EPSTAT_FULLBUF		0x20
#define D11_EPSTAT_DATA1			0x10
#define D11_EPSTAT_STALL			0x08
#define D11_EPSTAT_SETUP			0x04

#define D11_LTSTAT_PRVNRD			0x80
#define D11_LTSTAT_DATA1			0x40
#define D11_LTSTAT_SETUP			0x20
#define D11_LTSTAT_ERROR			0x1E
#define D11_LTSTAT_RXTXOK			0x01

#define WR_DATA								0x00
#define RD_DATA								0x01

#define D11_EP0OUT_IDX			0x02
#define D11_EP0IN_IDX				0x03
#define D11_EP1OUT_IDX			0x05
#define D11_EP1IN_IDX				0x04
#define D11_EP2OUT_IDX			0x06
#define D11_EP2IN_IDX				0x07
#define D11_EP3OUT_IDX			0x08
#define D11_EP3IN_IDX				0x09

#define D11_INT_BUSRESET	0x4000
#define D11_INT_HUBEP0OUT	0x0001
#define D11_INT_HUBEP0IN	0x0002
#define D11_INT_EP0OUT		0x0004
#define D11_INT_EP0IN			0x0008
#define D11_INT_EP1OUT		0x0020
#define D11_INT_EP1IN			0x0010
#define D11_INT_EP2OUT		0x0040
#define D11_INT_EP2IN			0x0080
#define D11_INT_EP3OUT		0x0100
#define D11_INT_EP3IN			0x0200

#define USB_CLEAR_FEATURE_DEVICE					0x01
#define USB_SET_FEATURE_DEVICE						0x03
#define USB_SET_ADRRESS										0x05
#define USB_SET_CONFIG										0x09
#define USB_CLEAR_FEATURE_INTERFACE				0x11
#define USB_SET_FEATURE_INTERFACE					0x13
#define USB_SET_INTERFACE									0x1B
#define USB_CLEAR_FEATURE_ENDPOINT				0x21
#define USB_SET_FEATURE_ENDPOINT					0x23

#define USB_GET_STATUS_DEVICE							0x80
#define USB_GET_SDD												0x86
#define USB_GET_CONFIG										0x88
#define USB_GET_STATUS_INTERFACE					0x90
#define USB_GET_INTERFACE									0x9A
#define USB_GET_STATUS_ENDPOINT						0xA0

#define USB_SET_VENDOR_I2C_WRITE					0x40
#define USB_GET_VENDOR_I2C_READ						0xC0
#define USB_SET_VENDOR_HEX								0x4F
#define USB_GET_VENDOR_STAT								0xCE

#define D11_REG_CMD			0x36
#define D11_REG_DATA		0x34

/* D11 USB function prototypes */
void D11_CfgInit(void);
void D11_CfgClr(void);
WORD D11_GetIrq(void);
BYTE D11_GetLtStat(BYTE byEpIdx);
BYTE D11_GetEpStat(BYTE byEpIdx);
void D11_AckSetup(void);
void D11_SetEpStall(BYTE byEpIdx);
void D11_ClrEpStall(BYTE byEpIdx);
void D11_WrEp(BYTE byEpIdx, BYTE * pbyData, BYTE byCount);
BYTE D11_ClrEp(BYTE byEpIdx);
BYTE D11_RdEp(BYTE * pbyData, BYTE byEpIdx);
void D11_TxNull(BYTE byEpIdx);

BYTE D11_CmdDataI2C(BYTE byCmd, BYTE * pbyData, BYTE byCount, BYTE byRead);


/* following endif is for skipping double includes of this header file */
#endif




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -