csl_usbhc.h

来自「dsp在音频处理中的运用」· C头文件 代码 · 共 1,496 行 · 第 1/4 页

H
1,496
字号
/** ===========================================================================
*   Copyright (c) Texas Instruments Inc 2002, 2003, 2004
*
*   Use of this software is controlled by the terms and conditions found
*   in the license agreement under which this software has been supplied
*   priovided
*   ===========================================================================
*/
/** @mainpage USB Host Controller
*
* @section Introduction
*
* @subsection xxx Purpose and Scope
* The purpose of this document is to identify a set of common CSL APIs for
* the USB Host Controller Module across various devices. The CSL developer
* is expected to refer to this document while implementing APIs for these
* modules . Some of the listed APIs may not be applicable to a given USB
* Host Controller Module. While in other cases this list of APIs may not be
* sufficient to cover all the features of a particular USB Host
* Controller Module. The CSL developer should use his/her discretion in
* designing new APIs or extending the existing ones to cover these. However, 
* much deviation is not expected since the Module is compliant to the OHCI
* specification.
*
*
*
* @subsection aaa Terms and Abbreviations
*   -# CSL  :  Chip Support Library
*   -# API  :  Application Programmer Interface
*   -# USB  :  Universal Serial Bus
*   -# HC   :  Host Controller
*   -# OHCI :  Open Host Controller Interface
*   -# USBHC:  USB Host Controller
*
* @subsection References
*    -# CSL 3.x Technical Requirements Specifications Version 0.5, dated
*       May 14th, 2003
*    -# The OMAP 1610 Technical Reference Manual (SWPU062B)
*    -# OHCI Specification version 1.0a dated 09/14/1999
*
* @subsection Assumptions
*     The abbreviations USB, OHCI, USBHC have been used throughout this
*     document to refer to the OMAP 1610 USB Host Controller Module
*/

/** @file csl_usbhc.h
*
*  @brief    Header file for functional layer of CSL
*
*  Description
*    - The different enumerations, structure definitions
*      and function declarations
*/
/*
*  Modification 1
*     - date   : 23 Dec, 2003
*     - reason : Modification to the CSL_UsbhcHwStart structure
*  Modification 2
*     - date   : 23 Dec, 2003
*     - reason : Modification to the CSL_UsbhcHwCtrlSetup structure
*  Modification 3
*     - date   : 29 Dec, 2003
*     - reason : Enhancement of comments and documentation
*  Modification 4
*     - date   : 20 Jan, 2004
*     - reason : Enhancement of comments and documentation
*  @date 15th Dec, 2003
*  @author Ruchika Kharwar
*/

#ifndef _CSL_USBHC_H_
#define _CSL_USBHC_H_       

