📄 csl_pwmgethwstatus.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_pwmGetHwStatus.c
*
* @brief File for functional layer of CSL API @a CSL_pwmGetHwStatus()
*
* Path: \\(CSLPATH)\\ipmodules\\pwm\\src
*
* @date 30 April, 2004
* @author Pratheesh Gangadhar
*/
/* =============================================================================
* Revision History
* ===============
* 02-Aug-2004 brn Updated for the new CSL architecture.
* 11-Oct_2004 brn File updated with the review comments
* =============================================================================
*/
#include <csl_pwm.h>
#include <csl_pwmAux.h>
/** ============================================================================
* @n@b CSL_pwmGetHwStatus
*
* @b Description
* @n Gets the status of the different operations of PWM.
*
* @b Arguments
* @verbatim
hPwm Handle to the PWM instance
query The query to this API of PWM 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_INVPARAMS - Invalid parameter
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_PwmHandle hPwm;
CSL_PwmHwStatusQuery query;
void reponse;
status = CSL_pwmGetHwStatus (hPwm, query, &response);
@endverbatim
* =============================================================================
*/
#pragma CODE_SECTION (CSL_pwmGetHwStatus, ".text:csl_section:pwm");
CSL_Status CSL_pwmGetHwStatus (
CSL_PwmHandle hPwm,
CSL_PwmHwStatusQuery query,
void *response
)
{
CSL_Status status = CSL_SOK;
if (hPwm == NULL) {
status = CSL_ESYS_BADHANDLE;
return status;
}
switch (query) {
case CSL_PWM_QUERY_OUTPUT_STATUS:
*(Uint32*)response = CSL_pwmGetOutputStatus (hPwm);
break;
case CSL_PWM_QUERY_OPER_STATUS:
*(Uint32*)response = CSL_pwmGetOperStatus (hPwm);
break;
case CSL_PWM_QUERY_PID:
*(Uint32*)response = CSL_pwmGetPid(hPwm);
break;
default:
status = CSL_ESYS_INVQUERY ;
break;
}
return status;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -