📄 hnp.h
字号:
/*-----------------------------------------------------------------------------
$File: //hodad/usblink/3.4/source/hostctrl/otg242/hnp.h $
$DateTime: 2003/09/08 15:17:45 $
$Revision: #1 $
Purpose: OTG242 Host Negotiation Protocol data and macro definitions.
CONFIDENTIAL AND PROPRIETARY INFORMATION OF SOFTCONNEX TECHNOLOGIES, INC.
THIS NOTICE IS NOT TO BE DELETED, MODIFIED, MOVED OR CHANGED IN ANY WAY.
Copyright (c) 1999 - 2003 by SoftConnex Technologies, Inc.
This software is protected by copyright laws and international copyright
treaties, as well as other intellectual property laws and treaties. This
software is a CONFIDENTIAL, unpublished work of authorship, and with portions
constituting TRADE SECRETS of SoftConnex Technologies, Inc., a Delaware USA
corporation. Any unauthorized use, disclosure, and/or reproduction of this
software, or any part of this software; or distribution of this software in any
form or by any means; or storage of this software in any database or retrieval
system, without the express written consent of, and license from, SoftConnex
Technologies, Inc. is strictly prohibited. This software is protected under the
copyright and/or trade secret laws in other countries in addition to USA. All
Rights Reserved. Failure to abide by the use, disclosure and/or reproduction
restrictions may result in civil and /or criminal penalties, and will be
prosecuted to the maximum extent of the law.
-----------------------------------------------------------------------------*/
#ifndef _SOFTCONNEX_OTG242HNP_H_
#define _SOFTCONNEX_OTG242HNP_H_
#include "top.h"
#define OTG242HNP_CTRL OTG242_HNPCONTROLSTATUS
#define OTG242HNP_CTRL_BUS_REQUEST 0x00000002
#define OTG242HNP_CTRL_BUS_DROP 0x00000004
#define OTG242HNP_CTRL_CLEAR_ERROR 0x00000008
#define OTG242HNP_CTRL_HNP_STATE 0x000001F0
#define OTG242HNP_CTRL_SWPDDM 0x00000200 /* SoftwarePullDownDM */
#define OTG242HNP_CTRL_SWPUDP 0x00000800 /* SoftwarePullUpDP */
#define OTG242HNP_CTRL_SWAUTORST 0x00001000 /* SoftwareAutomaticReset */
#define OTG242HNP_CTRL_SWVBUSPUL 0x00008000 /* SoftwareVBusPulse */
#define OTG242HNP_CTRL_IS_A_DEVICE 0x00020000
#define OTG242HNP_CTRL_IS_B_DEVICE 0x00040000
#define OTG242HNP_CTRL_COMPARATOR_ENABLE 0x00080000
#define OTG242HNP_CTRL_HNPCS_MASTER 0x00200000 /* HnpMasterState */
#define OTG242HNP_CTRL_HNPCS_SLAVE 0x00400000 /* HnpSlaveState */
#define OTG242HNP_CTRL_B_HNP_ENABLE 0x01000000
#define OTG242HNP_CTRL_AREMOTE_HNP_ENABLE 0x02000000
#define OTG242HNP_CTRL_VBUSGTAVV 0x08000000 /* VBusGreaterThanAVBusValid */
#define OTG242HNP_CTRL_VBUSABSV 0x10000000 /* VBusABSessionValid */
#define OTG242HNP_CTRL_VBUSGTBSE 0x20000000 /* VBusGreaterThanBSessionEnd */
#define OTG242HNP_CTRL_HNPDAT 0x40000000 /* HnpDataToggle */
/* HNP STATE */
#define OTG242HNP_CTRL_HNP_A_IDLE 0x00000000
#define OTG242HNP_CTRL_HNP_A_MASTER 0x00000010
#define OTG242HNP_CTRL_HNP_A_SLAVE 0x00000020
#define OTG242HNP_CTRL_HNP_A_SUSPEND 0x00000090
#define OTG242HNP_CTRL_HNP_A_VBUS_ERR 0x000000B0
#define OTG242HNP_CTRL_HNP_A_WAIT_B_REQ 0x000000D0
#define OTG242HNP_CTRL_HNP_B_IDLE 0x00000000
#define OTG242HNP_MNP_NOT_ENABLED 0x00
#define OTG242HNP_A_IDLE 0x10
#define OTG242HNP_A_WAIT_VRISE 0x11
#define OTG242HNP_A_WAIT_BCON 0x12
#define OTG242HNP_A_HOST 0x13
#define OTG242HNP_A_SUSPEND 0x14
#define OTG242HNP_A_PERIPHERAL 0x15
#define OTG242HNP_A_WAIT_VFALL 0x16
#define OTG242HNP_A_VBUS_ERR 0x17
#define OTG242HNP_B_IDLE 0x20
#define OTG242HNP_B_SRP_INIT 0x21
#define OTG242HNP_B_PERIPHERAL 0x22
#define OTG242HNP_B_WAIT_ACON 0x23
#define OTG242HNP_B_HOST 0x24
#define OTG242HNP_OTG_PORT 0x1
#define OTG242HNP_A_WAIT_VRISE_TIMEOUT 200
#define OTG242HNP_ReadReg(hnp, reg) HW_ReadOtg242Register(hnp->otg->regBase, reg)
#define OTG242HNP_WriteReg(hnp, reg, val) HW_WriteOtg242Register(hnp->otg->regBase, reg, val)
struct _Otg242;
typedef struct _Otg242Hnp
{
struct _Otg242 *otg;
U32 workingState;
U32 otgPortMode;
U32 status;
}
Otg242Hnp;
SctStatus OTG242HNP_Create(Otg242Hnp *hnp, struct _Otg242 *otg);
SctStatus OTG242HNP_Initialize(Otg242Hnp* hnp);
void OTG242HNP_Delete(Otg242Hnp *hnp);
void OTG242HNP_IntrHandler(Otg242Hnp *hnp, U32 status);
#endif /* _SOFTCONNEX_OTG242HNP_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -