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

📄 csl_rti.h

📁 基于ti tms320c672x下音频开发例子程式
💻 H
📖 第 1 页 / 共 2 页
字号:
/** Real Time Interrupt object structure */
typedef struct CSL_RtiObj {
    /** Pointer to the register overlay structure for the peripheral */
    CSL_RtiRegsOvly     regs;
    /** Specifies a particular instance of real time interrupt */
    CSL_InstNum         perNum; 
} CSL_RtiObj;

/** Default counters setup parameters	*/
#define CSL_RTI_COUNTERS_SETUP_DEFAULTS { \
	0,   \
	0,  \
	0,   \
	0    \
}

/** Default compare upcounters setup parameters	*/
#define CSL_RTI_COMP_UPCOUNTERS_SETUP_DEFAULTS { \
	0,   \
	0	  \
}

/** Default compare register setup parameters	*/
#define CSL_RTI_COMPARE_SETUP_DEFAULTS { \
	0,   \
	0,  \
	0,   \
	0    \
}

/** Default update compare setup parameters	*/
#define CSL_RTI_UPDATE_COMPARE_SETUP_DEFAULTS { \
	0,   \
	0,  \
	0,   \
	0    \
}

/** Default interrupt config setup parameters	*/
#define CSL_RTI_INT_SETUP_DEFAULTS { \
	FALSE,   \
	FALSE,  \
	FALSE,   \
	FALSE,    \
	FALSE,   \
	FALSE    \
}

/** Default dma request setup parameters	*/
#define CSL_RTI_DMA_SETUP_DEFAULTS { \
	FALSE,   \
	FALSE,  \
	FALSE,   \
	FALSE    \
}

/** Default hardware setup parameters */

#define CSL_RTI_HWSETUP_DEFAULTS  {\
	CSL_RTI_COUNTERS_STOP,	\
	CSL_RTI_CAPTURE_EVENT_SOURCE0,	\
	CSL_RTI_CAPTURE_EVENT_SOURCE0,	\
	CSL_RTI_FRC0_COMPARE_ENABLE,	\
	CSL_RTI_FRC0_COMPARE_ENABLE,	\
	CSL_RTI_FRC0_COMPARE_ENABLE,	\
	CSL_RTI_FRC0_COMPARE_ENABLE,	\
	CSL_RTI_COUNTERS_SETUP_DEFAULTS, \
	CSL_RTI_COMP_UPCOUNTERS_SETUP_DEFAULTS,	\
	CSL_RTI_COMPARE_SETUP_DEFAULTS,	\
	CSL_RTI_UPDATE_COMPARE_SETUP_DEFAULTS,	\
	CSL_RTI_INT_SETUP_DEFAULTS,	\
	CSL_RTI_DMA_SETUP_DEFAULTS,	\
	0x1FFF	\
}	 
   
/** Default Values for Config structure */
#define CSL_RTI_CONFIG_DEFAULTS {\
    CSL_RTI_RTIGCTRL_RESETVAL,\
    CSL_RTI_RTICAPCTRL_RESETVAL,\
    CSL_RTI_RTICOMPCTRL_RESETVAL,\
    CSL_RTI_RTIFRC0_RESETVAL,\
    CSL_RTI_RTIUC0_RESETVAL,\
    CSL_RTI_RTICPUC0_RESETVAL,\
    CSL_RTI_RTIFRC1_RESETVAL,\
    CSL_RTI_RTIUC1_RESETVAL,\
    CSL_RTI_RTICPUC1_RESETVAL,\
    CSL_RTI_RTICOMP0_RESETVAL,\
    CSL_RTI_RTIUDCP0_RESETVAL,\
    CSL_RTI_RTICOMP1_RESETVAL,\
    CSL_RTI_RTIUDCP1_RESETVAL,\
    CSL_RTI_RTICOMP2_RESETVAL,\
    CSL_RTI_RTIUDCP2_RESETVAL,\
    CSL_RTI_RTICOMP3_RESETVAL,\
    CSL_RTI_RTIUDCP3_RESETVAL,\
    CSL_RTI_RTISETINT_RESETVAL,\
    CSL_RTI_RTICLEARINT_RESETVAL,\
    CSL_RTI_RTIDWDCTRL_RESETVAL,\
    CSL_RTI_RTIDWDPRLD_RESETVAL,\
    CSL_RTI_RTIWDKEY_RESETVAL\
}

/**
 * This data type is used to return the handle to an instance of 
 * real time interrupt
 */
typedef struct CSL_RtiObj    *CSL_RtiHandle;

/*******************************************************************************
 * Real time interrupt global function declarations
 ******************************************************************************/
 
/*
 * =============================================================================
 *   @func CSL_rtiInit
 *
 *   @desc
 *     This is the initialization function for the real time interrupt CSL. 
 *     This function needs to be called before any RTI CSL functions
 *     are to be called. This function is idem-potent.Currently, this function 
 *     does not perform anything.
 *
 *   @arg pContext
 *        Context information for Real time interrupt
 *
 *   @ret CSL_Status
 *        CSL_SOK - Always returns 
 *
 *   @eg
 *     CSL_rtiInit (NULL);
 * =============================================================================
 */
extern CSL_Status  CSL_rtiInit(
    CSL_RtiContext * pContext 
);

/*
 *============================================================================
 *   @func CSL_rtiOpen
 *
 *   @desc
 *     This function populates the peripheral data object for the instance and
 *     returns a handle to the instance
 *
 *   @arg pRtiObj
 *        Pointer to the Real time interrupt instance object 
 *
 *   @arg rtiNum
 *        Instance of Real time interrupt CSL to be opened.There is only one 
 *		  instance of the Real time interrupt available. So, the value for this 
 *        parameter will be CSL_RTI always.
 *        
 *
 *   @arg pRtiParam
 *        Pointer to module specific parameters
 *
 *   @arg pStatus
 *        pointer for returning status of the function call
 *
 *   @ret CSL_RtiHandle
 *        Valid real time interrupt instance handle will be returned 
 *		  if status value is equal to CSL_SOK.
 *
 *   @eg
 *        CSL_status            status;
 *        CSL_RtiObj        	rtiObj;
 *        CSL_RtiHandle     	hRti;
 *
 *        hRti = CSL_rtiOpen (&rtiObj, CSL_RTI, NULL, &status);
 *
 * ===========================================================================
 */
extern CSL_RtiHandle CSL_rtiOpen (
    CSL_RtiObj      	*pRtiObj,
    CSL_InstNum          rtiNum,
    CSL_RtiParam    	*pRtiParam,
    CSL_Status          *pStatus
);

/*
 * =============================================================================
 *   @func CSL_rtiClose
 *
 *   @b Description
 *   @n This function closes the specified instance of real time interrupt.      
 *      
 *   @arg  hRti
           Handle to the real time interrupt instance 
 *
 *   @ret CSL_Status
 *         CSL_SOK            - Close successful
 *         CSL_ESYS_BADHANDLE - Invalid handle
 *
 *   @eg
 *     CSL_rtiClose (hRti);
 * =============================================================================
 */
extern CSL_Status CSL_rtiClose (
        CSL_RtiHandle hRti
);

/*
 * =============================================================================
 *   @func CSL_rtiHwSetup
 *
 *   @desc
 *     Configures the RTI instance with the specified setup parameters.  
 *
 *   @arg hRti
 *        Handle to the real time interrupt instance
 *
 *   @arg hwSetup
 *        Pointer to hardware setup structure
 *
 *   @ret CSL_Status
 *        CSL_SOK             - Hardware setup successful
 *        CSL_ESYS_BADHANDLE  - Invalid handle
 *
 *   @eg
 *  
 *	 	 CSL_status                  status;
 *       CSL_RtiHwSetup          	 hwSetup;
 *		 hwSetup.contOnSuspend = CSL_RTI_COUNTERS_RUN;
 *		 hwSetup.blk0ExtnCntl = CSL_RTI_CAPTURE_EVENT_SOURCE0;
 *		 hwSetup.blk1ExtnCntl = CSL_RTI_CAPTURE_EVENT_SOURCE0;
 *		 hwSetup.compare0Cntl = CSL_RTI_FRC0_COMPARE_ENABLE;
 *		 hwSetup.compare1Cntl = CSL_RTI_FRC0_COMPARE_ENABLE;
 *		 hwSetup.compare2Cntl = CSL_RTI_FRC0_COMPARE_ENABLE;
 *		 hwSetup.compare3Cntl = CSL_RTI_FRC0_COMPARE_ENABLE;
 *		 hwSetup.counters.frc0Counter = FRC0_TEST_VALUE; 
 *		 hwSetup.counters.uc0Counter = UC0_TEST_VALUE; 
 *		 hwSetup.counters.frc1Counter = FRC1_TEST_VALUE; 
 *		 hwSetup.counters.uc1Counter = UC1_TEST_VALUE; 
 *		 hwSetup.compareUpCntrs.compareUpCntr0 = UC0_COMP_VALUE;
 *		 hwSetup.compareUpCntrs.compareUpCntr1 = UC1_COMP_VALUE;
 *		 hwSetup.compVal.comp0Val = COMPARE0_VALUE;
 *		 hwSetup.compVal.comp1Val = COMPARE1_VALUE;
 *		 hwSetup.compVal.comp2Val = COMPARE2_VALUE;
 *		 hwSetup.compVal.comp3Val = COMPARE3_VALUE;   
 *		 hwSetup.updateCompVal.updateComp0Val = UPDATE_COMPARE0_VALUE;
 *		 hwSetup.updateCompVal.updateComp1Val = UPDATE_COMPARE1_VALUE;
 *		 hwSetup.updateCompVal.updateComp2Val = UPDATE_COMPARE2_VALUE;
 *		 hwSetup.updateCompVal.updateComp3Val = UPDATE_COMPARE3_VALUE;
 *		 hwSetup.intEnable.compIntr0En = FALSE; 
 *		 hwSetup.intEnable.compIntr1En = FALSE;
 *		 hwSetup.intEnable.compIntr2En = FALSE;
 *		 hwSetup.intEnable.compIntr3En = FALSE;
 *		 hwSetup.intEnable.ovlInt0En = FALSE;
 *		 hwSetup.intEnable.ovlInt0En = FALSE;
 *		 hwSetup.dmaReq.dmareq0En = FALSE;
 *		 hwSetup.dmaReq.dmareq1En = FALSE;
 *		 hwSetup.dmaReq.dmareq2En = FALSE;
 *		 hwSetup.dmaReq.dmareq3En = FALSE;
 *		 hwSetup.preLoadWatchdog = 0x1FFF;
 *
 *		 status = CSL_rtiHwsetup (hRti, &hwSetup);
 *
 */
extern CSL_Status CSL_rtiHwSetup (
	CSL_RtiHandle      hRti,
	CSL_RtiHwSetup	   *hwSetup
);

/*
 * =============================================================================
 *   @func CSL_rtiHwSetupRaw
 *
 *   @desc
 *       This function configures the registers of real time interrupt instance 
 *		 as per the values given in the Config structure.  
 *
 *   @arg hRti
 *        Handle to the real time interrupt instance
 *
 *   @arg hwConfig
 *        Pointer to real time interrupt config structure
 *
 *   @ret CSL_Status
 *         CSL_SOK             - Configuration successful
 *         CSL_ESYS_BADHANDLE  - Invalid handle
 *
 *   @eg
 *    
 *        CSL_Status            status;
 *        CSL_RtiConfig     	hwConfig;
 *
 *        status = CSL_rtiHwsetupRaw (hRti, &hwConfig);
 *
 * ===========================================================================
 */

extern CSL_Status  CSL_rtiHwSetupRaw (
    CSL_RtiHandle           hRti,
    CSL_RtiConfig *         config
);

/*
 * ============================================================================
 *   @func CSL_rtiGetHwSetup
 *
 *   @desc
 *     It retrives the hardware setup parameters 
 *
 *   @arg hRti
 *        Handle to the real time interrupt instance
 *
 *   @arg hwSetup
 *        Pointer to hardware setup structure
 *
 *   @ret CSL_Status
 *        CSL_SOK             - Hardware setup successful
 *        CSL_ESYS_BADHANDLE  - Invalid handle
 *
 *   @eg
 *        CSL_status                        status;
 *        CSL_RtiHwSetup               		hwSetup;
 *        
 *        status = CSL_rtiGetHwsetup (hRti, &hwSetup);
 *
 * ===========================================================================
 */
extern CSL_Status CSL_rtiGetHwSetup (
    CSL_RtiHandle   hRti,
    CSL_RtiHwSetup  *hwSetup
);

/** ============================================================================
 *   @func CSL_rtiHwControl
 *
 *   @desc
 *     This function performs various control operations on the real time interrupt instance,
 *     based on the command passed.
 *
 *   @arg hRti
 *        Handle to the real time interrupt instance
 *
 *   @arg cmd
 *        Operation to be performed on the real time interrupt instance
 *
 *   @arg cmdArg
 *        Arguement specific to the command 
 *
 *   @ret CSL_Status
 *        CSL_SOK            - Command execution successful.
 *        CSL_ESYS_BADHANDLE - Invalid handle
 *        CSL_ESYS_INVCMD    - Invalid command
 *
 *   @eg
 *        CSL_Status status;
 *
 *        status  = CSL_rtiHwControl (hRti,  
 *              CSL_RTI_CMD_START_BLOCK0, NULL);
 *
 * ===========================================================================
 */
extern CSL_Status CSL_rtiHwControl (
    CSL_RtiHandle           hRti,
    CSL_RtiHwControlCmd     cmd,
    void                    *arg
);

/*
 * =============================================================================
 *   @n@b CSL_rtiGetHwStatus
 *
 *   @desc
 *     This function is used to get the value of various parameters of an 
 *     instance of real time interrupt. The value returned depends on the 
 *     query passed.
 *
 *   @arg hrti
 *        Handle to the real time interrupt
 *
 *   @arg query
 *        Query to be performed. 
 *
 *   @arg response
 *        Pointer to buffer to return the data requested by the query passed
 *
 *   @arg CSL_Status
 *        CSL_SOK            - Successful completion of the query
 *        CSL_ESYS_BADHANDLE - Invalid handle
 *        CSL_ESYS_INVQUERY  - Query command not supported
 *
 *   @eg
 *        CSL_Status        status;
 *        Uint32            currentVal;
 *        status = CSL_rtiGetHwStatus (hRti,  
 *                        CSL_RTI_QUERY_CUR_FRC0_VAL,  
 *                        &currentVal);
 *
 * ===========================================================================
 */
extern CSL_Status CSL_rtiGetHwStatus (
    CSL_RtiHandle           	hRti,
    CSL_RtiHwStatusQuery    	query,
    void                        *response
);

/** ============================================================================
 *   @n@b CSL_rtiGetBaseAddress
 *
 *   @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_rtiOpen()
 *       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      
            rtiNum      	Specifies the instance of the RTI to be opened.
 
            pRtiParam   	Module specific parameters.
 
            pBaseAddress    Pointer to baseaddress 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.
 *
 *   <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
        CSL_Status              status;
        CSL_rtiBaseAddress  baseAddress;

       ...
      status = CSL_rtiGetBaseAddress(CSL_RTI_1, NULL, &baseAddress);

    @endverbatim
 * ===========================================================================
 */
extern CSL_Status   CSL_rtiGetBaseAddress (     
        CSL_InstNum               rtiNum,
        CSL_RtiParam *         	  pRtiParam,
        CSL_RtiBaseAddress *   	  pBaseAddress 
);

#ifdef __cplusplus
}
#endif

#endif  /* _CSL_RTI_H_ */


⌨️ 快捷键说明

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