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

📄 csl_uhpi.h

📁 基于ti tms320c672x下音频开发例子程式
💻 H
📖 第 1 页 / 共 3 页
字号:
	/* GPIO_EN2 bank includes the /HAS pin */    
    CSL_UHPI_GPIO_EN2  = 0x4,
	/* GPIO_EN3 bank includes the /HBE[3:0] */
    CSL_UHPI_GPIO_EN3  = 0x8,
	/* GPIO_EN4 bank includes the /HHWIL pin */
    CSL_UHPI_GPIO_EN4  = 0x10,
	/* GPIO_EN5 bank includes the /HRDY pin */
    CSL_UHPI_GPIO_EN5  = 0x20,
	/* GPIO_EN6 bank includes the /HINT pin */
    CSL_UHPI_GPIO_EN6  = 0x40,
	/* GPIO_EN7 bank includes the HD[7:0] pin */
    CSL_UHPI_GPIO_EN7  = 0x80,
	/* GPIO_EN8 bank includes the HD[15:8] pin */    
    CSL_UHPI_GPIO_EN8  = 0x100,
	/* GPIO_EN9 bank includes the HD[23:16] pin */    
    CSL_UHPI_GPIO_EN9  = 0x200,
	/* GPIO_EN10 bank includes the HD[31:24] pin */    
    CSL_UHPI_GPIO_EN10 = 0x400,
	/* GPIO_EN10 bank includes the HA[0:7] pin */
    CSL_UHPI_GPIO_EN11 = 0x800,
	/* GPIO_EN10 bank includes the HA[15:8] pin */    
    CSL_UHPI_GPIO_EN12 = 0x1000,
	/* GPIO_EN10 bank includes the HA[19:16] pin */    
    CSL_UHPI_GPIO_EN13 = 0x2000,
	/* GPIO_EN10 bank includes the HA[23:20] pin */    
    CSL_UHPI_GPIO_EN14 = 0x4000,
	/* GPIO_EN10 bank includes the HA[27:24] pin */    
    CSL_UHPI_GPIO_EN15 = 0x8000,
	/* GPIO_EN10 bank includes the HA[31:28] pin */    
    CSL_UHPI_GPIO_EN16 = 0x10000
}CSL_UhpiGpioEnable;    

typedef enum {
	/* GPINT_INV0 inverts the corresponding GPINT_EN0 */
    CSL_UHPI_GPINT_INV0 = 0x1,
    /* GPINT_INV1 corresponds with the HCNTLA GPINT */
    CSL_UHPI_GPINT_INV1 = 0x2,
    /* GPINT_INV2 corresponds with the /HAS GPINT */
    CSL_UHPI_GPINT_INV2 = 0x4
}CSL_UhpiGpIntInvEnable;

typedef enum {
	/* GPINT_EN0 enables HCNTLB as a GPINT sourcing DMA_WRITE_EVENT */
    CSL_UHPI_GPINT_EN0 = 0x1,
	/* GPINT_EN1 enables HCNTLA as a GPINT sourcing DMA_READ_EVENT */    
    CSL_UHPI_GPINT_EN1 = 0x2,
	/* GPINT_EN2 enables /HAS as a GPINT sourcing the CPU Interrupt */    
    CSL_UHPI_GPINT_EN2 = 0x4
}CSL_UhpiGpIntEnable;

typedef struct {
	/* GPINT control Interrupt Enable */
    CSL_UhpiGpIntEnable     gpIntEnable;
	/* GPINT control Interrupt Invert Enable */    
    CSL_UhpiGpIntInvEnable  gpIntInvEnable;
}CSL_UhpiGpIntCtrl; 
 
typedef struct {
    /** General Purpose Interrrupt Control Register **/
    CSL_UhpiGpIntCtrl   gpIntCtrl;
    /** General Purpose I/O Enable Register **/
    CSL_UhpiGpioEnable  gpioEnable;
    /** General Purpose I/O Direction Register **/
    CSL_UhpiGpioDir     gpioDir;
    /** General Purpose I/O Data Register **/
    CSL_UhpiGpioData    gpioData;
    /** Host port Interface control Register **/
    CSL_UhpiCtrl        hpiCtrl;
    /** Host port Interface Read & Write Address Register **/
    CSL_UhpiAddrCfg     hpiAddr;
    /** Emulation Mode parameter*/
    Uint32              emu;
}CSL_UhpiHwSetup;


/**************************************************************************\
* Configuration Structure 
\**************************************************************************/
typedef struct  {
	/* Power and Emulation Management Register */
    volatile Uint32 PWREMU_MGMT;
	/* General Purpose Interrupt Control Register */    
    volatile Uint32 GPINT_CTRL;
	/* GP I/O Enable Register */
    volatile Uint32 GPIO_EN;
	/* GPIO Direction 1 Register */    
    volatile Uint32 GPIO_DIR1;
	/* GPIO Data 2 Register */    
    volatile Uint32 GPIO_DAT1;
	/* GPIO Direction Register */    
    volatile Uint32 GPIO_DIR2;
	/* GPIO Data2 Register */
    volatile Uint32 GPIO_DAT2;
	/* GPIO Direction3 Register */    
    volatile Uint32 GPIO_DIR3;
	/* GPIO Data3 Register */    
    volatile Uint32 GPIO_DAT3;
	/* Host Port Interface Control Register */    
    volatile Uint32 HPIC;
	/* Host Port Interface Write Address Register */
    volatile Uint32 HPIAW;
	/* Host Port Interface Read Address Register */
    volatile Uint32 HPIAR;
	/* eXtended Host Port Interface Write Address Register */    
    volatile Uint32 XHPIAW;
	/* eXtended Host Port Interface Read Address Register */    
    volatile Uint32 XHPIAR;
} CSL_UhpiConfig;


/** Default Values for Config structure */
#define CSL_UHPI_CONFIG_DEFAULTS {\
    CSL_HPI_PWREMU_MGMT_RESETVAL,\
    CSL_HPI_GPIO_EN_RESETVAL,\
    CSL_RTI_RTICOMPCTRL_RESETVAL,\
    CSL_HPI_GPIO_DIR1_RESETVAL,\
    CSL_HPI_GPIO_DAT1_RESETVAL,\
    CSL_HPI_GPIO_DIR2_RESETVAL,\
    CSL_HPI_GPIO_DAT2_RESETVAL,\
    CSL_HPI_GPIO_DIR3_RESETVAL,\
    CSL_HPI_GPIO_DAT3_RESETVAL,\
    CSL_HPI_HPIC_RESETVAL,\
    CSL_HPI_HPIAW_RESETVAL,\
    CSL_HPI_HPIAR_RESETVAL,\
    CSL_HPI_XHPIAW_RESETVAL,\
    CSL_HPI_XHPIAR_RESETVAL\
}

/** \brief Module specific context information. Present implementation of uhpi CSL
 *  doesn't have any context information.
 */
typedef struct {
    /** Context information of uhpi CSL.
     *  The below declaration is just a place-holder for future implementation.
     */
    Uint32  contextInfo;
} CSL_UhpiContext;

/** \brief Module specific parameters. Present implementation of uhpi CSL
 *  doesn't have any module specific parameters.
 */
typedef struct {
    /** Bit mask to be used for module specific parameters. The below
     *  declaration is just a place-holder for future implementation.
     */
    CSL_BitMask32   flags;
} CSL_UhpiParam;

/** \brief This structure contains the base-address information for the peripheral
 *  instance of the UHPI
 */
typedef struct {
    /** Base-address of the configuration registers of the peripheral
     */
    CSL_UhpiRegsOvly  regs;
} CSL_UhpiBaseAddress;

/** \brief UHPI object structure
 */
typedef struct CSL_UhpiObj{
    /** Pointer to the register overlay structure of the uhpi */
    CSL_UhpiRegsOvly    regs;
    /** Instance of uhpi being referred by this object  */
    CSL_InstNum         uhpiNum;
} CSL_UhpiObj;

/** \brief This data type is used to return the handle to the CSL of the UHPI
 */
typedef struct CSL_UhpiObj    *CSL_UhpiHandle;

/*******************************************************************************
 * DSP UHPI controller function declarations
 ******************************************************************************/

/** ============================================================================
 *   @n@b CSL_uhpiInit
 *
 *   @b Description
 *   @n This is the initialization function for the uhpi CSL. The function
 *      must be called before calling any other API from this CSL. This
 *      function is idem-potent. Currently, the function just return status
 *      CSL_SOK, without doing anything.
 *
 *   @b Arguments
 *   @verbatim
        pContext    Pointer to module-context. As uhpi doesn't have
                    any context based information user is expected to pass NULL.
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                        CSL_SOK - Always returns
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The CSL for uhpi is initialized
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
            CSL_uhpiInit(NULL);
     @endverbatim
 * =============================================================================
 */
extern CSL_Status  CSL_uhpiInit (

    CSL_UhpiContext * pContext
);

/** ============================================================================
 *   @n@b CSL_uhpiOpen
 *
 *   @b Description
 *   @n This function returns the handle to the DSP UHPI controller
 *      instance. This handle is passed to all other CSL APIs.
 *
 *   @b Arguments
 *   @verbatim
            uhpiObj     Pointer to UHPI object.
 
            uhpiNum         Instance of DSP UHPI CSL to be opened. 
                           There is only one instance of the uhpi available.
                           So, the value for this parameter will be 
                           CSL_UHPI always.
 
            pUhpiParam  Module specific parameters.
 
            status         Status of the function call
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_UhpiHandle
 *   @n                         Valid uhpi handle will be returned if
 *                              status value is equal to CSL_SOK.
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   1.    The status is returned in the status variable. If status
 *              returned is
 *   @li            CSL_SOK             Valid uhpi handle is returned
 *   @li            CSL_ESYS_FAIL       The uhpi instance is invalid
 *   @li            CSL_ESYS_INVPARAMS  Invalid parameter
 *
 *        2.    UHPI object structure is populated
 *
 *   @b Modifies
 *   @n    1. The status variable
 *
 *         2. UHPI object structure
 *
 *   @b Example
 *   @verbatim
            CSL_status              status;
            CSL_UhpiObj          uhpiObj;
            CSL_UhpiHandle       hUhpi;

            ...
                
            hUhpi = CSL_uhpiOpen(&uhpiObj, CSL_UHPI, NULL, &status);
            
            ...
    @endverbatim
 * =============================================================================
 */
extern CSL_UhpiHandle CSL_uhpiOpen (
    CSL_UhpiObj         *uhpiObj,
    CSL_InstNum         uhpiNum,
    CSL_UhpiParam       *pUhpiParam,
    CSL_Status          *status
);

/** ============================================================================
 *   @n@b CSL_uhpiGetBaseAddress
 *
 *   @b Description
 *   @n  Function to get the base address of the peripheral instance.
 *       This function is used for getting the base address of the peripheral
 *       instance. This function will be called inside the CSL_uhpiOpen()
 *       function call. This function is open for re-implementing if the user
 *       wants to modify the base address of the peripheral object to point to
 *       a different location and there by allow CSL initiated write/reads into
 *       peripheral. MMR's go to an alternate location.
 *
 *   @b Arguments
 *   @verbatim
            uhpiNum      Specifies the instance of the uhpi to be opened.

            pUhpiParam   Module specific parameters.

            pBaseAddress    Pointer to base address structure containing base
                            address details.

     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_OK              Open call is successful
 *   @li                    CSL_ESYS_FAIL       The instance number is invalid.
 *   @li                    CSL_ESYS_INVPARAMS  Invalid parameter 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Base address structure is populated
 *
 *   @b Modifies
 *   @n    1. The status variable
 *
 *         2. Base address structure is modified.
 *
 *   @b Example
 *   @verbatim

⌨️ 快捷键说明

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