csl_reszopen.c
来自「TI达芬奇dm644x各硬件模块测试代码」· C语言 代码 · 共 66 行
C
66 行
/** @file csl_reszOpen.c
*
* @brief File for functional layer of CSL API @a CSL_reszOpen()
*
* Description
* - The @a CSL_reszOpen() function definition & it's associated functions
*
* Modification 1
* - Created on: 10/12/2004
* - Reason: Created the sources
*
* @date 12th October, 2004
* @author Sandeep Tiwari.
*/
#include <csl_resz.h>
#include <_csl_resource.h>
#pragma CODE_SECTION (CSL_reszOpen, ".text:csl_section:resz");
extern void _CSL_reszGetAttrs(CSL_ReszNum reszNum , CSL_ReszHandle hResz);
/** @brief Reserves the specified RESZ for use.
*/
CSL_ReszHandle CSL_reszOpen (
/** Pointer to the object that holds reference to the
* instance of RESZ requested after the call
*/
CSL_ReszObj *hReszObj,
/** Instance of Resz to which a handle is requested
*/
CSL_ReszNum reszNum,
/** Specifies if RESZ 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_ReszNum reszInst;
CSL_ReszHandle hResz = (CSL_ReszHandle)NULL;
hReszObj->openMode = openMode;
if (reszNum >= 0 ) {
_CSL_reszGetAttrs(reszNum, hReszObj);
hResz = (CSL_ReszHandle)_CSL_certifyOpen((CSL_ResHandle)hReszObj, status);
}
else {
for(reszInst=(CSL_ReszNum)0;reszInst < (CSL_ReszNum)CSL_RESZ_PER_CNT;++reszInst){
_CSL_reszGetAttrs(reszInst, hReszObj);
hResz = (CSL_ReszHandle)_CSL_certifyOpen((CSL_ResHandle)hReszObj, status);
if (*status == CSL_SOK)
break;
}
if (reszInst == CSL_RESZ_PER_CNT)
*status = CSL_ESYS_OVFL;
}
return hResz;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?