📄 csl_vlynqopen.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_vlynqOpen.c> ---- *//** @file csl_vlynqOpen.c * * @brief File for functional layer of CSL API @a CSL_vlynqOpen() * * Description * - The @a CSL_vlynqOpen() function definition & it's associated functions * *//* ============================================================================ * Revision History * =============== * 20-Dec-2004 Nsr Updated function and documentation for CSL_vlynqOpen. * * ============================================================================ */#include <csl_vlynq.h>/* *============================================================================ * @func CSL_vlynqOpen * * @desc * This function populates the peripheral data object for the instance * and returns a handle to the instance. * The open call sets up the data structures for the particular instance * of VLYNQ device. The device can be re-opened anytime after it has been * normally closed if so required. VLYNQ Hardware setup will be performed * at the end of the open call only if the HwSetup Pointer supplied was * non- NULL. The handle returned by this call is input as an essential * argument for rest of the APIs described for this module. * * @arg pVlynqObj * Pointer to the VLYNQ instance object * * @arg vlynqNum * Instance of the VLYNQ to be opened. * * @arg pVlynqParam * Pointer to module specific parameters * * @arg pStatus * pointer for returning status of the function call * * @ret CSL_VlynqHandle * Valid VLYNQ instance handle will be returned if status value is * equal to CSL_SOK. * * @eg * CSL_status status; * CSL_VlynqObj vlynqObj; * CSL_VlynqHandle hVlynq; * * hVlynq = CSL_VlynqOpen (&vlynqObj, * CSL_VLYNQ_PER_CNT, * NULL, * &status * ); * * =========================================================================== */#pragma CODE_SECTION (CSL_vlynqOpen, ".text:csl_section:vlynq");CSL_VlynqHandle CSL_vlynqOpen ( CSL_VlynqObj *pVlynqObj, CSL_InstNum vlynqNum, CSL_VlynqParam *pVlynqParam, CSL_Status *pStatus){ CSL_Status status; CSL_VlynqHandle hVlynq; CSL_VlynqBaseAddress baseAddress; if (pVlynqObj == NULL) { *pStatus = CSL_ESYS_INVPARAMS; return NULL; } status = CSL_vlynqGetBaseAddress(vlynqNum, pVlynqParam, &baseAddress); if (status == CSL_SOK) { pVlynqObj->regs = baseAddress.regs; pVlynqObj->perNum = (CSL_InstNum)vlynqNum; hVlynq = (CSL_VlynqHandle)pVlynqObj; } else { pVlynqObj->regs = (CSL_VlynqRegsOvly)NULL; pVlynqObj->perNum = (CSL_InstNum)-1; hVlynq = (CSL_VlynqHandle)NULL; } if (pStatus) { *pStatus = status; } return hVlynq;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -