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

📄 csl_i2cgethwstatus.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_i2cGetHwStatus.c * *  @brief    File for functional layer of CSL API @a CSL_i2cGetHwStatus() * *  Description *    - The @a CSL_i2cGetHwStatus() function definition & it's associated *      functions * *  PATH  \\(CSLPATH)\\ipmodules\\i2c\\src * *  Modification 1 *    - Modified on: 28/5/2004 *    - Reason: created the sources * *  Date 28th May, 2004 *  Author Santosh Narayanan. *//* ============================================================================= *  Revision History *  =============== *  11-oct-2004 Hs updated code according to code review comments. *  31-aug-2004 Hs Updated the CSL_i2cGetHwStatus to call respective functions. * ============================================================================= */#include <csl_i2c.h>#include <csl_i2cAux.h>/** ============================================================================ *   @n@b CSL_i2cGetHwStatus * *   @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_I2cHwStatusQuery * *   @b Arguments *   @verbatim            hI2c      Pointer to the object that holds reference to the                      instance of I2C requested after the call            query     The query to this API 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_BADHANDLE  - Invalid handle *   @li                    CSL_ESYS_INVQUERY   - Invalid query command *   @li                    CSL_ESYS_INVPARAMS  - Invalid parameter * *   <b> Pre Condition </b> *   @n  Both @a CSL_i2cInit() and @a CSL_i2cOpen() must be called successfully *       in that order before @a CSL_i2cGetHwStatus() can be called. * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n None * *   @b Example *   @verbatim        CSL_I2cHandle          hI2c;        CSL_I2cHwStatusQuery   query;        void                       reponse;        status = CSL_Geti2cHwStatus (hI2c, query, &response);     @endverbatim *  ============================================================================ */#pragma CODE_SECTION (CSL_i2cGetHwStatus, ".text:csl_section:i2c")CSL_Status CSL_i2cGetHwStatus (    CSL_I2cHandle                hI2c,    CSL_I2cHwStatusQuery         query,    void                        *response){    CSL_Status status = CSL_SOK;    if (hI2c == NULL) {        return CSL_ESYS_BADHANDLE;    }    /* Added according to review comment 3. */    if (response == NULL) {        return CSL_ESYS_INVPARAMS;    }    switch (query) {        case CSL_I2C_QUERY_CLOCK_SETUP:            CSL_i2cGetClockSetup (hI2c, response);            break;        case CSL_I2C_QUERY_BUS_BUSY:            CSL_i2cGetBusBusy (hI2c, response);            break;        case CSL_I2C_QUERY_RX_RDY:            CSL_i2cGetRxRdy (hI2c, response);            break;        case CSL_I2C_QUERY_TX_RDY:            CSL_i2cGetTxRdy (hI2c, response);            break;        case CSL_I2C_QUERY_ACS_RDY:            CSL_i2cGetAcsRdy (hI2c, response);            break;        case CSL_I2C_QUERY_SCD:            CSL_i2cGetScd (hI2c, response);            break;        case CSL_I2C_QUERY_AD0:            CSL_i2cGetAd0 (hI2c, response);            break;        case CSL_I2C_QUERY_AAS:            CSL_i2cGetAas (hI2c, response);            break;        case CSL_I2C_QUERY_RSFULL:            CSL_i2cGetRsFull (hI2c, response);            break;        case CSL_I2C_QUERY_XSMT:            CSL_i2cGetXsmt (hI2c, response);            break;        case CSL_I2C_QUERY_AL:            CSL_i2cGetAl (hI2c, response);            break;        case CSL_I2C_QUERY_SDIR:            CSL_i2cGetSdir (hI2c, response);            break;        case CSL_I2C_QUERY_NACKSNT:            CSL_i2cGetNacksnt (hI2c, response);            break;        case CSL_I2C_QUERY_RDONE:            CSL_i2cGetRdone (hI2c, response);            break;        case CSL_I2C_QUERY_BITCOUNT:            CSL_i2cGetBitcount (hI2c, response);            break;        case CSL_I2C_QUERY_INTCODE:            CSL_i2cGetIntcode (hI2c, response);            break;        case CSL_I2C_QUERY_REV:            CSL_i2cGetRev (hI2c, response);            break;        case CSL_I2C_QUERY_CLASS:            CSL_i2cGetClass (hI2c, response);            break;        case CSL_I2C_QUERY_TYPE:            CSL_i2cGetType (hI2c, response);            break;        default:            status = CSL_ESYS_INVQUERY ;            break;    }    return status;}

⌨️ 快捷键说明

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