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

📄 csl_edma.h

📁 ccs下对dm6446的测试程序
💻 H
📖 第 1 页 / 共 5 页
字号:
    ...
    // Channel 0 is opened which is allocated to Region Region 0
    chParam.regionNum = CSL_EDMA_REGION_GLOBAL;
    chParam.chaNum = CSL_EDMA_CHA0;
    hChannel = CSL_edmaChannelOpen(&edmaObj,
                            CSL_EDMA_0,
                            &chParam,
                            &edmaStatus);
     @endverbatim
 *
 * ===========================================================================
 */
CSL_EdmaChanHandle  CSL_edmaChannelOpen(
    /** Pointer to the channel object*/
    CSL_EdmaChanObj            *edmaObj,
    /** Module instance number */
    CSL_InstNum                edmaNum,
    /** Channel parameters  */
    CSL_EdmaChannelParam       *param,
    /** place holder for the status */
    CSL_Status                 *status
);


/** ============================================================================
 *  @n@b   CSL_edmaChannelClose
 *
 *  @brief
 *     The channel cannot be accessed anymore using the handle
 *
 *   @b Arguments
 *   @verbatim
            hEdma         Handle to the EDMA instance
     @endverbatim
 *
 *   <b> Return Value   CSL_Status
 *   @li                    CSL_SOK            - EDMA is closed
 *                                               successfully
 *
 *   @li                    CSL_ESYS_BADHANDLE - The handle passed is invalid
 *
 *   <b> Pre Condition
 *   @n  None
 *
 *   <b> Post Condition
 *   @n  1. The EDMA CSL APIs can not be called until the EDMA
 *          CSL is reopened again using CSL_uartOpen()
 *
 *   @b Modifies
 *   @n  None
 *
 *  <b> Usage Constraints: </b>
 *  All @a CSL_edmaInit(), @a CSL_edmaOpen(), @a CSL_edmaChannelOpen() must be
 *  invoked successfully in that order before this API can be invoked.
 *  If the channel is opened in context of a Region, @a CSL_edmaRegionOpen()
 *  may also need to be invoked before this API. If a Shadow region is used
 *  then care of the DRAE settings must be taken.
 *
 *  @b Example:
 *  @verbatim
*       CSL_EdmaHandle hModule;

        CSL_EdmaChanObj ChObj;
        CSL_EdmaChanHandle hChannel;
        CSL_EdmaChannelParam chParam;
        CSL_Status         edmaStatus;

        // Initialization
        CSL_edmaInit();
        // Module Level Open
         hModule = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&edmaStatus);

        ...
        // Channel 0 is opened which is allocated to Region Region 0
        chParam.regionNum = CSL_EDMA_REGION_GLOBAL;
        chParam.chaNum = CSL_EDMA_CHA0;
        hChannel = CSL_edmaChannelOpen(&edmaObj,
                                CSL_EDMA_0,
                                &chParam,
                                &edmaStatus);
        ...
        // EDMA Channel Close Call
    edmaStatus = CSL_edmaChannelClose(hChannel);
    @endverbatim
 *
 * =============================================================================
 */
CSL_Status  CSL_edmaChannelClose(
    /** Channel Handle*/
    CSL_EdmaChanHandle        hEdma
);


/** ===========================================================================
 *  @n@b   CSL_edmaHwChannelSetup
 *
 *  @b Description
 *  @n Does the Channel setup i.e the channel to param entry mapping(if relevant)
 *     trigger word programmation (if relevant) and the que to which the channel
 *     is mapped.
 *   @b Arguments
 *
 *   @verbatim
            hEdma           Channel handle

            setup           Pointer to hardware setup structure
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Hardware setup successful
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *   @li                    CSL_ESYS_INVPARAMS  - Hardware structure is not
 *                                                properly initialized
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The specified instance will be setup according to value passed
 *
 *   @b Modifies
 *   @n Hardware registers for the specified instance
 *
 *  <b> Usage Constraints: </b>
 *  All   CSL_edmaInit(),   CSL_edmaOpen() and   CSL_edmaChannelOpen() must be
 *  called successfully in that order before   csl_edmaHwChannelSetup()
 *  can be called.
 *
 *  @b Example:
 *  @verbatim
     CSL_EdmaHandle hModule;

    CSL_EdmaChanObj ChObj;
    CSL_EdmaChanHandle hChannel;
    CSL_EdmaChannelParam chParam;
    CSL_Status         edmaStatus;

    // Initialization
    CSL_edmaInit();
    // Module Level Open
     hModule = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&edmaStatus);

    ...
    // Channel 0 is opened which is allocated to Region Region 0
    chParam.regionNum = CSL_EDMA_REGION_GLOBAL;
    chParam.chaNum = CSL_EDMA_CHA0;
    hChannel = CSL_edmaChannelOpen(&edmaObj,
                            CSL_EDMA_0,
                            &chParam,
                            &edmaStatus);

    // Channel Setup
    setup.que =  CSL_EDMA_EVT_QUE0;
    setup.paramEntry = 0;
    setup.triggerWord = CSL_EDMA_TRIGWORD_NONE;
    CSL_edmaHwChannelSetup(edmaHndl,&setup);
    @endverbatim
 *
 * ============================================================================
 */
CSL_Status  CSL_edmaHwChannelSetup(
    /** Channel Handle*/
    CSL_EdmaChanHandle        hEdma,
    /** Setup Parameters */
    CSL_EdmaHwChannelSetup      *setup
);

/* Higher level control API */
/** ============================================================================
 *  @n@b   CSL_edmaHwChannelControl
 *
 *  @b Description
 *  @n Takes a command with an optional argument & implements it. This function is
 *  used to carry out the different operations performed by EDMA
 *
 *   @b Arguments
 *   @verbatim
            hCh          Channel Handle

            cmd          Channel Command

            cmdArg       Additional command arguments are passed to the API
                         using this. The CSL function type casts to the
                         appropriate arguments type depending on the cmd.

     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK            - Command execution successful.
 *   @li                    CSL_ESYS_BADHANDLE - Invalid handle
 *   @li                    CSL_ESYS_INVCMD    - Invalid command
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Registers of the EDMA instance are configured according to the command
 *       and the command arguments. The command determines which registers are
 *       modified.
 *
 *   @b Modifies
 *   @n Registers determined by the command
 *
 *  <b> Usage Constraints: </b>
 *  All @a CSL_edmaInit(), @a CSL_edmaOpen(), @a CSL_edmaChannelOpen() must be
 *  invoked successfully in that order before this API can be invoked.
 *  If the channel is opened in context of a Region, @a CSL_edmaRegionOpen()
 *  may also need to be invoked before this API. If a Shadow region is used
 *  then care of the DRAE settings must be taken
 *
 *  @b Example:
 *  @verbatim
       // Initialization

    CSL_EdmaChanObj ChObj;
    CSL_EdmaChanHandle chHndl;

    CSL_EdmaHandle     hModHndl;
    CSL_Status modStatus;

    // Initialize
    modStatus = CSL_edmaInit(NULL);
    ...
    // Open Module
    hModHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);

    // Open Channel 0
    chParam.regionNum = CSL_EDMA_REGION_GLOBAL;
    chParam.chaNum = CSL_EDMA_CHA0;
    edmaHndl = CSL_edmaChannelOpen(&edmaObj,
                            CSL_EDMA_0,
                            &chParam,
                            &edmaStatus);
    status = CSL_edmaHwChannelControl(edmaHndl,CSL_EDMA_CMD_CHANNEL_ENABLE,NULL);
 *  @endverbatim
 * ============================================================================
 */
CSL_Status  CSL_edmaHwChannelControl
(
    /** Channel Handle*/
    CSL_EdmaChanHandle              hCh,
    /** The command to this API which indicates the action to be taken */
    CSL_EdmaHwChannelControlCmd     cmd,
    /** Optional argument @a void* casted */
    void                            *cmdArg
);


/* top level query API */

/** ============================================================================
 *  @n@b   CSL_edmaGetHwChannelStatus
 *
 *  @b Description
 *  @n Gets the status of the different operations or the current setup of EDMA
 *  module
 *
 *   @b Arguments
 *   @verbatim
            hEdma           Handle to the EDMA instance

            myQuery         Shadow region query

            response        Additional query arguments are passed to the API
                            sing the response structure. The query response is
                            passed back to the user program using this pointer.
                            Depending on 'myQuery' this argument is type casted
                            appropriately.
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK            - Successful completion of the
 *                                               query
 *
 *   @li                    CSL_ESYS_BADHANDLE - Invalid handle
 *
 *   @li                    CSL_ESYS_INVQUERY  - Query command not supported
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *       Data requested by the query is returned through the variable "response"
 *
 *   @b Modifies
 *   @n  The input arguement "response" is modified
 *
 *  <b> Usage Constraints: </b>
 *  All @a CSL_edmaInit(), @a CSL_edmaOpen(), @a CSL_edmaChannelOpen() must be
 *  invoked successfully in that order before this API can be invoked.
 *  If the channel is opened in context of a Region, @a CSL_edmaRegionOpen()
 *  may also need to be invoked before this API. If a Shadow region is used
 *  then care of the DRAE settings must be taken
 *
 *  @b Example:
 *  @verbatim
      // Initialization

    CSL_EdmaHandle hModule;

    CSL_EdmaChanObj ChObj;
    CSL_EdmaChanHandle hChannel;
    CSL_EdmaChannelParam chParam;
    CSL_Status         edmaStatus;

    // Initialization
    CSL_edmaInit();
    // Module Level Open
     hModule = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&edmaStatus);

    ...
    // Channel 0 is opened which is allocated to Region Region 0
    chParam.regionNum = CSL_EDMA_REGION_GLOBAL;
    chParam.chaNum = CSL_EDMA_CHA0;
    hChannel = CSL_edmaChannelOpen(&edmaObj,
                            CSL_EDMA_0,
                            &chParam,
                            &edmaStatus);

    // Channel 0 is opened which is in the global region, hence the shadow
    // Handle is NULL
    edmaStatus = CSL_edmaGetHwChannelStatus(hChannel,
                            CSL_EDMA_QUERY_CHANNEL_SETUP,
                            &querySetup);
    @endverbatim
 *
 * ============================================================================
 */
CSL_Status  CSL_edmaGetHwChannelStatus(
    /** Channel Handle */
    CSL_EdmaChanHandle                 hCh,
    /** The query command */
    CSL_EdmaHwChannelStatusQuery    myQuery,
    /** Placeholder to return the status @a void* casted */
    void                           *response
);


/** ============================================================================
 *  @n@b   CSL_edmaGetParamHandle
 *
 *  @b Description
 *  @n Acquires the Param entry as specified by the argument
 *   @b Arguments
 *
 *   @verbatim
            hEdma           Channel handle

            entryNum        Entry number desired

            status          Pointer to the placeholder for the status

     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Hardware setup successful
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *   @li                    CSL_ESYS_INVPARAMS  - Hardware structure is not
 *                                                properly initialized
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Returns the handle to the requested parameter entry
 *
 *   @b Modifies
 *   @n NONE
 *
 *  <b> Us

⌨️ 快捷键说明

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