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

📄 csl_wdtgethwstatus.c

📁 TI的DM6446的硬件平台搭建的相关例子
💻 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_wdtGetHwStatus.c
 *
 *   @brief  File for functional layer of CSL API @a CSL_wdtGetHwStatus()
 *
 *  Path: \\(CSLPATH)\\ipmodules\\wdt\\src
 *
 */

/* =============================================================================
 *  Revision History
 *  ===============
 *  11-Oct-2004 Hs  updated the code review comments
 *  01-Sep-2004 Hmm File created.
 * ============================================================================
 */

#include <csl_wdt.h>
#include <csl_wdtAux.h>

/** ============================================================================
 *   @n@b CSL_wdtGetHwStatus
 *
 *   @b Description
 *   @n This function is used to get the value of various parameters of the
 *      watchdog timer. The value returned depends on the query passed.
 *
 *   @b Arguments
 *   @verbatim
            hWdt            Handle to the watchdog timer

            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 Example
 *   @verbatim
            Uint16       count = 0;
            CSL_Status   status;

            status = CSL_wdtGetHwStatus(hWdt, CSL_WDT_QUERY_COUNT,
                                        &count);
     @endverbatim
 * =============================================================================
 */
#pragma CODE_SECTION (CSL_wdtGetHwStatus, ".text:csl_section:wdt");
CSL_Status  CSL_wdtGetHwStatus (
    CSL_WdtHandle          hWdt,
    CSL_WdtHwStatusQuery   query,
    void                   *response
)
{
    CSL_Status status = CSL_SOK;

    if (hWdt == NULL)
        return CSL_ESYS_BADHANDLE;

    if (response == NULL) {
        status = CSL_ESYS_INVPARAMS;
        return status;
    }

    switch (query) {
        /* Gets the current value of the watchdog timer count register 12
         *
         */
        case CSL_WDT_QUERY_COUNT12:
            CSL_wdtGetTim12Count(hWdt, (Uint32 *)response);
            break;
		/* Gets the current value of the watchdog timer count register 34
         *
         */
        case CSL_WDT_QUERY_COUNT34:
            CSL_wdtGetTim34Count(hWdt, (Uint32 *)response);
            break;
        /* This query command returns the status about
         * whether the watchdog timer is running or stopped
         */
        case CSL_WDT_QUERY_WDFLAG_STAT:
            *((CSL_WdtFlagBitStatus *)response) = CSL_wdtGetWdflagStat (hWdt);
            break;
        case CSL_WDT_QUERY_PID_NUMBER:
            CSL_wdtGetPidNumber(hWdt, (CSL_WdtPidNumber *)response);
            break;
        default:
            status = CSL_ESYS_INVQUERY;
    }
    return status;
}

⌨️ 快捷键说明

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