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

📄 csl_mcasp.h

📁 Configuring External Interrupts on TMS320C672x Devices
💻 H
📖 第 1 页 / 共 3 页
字号:
/**
 * ============================================================================
 *   @func CSL_mcaspHwSetup
 *
 *   @desc
 *   @n     Configures the McASP instance with the specified setup parameters.  
 *
 *   @arg hMcasp
 *        Handle to the McASP instance
 *
 *   @arg myHwSetup
 *        Pointer to hardware setup structure
 *
 *   @ret CSL_Status
 *        CSL_SOK             - Hardware setup successful
 *        CSL_ESYS_BADHANDLE  - Invalid handle
 *        CSL_ESYS_INVPARAMS  - Invalid parameters
 *
 *   @eg
 *    
 *       CSL_status          status;
 *       CSL_McaspHwSetup    myHwSetup;
 *       CSL_McaspHandle     hMcasp;
 *
 *      myHwSetup.glb.ctl = 0x00000000;
 *      myHwSetup.glb.ditCtl = 0x00000003;
 *      myHwSetup.glb.dlbMode = 0x00000002;
 *      myHwSetup.glb.amute = 0x00001234;
 *      myHwSetup.glb.serSetup[1] = 0x00000012;
 *      myHwSetup.glb.serSetup[2] = 0x00000012;
 *      myHwSetup.glb.serSetup[3] = 0x00000012;
 *      myHwSetup.glb.serSetup[4] = 0x00000012;
 *      myHwSetup.glb.serSetup[5] = 0x00000012;
 *      myHwSetup.glb.serSetup[6] = 0x00000012;
 *      myHwSetup.glb.serSetup[7] = 0x00000012;
 *      myHwSetup.glb.serSetup[8] = 0x00000012;
 *      myHwSetup.glb.serSetup[9] = 0x00000012;
 *      myHwSetup.glb.serSetup[10] = 0x00000012;
 *      myHwSetup.glb.serSetup[11] = 0x00000012;
 *      myHwSetup.glb.serSetup[12] = 0x00000012;
 *      myHwSetup.glb.serSetup[13] = 0x00000012;
 *      myHwSetup.glb.serSetup[14] = 0x00000012;
 *      myHwSetup.glb.serSetup[15] = 0x00000012;
 *      myHwSetup.rx.mask = 0x11111111;
 *      myHwSetup.tx.mask = 0x11111111;
 *      myHwSetup.rx.fmt = 0x00001111;
 *      myHwSetup.tx.fmt = 0x00001111;
 *      myHwSetup.rx.frSyncCtl = 0x00000001;
 *      myHwSetup.tx.frSyncCtl = 0x00000001;
 *      myHwSetup.rx.tdm = 0x11111111;
 *      myHwSetup.tx.tdm = 0x11111111;
 *      myHwSetup.rx.intCtl = 0x00000111;
 *      myHwSetup.tx.intCtl = 0x00000111;
 *      myHwSetup.rx.stat = 0x00000110;
 *      myHwSetup.tx.stat = 0x00000110;
 *      myHwSetup.rx.evtCtl = 0x00000001;
 *      myHwSetup.tx.evtCtl = 0x00000001;
 *      myHwSetup.rx.clk.clkSetupClk = 0x00000001;
 *      myHwSetup.tx.clk.clkSetupClk = 0x00000001;
 *      myHwSetup.rx.clk.clkSetupHiClk = 0x00000101;
 *      myHwSetup.tx.clk.clkSetupHiClk = 0x00000101;
 *      myHwSetup.rx.clk.clkChk = 0x00432100;
 *      myHwSetup.tx.clk.clkChk = 0x00432100;
 *      myHwSetup.emu = CSL_MCASP_PWRDEMU_FREE_ON;
 *
 *      status = CSL_mcaspHwsetup (hMcasp, &myHwSetup);
 *
 * ============================================================================
 */
extern CSL_Status CSL_mcaspHwSetup (
    CSL_McaspHandle   hMcasp,
    CSL_McaspHwSetup  *myHwSetup
);

/**
 * ============================================================================
 *   @func CSL_mcaspHwSetupRaw
 *
 *   @desc
 *   @n     This function configures the registers of McASP instance as per the 
 *          values given in the config structure.  
 *
 *   @arg hMcasp
 *        Handle to the McASP instance
 *
 *   @arg config
 *        Pointer to McASP config structure
 *
 *   @ret CSL_Status
 *        CSL_SOK             - Configuration successful
 *        CSL_ESYS_BADHANDLE  - Invalid handle
 *        CSL_ESYS_INVPARAMS  - Invalid parameters
 *
 *   @eg
 *        CSL_Status          status;
 *        CSL_McaspConfig     hwConfig;
 *        CSL_McaspHandle     hMcasp;
 *
 *        hwConfig.PWRDEMU = 0x00000001;
 *        hwConfig.PFUNC = 0x00000000;
 *        hwConfig.PDIR = 0x00000000;
 *        hwConfig.PDOUT = 0x00000000;
 *        hwConfig.PDIN_PDSET = 0x00000000;
 *        hwConfig.PDCLR = 0x00000000;
 *        hwConfig.GBLCTL = 0x00000000;
 *        hwConfig.AMUTE = 0x00000000;
 *        hwConfig.DLBCTL = 0x00000000;
 *        hwConfig.DITCTL = 0x00000000;
 *        hwConfig.RMASK = 0x00000000;
 *        hwConfig.RFMT = 0x00000000;
 *        hwConfig.AFSRCTL = 0x00000000;
 *        hwConfig.ACLKRCTL = 0x00000020;
 *        hwConfig.AHCLKRCTL = 0x00008000;
 *        hwConfig.RTDM = 0x00000000;
 *        hwConfig.RINTCTL = 0x00000000;
 *        hwConfig.RSTAT = 0x00000000;
 *        hwConfig.RCLKCHK = 0x00000000;
 *        hwConfig.REVTCTL = 0x00000000;
 *        hwConfig.XMASK = 0x00000000;
 *        hwConfig.XFMT = 0x00000000;
 *        hwConfig.AFSXCTL = 0x00000000;
 *        hwConfig.ACLKXCTL = 0x00000060;
 *        hwConfig.AHCLKXCTL = 0x00008000;
 *        hwConfig.XTDM = 0x00000000;
 *        hwConfig.XINTCTL = 0x00000000;
 *        hwConfig.XSTAT = 0x00000000;
 *        hwConfig.XCLKCHK = 0x00000000;
 *        hwConfig.XEVTCTL = 0x00000000;
 *        hwConfig.SRCTL0 = 0x00000000;
 *        hwConfig.SRCTL1 = 0x00000000;
 *        hwConfig.SRCTL2 = 0x00000000;
 *        hwConfig.SRCTL3 = 0x00000000;
 *        hwConfig.SRCTL4 = 0x00000000;
 *        hwConfig.SRCTL5 = 0x00000000;
 *        hwConfig.SRCTL6 = 0x00000000;
 *        hwConfig.SRCTL7 = 0x00000000;
 *        hwConfig.SRCTL8 = 0x00000000;
 *        hwConfig.SRCTL9 = 0x00000000;
 *        hwConfig.SRCTL10 = 0x00000000;
 *        hwConfig.SRCTL11 = 0x00000000;
 *        hwConfig.SRCTL12 = 0x00000000;
 *        hwConfig.SRCTL13 = 0x00000000;
 *        hwConfig.SRCTL14 = 0x00000000;
 *        hwConfig.SRCTL15 = 0x00000000;
 *
 *        status = CSL_mcaspHwsetupRaw (hMcasp, &hwConfig);
 *
 * ============================================================================
 */

extern CSL_Status  CSL_mcaspHwSetupRaw (
    CSL_McaspHandle         hMcasp,
    CSL_McaspConfig         *config
);

/**
 * ============================================================================
 *   @func CSL_mcaspGetHwSetup
 *
 *   @desc
 *   @n     It retrieves the hardware setup parameters .
 *
 *   @arg hMcasp
 *        Handle to the McASP instance
 *
 *   @arg myHwSetup
 *        Pointer to hardware setup structure
 *
 *   @ret CSL_Status
 *        CSL_SOK             - Hardware setup successfully retrieved
 *        CSL_ESYS_BADHANDLE  - Invalid handle
 *
 *   @eg
 *        CSL_status        status;
 *        CSL_McaspHwSetup  hwSetup;
 *        CSL_McaspHandle   hMcasp;
 *        
 *        status = CSL_mcaspGetHwsetup (hMcasp, &hwSetup);
 *
 * ============================================================================
 */
extern CSL_Status CSL_mcaspGetHwSetup (
    CSL_McaspHandle   hMcasp,
    CSL_McaspHwSetup  *myHwSetup
);

/** 
 * ============================================================================
 *   @func CSL_mcaspHwControl
 *
 *   @desc
 *   @n     This function performs various control operations on the McASP 
 *          instance, based on the command passed.
 *
 *   @arg hMcasp
 *        Handle to the McASP instance
 *
 *   @arg cmd
 *        Operation to be performed on the McASP instance
 *
 *   @arg arg
 *        Argument 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;
 *        CSL_McaspHandle   hMcasp;
 *
 *        status  = CSL_mcaspHwControl (hMcasp,  
 *              CSL_MCASP_CMD_CLK_RESET_XMT, NULL);
 *
 * ============================================================================
 */
extern CSL_Status CSL_mcaspHwControl (
    CSL_McaspHandle           hMcasp,
    CSL_McaspHwControlCmd     cmd,
    void                      *arg
);

/**
 * ============================================================================
 *   @func CSL_mcaspGetHwStatus
 *
 *   @desc
 *   @n     This function is used to get the value of various parameters of an 
 *          instance of McASP. The value returned depends on the query passed.
 *
 *   @arg hMcasp
 *        Handle to the McASP
 *
 *   @arg myQuery
 *        Query to be performed. 
 *
 *   @arg response
 *        Pointer to buffer to return the data requested by the query passed
 *
 *   @ret CSL_Status
 *        CSL_SOK            - Successful completion of the query
 *        CSL_ESYS_BADHANDLE - Invalid handle
 *        CSL_ESYS_INVQUERY  - Query command not supported
 *        CSL_ESYS_FAIL      - Generic failure
 *
 *   @eg
 *        CSL_Status        status;
 *        Bool              xmtUnderRun;
 *        CSL_McaspHandle   hMcasp;
 *
 *        status = CSL_mcaspGetHwStatus (hMcasp,  
 *                        CSL_MCASP_QUERY_XSTAT_XUNDRN,  
 *                        &xmtUnderRun);
 *
 * ============================================================================
 */
extern CSL_Status CSL_mcaspGetHwStatus (
    CSL_McaspHandle           hMcasp,
    CSL_McaspHwStatusQuery    myQuery,
    void                      *response
);

/**
 * ============================================================================
 *   @func CSL_mcaspRead
 *
 *   @desc
 *   @n     This reads the data from McASP. 32 bits of data will be read
 *          in the data object (variable); the pointer to which is passed
 *          as the third argument.
 *
 *   @arg hMcasp
 *        Handle to the McASP
 *
 *   @arg serNum
 *        Serializer Number
 *
 *   @arg data
 *        Buffer to store read data.
 *
 *   @ret CSL_Status
 *        CSL_SOK               - Successful completion of read
 *        CSL_ESYS_BADHANDLE    - Invalid handle
 *        CSL_ESYS_INVPARAMS    - Invalid serializer
 *
 *   @eg
 *        CSL_Status        status;
 *        Uint32            inData;
 *        CSL_McaspHandle   hMcasp;
 *
 *        status = CSL_mcaspRead (hMcasp, &inData);
 *
 * ============================================================================
 */
