📄 isp1581.h
字号:
//**********************************************************************
//
// Filename: ISP1581.H
//
// Description: ISP1581 USB Function Platform-Dependent Driver header.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Use of this source code is subject to the terms of the Cirrus end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to
// use this source code. For a copy of the EULA, please see the
// EULA.RTF on your install media.
//
// Copyright(c) Cirrus Logic Corporation 2005, All Rights Reserved
//
//**********************************************************************
#ifndef _ISP1581_H_
#define _ISP1581_H_
#include <windows.h>
#include <usbfntypes.h>
#include <usbfn.h>
#define STR_MODULE _T("EP93XX_USBFN ")
#define SETFNAME() LPCTSTR pszFname = STR_MODULE _T(__FUNCTION__) _T(":")
//
// Definitions of the bit fields in the bmRequestType field of a setup packet.
//
#define USB_RT_DEVICE_TO_HOST 0x80
#define USB_RT_TYPE_MASK 0x60
#define USB_RT_TYPE_STANDARD 0x00
#define USB_RT_TYPE_CLASS 0x20
#define USB_RT_TYPE_VENDOR 0x40
#define USB_RT_RECIPIENT_MASK 0x1F
#define USB_RT_RECIPIENT_DEVICE 0x00
#define USB_RT_RECIPIENT_INTERFACE 0x01
#define USB_RT_RECIPIENT_ENDPOINT 0x02
//
// Definitions of the bit fields in the wIndex field of setup packets where the
// wIndex field is used to specify a endpoint (i.e. Clear_Feature, Get_Status,
// and Set_Feature).
//
//#define USB_ENDPOINT_DIRECTION_MASK 0x0080
#define USB_ENDPOINT_ADDRESS_MASK 0x000F
//
// Definitions of the features that can be specified in the wValue field of a
// Clear_Feature or Set_Feature setup packet.
//
#define USB_FEATURE_ENDPOINT_STALL 0x0000
#define USB_FEATURE_REMOTE_WAKEUP 0x0001
#define USB_FEATURE_POWER_D0 0x0002
#define USB_FEATURE_POWER_D1 0x0003
#define USB_FEATURE_POWER_D2 0x0004
#define USB_FEATURE_POWER_D3 0x0005
//
// Definitions of the wValue field for a Get_Descriptor setup packet.
//
#define USB_DESCRIPTOR_TYPE_MASK 0xFF00
#define USB_DESCRIPTOR_DEVICE 0x0100
#define USB_DESCRIPTOR_CONFIGURATION 0x0200
#define USB_DESCRIPTOR_STRING 0x0300
#define USB_DESCRIPTOR_INTERFACE 0x0400
#define USB_DESCRIPTOR_ENDPOINT 0x0500
/*
#define USB_DESCRIPTOR_STRING 0x0600
#define USB_DESCRIPTOR_INTERFACE 0x0700
#define USB_DESCRIPTOR_ENDPOINT 0x0800
*/
#define USB_DESCRIPTOR_INDEX_MASK 0x00FF
//
// Definitions of the device status returned for a Get_Status setup packet.
//
#define USB_DEVICE_STATUS_SELF_POWERED 0x01
#define USB_DEVICE_STATUS_REMOTE_WAKEUP 0x02
//
// Definitions of the endpoint status returned for a Get_Status setup packet.
//
#define USB_ENDPOINT_STATUS_STALLED 0x01
//****************************************************************************
//
// The following defines are specific the the Philips ISP1581 USB controller.
//
//****************************************************************************
//
// The base address of the ISP1581 USB controller.
//
#define HwUSBBase 0xEE000000//0x70000000
//
// The offsets of the individual registers in the ISP1581 USB controller.
//
#define HwUSBAddress 0x00000000
#define HwUSBEndpointMaxPacketSize 0x00000004
#define HwUSBEndpointType 0x00000008
#define HwUSBMode 0x0000000c
#define HwUSBIntConfig 0x00000010
#define HwUSBIntEnable 0x00000014
#define HwUSBIntReason 0x00000018
#define HwUSBEndpointBufferLength 0x0000001c
#define HwUSBEndpointData 0x00000020
#define HwUSBEndpointShortPacket 0x00000024
#define HwUSBEndpointControl 0x00000028
#define HwUSBEndpointIndex 0x0000002c
#define HwUSBDMACommand 0x00000030
#define HwUSBDMACount 0x00000034
#define HwUSBDMAConfig 0x00000038
#define HwUSBDMAHardware 0x0000003c
#define HwUSBDMAIntReason 0x00000050
#define HwUSBDMAIntEnable 0x00000054
#define HwUSBDMAEndpoint 0x00000058
#define HwUSBDMAStrobeTiming 0x00000060
#define HwUSBChipID 0x00000070
#define HwUSBFrameNumber 0x00000074
#define HwUSBScratch 0x00000078
#define HwUSBUnlock 0x0000007c
#define HwUSBTest 0x00000084
//
// Definitions of the bit fields in the Address register.
//
#define USB_ADDRESS_DEVICE_ENABLE 0x0080
#define USB_ADDRESS_DEVICE_ADDR_MASK 0x007f
#define USB_ADDRESS_DEVICE_ADDR_SHIFT 0
//
// Definitions of the bit fields in the EndpointMaxPacketSize register.
//
#define USB_EPMAXPACKET_NTRANS_MASK 0x00001800
#define USB_EPMAXPACKET_NTRANS_ONE 0x00000000
#define USB_EPMAXPACKET_NTRANS_TWO 0x00000800
#define USB_EPMAXPACKET_NTRANS_THREE 0x00001000
#define USB_EPMAXPACKET_FIFO_SIZE_MASK 0x000007ff
#define USB_EPMAXPACKET_FIFO_SIZE_SHIFT 0
//
// Definitions of the bit fields in the EndpointType register.
//
#define USB_EPTYPE_NO_EMPTY 0x00000010
#define USB_EPTYPE_ENABLE 0x00000008
#define USB_EPTYPE_DOUBLE_BUFFER 0x00000004
#define USB_EPTYPE_TYPE_MASK 0x00000003
#define USB_EPTYPE_TYPE_CONTROL 0x00000000
#define USB_EPTYPE_TYPE_ISOCHRONOUS 0x00000001
#define USB_EPTYPE_TYPE_BULK 0x00000002
#define USB_EPTYPE_TYPE_INTERRUPT 0x00000003
//
// Definitions of the bit fields in the Mode register.
//
#define USB_MODE_CLOCK_ON 0x0080
#define USB_MODE_SEND_RESUME 0x0040
#define USB_MODE_GO_SUSPEND 0x0020
#define USB_MODE_SOFT_RESET 0x0010
#define USB_MODE_INT_ENABLE 0x0008
#define USB_MODE_WAKE_UP_CS 0x0004
#define USB_MODE_SOFT_CONNECT 0x0001
//
// Definitions of the bit fields in the IntConfig register.
//
#define USB_INTCONFIG_CDBGMOD_MASK 0x000000c0
#define USB_INTCONFIG_CDBGMOD_ALL 0x00000000
#define USB_INTCONFIG_CDBGMOD_ACK 0x00000040
#define USB_INTCONFIG_CDBGMOD_ACK_1NAK 0x00000080
#define USB_INTCONFIG_DDBGMODIN_MASK 0x00000030
#define USB_INTCONFIG_DDBGMODIN_ALL 0x00000000
#define USB_INTCONFIG_DDBGMODIN_ACK 0x00000010
#define USB_INTCONFIG_DDBGMODIN_ACK_1NAK 0x00000020
#define USB_INTCONFIG_DDBGMODOUT_MASK 0x0000000c
#define USB_INTCONFIG_DDBGMODOUT_ALL 0x00000000
#define USB_INTCONFIG_DDBGMODOUT_ACK 0x00000004
#define USB_INTCONFIG_DDBGMODOUT_ACK_1NAK 0x00000008
#define USB_INTCONFIG_INTLVL 0x00000002
#define USB_INTCONFIG_INTPOL 0x00000001
//
// Definitions of the bit fields in the IntEnable and IntReason registers.
//
#define USB_INT_EP7_TX 0x02000000
#define USB_INT_EP7_RX 0x01000000
#define USB_INT_EP6_TX 0x00800000
#define USB_INT_EP6_RX 0x00400000
#define USB_INT_EP5_TX 0x00200000
#define USB_INT_EP5_RX 0x00100000
#define USB_INT_EP4_TX 0x00080000
#define USB_INT_EP4_RX 0x00040000
#define USB_INT_EP3_TX 0x00020000
#define USB_INT_EP3_RX 0x00010000
#define USB_INT_EP2_TX 0x00008000
#define USB_INT_EP2_RX 0x00004000
#define USB_INT_EP1_TX 0x00002000
#define USB_INT_EP1_RX 0x00001000
#define USB_INT_EP0_TX 0x00000800
#define USB_INT_EP0_RX 0x00000400
#define USB_INT_EP0_SETUP 0x00000100
#define USB_INT_DMA 0x00000040
#define USB_INT_HS_STATUS 0x00000020
#define USB_INT_RESUME 0x00000010
#define USB_INT_SUSPEND 0x00000008
#define USB_INT_PSEUDO_SOF 0x00000004
#define USB_INT_SOF 0x00000002
#define USB_INT_BUS_RESET 0x00000001
//
// Definitions of the bit fields in the EndpointBufferLength register.
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -