?? csl_wdtgethwstatus.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 + -