extern CSL_Status CSL_mcaspRead (
    CSL_McaspHandle         hMcasp,
    Uint32                  *data
);

/**
 * ============================================================================
 *   @func CSL_mcaspWrite
 *
 *   @desc
 *   @n     This transmits the data from McASP. 32 bits of data will be
 *          transmitted in the data object (variable); the pointer to which
 *          is passed as the third argument.
 *
 *   @arg hMcasp
 *        Handle to the McASP
 *
 *   @arg serNum
 *        Serializer Number
 *
 *   @arg data
 *        Data to be written.
 *
 *   @ret CSL_Status
 *        CSL_SOK              - Successful completion of the query
 *        CSL_ESYS_BADHANDLE   - Invalid handle
 *        CSL_ESYS_INVPARAMS   - Invalid parameters
 *
 *   @eg
 *        CSL_Status        status;
 *        Uint32            outData;
 *        CSL_McaspHandle   hMcasp;
 *        
 *        outData = 0x1234;
 *        status = CSL_mcaspWrite (hMcasp, &outData);
 *
 * ============================================================================
 */
extern CSL_Status CSL_mcaspWrite (
    CSL_McaspHandle         hMcasp,
    Uint32                  *data
);

/**
 * ============================================================================
 *   @func CSL_mcaspRegReset
 *
 *   @desc
 *   @n     Function to reset all the registers values.
 *
 *   @arg hMcasp
 *          Handle to the McASP
 *
 *   @ret void
 *          None
 * 
 *   @eg
 *          CSL_McaspHandle     hMcasp;
 *
 *          CSL_mcaspRegReset (hMcasp);
 *
 * ============================================================================
 */
extern void CSL_mcaspRegReset (
    CSL_McaspHandle     hMcasp
);

/**
 * ============================================================================
 *   @func CSL_mcaspResetCtrl
 *
 *   @desc
 *   @n     This function enables bit fields of GBLCTL register.
 *
 *   @arg hMcasp
 *          Handle to the McASP
 *
 *   @arg selectMask
 *          Selects bits to enable
 *
 *   @ret void
 *          None
 * 
 *   @eg
 *          CSL_McaspHandle     hMcasp;
 *
 *          CSL_mcaspResetCtrl (hMcasp, CSL_MCASP_GBLCTL_XSMRST_MASK
 *                              | CSL_MCASP_GBLCTL_RSMRST_MASK);
 *
 * ============================================================================
 */
extern void CSL_mcaspResetCtrl (
    CSL_McaspHandle     hMcasp,
    CSL_BitMask32       selectMask
);


/** 
 * ============================================================================
 *   @func CSL_mcaspGetChipCtxt
 *
 *   @b Description
 *   @n  This function is used for getting the base address of the peripheral
 *       instance and to configure the number of serializers for a particular
 *       instance of McASP on a chip. This function will be called inside the
 *       CSL_mcaspOpen() function.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      
            mcaspNum        Specifies the instance of the McASP to be opened.
 
            pMcaspParam     Module specific parameters.
 
            pChipContext    Pointer to chip context 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_McaspChipContext  chipContext;

       ...
      status = CSL_mcaspGetChipCtxt(CSL_MCASP_1, NULL, &chipContext);

    @endverbatim
 * ============================================================================
 */
extern CSL_Status   CSL_mcaspGetChipCtxt (
    CSL_InstNum             mcaspNum,
    CSL_McaspParam          *pMcaspParam,
    CSL_McaspChipContext    *pChipContext 
);

#ifdef __cplusplus
}
#endif

#endif  /* _CSL_MCASP_H_ */

⌨️ 快捷键说明

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