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

📄 csl_spigethwstatus.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_spiGetHwStatus.c * *  @brief    File for functional layer of CSL API @a CSL_spiGetHwStatus() * *  Description *    - The @a CSL_spiGetHwStatus() function definition & it's associated *      functions * *  Path: \\(CSLPATH)\\ipmodules\\spi\\src * *  Modification 1 *    - modified on: 15/12/2003 *    - reason: created the sources * *  Modification 2 *    - modified on: 19/12/2003 *    - reason: created better documentation * *  Modification 3 *    - modified on: 01/03/2004 *    - reason: modified according to review comments * *  Modification 4 *    - modified on: 10/05/2004 *    - reason: removed MIB from code & documentation * *  Date 15th Dec, 2003 *  Author Sumant S. NaikKhanvte *//* ============================================================================= *  Revision History *  =============== *  11-oct-2004 HMM Updated code review comments *  01-Sep-2004 HMM File Updated. * ============================================================================= */#include <csl_spi.h>#include <csl_spiAux.h>/** ============================================================================ *   @n@b CSL_spiGetHwStatus * *   @b Description *   @n This function is used to get the value of various parameters of the *      SPI instance. The value returned depends on the query passed. * *   @b Arguments *   @verbatim            hSpi            Handle to the SPI 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             - 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  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 Example *   @verbatim        CSL_status    status;        Uint8         response;        status = CSL_spiGetHwStatus(hSpi, CSL_SPI_QUERY_INT_VECTOR0, &response);     @endverbatim * =========================================================================== */#pragma CODE_SECTION (CSL_spiGetHwStatus, ".text:csl_section:spi")CSL_Status CSL_spiGetHwStatus (    CSL_SpiHandle                hSpi,    CSL_SpiHwStatusQuery         query,    void                        *response){    CSL_Status status = CSL_SOK;    if (hSpi == NULL) {        return CSL_ESYS_BADHANDLE;    }    if (response == NULL) {        return CSL_ESYS_INVPARAMS;    }    switch (query) {        case CSL_SPI_QUERY_POWER_STATUS:            CSL_spiPwrStat(hSpi, (CSL_SpiPwrStat *)response);            break;        case CSL_SPI_QUERY_PINS_VALUE:            CSL_spiPinVal(hSpi, (Uint32 *)response);            break;        case CSL_SPI_QUERY_INT_VECTOR0:            CSL_spiIntVector(hSpi,                             CSL_SPI_QUERY_INT_VECTOR0,                             (CSL_SpiIntVec *)response);            break;        case CSL_SPI_QUERY_INT_VECTOR1:            CSL_spiIntVector(hSpi,                             CSL_SPI_QUERY_INT_VECTOR1,                             (CSL_SpiIntVec *)response);            break;        case CSL_SPI_QUERY_INT_ENABLED:            CSL_spiIntEnabled(hSpi, (Uint32 *)response);            break;        case CSL_SPI_QUERY_CPT_DMA_ENABLED:            CSL_spiCptDmaEnabled(hSpi, (Uint16 *)response);            break;        default:            status = CSL_ESYS_INVQUERY;    }    return status;}

⌨️ 快捷键说明

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