⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_vpbeopen.c

📁 TI达芬奇dm644x各硬件模块测试代码
💻 C
字号:
/*   ==========================================================================
 *   Copyright (c) Texas Instruments Inc , 2004
 *
 *   Use of this software is controlled by the terms and conditions found
 *   in the license agreement under which this software has been supplied
 *   priovided
 *   ==========================================================================
*/
/** @file csl_vpbeOpen.c
 *
 *  @brief    File for functional layer of CSL API @a CSL_vpbeOpen()
 *
 *  Description
 *    - The @a CSL_vpbeOpen() function definition & it's associated functions
 *
 *  @date 11 October, 2004
 *  @author Santosh Narayanan
 */

#include <csl_vpbe.h>
#include <_csl_resource.h>

#pragma CODE_SECTION (CSL_vpbeOpen, ".text:csl_section:vpbe");
/**
    \brief Open VPBE
    \param hVpbeObj   Pointer to the handle object - to be allocated by the user
    \param vpbeNum    Specifies the instance of VPBE to be opened
    \param openMode Specifies if VPBE should be opened with exclusive OR
                    share access to the associate pins 
    \param hwSetup  If a valid structure is passed (not @a NULL), then
                    the @a CSL_VpbeHwSetup() is called with this parameter 
    \param status   Pointer to the variable that holds the holds the status of 
                    the open call		
		    
    \return Handle @a CSL_VpbeHandle to the requested instance of
                    VPBE if the call is successful, otherwise, a @a NULL is returned     
    \see 
*/

CSL_VpbeHandle CSL_vpbeOpen ( CSL_VpbeObj *hVpbeObj,
                              CSL_VpbeNum vpbeNum,
                              CSL_OpenMode openMode,
                              CSL_Status *status ) {
  Uint16     inst;
  /*CSL_VpbeHandle hVpbe = (CSL_VpbeHandle)NULL; */
  hVpbeObj->openMode = openMode;

  if (vpbeNum >= 0) {
    /* one of the VPBE instance numbers */
    /* Get the unique identifier & resource mask */
    _CSL_vpbeGetAttrs(vpbeNum, hVpbeObj);
    /* indicate in the CSL global data structure that the peripheral
     * is reserved & return a handle to it */
    /*hVpbe = (CSL_VpbeHandle) _CSL_certifyOpen((CSL_ResHandle)hVpbeObj, status);*/
    (CSL_VpbeHandle) _CSL_certifyOpen((CSL_ResHandle)hVpbeObj, status);
  } else { /* any VPBE acceptable */
    for (inst = 0; inst < CSL_VPBE_PER_CNT; ++inst) {
      /* get the unique identifier & resource mask */
      _CSL_vpbeGetAttrs((CSL_VpbeNum)inst, hVpbeObj);
      /* indicate in the CSL global data structure that the peripheral
       * is reserved & return a handle to it */
      /*hVpbe = (CSL_VpbeHandle)_CSL_certifyOpen((CSL_ResHandle)hVpbeObj, status);*/
      (CSL_VpbeHandle)_CSL_certifyOpen((CSL_ResHandle)hVpbeObj, status);

      if (*status == CSL_SOK) {
        break;
      }
    }
    
    if (inst == CSL_VPBE_PER_CNT) {
      /* requested MMCSD not available */
      *status = CSL_ESYS_OVFL;
    }
  }
  
 
  return hVpbeObj;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -