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

📄 csl_rti.h

📁 Configuring External Interrupts on TMS320C672x Devices
💻 H
📖 第 1 页 / 共 3 页
字号:
typedef struct {
    /** Enable/Disable DMA request3 */
    Bool dmaReq3En;
    /** Enable/Disable DMA request2 */
    Bool dmaReq2En;
    /** Enable/Disable DMA request1 */
    Bool dmaReq1En;
    /** Enable/Disable DMA request0 */
    Bool dmaReq0En;
} CSL_RtiDmaReq; 

/** 
 * This structure is used enable/disable the Interrupts
 */
typedef struct {
    /** Enable/Disable Overflow Interrupt1 */
    Bool ovlIntr1En;
    /** Enable/Disable Overflow Interrupt0 */
    Bool ovlIntr0En;
    /** Enable/Disable Interrupt3 */
    Bool compIntr3En;
    /** Enable/Disable Interrupt2 */
    Bool compIntr2En;
    /** Enable/Disable Interrupt1 */
    Bool compIntr1En;
    /** Enable/Disable Interrupt0 */
    Bool compIntr0En;
} CSL_RtiIntrConfig;


/** Hardware setup structure */
typedef struct CSL_RtiHwSetup {
    /** Stop/continue counters */
    CSL_RtiContOnSuspend            contOnSuspend;
    /** Select capture event source0/capture event source1 for block0 */
    CSL_RtiExtnControl              blk0ExtnCntl;
    /** Select capture event source0/capture event source1 for block1 */
    CSL_RtiExtnControl              blk1ExtnCntl;
    /** Select compare counter FRC0/FRC1 */
    CSL_RtiCompareCntl              compare3Cntl;
    /** Select compare counter FRC0/FRC1 */
    CSL_RtiCompareCntl              compare2Cntl;
    /** Select compare counter FRC0/FRC1 */
    CSL_RtiCompareCntl              compare1Cntl;
    /** Select compare counter FRC0/FRC1 */
    CSL_RtiCompareCntl              compare0Cntl;
    /** Set value for counters */
    CSL_RtiCounters                 counters;
    /** Set values for Compare up counters */
    CSL_RtiCompUpCounter            compareUpCntrs;
    /** Set compare register values */
    CSL_RtiCompareVal               compVal;
    /** Set update compare register values */
    CSL_RtiUpdateCompVal            updateCompVal;
    /** Configuration for enable the interrupt  */
    CSL_RtiIntrConfig               intConfig;
    /** Configuration for enable dma Request */
    CSL_RtiDmaReq                   dmaReqEn;
    /** Set preload value for digital watchdog */
    Uint16                          preLoadWatchdog;
} CSL_RtiHwSetup;

/**
 * Configuration structure.This is used to configure real time interrupt
 * instance using CSL_rtiHwSetupRaw function
 */
typedef struct  {
    /** RTI Global Control Register  */
    volatile Uint32 RTIGCTRL;
    /** RTI Capture Control Register */
    volatile Uint32 RTICAPCTRL;
    /** RTI Compare Control Register */
    volatile Uint32 RTICOMPCTRL; 
    /** RTI Free Running Counter 0 Register */
    volatile Uint32 RTIFRC0;
    /** RTI Up Counter 0 Register */
    volatile Uint32 RTIUC0;
    /** RTI Compare Up Counter 0 Register */
    volatile Uint32 RTICPUC0;
    /** RTI Free Running Counter 1 Register */
    volatile Uint32 RTIFRC1;
    /** RTI Up Counter 1 Register */
    volatile Uint32 RTIUC1;
    /** RTI Compare Up Counter 1 Register */
    volatile Uint32 RTICPUC1; 
    /** RTI Compare 0 Register */
    volatile Uint32 RTICOMP0;
    /** RTI Update Compare 0 Register */
    volatile Uint32 RTIUDCP0;
    /** RTI Compare 1 Register */
    volatile Uint32 RTICOMP1;
    /** RTI Update Compare 1 Register */
    volatile Uint32 RTIUDCP1;
    /** RTI Compare 2 Register */
    volatile Uint32 RTICOMP2;
    /** RTI Update Compare 2 Register */
    volatile Uint32 RTIUDCP2;
    /** RTI Compare 3 Register */
    volatile Uint32 RTICOMP3;
    /** RTI Update Compare 3 Register */
    volatile Uint32 RTIUDCP3;
    /** RTI Set/Status Interrupt Register */
    volatile Uint32 RTISETINT;
    /** RTI Clear/Status Interrupt Register */
    volatile Uint32 RTICLEARINT;
    /** Digital Watchdog Control Register */
    volatile Uint32 RTIDWDCTRL;
    /** Digital Watchdog Preload Register */
    volatile Uint32 RTIDWDPRLD;
    /** Watchdog Key Register */
    volatile Uint32 RTIWDKEY ;
} CSL_RtiConfig;

/** 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
 ******************************************************************************/
 
/** ============================================================================
 *   @n@b CSL_rtiInit
 *
 *   @b Description
 *   @n This is the initialization function for the real time interrupt 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 real time interrupt 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  CSL_sysInit() must be called. 
 *
 *   <b> Post Condition </b>
 *   @n  The CSL for real time interrupt is initialized 
 *
 *   @b Modifies
 *   @n  None  
 *
 *   @b Example
 *   @verbatim
            CSL_rtiInit(NULL);
     @endverbatim
 * =============================================================================
 */
extern CSL_Status  CSL_rtiInit(
    CSL_RtiContext  *pContext 
);

/** ============================================================================
 *   @n@b CSL_rtiOpen
 *
 *   @b Description
 *   @n This function returns the handle to the Real time interrupt controller
 *      instance. This handle is passed to all other CSL APIs.
 *
 *   @b Arguments
 *   @verbatim
            rtiObj      Pointer to Real time interrupt object.
 
            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.
 
            pRtiParam   Module specific parameters.
 
            status      Status of the function call
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_RtiHandle
 *   @n                     Valid Real time interrupt 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 Real time interrupt handle is returned
 *   @li            CSL_ESYS_FAIL   The Real time interrupt instance is invalid
 *
 *        2.    Real time interrupt object structure is populated
 *
 *   @b Modifies
 *   @n    1. The status variable
 *
 *         2. Real time interrupt object structure
 *
 *   @b Example
 *   @verbatim
            CSL_status              status;
            CSL_RtiObj              rtiObj;
            CSL_RtiHandle           hRti;

            ...
                
            hRti = CSL_rtiOpen (&rtiObj, CSL_RTI, NULL, &status);
            
            ...
    @endverbatim
 * =============================================================================
 */
extern CSL_RtiHandle CSL_rtiOpen (
    CSL_RtiObj          *pRtiObj,
    CSL_InstNum          rtiNum,
    CSL_RtiParam        *pRtiParam,
    CSL_Status          *pStatus
);

/** ============================================================================
 *   @n@b csl_rtiClose.c
 *
 *   @b Description
 *   @n This function marks that CSL for the real time interrupt instance is 
 *      closed. CSL for the real time interrupt instance need to be reopened 
 *      before using any real time interrupt CSL API.
 *      
 *   @b Arguments
 *   @verbatim
            hRti         Handle to the real time interrupt instance 
     @endverbatim
 *
 *   <b> Return Value </b> CSL_Status
 *   @li                   CSL_SOK - Real Time Interrupt is closed successfully
 *   @li                   CSL_ESYS_BADHANDLE - The handle passed is invalid
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  1. The real time interrupt CSL APIs can not be called until the real 
 *          time interrupt CSL is reopened again using CSL_rtiOpen() 
 *
 *   @b Modifies
 *   @n  None
 *            
 *   @b Example
 *   @verbatim
            CSL_RtiHandle   hRti;
            
            ...
            
            CSL_rtiClose (hRti);
            

⌨️ 快捷键说明

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