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

📄 csl_cfggethwstatus.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_cfgGetHwStatus.c
 *
 *    @brief    File for functional layer of CSL API @a CSL_cfgGetHwStatus()
 *
 *  Description
 *    - The @a CSL_cfgGetHwStatus() function definition & it's associated
 *      functions
 *
 */

#include <csl_cfg.h>
#include <csl_cfgAux.h>

/** @brief Gets the status of the different operations.
 */
/** ============================================================================
 *   @n@b CSL_cfgGetHwStatus
 *
 *   @b Description
 *   @n Gets the status of the different operations of CFG.
 *
 *   @b Arguments
 *   @verbatim
            hCfg          Handle to the CFG instance

            query         The query to this API of CFG which indicates the
                          status to be returned.

            response      Placeholder to return the status.

     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Status info return successful
 *   @li                    CSL_ESYS_INVQUERY   - Invalid query command
 *   @li                    CSL_ESYS_INVPARAMS  - Invalid parameter
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_CfgHandle          hCfg;
        CSL_CfgHwStatusQuery   query;
        void                   reponse;

        status = CSL_GetcfgHwStatus (hCfg, query, &response);

     @endverbatim
 * =============================================================================
 */
#pragma CODE_SECTION (CSL_cfgGetHwStatus, ".text:csl_section:cfg")
CSL_Status  CSL_cfgGetHwStatus(
    /** Pointer to the object that holds reference to the
     *  instance of CFG requested after the call
     */
    CSL_CfgHandle               hCfg,
    /** The query to this API which indicates the status
     *  to be returned
     */
    CSL_CfgHwStatusQuery        query,
    /** Placeholder to return the status. @a void* casted */
    void                        *response
)
{
    CSL_Status status = CSL_SOK;

    if (hCfg == NULL)
        return CSL_ESYS_BADHANDLE;

    /* Added according to review comment 3. */
    if(response == NULL) {
        return CSL_ESYS_INVPARAMS;
    }

    switch(query) {
        case CSL_CFG_QUERY_FAULT_ADDR:
            CSL_cfgGetFaultAddr (hCfg,(Uint32*) response);
            break;

        case CSL_CFG_QUERY_STATUS:
            CSL_cfgGetCfgStat (hCfg, (CSL_CfgStatus *)response);
            break;

        default:
            status = CSL_ESYS_INVQUERY ;
            break;
    }
    return status;
}

⌨️ 快捷键说明

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