#ifdef __cplusplus
extern "C" {
#endif

#include <csl.h>
#include <cslr_usbhc.h>


/**************************************************************************\
* USBHC global macro declarations
\**************************************************************************/
/* Macros - events, used for
* a. Interrupt Status intepretation
* b. Interrupt Enable
* c. Interrupt Disable
*/

/** @defgroup CSL_USBHC_API CSL USB Host Controller API's */
/** @defgroup CSL_USBHC_EVENT_SYMBOL Symbols for Events
*   @ingroup CSL_USBHC_CONTROL_API CSL_USBHC_QUERY_API
*
*
* @{ */
/** Master Interrupt */
#define CSL_USBHC_EVENT_MSINTR		           0x80000000
/** Ownership Change */
#define CSL_USBHC_EVENT_OWNERSHIP_CHG          0x40000000
/** Root hub Status change */
#define CSL_USBHC_EVENT_ROOTHUBSTATUS_CHG      0x00000040
/** Frame number overflow */
#define CSL_USBHC_EVENT_FRMNUM_OVRFLOW         0x00000020
/** Unrecoverable error occured */
#define CSL_USBHC_EVENT_UNRECOVERERROR		   0x00000010
/** Resume signalling detected */
#define CSL_USBHC_EVENT_RESUME_DETECT		   0x00000008
/** Start of Frame Event */
#define CSL_USBHC_EVENT_SOF					   0x00000004
/** Done Head written */
#define CSL_USBHC_EVENT_WRITEDONEHEAD		   0x00000002
/** Scheduling overrun event */
#define CSL_USBHC_EVENT_SCHED_OVRRUN     	   0x00000001
/**
@} */
/** @defgroup CSL_USBHC_ROOTHUBSTATUS_SYMBOL Symbols for Root Hub Status
*   @ingroup CSL_USBHC_QUERY_API
*
* @{ */
/* Macros - Root Hub Status
* a. Root Hub Status intepretation
*/
/** Overcurrent indication change  */
#define CSL_USBHC_ROOTHUBSTATUS_OVRCURR_CHG    0x00020000
/** Local power status change  */
#define CSL_USBHC_ROOTHUBSTATUS_LOCPOWER_CHG   0x00010000
/** Device Remote wakeup enable  */
#define CSL_USBHC_ROOTHUBSTATUS_DEVRMWKUP      0x00008000
/** Overcurrent indication  */
#define CSL_USBHC_ROOTHUBSTATUS_OVRCURR        0x00000002
/** Local power status  */
#define CSL_USBHC_ROOTHUBSTATUS_LOCPOWER       0x00000001
/**
@}*/

/** @defgroup CSL_USBHC_ROOTHUBCONTROL_SYMBOL Symbols for Root Hub 
*             Control
*   @ingroup CSL_USBHC_CONTROL_API
*
* @{ */
/* Macros - USB Host Controller Root Hub Control Status
*  The application may also use these masks to control the root hub status
*/
/** Clear Device Remote WakeUp Enable */
#define CSL_USBHC_ROOTHUBCONTROL_DEVRMWKUP_DISABLE  0x80000000
/** Overcurrent indication change  */
#define CSL_USBHC_ROOTHUBCONTROL_OVRCURR_CHG_CLR    0x00020000
/** Sets local power bits for all ports  */
#define CSL_USBHC_ROOTHUBCONTROL_LOCPOWER_SET       0x00010000
/** Device Remote wakeup enable  */
#define CSL_USBHC_ROOTHUBCONTROL_DEVRMWKUP_ENABLE   0x00008000
/** Local power turned off to relevant ports  */
#define CSL_USBHC_ROOTHUBCONTROL_LOCPOWER_CLR       0x00000001
/**
@}*/
/* Macros - Port Status
* a. Port Status intepretation
*/
/** @defgroup CSL_USBHC_PORTSTATUS_SYMBOL Symbols for Port Status
*   @ingroup CSL_USBHC_QUERY_API
*
*
* @{ */
/** Reset status change STATUS  */
#define CSL_USBHC_PORTSTATUS_RESET_CHG		   0x00100000
/** Overcurrent indicator change STATUS  */
#define CSL_USBHC_PORTSTATUS_OVRCURR_CHG       0x00080000
/** Suspend status change STATUS  */
#define CSL_USBHC_PORTSTATUS_SUSPEND_CHG       0x00040000
/** Port enable status change STATUS  */
#define CSL_USBHC_PORTSTATUS_ENABLE_CHG        0x00020000
/** Port connect status change STATUS  */
#define CSL_USBHC_PORTSTATUS_CONNECT_CHG       0x00010000
/** Low speed device attached ,STATUS  */
#define CSL_USBHC_PORTSTATUS_LSDEVATTACH       0x00000200
/** Port power is enabled STATUS  */
#define CSL_USBHC_PORTSTATUS_POWER             0x00000100
/** Reset port status                */
#define CSL_USBHC_PORTSTATUS_RESET             0x00000010
/** Port overcurrent indicator  */
#define CSL_USBHC_PORTSTATUS_OVRCURR           0x00000008
/** Port suspend status */
#define CSL_USBHC_PORTSTATUS_SUSPEND		   0x00000004
/** Port enable status  */
#define CSL_USBHC_PORTSTATUS_ENABLE	    	   0x00000002
/** Port current connection status  */
#define CSL_USBHC_PORTSTATUS_CONNECT		   0x00000001

/**
@}*/

/* Macros - Port Control
* a. Port Control
*/
/** @defgroup CSL_USBHC_PORTCONTROL_SYMBOL Symbols for Port Control
*   @ingroup CSL_USBHC_CONTROL_API
*
*
* @{ */
/** Clear Port reset status change bit */
#define CSL_USBHC_PORTCTRL_RESET_CLR		   0x00100000
/** Port Overcurrent indicator change bit clear */
#define CSL_USBHC_PORTCTRL_OVRCURR_CHG_CLR     0x00080000
/** Suspend status change clear */
#define CSL_USBHC_PORTCTRL_SUSPEND_CHG_CLR     0x00040000
/** Port enable status change clear  */
#define CSL_USBHC_PORTCTRL_ENABLE_CHG_CLR      0x00020000
/** Port connect status change clear  */
#define CSL_USBHC_PORTCTRL_CONNSTATUS_CHG_CLR  0x00010000
/** Clear port Power  */
#define CSL_USBHC_PORTCTRL_PORTPOWER_CLR       0x00000200
/** Set port power  */
#define CSL_USBHC_PORTCTRL_POWER_SET           0x00000100
/** Set port reset                   */
#define CSL_USBHC_PORTCTRL_RESET_SET           0x00000010
/** Clear suspend status i.e start resume signalling */
#define CSL_USBHC_PORTCTRL_SUSPEND_CLR         0x00000008
/** Set port suspend */
#define CSL_USBHC_PORTCTRL_SUSPEND_SET         0x00000004
/** Port enable set  */
#define CSL_USBHC_PORTCTRL_ENABLE_SET    	   0x00000002
/** Port enable clear */
#define CSL_USBHC_PORTCTRL_PORTENABLE_CLR      0x00000001
/**
@}*/
/** @defgroup CSL_USBHC_PORTCONTROL_SYMBOL Symbols for Port Control
*   @ingroup CSL_USBHC_CONTROL_API
*
* @{ */

/* Macros - USB Host Controller Port Control
* The application may also use these masks to control the port status
*/
/** Reset status change bit cleared  */
#define CSL_USBHC_PORTCONTROL_RESETCHG_CLR	   0x00100000
/** Overcurrent indicator change bit cleared  */
#define CSL_USBHC_PORTCONTROL_OVRCURRCHG_CLR   0x00080000
/** Suspend status change bit cleared  */
#define CSL_USBHC_PORTCONTROL_SUSPENDCHG_CLR   0x00040000
/** Port enable status change bit cleared  */
#define CSL_USBHC_PORTCONTROL_ENABLECHG_CLR    0x00020000
/** Port connect status change bit cleared  */
#define CSL_USBHC_PORTCONTROL_CONNECTCHG_CLR   0x00010000
/** Port power status is cleared  */
#define CSL_USBHC_PORTCONTROL_POWER_CLR        0x00000200
/** Port power status is set  */
#define CSL_USBHC_PORTCONTROL_POWER_SET        0x00000100
/** Reset port status                */
#define CSL_USBHC_PORTCONTROL_RESET            0x00000010
/** Clear Suspend condition i e resume  */
#define CSL_USBHC_PORTCONTROL_SUSPEND_CLR      0x00000008
/** Suspend the port */
#define CSL_USBHC_PORTCONTROL_SUSPEND		   0x00000004
/** Set Port enable  */
#define CSL_USBHC_PORTCONTROL_ENABLE	       0x00000002
/** Clears the port enable bit  */
#define CSL_USBHC_PORTCONTROL_DISABLE		   0x00000001
/**
@}*/

/** @defgroup CSL_USBHC_PORT_SYMBOL Symbols for Port Number
*   @ingroup CSL_USBHC_CONTROL_API
*
* @{ */
/* Macros - USB Host Port Flags
* The application may also use these masks to set the removeable status
* of individual ports.
*/
/** Port 1 */
#define CSL_USBHC_PORT_1   			  		   0x0002
/** Port 2 */
#define CSL_USBHC_PORT_2              		   0x0004
/** Port 3 */
#define CSL_USBHC_PORT_3                       0x0008
/**
@}*/

/** @defgroup CSL_USBHC_LIST_SYMBOL Symbols for List ID's
*   @ingroup CSL_USBHC_CONTROL_API
* @{ */
/* Macros - USB Host Controller List Flags
* The application may also use these masks to enable/disable
* the respective lists.
*/
/** ID for the Bulk List */
#define CSL_USBHC_LIST_BULK                        0x0001
/** ID for the Control List */
#define CSL_USBHC_LIST_CTRL                        0x0002
/** ID for the Isochronous List */
#define CSL_USBHC_LIST_ISOCH                       0x0004
/** ID for the Periodic List */
#define CSL_USBHC_LIST_PER                         0x0008
/**
@}*/
/**************************************************************************\
* USBHC global typedef declarations
\**************************************************************************/
/**@addtogroup CSL_USBHC_OPEN_API
@{*/
/** @brief Enumeration for USB Host Controller instances.
*
* This is the serial number of USB Host as reflected in the device
specifications.
* There is only one instance of USB Host in Trinity */

typedef enum {
    CSL_USBHC_0                    =                  0
} CSL_UsbhcNum;
/**
@}*/
/**@defgroup CSL_USBHC_PORT_ENUM Enums for Port Number
*  @ingroup CSL_USBHC_CONTROL_API CSL_USBHC_QUERY_API
@{*/
/** @brief Enumeration for number of USB devices that can be
*         attached to the USB Host Controller.
*
* The trinity USBHC can support 3 ports/devices. It is used in commands/
* queries to indicate the port for which the command/query is issued.
*/
typedef enum {
   /** Device ID attached to Port 1  */
    CSL_USBHC_DEV_1 = 1,
   /** Device ID attached to Port 2  */
    CSL_USBHC_DEV_2 = 2,
   /** Device ID attached to Port 3  */
    CSL_USBHC_DEV_3 = 3
}CSL_UsbhcDev;
/**
@}*/
/**@defgroup CSL_USBHC_STATE_ENUM Enums for USB Host Functional States
*  @ingroup CSL_USBHC_CONTROL_API CSL_USBHC_QUERY_API
@{*/
/** @brief Enumeration for USBHC functional state
*
* This is used for control/query commands to set/query the  USB Host
* functional state.
*/
typedef enum {
    /** Reset State        */
    CSL_USBHC_FUNCSTATE_USBRESET	   = 0x0,
    /** Resume State       */
    CSL_USBHC_FUNCSTATE_USBRESUME 	   = 0x1,
    /** Operational State  */
    CSL_USBHC_FUNCSTATE_USBOPERATIONAL = 0x2,
    /** Suspend State      */
    CSL_USBHC_FUNCSTATE_USBSUSPEND     = 0x3
}CSL_UsbhcFuncState;
/**
@}*/
/**@defgroup CSL_USBHC_CONTROLCMD_ENUM Enums for Control Commands
*  @ingroup CSL_USBHC_CONTROL_API
@{*/
/** @brief Enumeration for control commands passed to @a
CSL_usbhcHwControl()
*
* This is the set of commands that are passed to the @a CSL_usbhcHwControl()
* with an optional argument type-casted to @a void* .
* The arguments to be passed with each enumeration (if any) are specified
* next to the enumeration.
*/

typedef enum {
/** @brief Remote WakeUp enable
@param NULL  @return CSL_ESYS_INVCMD
*/
    CSL_USBHC_CMD_RMWKUP_ENABLE,
/**@brief Remote WakeUp disable.On Trinity this feature is not supported.
@param NULL
@return  CSL_ESYS_INVCMD
*/
  CSL_USBHC_CMD_RMWKUP_DISABLE,
/**@brief Remote WakeUp connect enable. On Trinity this feature is not 
          supported.

⌨️ 快捷键说明

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