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

📄 csl_edmagethwregionstatus.c

📁 TI达芬奇dm644x各硬件模块测试代码
💻 C
字号:
/*  ============================================================================
 *   Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005
 *
 *   Use of this software is controlled by the terms and conditions found in the
 *   license agreement under which this software has been supplied.
 *   ===========================================================================
 */
/** @file csl_edmaGetHwRegionStatus.c
 *
 *  @brief File for functional layer of CSL API @a CSL_edmaGetHwRegionStatus()
 *
 *  Path: \\(CSLPATH)\\ipmodules\\edma\\src
 *
 *  @date
 *  @author Ruchika Kharwar
 */

/* =============================================================================
 *  Revision History
 *  ===============
 *  10-Aug-2005  brn      Updated for doxygen documentation and butification
 * =============================================================================
 */

#include <csl_edma.h>
#include <csl_edmaAux.h>

/** ============================================================================
 *  @n@b   CSL_edmaGetHwRegionStatus
 *
 *  @b Description
 *  @n Queries the status paramaters of the shadow region.
 *
 *   @b Arguments
 *   @verbatim
            hEdma           Handle to the EDMA instance

            myQuery         Shadow region query

            response        Additional query arguments are passed to the API
                            using the response structure. The query response is
                            passed back to the user program using this pointer.
                            Depending on the '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>
 *    CSL_edmaInit(),   CSL_edmaOpen(),  CSL_edmaRegionOpen() must have been 
 *  called successfully before this function can be called.The user must 
 *  allocate space for this and this API fills in the system specified fields
 *
 *  @b Example:
 * @verbatim
    CSL_EdmaRegionObj RegionObj;
    CSL_EdmaRegionHndl shHndl;
    CSL_EdmaRegionParam regParam;

    CSL_EdmaChanObj ChObj;
    CSL_EdmaChanHandle chHndl;

    CSL_BitMask32 intrEnable[2];
    CSL_EdmaHandle     hModHndl;
    CSL_Status modStatus;

    // Initialize
    modStatus = CSL_edmaInit(NULL);
    ...

    hModHndl = CSL_edmaOpen(NULL,CSL_EDMA_0,NULL,&modStatus);

    // Region 0 Open
    regParam.regionNum = CSL_EDMA_REGION_0;
    shHndl = CSL_edmaRegionOpen(&RegionObj,CSL_EDMA_0,&regParam,&status);

    // Query the shadow region
    CSL_edmaGetHwRegionStatus(shHndl, 
                              CSL_EDMA_QUERY_REGION_INTERRUPT_PENDSTATUS, 
                              intrPend
                              );

   @endverbatim
 *
 *
 * ============================================================================
 */
#pragma CODE_SECTION (CSL_edmaGetHwRegionStatus, ".text:csl_section:edma");
CSL_Status  CSL_edmaGetHwRegionStatus(
    /** Pointer to the object that holds reference to the
     * instance of EDMA */
    CSL_EdmaRegionHandle                 hSh,
    /** The query to this API which indicates the status/setup
     * to be returned */
    CSL_EdmaHwRegionStatusQuery    myQuery,
    /** Placeholder to return the status; @a void* casted */
    void                           *response
)
{
    CSL_Status st = CSL_SOK;
    if (hSh == NULL)
        return CSL_ESYS_BADHANDLE;
    if (response == NULL)
        return CSL_ESYS_INVPARAMS;
    switch(myQuery) {
        case CSL_EDMA_QUERY_REGION_INTERRUPT_PENDSTATUS:
            st = CSL_edmaGetRegionIntrPendStatus(hSh,
                                            &((CSL_BitMask32*)response)[0],
                                            &((CSL_BitMask32*)response)[1]);
            break;
        default:
            st = CSL_ESYS_INVQUERY;
            break;
    }
    return st;
}

⌨️ 快捷键说明

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