📄 csl_ccdcopen.c
字号:
/** @file csl_ccdcOpen.c
*
* @brief File for functional layer of CSL API @a CSL_ccdcOpen()
*
* Description
* - The @a CSL_ccdcOpen() function definition & it's associated functions
*
* Modification 1
* - Created on: 10/21/2004
* - Reason: Created the sources
*
* @date 21st Oct, 2004
* @author Santosh Narayanan.
*/
#include <csl_ccdc.h>
#include <_csl_resource.h>
#pragma CODE_SECTION (CSL_ccdcOpen, ".text:csl_section:ccdc");
extern void _CSL_ccdcGetAttrs(CSL_CcdcNum ccdcNum , CSL_CcdcHandle hCcdc);
/** @brief Reserves the specified CCDC for use.
*/
CSL_CcdcHandle CSL_ccdcOpen (
/** Pointer to the object that holds reference to the
* instance of CCDC requested after the call
*/
CSL_CcdcObj *hCcdcObj,
/** Instance of CCDC to which a handle is requested
*/
CSL_CcdcNum ccdcNum,
/** Specifies if CCDC should be opened with exclusive or
* shared access to the associate pins
*/
CSL_OpenMode openMode,
/** This returns the status (success/errors) of the call
*/
CSL_Status *status
){
CSL_CcdcNum ccdcInst;
CSL_CcdcHandle hCcdc = (CSL_CcdcHandle)NULL;
hCcdcObj->openMode = openMode;
if (ccdcNum >= 0 ) {
_CSL_ccdcGetAttrs(ccdcNum, hCcdcObj);
hCcdc = (CSL_CcdcHandle)_CSL_certifyOpen((CSL_ResHandle)hCcdcObj, status);
}
else {
for(ccdcInst=(CSL_CcdcNum)0;ccdcInst < (CSL_CcdcNum)CSL_CCDC_PER_CNT;++ccdcInst){
_CSL_ccdcGetAttrs(ccdcInst, hCcdcObj);
hCcdc = (CSL_CcdcHandle)_CSL_certifyOpen((CSL_ResHandle)hCcdcObj, status);
if (*status == CSL_SOK)
break;
}
if (ccdcInst == CSL_CCDC_PER_CNT)
*status = CSL_ESYS_OVFL;
}
return hCcdc;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -