📄 csl_prevopen.c
字号:
/** @file csl_prevOpen.c
*
* @brief File for functional layer of CSL API @a CSL_prevOpen()
*
* Description
* - The @a CSL_prevOpen() function definition & it's associated functions
*
*
* @date 18th October, 2004
* @author Vignesh LA.
*/
#include <csl_prev.h>
#include <_csl_resource.h>
#pragma CODE_SECTION (CSL_prevOpen, ".text:csl_section:prev");
extern void _CSL_prevGetAttrs(CSL_PrevNum prevNum , CSL_PrevHandle hPrev);
/** @brief Reserves the specified PREV for use.
*/
CSL_PrevHandle CSL_prevOpen (
/** Pointer to the object that holds reference to the
* instance of PREV requested after the call
*/
CSL_PrevObj *hPrevObj,
/** Instance of PREV to which a handle is requested
*/
CSL_PrevNum prevNum,
/** Specifies if PREV 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_PrevNum prevInst;
CSL_PrevHandle hPrev = (CSL_PrevHandle)NULL;
hPrevObj->openMode = openMode;
if (prevNum >= 0 ) {
_CSL_prevGetAttrs(prevNum, hPrevObj);
hPrev = (CSL_PrevHandle)_CSL_certifyOpen((CSL_ResHandle)hPrevObj, status);
}
else {
for(prevInst=(CSL_PrevNum)0;prevInst < (CSL_PrevNum)CSL_PREV_PER_CNT;++prevInst){
_CSL_prevGetAttrs(prevInst, hPrevObj);
hPrev = (CSL_PrevHandle)_CSL_certifyOpen((CSL_ResHandle)hPrevObj, status);
if (*status == CSL_SOK)
break;
}
if (prevInst == CSL_PREV_PER_CNT)
*status = CSL_ESYS_OVFL;
}
return hPrev;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -