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

📄 csl_pmxgethwstatus.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_pmxGetHwStatus.c
 *
 *  @brief    File for functional layer of CSL API @a CSL_pmxGetHwStatus()
 *
 *  Path: \\(CSLPATH)\\ipmodules\\pmx\\src
 *
 */


/* =============================================================================
 *  Revision History
 *  ===============
 *  08-nov-2004 BRN File Created
 *
 * =============================================================================
 */

#include <csl_pmx.h>
#include <csl_pmxAux.h>

/** ============================================================================
 *  @n@b CSL_pmxGetHwStatus
 *  @b Description
 *
 *  @n This function is used to read the current device configuration, status
 *  flags and the value present associated registers. Following table details
 *  the various status queries supported and the associated data structure to
 *  record the response. User should allocate memory for the said data type and
 *  pass its pointer as an unadorned void* argument to the status query call.
 *  For details about the various status queries supported and the associated
 *  data structure to record the response, refer to @a CSL_PmxHwStatusQuery.
 *
 *   @b Arguments
 *   @verbatim
            hPmx           Handle to the PMX instance

            query           Query to be performed

            response        Pointer to buffer to return the data requested by
                            the query passed
     @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>
 *  Both @a CSL_pmxInit() and @a CSL_pmxOpen() must be called successfully
 *  in that order before @a CSL_pmxGetHwStatus() can be called. For the
 *  argument type that can be @a void* casted & passed with a particular cmd
 *  refer to @a CSL_PmxHwStatusQuery
 *
 * @b Example:
 * @verbatim
      CSL_PmxHandle hPmx;
      CSL_Status    status;
      Uint16        *response;
       ...
      status = CSL_pmxGetHwStatus(hPmx, CSL_PMX_QUERY_PIN_MUX0_STAT, &response);
   @endverbatim
 *  ============================================================================
 */
#pragma CODE_SECTION (CSL_pmxGetHwStatus, ".text:csl_section:pmx");
CSL_Status CSL_pmxGetHwStatus (
    CSL_PmxHandle          hPmx,
    CSL_PmxHwStatusQuery   query,
    void                   *response
)
{
    CSL_Status status = CSL_SOK;

    if (hPmx == NULL) {
        status = CSL_ESYS_BADHANDLE;
        return status;
    }

    switch (query) {
        case CSL_PMX_QUERY_PIN_MUX0_STAT:
            CSL_pmxGetPinMux0Status (hPmx, (CSL_PinMux0Setup *)response);
            break;

        case CSL_PMX_QUERY_PIN_MUX1_STAT:
            CSL_pmxGetPinMux1Status (hPmx, (CSL_PinMux1Setup *)response);
            break;

        default:
            status = CSL_ESYS_INVQUERY ;
            break;
    }

    return status;
}

⌨️ 快捷键说明

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